‎2008 Jan 24 9:33 AM
Hello, when there are more than 999 entries in the internal table, an error message is generated.I got the option to split the internal table ,total the amount, reverse it and pass it to the bapi to counter the problem.However:
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = ls_documentheader
IMPORTING
obj_type = ld_obj_type
obj_key = ld_obj_key
obj_sys = ld_obj_sys
TABLES
accountgl = lt_accountgl
currencyamount = lt_currencyamount
return = lt_return.
lt_currencyamount contains 2 lines, the same amount positive and negative.it is to be debited /credited to two account.How can i solve this problem then(more than 999 lines)?
‎2008 Jan 24 9:55 AM
Hi,
Let us assume for the purpose of example that max no of enteries allowed is say 3. Let us assume that your have got 4 enteries in i/p say
1) amt 100 CR GL account 1234
2) amt 200 CR GL account 2345
3) amt 300 CR gl account say 4567
$) amt 600 DR gl account 55555.
SO your internal table will have 5 enteris. Now since max of 3 enteris are allowed pick up only first 2 enteris in another internal table (say XX) which will be used to post document thru BAPI ( If max no of enteries is 999 then this should be 999-1=998) now after adding amts of first 2 recs you get an amt of 300 CR so append a dumy entry with valid GL code say 77777 with amt 300DR so that total of these 3 records is 0 & call BAPI & post a fI document containing first 2 entries & a dummy entry mentioned above i.e. 300Dr with GL account 77777. Now your through with first 2 records. Now refresh internal table xx & copy the remaining records no 3 & 4 in XX
The total of record no 3 & 4 is 300 DR( 600DR-300CR) so creat one more dummy record with amount 300 CR & GL account 77777 used earlier. Thus If you notice we have posted 2 dummy enteries in 77777 first with 300Cr & another with 300Dr thus net effect is 0. Now agin call BAPI & post these 3 records. Continue this process till all records are over.
Regards
Raju Chitale