VA01信贷使用
阅读原文时间:2023年07月11日阅读:1

1业务场景

业务在正式机中发现,当使用VA01输入客户编号回车后会报错

2解决方法

1. SE24进入CL_IM_UKM_SD_FSCM_INTEGR1

2. 双击方法IF_EX_BADI_SD_CM~FSCM_CREDIT_CHECK_ORDER

3. 找到并进入cl_ukm_xi_facade_r3_50=>if_ukm_credit_query_r3~check_credit

4. 在此处创建隐式增强

ZSD_WS_Credit

FSCM Credit Webservice Enhancement

5.粘贴的代码

ENHANCEMENT ZSD_WS_CREDIT. "active version
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(2) Class CL_UKM_XI_FACADE_R3_50, Interface IF_UKM_CREDIT_QUERY_R3, Method CHECK_CREDIT, Start, Enhancement ZSD_WS_CREDIT, Start A
* Data Declarations that would be used for local mapping of structures

DATA:  
      ls\_query1     TYPE ukmr3\_credit\_worthiness\_query,  
      ls\_response1  TYPE ukmr3\_cw\_response,  
      lx\_exc1       TYPE REF TO cx\_root,  
      lx\_ai1        TYPE REF TO cx\_ai\_system\_fault,  
      e\_message1    LIKE LINE OF et\_return,  
      ltext1        TYPE string.  

* Data declaration to get the input data to the proxy
DATA: ls_input TYPE ukm_credit_worthiness_q_in,
ls_ouput TYPE ukm_credit_worthiness_r_out,
ls_chk_sch TYPE ukm_credit_worthiness_query_ch,
* ls_chk_sch1 TYPE ukmr3_cw_checkingschedule1,
ls_chk_sch1 LIKE LINE OF ls_query1-credit_worthiness_query-credit_worthiness_query-checking_schedule,
lref_wor_qu TYPE REF TO cl_ukm_credit_worthiness_query,
ls_in_cre_par TYPE ukm_cw_creditor_party,
* ls_out_cre_par TYPE ukmr3_cw_creditor_party2,
ls_out_cre_par TYPE ukm_cw_creditor_party,
ls_in_sel_par TYPE ukm_cw_seller_party,
* ls_out_sel_par TYPE ukmr3_cw_seller_party2,
ls_out_sel_par TYPE ukm_cw_seller_party,
ls_in_pro_cat TYPE ukm_cw_product_category,
* ls_out_pro_cat TYPE ukmr3_cw_product_category2.
ls_out_pro_cat TYPE ukm_cw_product_category.

**Using the below method convert the Import Parameters coming into Check Credit Method - query data being sent to PI
CALL METHOD cl_ukm_xi_facade_r3_50=>credit_query_convert_outbound
EXPORTING
i_partner = i_partner
i_credit_sgmnt = i_credit_sgmnt
i_amount = i_amount
i_currency = i_currency
i_checkrule = i_checkrule
i_checkseverity = i_checkseverity
i_retrieval_flag = i_retrieval_flag
i_effective_date = i_effective_date
i_log_reference = i_log_reference
it_schedule = it_schedule
IMPORTING
es_query = ls_query1.

* Map the values from ls_query1 to ls_input and than calling the inbound proxy of FSCM* information of the segment id

  MOVE:  
  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-credit\_segment\_internal\_id  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-credit\_segment\_internal\_id,

* information of the amount to be checked
ls_query1-credit_worthiness_query-credit_worthiness_query-checked_amount-currency_code
TO ls_input-credit_worthiness_query-credit_worthiness_query-checked_amount-currency_code,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-checked\_amount-VALUE  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-checked\_amount-VALUE,  

* Details of the rule code
ls_query1-credit_worthiness_query-credit_worthiness_query-checking_rule_code
TO ls_input-credit_worthiness_query-credit_worthiness_query-checking_rule_code,

* Details of severity code
ls_query1-credit_worthiness_query-credit_worthiness_query-checking_severity_code
TO ls_input-credit_worthiness_query-credit_worthiness_query-checking_severity_code,

