Skip to Content
author's profile photo Former Member
Former Member

Document Splitting

I need to post a financial document in SAP from PI. I need to split that document after the 999 Th line. Can anyone help me with the splitting logic?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2014 at 03:46 PM

    Hi,

    How you are posting the Invoice, Are you using BAPI?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 05, 2014 at 03:47 PM

    Where is the problem?

    Just use a counter and after the 999 line set your pointer to the next internal table.

    And this isn't a question right now. What document do you got. is it an XML or already in another table stored or or or.

    Please share more about the details you are into and I think you will get some useful answers in case my answer didn't help you out😉

    Regards

    Florian

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2014 at 08:11 AM

    Hi - What type of financial document is it ( like GL Posting) ?

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Tina -

      Say if you have 1200 Lines to be posted then you will create two account documents. The First Accounting document will have 998 Lines + 1 Line for Dummy GL and 2nd document will have 222 Lines + 1 Dummy GL.

      1. Now loop over the 1200 lines. Put a counter and another variable for sum of the amounts.

      2. When the counter reaches 998 then check the sum of amounts.

      (a)If its credit (negative) then post a debit to the dummy GL as the line 999. So the balance will be zero.

      (b) If its debit (positive then post a credit to the dummy GL as the line 999.). So the balance will be zero.

      (c) then you call BAPI_ACC_DOCUMENT_POST to create first accounting document

      3. Now you need create 2nd account document. If you posted the dummy GL as negative in step 2 above then create the 1st line as positive for dummy GL else create the 1st line as negative for dummy GL.

      4. Proceed for the rest of line items and create till 1200 lines. ( the 2nd document should have 221 lines )

      5. Then you call BAPI_ACC_DOCUMENT_POST to create 2nd accounting document .

      Let us know if it helps.

      Regards,

      Atul Mohanty


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.