Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FI : Document split for line items exceeding the number '999' while using BAPI 'BAPI_ACC_GL_POSTING_POST'

Sijin_Chandran
Active Contributor
0 Likes
8,646

Hi All ,

As evident from the heading of this discussion.

I have a ZPROGRAM in my current project which posts accounting entries to G/L using the BAPI 'BAPI_ACC_GL_POSTING_POST'.

Now I have to enhance this ZPROGRAM to overcome the very famous limitation of number of line items in an Accounting Entry ( '999' ).

I saw many threads for this, but all are not certain about the solution.

I would like to share my solution, Gurus please recommend whether the workaround is good enough to move ahead or not.

Step 1. Using Mathematical function I will calculate the number of Accounting Entries to be spitted into. Eg. say its 1002 then the accounting documents will be 2 ( first with 999 line items and second with remaining 3 line items.

Step 2. Later I will loop DO ENDO 6 times and inside this i will LOOP ENDLOOP based on index onto the line item table and call BAPI accordingly.

So, the BAPI will be called twice.

Will segregate the return messages and display the same after DO ENDO loop.

I can see in one of the thread it has been mentioned that there is a flag in this bapi which automatically takes care of this split.

FI - document split for FB01 | SCN

Does this thing really work ?


Waiting for recommendations and reviews.


Thanks,

Sijin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,382

I have never done splitting the document within the FM. You will have to do it manually in your program.

you can use following steps to do the same.

Firstly check the line items (all of them) in the document , debit line items should be equal to credit line items,

Ask the business team for a clearing GL, this will help you in splitting the document.

now if the document has more than 999 line items, split it at 998 lines. check the debit amount and credit amount, if there is any difference clear it on the clearing GL.

lets say you document has 1002 lines.

Split at 998. add the 999th item with clearing GL. Post the document. (lets say clearing GL got debited in this document).

Now for rest of the items credit this clearing GL and add the other 4 line items , post the document.

Hope this helps.

8 REPLIES 8
Read only

Former Member
0 Likes
5,383

I have never done splitting the document within the FM. You will have to do it manually in your program.

you can use following steps to do the same.

Firstly check the line items (all of them) in the document , debit line items should be equal to credit line items,

Ask the business team for a clearing GL, this will help you in splitting the document.

now if the document has more than 999 line items, split it at 998 lines. check the debit amount and credit amount, if there is any difference clear it on the clearing GL.

lets say you document has 1002 lines.

Split at 998. add the 999th item with clearing GL. Post the document. (lets say clearing GL got debited in this document).

Now for rest of the items credit this clearing GL and add the other 4 line items , post the document.

Hope this helps.

Read only

0 Likes
5,382
ask the business team for a clearing GL, this will help you in splitting the document.

Yeah this point is very helpful.

This makes the program a bit more complex

I didn't think initially on this note.

Still waiting for other fellow SDNers who might have encountered with a very similar requirement like this.

Must say your points were very helpful

And one more thing, I guess these clearing G/Ls can be posted with both CREDIT and DEBIT type line items ?

Thanks

Read only

0 Likes
5,382

Yes these clearing GL are kept for the type of posting DEBIT or CREDIT. That's why it should come from the business team.

Also this becomes less complex if you have only 1 debit item and rest credit items or vice versa.

Hope this helps.

Read only

0 Likes
5,382

Firstly, you should not split at 999 items. SAP may automatically create extra line items for things like taxes. If I recall correctly, SAP recommends a maximum of 950 line items per document.

Secondly, you will need some sort of dummy offset account. Simply go through your input and keep track of the debits and credits. When you reach 950 items, create a line item to the offset account for the opposite amount and then start the next document with an entry to the offset account that is the negative of the first amount. In this way, the total to the offset will be zero.

Rob

Read only

0 Likes
5,382
SAP may automatically create extra line items for things like taxes.

By looking at valuable suggestions here, it seems this not gonna be as simple as I thought initially.

Can you tell me how can I make it sure whether automatic entries will be created for a particular scenario or not.

And coming to your point,

you will need some sort of dummy offset account.

I guess its the same what Gaurav addressed as clearing G/L.

Read only

0 Likes
5,382

Can you tell me how can I make it sure whether automatic entries will be created for a particular scenario or not.

This you can ask your functional guy to confirm if the vendor or customer attracts some other kind of payment (like taxes, with holding tax codes), in that cases line items are added by SAP.

And yes the offset Account is the same as Clearing GL , different people may use different terms for the same.

Hope this helps.

Read only

0 Likes
5,382

You don't need to know if automatic entries will be created. Just do the split on or before 950 items. See the note that was recommended earlier.

Rob

Read only

Former Member
0 Likes
5,382

Hi,

May be you can have a look at below OSS Notes may be that can help you for your requirement.

http://service.sap.com/sap/support/notes/117708

Regards,

Srinivas