* Details of permission indicator
ls_query1-credit_worthiness_query-credit_worthiness_query-car_permission_indicator
TO ls_input-credit_worthiness_query-credit_worthiness_query-credit_agency_permission_ind.

  LOOP AT ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-checking\_schedule  
  INTO ls\_chk\_sch1.

    MOVE: ls\_chk\_sch1-valuation\_date                TO ls\_chk\_sch-valuation\_date,  
    ls\_chk\_sch1-checked\_amount                TO ls\_chk\_sch-checked\_amount,  
    ls\_chk\_sch1-credit\_segment\_internal\_id    TO ls\_chk\_sch-credit\_segment\_internal\_id,  
    ls\_chk\_sch1-debtor\_party-scheme\_id        TO ls\_chk\_sch-debtor\_party-scheme\_id,  
    ls\_chk\_sch1-debtor\_party-scheme\_agency\_id TO ls\_chk\_sch-debtor\_party-scheme\_agency\_id,  
    ls\_chk\_sch1-debtor\_party-VALUE            TO ls\_chk\_sch-debtor\_party-VALUE.

    APPEND ls\_chk\_sch TO  
    ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-checking\_schedule.  
    CLEAR ls\_chk\_sch.

  ENDLOOP.

* setting up values of DEBTOR PARTY
MOVE:
ls_query1-credit_worthiness_query-credit_worthiness_query-debtor_party-internal_id-scheme_id
TO ls_input-credit_worthiness_query-credit_worthiness_query-debtor_party-internal_id-scheme_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-debtor\_party-internal\_id-scheme\_agency\_id  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-debtor\_party-internal\_id-scheme\_agency\_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-debtor\_party-internal\_id-VALUE  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-debtor\_party-internal\_id-VALUE,

* setting up values of CREDITOR PARTY
ls_query1-credit_worthiness_query-credit_worthiness_query-creditor_party-internal_id-scheme_id
TO ls_input-credit_worthiness_query-credit_worthiness_query-creditor_party-internal_id-scheme_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-creditor\_party-internal\_id-scheme\_agency\_id  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-creditor\_party-internal\_id-scheme\_agency\_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-creditor\_party-internal\_id-VALUE  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-creditor\_party-internal\_id-VALUE,

* setting up values of seller party
ls_query1-credit_worthiness_query-credit_worthiness_query-seller_party-internal_id-scheme_id
TO ls_input-credit_worthiness_query-credit_worthiness_query-seller_party-internal_id-scheme_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-seller\_party-internal\_id-scheme\_agency\_id  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-seller\_party-internal\_id-scheme\_agency\_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-seller\_party-internal\_id-VALUE  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-seller\_party-internal\_id-VALUE,

* setting up values of product category
ls_query1-credit_worthiness_query-credit_worthiness_query-product_category-internal_id-scheme_id
TO ls_input-credit_worthiness_query-credit_worthiness_query-product_category-internal_id-scheme_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-product\_category-internal\_id-scheme\_agency\_id  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-product\_category-internal\_id-scheme\_agency\_id,

  ls\_query1-credit\_worthiness\_query-credit\_worthiness\_query-product\_category-internal\_id-VALUE  
  TO ls\_input-credit\_worthiness\_query-credit\_worthiness\_query-product\_category-internal\_id-VALUE.

***************************************************************************************

** Call the inbound Proxy with the data mapped in previous steps **

** This is the Proxy method that is called when the FSCM inbound call is made to ECC **

***************************************************************************************

  CREATE OBJECT lref\_wor\_qu.

  TRY.  
    CALL METHOD lref\_wor\_qu->ii\_ukm\_credit\_worthiness\_query~execute\_synchronous  
    EXPORTING  
      INPUT  = ls\_input  
    IMPORTING  
      OUTPUT = ls\_ouput.  
  CATCH cx\_ukm\_cw\_check\_fault INTO lx\_exc1.

    ltext1 = lx\_exc1->get\_text( ).  
    MESSAGE e008(ukm\_pi) WITH ltext1 INTO e\_message1-MESSAGE.

    e\_message1-TYPE         = sy-msgty.  
    e\_message1-ID           =  sy-msgid.  
    e\_message1-NUMBER       = sy-msgno.  
    e\_message1-message\_v1   = ltext1.  
    APPEND e\_message1 TO et\_return.  
    RAISE credit\_check\_failed.

  ENDTRY.

* From the response of the Inbound Proxy, map accordingly to the corresponding structures and tables to be converted into the return parameters of the Check Credit Method

  MOVE:  
  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-credit\_segment\_internal\_id  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-credit\_segment\_internal\_id,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-indicator  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-indicator,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-debtor\_party\_blocked\_indicator  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-debtor\_party\_blocked\_indicator,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-debtor\_party\_attntn\_indicator  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-debtor\_party\_special\_attention,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-horizon\_end\_date  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-horizon\_end\_date,

