‎2008 May 05 12:04 PM
Hi All,
I have an issue with BAPI_ACC_DOCUMENT_POST.
My program gets data through flat file and the data is processed to post through above mentioned BAPI.
The problem I face here is that there might be some errors in the data coming from the flat file, so when ever there is an error the BAPI raises through return parameter and stops there, so every time the error comes we need to go to the flat file, correct it and re-execute the program.
This is fine with few records, now user complaints that if there are many records then going to flat file each time would be tedious.
Could you please suggest me any solution regarding this, if there can be anyway such that all the errors are captured at once or any other BAPI or FM which can do the same.
Full points to the useful answer.
Regards
Sunil Kumar P
‎2008 May 05 1:58 PM
Hi sunil,
check with the following code
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
IMPORTING
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
TABLES
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it
extension2 = it_ext2
realestate = it_re.
otherwise go through the program 'ACC_BAPI_TEST_DOCUMENT'
thanks
karthik
‎2008 May 05 2:10 PM
Hi
U can use BAPI_ACC_DOCUMENT_CHECK in order to check the file before posting the document and create a log where u print the number of wrong record.
Max