‎2008 Jul 01 7:59 AM
HI all,
We have one interface that is used to create the Sales order ,Purchase requistions,etc...
We create all these using corresponding BAPI.Firstly we fill all the data to BAPI and then execute that BAPI.
Let the BAPI execute successfully then it is ok, but if there is some error then it shows error messages now i want to store all data in corresponding tables if error comes.
so after that we again go to data and correct the particular fields / data and again execute that BAPI with the corresponding data.
Any suggestion welcome,
Regards,
‎2008 Jul 01 8:04 AM
hi...
what you can do is your BAPI data must be coming to some internal table.
you can read this internal tble with key = 'E'.
if sy-subrc = 0.
then you cn move the corressponding records t some other internal table and display them if needed.
i am doing a similar case over here.you can check it.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING
documentheader = i_dochd
IMPORTING
obj_type = header-obj_type
obj_key = header-obj_key
obj_sys = header-obj_sys
TABLES
accountreceivable = i_ar
accountgl = i_accountgl
accounttax = i_acctax
currencyamount = i_curramt
return = i_return
extension1 = i_extn.
READ TABLE i_return WITH KEY type = 'E'.
IF sy-subrc EQ 0.
v_tabix = sy-tabix + 1.
ENDIF.
READ TABLE i_return INDEX v_tabix.
IF sy-subrc EQ 0.
LOOP AT izecollect_citi WHERE sel = 'X' AND docno IS initial.
izecollect_citi-errflg = 'E'.
izecollect_citi-errdesc = i_return-message.
MODIFY izecollect_citi.
CLEAR izecollect_citi.
v_error1 = 'X'.
ENDLOOP.
‎2008 Jul 01 8:05 AM
‎2008 Jul 01 8:07 AM
use the function module to save the data to databse.
BAPI_TRANSACTION_COMMIT
Execute external Commit when using BAPIs