Skip to Content
avatar image
Former Member

Message Mapping logic ...!!

Hi Experts ,

I am working on the below scenario where my Sender System is the Oracle Database system and Receiver System is SAP ECC

basically JDBC ->PI ->IDOC channels i am using . I need to create the below Mapping logic in order to satisfy the Interface Requirement

Based on the Interface_Transaction_ID each Idoc has to be Created and each Idoc should have corresponding Segments and line items . based on th value of GLAccount and Vendor Account

My sender Payload is

<row>

<INTERFACE_TRANSACTION_ID>CFCV00000627</INTERFACE_TRANSACTION_ID>

<DOC_HEADER_TEXT>5251/0115/000000/0000</DOC_HEADER_TEXT>

<COMPANY_CODE>1610</COMPANY_CODE>

<DOCUMENT_DATE>20110707</DOCUMENT_DATE>

<POSTING_DATE>20110305</POSTING_DATE>

<PERIOD>3</PERIOD>

<DOCUMENT_TYPE>ZF</DOCUMENT_TYPE>

<REFERENCE>45720-T</REFERENCE>

<VENDOR_ACCOUNT></VENDOR_ACCOUNT>

<CF_MATERIAL_TYPE>MATTE</CF_MATERIAL_TYPE>

<CF_ENTRY_POINT>610 Tank</CF_ENTRY_POINT>

<CF_SOURCE>XNN</CF_SOURCE>

<PAYMENT_TERMS></PAYMENT_TERMS>

<BASELINE_DATE>20110305</BASELINE_DATE>

<ASSIGNMENT>5251/0115/000</ASSIGNMENT>

<TEXT>USD </TEXT>

<GL_ACCOUNT>111810</GL_ACCOUNT>

<SPECIAL_GL_IND></SPECIAL_GL_IND>

<PREV_DOC_NUMBER></PREV_DOC_NUMBER>

<PREV_POSTING_DATE></PREV_POSTING_DATE>

</row>

<row>

<INTERFACE_TRANSACTION_ID>CFCV00000627</INTERFACE_TRANSACTION_ID>

<DOC_HEADER_TEXT>5251/0115/000000/0000</DOC_HEADER_TEXT>

<ASSIGNMENT>5251/0115/000</ASSIGNMENT>

<TEXT>USD </TEXT>

<GL_ACCOUNT>111821</GL_ACCOUNT>

<SPECIAL_GL_IND></SPECIAL_GL_IND>

<PREV_DOC_NUMBER></PREV_DOC_NUMBER>

<PREV_POSTING_DATE></PREV_POSTING_DATE>

</row>

Row having GL_Account Value E1BPACHE09,

E1BPACGL09, (GLvalue 111810)

E1BPACGL09, (GLvalue 111821)

E1BPACCR09,

E1BPACCR09,

E1PACEXTC .

Field value=CFCV00000627

Similary if Vendor_Account Value exist then only Vendor Segment (E1BPACAP09) must occur at target side

Row having Vendor_Aaccount Value

E1BPACHE09,

c (Vendor value 123)

E1BPACAP09, (Vendor Value 124)

E1BPACCR09,

E1BPACCR09,

E1PACEXTC .

Field value=CFCV00000628

I have mapped GL_ACCOUNT -


>E1BPACGL09 .

Vendor_Account---->E1BPACGL09.

if any one have gone through simiar mapping logic kindly share and do the needfull ...

Regards,

Aziz khan .

I

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 20, 2011 at 08:16 PM

    Hi Aziz,

    By default when you import Idoc it creates only one in SAP even if you have multiple INTERFACE_TRANSACTION_ID . So first you need to change the idoc occurence to 1..unbounded. Use this blog for this:

    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

    Then since you need to create an idoc for each change on INTERFACE_TRANSACTION_ID then map like this:

    INTERFACE_TRANSACTION_ID ---> Split by value (value change) --> IDoc

    Map GL_ACCOUNT from source to your E1BPACGL09 segment. It should automatically get in else you may need to use context fucntions for those to populate accordingly.

    Regards,

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded

    • chk this:

      1)

      
      INTERFACE_TRANSACTION_ID -> RemoveContext -> sort - splitbyValue (value change) - >collapseContext -> IDOC
      
      

      2)

      
      INTERFACE_TRANSACTION_ID ->removeContext ->sort(numerical)-> splitbyvalue (valuechange) -> collapsecontext- >
      
        INTERFACE_TRANSACTION_ID->RemoveContext->.                                                               --------------------UDF--E1BPACGL09
      
      GL_ACCOUNT-->mapwith default----> remove context
      
      

      3) In the same way do the mapping for VENDOR_ACCOUNT (follow the same mapping steps as shown above for GL_ACCOUNT) .

      UDF:

      this will have 3 inputs

      var1, var2, var3

      Execution type all values of a context

      for(int i=0;i<var1.length;i++)
      {
      for(int j=0;j<var2.length;j++)
      {
      if(var1<i>.equals(var2[j]))
      {
      if(!var3[j].equals(""))
      {
      result.addValue(var3[j]);
      }
      }
      }
      result.addContextChange();
      }
      

      Note: This UDF will take care of the context changes if there are more than one (i.e different) INTERFACE_TRANSACTION_ID.