* setting up value for DEBTOR PARTY
ls_ouput-credit_worthiness_response-credit_worthiness-debtor_party-internal_id-scheme_id
TO ls_response1-credit_worthiness_response-credit_worthiness-debtor_party-internal_id-scheme_id,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-debtor\_party-internal\_id-scheme\_agency\_id  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-debtor\_party-internal\_id-scheme\_agency\_id,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-debtor\_party-internal\_id-VALUE  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-debtor\_party-internal\_id-VALUE,

* setting up value for RATING
ls_ouput-credit_worthiness_response-credit_worthiness-rating
TO ls_response1-credit_worthiness_response-credit_worthiness-rating,

* setting up value for RISK_CLASS
ls_ouput-credit_worthiness_response-credit_worthiness-risk_class
TO ls_response1-credit_worthiness_response-credit_worthiness-risk_class,

* setting up value for CREDIT_LIMIT
ls_ouput-credit_worthiness_response-credit_worthiness-credit_limit
TO ls_response1-credit_worthiness_response-credit_worthiness-credit_limit,

  ls\_ouput-credit\_worthiness\_response-credit\_worthiness-checking\_description\[\]  
  TO  ls\_response1-credit\_worthiness\_response-credit\_worthiness-checking\_description\[\].

* getting the values of the creditor party
LOOP AT ls_ouput-credit_worthiness_response-credit_worthiness-creditor_party
INTO ls_in_cre_par.

    MOVE: ls\_in\_cre\_par-internal\_id-scheme\_id         TO ls\_out\_cre\_par-internal\_id-scheme\_id,  
    ls\_in\_cre\_par-internal\_id-scheme\_agency\_id  TO ls\_out\_cre\_par-internal\_id-scheme\_agency\_id,  
    ls\_in\_cre\_par-internal\_id-VALUE             TO  ls\_out\_cre\_par-internal\_id-VALUE.

    APPEND ls\_out\_cre\_par TO ls\_response1-credit\_worthiness\_response-credit\_worthiness-creditor\_party.  
    CLEAR ls\_out\_cre\_par.  
  ENDLOOP.

* getting the values of the seller party
LOOP AT ls_ouput-credit_worthiness_response-credit_worthiness-seller_party
INTO ls_in_sel_par.

    MOVE: ls\_in\_sel\_par-internal\_id-scheme\_id         TO ls\_out\_sel\_par-internal\_id-scheme\_id,  
    ls\_in\_sel\_par-internal\_id-scheme\_agency\_id  TO ls\_out\_sel\_par-internal\_id-scheme\_agency\_id,  
    ls\_in\_sel\_par-internal\_id-VALUE             TO ls\_out\_sel\_par-internal\_id-VALUE.

    APPEND ls\_out\_sel\_par TO ls\_response1-credit\_worthiness\_response-credit\_worthiness-seller\_party.  
    CLEAR ls\_out\_sel\_par.  
  ENDLOOP.

* getting the values of product category
LOOP AT ls_ouput-credit_worthiness_response-credit_worthiness-product_category
INTO ls_in_pro_cat.

    MOVE: ls\_in\_pro\_cat-internal\_id-scheme\_id         TO ls\_out\_pro\_cat-internal\_id-scheme\_id,  
    ls\_in\_pro\_cat-internal\_id-scheme\_agency\_id  TO ls\_out\_pro\_cat-internal\_id-scheme\_agency\_id,  
    ls\_in\_pro\_cat-internal\_id-VALUE             TO ls\_out\_pro\_cat-internal\_id-VALUE.

    APPEND ls\_in\_pro\_cat TO  
    ls\_response1-credit\_worthiness\_response-credit\_worthiness-product\_category.  
    CLEAR ls\_in\_pro\_cat.

  ENDLOOP.

* Use the data populated with the proxy response to convert it to the Export parameters of the Check Credit Method

  CALL METHOD cl\_ukm\_xi\_facade\_r3\_50=>credit\_query\_convert\_inbound  
  EXPORTING  
    is\_response           = ls\_response1  
  IMPORTING  
    et\_credit\_messages    = et\_credit\_messages  
    e\_check\_confirmation  = e\_check\_confirmation  
    e\_rating              = e\_rating  
    e\_riskclass           = e\_riskclass  
    e\_creditlimit         = e\_creditlimit  
    e\_limit\_currency      = e\_limit\_currency  
    e\_limit\_valid\_to      = e\_limit\_valid\_to  
    e\_blocked\_indicator   = e\_blocked\_indicator  
    e\_attntn\_indicator    = e\_attntn\_indicator  
    e\_credit\_horizon\_date = e\_credit\_horizon\_date.

* EXIT statement to come out of the method.

  EXIT.

* This EXIT statement would force the execution out of this method by-passing the standard code where PI calls are made

ENDENHANCEMENT.

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章