Skip to Content
avatar image
Former Member

Mapping line-Item

experts,

I used 'Index' function to generate an line item at the target..

and only line items which have 2 are passed.. and I'm combining Idocs at the source based on condition and sending them to target..

but the line item on target is coming as 1 3 5... (reason being I'm passing only line item 2)....... not serial number.. i may need this to give value as 1 2 3 ..

source line items RemoveContext -index(initial Value-00001,increment-1) -format('00000') Split(ByValue)--Target line items..

appriciate your help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 21, 2009 at 07:45 PM

    HI Prema,

    Your solution should work.

    But You can also try to use "Counter" standard function(under Arithmetic) ?

    Counter-- > formatNum(0000) -->Target line items

    and set the initial value as 1 and use increment as 1 in counter.

    Thanks,

    Pooja Pandey

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Pooja, here is my test data:

      <?xml version="1.0" encoding="UTF-8" ?>

      <ACC_GOODS_MOVEMENT02>

      <IDOC BEGIN="1">

      <EDI_DC40 SEGMENT="1">

      <TABNAM>EDI_DC40</TABNAM>

      <MANDT>010</MANDT>

      <DOCNUM>0000000000004223</DOCNUM>

      <DOCREL>700</DOCREL>

      <STATUS>30</STATUS>

      <DIRECT>1</DIRECT>

      <OUTMOD>4</OUTMOD>

      <IDOCTYP>ACC_GOODS_MOVEMENT02</IDOCTYP>

      <MESTYP>ACC_GOODS_MOVEMENT</MESTYP>

      <STDMES>ACC_GO</STDMES>

      <SNDPOR>SAPSS1</SNDPOR>

      <SNDPRT>LS</SNDPRT>

      <SNDPRN>SS1CLNT010</SNDPRN>

      <RCVPOR>SRM_XML</RCVPOR>

      <RCVPRT>LS</RCVPRT>

      <RCVPRN>SI1CLNT010</RCVPRN>

      <CREDAT>20090106</CREDAT>

      <CRETIM>172756</CRETIM>

      <SERIAL>20081113175453</SERIAL>

      </EDI_DC40>

      <E1BPACHE02 SEGMENT="1">

      <OBJ_TYPE>IDOC</OBJ_TYPE>

      <OBJ_KEY>00000004002008000001</OBJ_KEY>

      <OBJ_SYS>SS1CLNT010</OBJ_SYS>

      <USERNAME>NEELAD1</USERNAME>

      <HEADER_TXT>STAPLES</HEADER_TXT>

      <BUS_ACT>RMWE</BUS_ACT>

      <COMP_CODE>1000</COMP_CODE>

      <FISC_YEAR>2008</FISC_YEAR>

      <DOC_DATE>20081113</DOC_DATE>

      <PSTNG_DATE>00000000</PSTNG_DATE>

      <FIS_PERIOD>00</FIS_PERIOD>

      <DOC_TYPE>KR</DOC_TYPE>

      <REF_DOC_NO>9100000148</REF_DOC_NO>

      </E1BPACHE02>

      <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <GL_ACCOUNT>0008110000</GL_ACCOUNT>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <COSTCENTER>0000140317</COSTCENTER>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <PROFIT_CTR>CSPCOS</PROFIT_CTR>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000-</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      </IDOC>

      <IDOC BEGIN="1">

      <EDI_DC40 SEGMENT="1">

      <TABNAM>EDI_DC40</TABNAM>

      <MANDT>010</MANDT>

      <DOCNUM>0000000000004224</DOCNUM>

      <DOCREL>700</DOCREL>

      <STATUS>30</STATUS>

      <DIRECT>1</DIRECT>

      <OUTMOD>4</OUTMOD>

      <IDOCTYP>ACC_GOODS_MOVEMENT02</IDOCTYP>

      <MESTYP>ACC_GOODS_MOVEMENT</MESTYP>

      <STDMES>ACC_GO</STDMES>

      <SNDPOR>SAPSS1</SNDPOR>

      <SNDPRT>LS</SNDPRT>

      <SNDPRN>SS1CLNT010</SNDPRN>

      <RCVPOR>SRM_XML</RCVPOR>

      <RCVPRT>LS</RCVPRT>

      <RCVPRN>SI1CLNT010</RCVPRN>

      <CREDAT>20090106</CREDAT>

      <CRETIM>172759</CRETIM>

      <SERIAL>20081113175453</SERIAL>

      </EDI_DC40>

      - <E1BPACHE02 SEGMENT="1">

      <OBJ_TYPE>IDOC</OBJ_TYPE>

      <OBJ_KEY>00000004002008000001</OBJ_KEY>

      <OBJ_SYS>SS1CLNT010</OBJ_SYS>

      <USERNAME>NEELAD1</USERNAME>

      <HEADER_TXT>STAPLES</HEADER_TXT>

      <BUS_ACT>RMWE</BUS_ACT>

      <COMP_CODE>1000</COMP_CODE>

      <FISC_YEAR>2008</FISC_YEAR>

      <DOC_DATE>20081113</DOC_DATE>

      <PSTNG_DATE>00000000</PSTNG_DATE>

      <FIS_PERIOD>00</FIS_PERIOD>

      <DOC_TYPE>KR</DOC_TYPE>

      <REF_DOC_NO>9100000148</REF_DOC_NO>

      </E1BPACHE02>

      - <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <GL_ACCOUNT>0008110000</GL_ACCOUNT>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <COSTCENTER>0000140317</COSTCENTER>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <PROFIT_CTR>CSPCOS</PROFIT_CTR>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      - <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      - <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      - <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000-</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      </IDOC>

      - <IDOC BEGIN="1">

      - <EDI_DC40 SEGMENT="1">

      <TABNAM>EDI_DC40</TABNAM>

      <MANDT>010</MANDT>

      <DOCNUM>0000000000004225</DOCNUM>

      <DOCREL>700</DOCREL>

      <STATUS>30</STATUS>

      <DIRECT>1</DIRECT>

      <OUTMOD>4</OUTMOD>

      <IDOCTYP>ACC_GOODS_MOVEMENT02</IDOCTYP>

      <MESTYP>ACC_GOODS_MOVEMENT</MESTYP>

      <STDMES>ACC_GO</STDMES>

      <SNDPOR>SAPSS1</SNDPOR>

      <SNDPRT>LS</SNDPRT>

      <SNDPRN>SS1CLNT010</SNDPRN>

      <RCVPOR>SRM_XML</RCVPOR>

      <RCVPRT>LS</RCVPRT>

      <RCVPRN>SI1CLNT010</RCVPRN>

      <CREDAT>20090106</CREDAT>

      <CRETIM>172803</CRETIM>

      <SERIAL>20081113175453</SERIAL>

      </EDI_DC40>

      - <E1BPACHE02 SEGMENT="1">

      <OBJ_TYPE>IDOC</OBJ_TYPE>

      <OBJ_KEY>00000004002008000001</OBJ_KEY>

      <OBJ_SYS>SS1CLNT010</OBJ_SYS>

      <USERNAME>NEELAD1</USERNAME>

      <HEADER_TXT>STAPLES</HEADER_TXT>

      <BUS_ACT>RMWE</BUS_ACT>

      <COMP_CODE>1000</COMP_CODE>

      <FISC_YEAR>2008</FISC_YEAR>

      <DOC_DATE>20081113</DOC_DATE>

      <PSTNG_DATE>00000000</PSTNG_DATE>

      <FIS_PERIOD>00</FIS_PERIOD>

      <DOC_TYPE>KR</DOC_TYPE>

      <REF_DOC_NO>9100000148</REF_DOC_NO>

      </E1BPACHE02>

      - <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <GL_ACCOUNT>0008110000</GL_ACCOUNT>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <COSTCENTER>0000140317</COSTCENTER>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <PROFIT_CTR>CSPCOS</PROFIT_CTR>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      - <E1BPACGL02 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <COMP_CODE>1000</COMP_CODE>

      <PSTNG_DATE>20081113</PSTNG_DATE>

      <FISC_YEAR>0000</FISC_YEAR>

      <FIS_PERIOD>00</FIS_PERIOD>

      <ITEM_TEXT>STAPLES</ITEM_TEXT>

      <PO_PR_QNT>0.000</PO_PR_QNT>

      <ASVAL_DATE>00000000</ASVAL_DATE>

      <QUANTITY>0.000</QUANTITY>

      <ROUTING_NO>0000000000</ROUTING_NO>

      <ORDER_ITNO>0000</ORDER_ITNO>

      <S_ORD_ITEM>000000</S_ORD_ITEM>

      <SERIAL_NO>00</SERIAL_NO>

      <GROSS_WT>0.000</GROSS_WT>

      <ENTRY_QNT>0.000</ENTRY_QNT>

      </E1BPACGL02>

      - <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000002</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      - <E1BPACCR01 SEGMENT="1">

      <ITEMNO_ACC>0000000001</ITEMNO_ACC>

      <CURR_TYPE>00</CURR_TYPE>

      <CURRENCY>USD</CURRENCY>

      <AMT_DOCCUR>40.0000-</AMT_DOCCUR>

      <EXCH_RATE>0.00000</EXCH_RATE>

      <AMT_BASE>0.0000</AMT_BASE>

      <DISC_BASE>0.0000</DISC_BASE>

      <EXCH_RATE_V>0.00000</EXCH_RATE_V>

      </E1BPACCR01>

      </IDOC>

      </ACC_GOODS_MOVEMENT02>

  • avatar image
    Former Member
    Jan 21, 2009 at 08:24 PM

    Hi,

    What do you mean by line item which have 2, do you mean line item which have VALUE 2? or line item 2?

    If I have understood your problem correctly then, I guess you should involve the below step in you mapping...

    LineItem ---RemoveContext --- Equlas (2) ---If --- Then --- Constant value 1 --- Counter (increment by 1) --- SplitByValue --- Target

    Regards,

    Sarvesh

    Add comment
    10|10000 characters needed characters exceeded