Skip to end of metadata
Go to start of metadata

 
Non-PI Synchronous FSCM Integration via WSRM and Direct Updates

Link to Content's target Space :

http://wiki.sdn.sap.com/wiki/display/XI/Step-by-Step+Guides 

Applies to:

SAP Process Integration, SAP ECC, SAP NW 7.02 , EHp5, FSCM 

Summary

This article is in continuation of the blog on POV - FSCM a Pinch-Point for PI.   In this article, we would demonstrate couple of non-PI integration mechanisms for FSCM (Credit Management)

Author(s): 

 Abhishek Vinayaka & Mahaboob Basha Shaik

   
Company:     Deloitte Consulting LLP
Created on:    March 5th 2012
Author(s) Bio

 
Abhishek is working as a SAP PI SME at Deloitte Consulting LLP. He has over 8 years of experience in SAP PI and other integration technologies
 

 
Basha is working as SAP Netweaver PI consultant for Deloitte Consulting LLP. He also has extensive knowledge on SAP ABAP & WD ABAP technologies

Table of Contents

Introduction

WS-RM Based Integration.
Step 1: Navigate to SOAMANGER

Step 2: Selection of the Server Proxy Name

Step 3: Service Creation (Server)

Step 4: Setting Up Bindings (Server)

Step 5: Setting up Security Details (Server)

Step 6: Choosing the Binding Name (Server)

Step 7: Display End-point (Server)

Step 8: Select the consumer proxy

Step 9: Define Logical Port (Consumer)

Step 10: Configure logical port (Consumer)

Step 11: Set Up Service User for Web Service Consumption

FSCM via Direct Update in ECC

Step 1: Find BAdi for Credit Management

Step 2:  Find the BAdi implementation

Step 3:  Standard Credit Check Code

Step 4:  Implement an Implicit Enhancement

 

 

 

Introduction

SAP FSCM or Financial Supply chain management for Credit Management is a widely used SAP Application package on an SAP implementation.

The business logic for the credit management function exists with the SAP FINBASIS core component.  Interestingly the integration medium used for the above is SAP PI.  SAP PI provides out of the box integration content around FSCM.


The core scenarios involved in FSCM are Creditworthiness Query and Credit Exposure updates. 
 
 
The FSCM Creditworthiness calls are synchronous in nature and are triggered whenever a configured document type like Sales Order/Delivery/Invoice is changed or created.

Though the FSCM business function lies on the same box as ECC, the driver for using PI, in my opinion was to leverage SAP FSCM as a separate SAP product for clients not implementing ECC.

This PI integration can sometimes become a major pinch-point of PI and operations in general.

This article is divided into 2 sections

  1. WSRM based Integration
  2. Direct Update.

WS-RM Based Integration

To achieve WS-RM based integration for Synchronous FSCM calls, the ECC system should be on NW 7.02, Enhancement pack 5.

With Eph5, the system is delivered with the Client and the Server proxies, this can been see using the transaction SPROXY, under the component FINBASIS, and the namespace as shown below.

 
To achieve a WS-RM based integration, Web service ports and End-points need to be defined for both the Client (CreditCommitmentQuery_Out) as well as Server (CreditCommitmentQuery_In) proxies.

 
Let us now look at the configuration steps in details. The configuration would be done, using the transaction SOAMANGER. 

Step 1: Navigate to SOAMANGER

Click “Application and Scenario Communication” tab and click “Single Service, administration link.

Step 2: Selection of the Server Proxy Name

 
 

Step 3:  Service Creation (Server)

Click “Configuration” tab and click “Create Service”.

 

Step 4:  Setting Up Bindings (Server)

These can be any free string entries following a particular naming convention

Step 5:  Setting up Security Details (Server)

Configure the web service details, including the Security and authentication details.


 

Step 6:  Choosing the Binding Name (Server)

On the overview tab, you can choose the binding name set in step 4, and click on display selected binding WSDL.
 

Step 7:  Display End-point (Server)

 The above would display the generated Web Service end point URL for the server proxy
 

Step 8: Select the consumer proxy

The consumer proxy is CreditWorthinessQuery_Out

 

Step 9: Define Logical Port (Consumer)

Click on configuration and the define logical port

Step 10:  Configure logical port (Consumer)

The URL obtained on Step 7 of Server Proxy configuration, should be set up as the WSDL access URL, also a valid server user with the roles of WS-Administrator should be configured
 

Step 11:  Set Up Service User for Web Service Consumption

On the consume security tab, set up the user/password for the service user having access to execute web services
 
