cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid Line Items(fields) in BAPI mapping.

Former Member
0 Kudos

Hi

Does any body help me for mapping between header and line items in BAPI..

my scenario is filerfcmail(wokflow)!

File is CSV based :

(ex: 001150,,1123,JERM,08122006,,,

,,,ANN,,01082006,

If you look at example csv file , there is some fields mixed with header and line items. But in RFC header can be 1 to 1 and line item should be 0 to Unbound.

Now my problem is if I sent above example csv file as source :

The payload coming like this(sxmb_moni) :

</HEADERDATA>

- <GLACCOUNTDATA>

- <item>

<COSTCENTER />

<PROFIT_CTR />

</item>

- <item>

<GL_ACCOUNT>738100</GL_ACCOUNT>

<ITEM_AMOUNT>60000</ITEM_AMOUNT>

<COMP_CODE>001150</COMP_CODE>

<ITEM_TEXT>*777-8030-861</ITEM_TEXT>

<COSTCENTER>7320</COSTCENTER>

<PROFIT_CTR>7320</PROFIT_CTR>

<ALLOC_NMBR />

</item>

- <item>

<GL_ACCOUNT>738100</GL_ACCOUNT>

<ITEM_AMOUNT>40000</ITEM_AMOUNT>

<COMP_CODE>001151</COMP_CODE>

<ITEM_TEXT>*777-8030-861</ITEM_TEXT>

<COSTCENTER>6010</COSTCENTER>

<PROFIT_CTR>6010</PROFIT_CTR>

<ALLOC_NMBR />

</item>

<item />

</GLACCOUNTDATA>

You can find there is one more item coming after headerdata with null values. It means map reading first line and one by one , if any field found in rows which belogs to GLAccount(Line item), then it writing one more item after headerdata with that fields only.

Remainig GLAccount data coming as per map after the item .

Can you tell me how to avoid extra line items.

Thanks,

Sankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can check if element <GL_ACCOUNT> exists.

regards,

wojtek

Former Member
0 Kudos

Yes, It exist..

I cross checked ..with out givig fileds and giving some fields...its writing another items in after headerdata tag.

hope you understand , what my problem..

See: GLACCOUNTDATA under subnode

item is 0 to unbound in BAPI side, because of this its reading all rows , and if find any field which belongs to GLAccount , then it writing another item tag after headerr data.

Thnaks,

Sankar

Former Member
0 Kudos

Hi,

So you can always use [index] function.

regards,

wojtek

Answers (0)