2009 Jan 09 6:34 AM
Hi,
Below is my code
*--Call BAPI to Post the Document
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = ls_dochdr
TABLES
accountgl = lt_accountgl
accountpayable = lt_accountpay
accounttax = lt_accounttax
currencyamount = lt_curramt
return = lt_bapiret
extension2 = lt_extension.
READ TABLE lt_bapiret TRANSPORTING NO FIELDS WITH KEY type = 'E'.
IF sy-subrc EQ 0.
*--Roll back any update
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
lv_subrc = 1.
ELSE.
*--Update the transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
lv_subrc = 0.
ENDIF.
I m getting succuessful message with doc number in bapi return but I m not able to see document in FB03 (table BKPF) after using commit.
Please answer.
Thanks & Regards,
Prashant
Hi,
Below is my code
*--Call BAPI to Post the Document
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = ls_dochdr
TABLES
accountgl = lt_accountgl
accountpayable = lt_accountpay
accounttax = lt_accounttax
currencyamount = lt_curramt
return = lt_bapiret
extension2 = lt_extension.
READ TABLE lt_bapiret TRANSPORTING NO FIELDS WITH KEY type = 'E'.
IF sy-subrc EQ 0.
*--Roll back any update
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
lv_subrc = 1.
ELSE.
*--Update the transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
lv_subrc = 0.
ENDIF.
I m getting succuessful message with doc number in bapi return but I m not able to see document in FB03 (table BKPF) after using commit.
Please answer.
Thanks & Regards,
Prashant
2009 Jan 09 6:56 AM
Hi,
try to use below code
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = wa_account_header
TABLES
accountgl = it_accountgl
accountpayable = it_account_pay
currencyamount = it_currency_amount
return = it_bapi_return.
CLEAR v_lineitem.
v_lineitem = 1.
LOOP AT it_bapi_return INTO wa_type_bapi_return.
-
To Save Success Record Through BAPI Commit----
IF wa_type_bapi_return-type = 'S' .''if it is success
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDLOOP .
2009 Jan 09 7:47 AM
Hi ,
There might be an error message of type 'A' in bapireturn.
Regards,
Deepthi
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |