Skip to Content
0

Multiple header document posting using BAPI for FB01 transaction

Jul 05, 2017 at 11:10 AM

86

avatar image

Hi Friends,

I have a GL posting program which is using BDC for transaction FB01. the requirement has changed as the posting document is now having multiple headers. The existing program is causing my issues so I was asked to develop new program using BAPI.

Well I have manged to get document data in to Header and lineitem internal tables. The mapping look good now. But I am struck with the BAPI.

I am trying to use BAPI_ACC_DOCUMENT_POST.

lt_header:

H1,,,,,

H2,,,,

H3,,,,

lt_lineitem:

H1,L1,,,,

H1,L2,,,,

H1,L3,,,,

H2,L1,,,,

H2,L2,,,,

H2,L3,,,,

Can someone please help me with this .

Thank you and regards.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Uwe Fetzer Jul 05, 2017 at 02:20 PM
0

How one document should have more than one header? I don't understand the requirement.

For each document you have to call the BAPI separately, the header i not an internal table but a structure.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Well for your understanding I am going put the document structure.

So, I had to read both headers and lineitems separately and put them in different internal tables with a header key which helps me to read lineitems of each header. Hope this makes some sense.

capture.jpg (138.3 kB)
0

Now where exactly is your problem? Again: for each header in your header table you have to call the BAPI (and of course you have to move the corresponding items to a separate internal table first)

0
Elwyn Pula Jul 25, 2017 at 08:34 AM
0

Well I figured out the solution. Thank you so much for your comments.

Share
10 |10000 characters needed characters left characters exceeded