The point to point configuration is now ready, and can be monitored via SXMB_MONI.

FSCM via Direct Update in ECC

This solution was driven by the need for Direct Update solution which has been illustrated in the blog POV - FSCM a Pinch-Point for PI.

This solution was designed to have FSCM via Direct update eliminating the need of PI integration for Synchronous FSCM calls, keeping intact the functionality of Credit Check which involves (CreditCommitmentQuery_Out & CreditCommitmentQuery_In Proxies).

Viability of this approach was that the Credit Worthiness Scenario has one to one mapping without any additional logic involved in the mapping.  And this mapping is handled in ABAP instead of PI.

Prerequisites: Standard FSCM Credit Worthiness Scenario has been enabled in ECC/PI.

Step 1:  Find BAdi for Credit Management

Step 2:  Find the BAdi implementation:

Step 3:  Standard Credit Check Code

From the implementation class of the BAdi - ZCL_IM_BADI_SD_CM, check for the method FSCM_CREDIT_CHECK_ORDER and find the code where the Credit Check is being done

Step 4:  Implement an Implicit Enhancement

 
Navigate into this Method and have an implicit enhancement (Code) created at the start of the method and use the code snippet in the enhancement and activate it,

Note:

This method is the place where the actual PI calls for the FSCM Credit Check happen and using this implicit enhancement we would force FSCM Direct Update in ECC and EXIT before the actual PI call.
//This is a code Block

* 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 proxyDATA: 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,
      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_in_sel_par   TYPE ukm_cw_seller_party,
      ls_out_sel_par  TYPE ukmr3_cw_seller_party2,
      ls_in_pro_cat   TYPE ukm_cw_product_category,
      ls_out_pro_cat  TYPE ukmr3_cw_product_category2.

**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 PARTYMOVE:
      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 partyLOOP 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 partyLOOP 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 categoryLOOP 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

Related Content

Please include at least three references to SDN documents or web pages.

Consuming Services in SOA Manger

POV - FSCM a Pinch-Point for PI

FSCM Configuration

6 Comments

  1. Unknown User (103awapu0)

    Hi, I believe to be able to use the above WS-RM, you need to get basis to activate in transaction SFW5 :

    1) FIN_FSCM_CCD_3

    2) FND_SOA_REUSE_1

    Is that correct Abhishek?

    Thanks,

  2. Unknown User (tmvo7mb)

    Hello Abhishek and Mahaboob,

    I tried doing the same way you have explained here. After implementing this code and mapping creditworthiness in and out services in soa, i am trying to create and save sales order for business partner for which credit limit has been assigned.

    1st thing i noticed is when i am saving sales order its giving me pop up to enter client, username and password to log in to application server.. Why is it asking me for this information?

    2nd thing i noticed is whne i checked processed XML messages, i found that sender is system name of current client and receiver is a port. Sender (current system) is using interface CreditCommitmentQuery_out and receiver port is also using same interface.

    Also i see error INTERFACE_REGISTRATION_ERROR in same XML msg. Can you please tell me where i am wrong? Your help is highly appreciated.

  3. Former Member

    Hello Abhishek and Mahaboob,

    I would like to ask how you configured WS-RM? Is it supported by SAP as default?

  4. Former Member

    Hi,

    To connect FSCM Credit Management with SD/FI on the same box via the second method "FSCM via Direct Update in ECC" that you mention in your blog, you say that "Prerequisite(s): Standard FSCM Credit Worthiness Scenario has been enabled in ECC/PI." How to do this enabling? Which transactions? I thought with Direct Update in ECC via implementation of BADI BADI_SD_CM no PI configuration is needed anymore?

    The document refers to transaction "SOAMANGR". This transaction does not exist. It should be "SOAMANAGER", a typing error I assume.

    Regards,

  5. Former Member

    Hi Abhishek & Basha,

    Thanks for a well written guide on how to activate WS-RM for FSCM and the Direct Update option of using a non-PI and non-WS solution.

    Regarding the Direct Update approach, I see that you implemented the Credit Worthiness check but did not discuss the Credit Commitment interface (which updates the credit exposure). Do you know if this interface too can be activated using this approach?

    Thanks,

    Chait

  6. Former Member

    Hi Abhishek & Basha,

    Thanks for the document..

    I am thinking to implement this solution for direct update. But have the below question.

    I see that you implemented the Credit Worthiness check but did not discuss the Credit Commitment interface (which updates the credit exposure). Do you know if this interface too can be activated using this approach?

    Thanks,

    Rama