Hello, friends!

Once, we faced with objective of implementation SAP MII transaction and managing mechanism to creating correct IDOC and sending it to SAP MDG (this instruction applicable to all SAP ERP systems).

Goal: to implement regularly sending needed data of contractors from non-SAP system to SAP MDG using SAP MII.

At first, we looking for mechanism of sending IDOCs from SAP MII to SAP MDG. After some time of searching we have found RFC IDOC_INBOUND_ASYNCHRONOUS at SAP MDG.


IDOC_INBOUND_ASYNCHRONOUS

IDOC_INBOUND_ASYNCHRONOUS. This function module is used for SAP release 4.0 and later.

This function module starts inbound processing in the case of port type “tRFC”. The function module is a successor to INBOUND_IDOC_PROCESS, which processes IDocs in the Release 4.0 record types. If you are processing IDocs in Release 3.X record types, the function module INBOUND_IDOC_PROCESS must still be called.
The function module checks the ID ‘EDI_MES’ in authorization object B_ALE_RECV against the received message type.
The IDocs are saved by the function module IDOC_INBOUND_WRITE_TO_DB (a COMMIT for all IDocs) and then transferred directly to the application by the dispatcher module IDOC_START_INBOUND.


1. Create a connection in XMII admin menu: Data Services – Connections. Create new JCO connection with any name and description, then correctly set up Server URL, Client number, System number (for default 00) and Pool size (for first time 10 will be sufficient) – refer to Your SAP basis for more details.


/wp-content/uploads/2015/12/create_connection_842021.png

2. Create credentials to using connection from first step at Security Services – Credential Stores. Create new credentials with Name and Password from target system (SAP MDG) to call this RFC function – refer to Your SAP basis for more details.


/wp-content/uploads/2015/12/credential_stores_842022.png


3. Now You can switch to SAP MII Worbench and create new transaction. Main blocks of this transaction will be SAP JCo operations.


/wp-content/uploads/2015/12/sapjco_842040.png


Create some blocks in transaction in the following sequence: SAP JCo Start Session, SAP JCo Function, SAP JCo Commit, SAP JCo End Session.


/wp-content/uploads/2015/12/workbench1_842045.png

SAP JCo Start Session operation opens connection to RFC at SAP MDG with created JCo-connection and Credentials. Simple choose connection from Connection Alias dropdown and credentials from Credential Alias dropdown.


/wp-content/uploads/2015/12/workbench2_842052.png


SAP JCo Function operation directly call RFC at SAP MDG. In SAP JCo Session Action choose created connection from previous block and set at RFC Name name of RFC function (in our case IDOC_INBOUND_ASYNCHRONOUS, but You can search needed one from all available from Search Pattern).


/wp-content/uploads/2015/12/workbench3_842057.png


To getting RFC fields make Generate Sample of SAP JCo Function block operation.


/wp-content/uploads/2015/12/workbench301_842059.png


In Links Editor window of SAP JCo Function map RFC fields with data from Your input source.


/wp-content/uploads/2015/12/workbench31_842058.png


SAP JCo Commit operation is commiting send operation from SAP JCo Function – simple choose connection from previous steps.


/wp-content/uploads/2015/12/workbench4_842216.png


SAP JCo End Session is closing created connection with RFC function.


/wp-content/uploads/2015/12/workbench5_842217.png

This is the necessary minimum. Now You can test created transaction.

I hope my guide will be useful.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. christian libich

    Kirill,

    I think it would be really helpful to readers if you could go into more technical detail about how the required idoc fields/segments are determined and how they are mapped into the bapi.

    Regards,
    Christian

    (0) 
    1. Kirill Levitskiy Post author

      Christian,


      Thank you for reply. OK, I’ll write next guide about mapping idoc fields. There are some interesting details when you try to grab fields into segment.


      Regards,

      Kirill

      (0) 

Leave a Reply