2013 Dec 24 5:40 PM
Hi Friends,
I am getting an Initial return Table for BAPI_BUPA_TAX_CHANGE/ADD/REMOVE. The return Table is not getting populated and therefore commit is not happening. Please advice what to do in this situation. I am also pasting the code below. ALL THE BAPIRET TABLES ARE COMING INITIAL AND SO I AM NOT GETTING ANY DECISION WHETHER TO COMMIT OR NOT...?? PLEASE HELP ME WITH THIS.
LOOP at lit_tax INTO lwa_tax.
ls_taxtype = lwa_tax-taxtype.
l_taxnum = lwa_tax-taxnum.
SELECT SINGLE *
FROM dfkkbptaxnum
INTO ls_bptax
WHERE partner = lwa_tax-partner
and taxtype = ls_taxtype.
if sy-subrc ne 0.
* if ( ls_taxtype IS NOT INITIAL ) or ( l_taxnum IS NOT INITIAL ).
CALL FUNCTION 'BAPI_BUPA_TAX_ADD'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
taxnumber = l_taxnum
TABLES
RETURN = lit_bapiret_taxad
.
READ TABLE lit_bapiret_taxad WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
* endif.
else.
if lwa_tax-del_ind = 'Y'.
CALL FUNCTION 'BAPI_BUPA_TAX_REMOVE'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
TABLES
RETURN = lit_bapiret_taxdel
.
READ TABLE lit_bapiret_taxdel WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_BUPA_TAX_CHANGE'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
taxnumber = l_taxnum
TABLES
return = lit_bapiret_taxch.
READ TABLE lit_bapiret_taxch WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
ENDIF.
ENDIF.
CLEAR: ls_taxtype,l_taxnum,ls_identification,lv_partner,lv_identificationno.
ENDLOOP.
Thanks & Regards
Anirban
Hi Friends,
I am getting an Initial return Table for BAPI_BUPA_TAX_CHANGE/ADD/REMOVE. The return Table is not getting populated and therefore commit is not happening. Please advice what to do in this situation. I am also pasting the code below. ALL THE BAPIRET TABLES ARE COMING INITIAL AND SO I AM NOT GETTING ANY DECISION WHETHER TO COMMIT OR NOT...?? PLEASE HELP ME WITH THIS.
LOOP at lit_tax INTO lwa_tax.
ls_taxtype = lwa_tax-taxtype.
l_taxnum = lwa_tax-taxnum.
SELECT SINGLE *
FROM dfkkbptaxnum
INTO ls_bptax
WHERE partner = lwa_tax-partner
and taxtype = ls_taxtype.
if sy-subrc ne 0.
* if ( ls_taxtype IS NOT INITIAL ) or ( l_taxnum IS NOT INITIAL ).
CALL FUNCTION 'BAPI_BUPA_TAX_ADD'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
taxnumber = l_taxnum
TABLES
RETURN = lit_bapiret_taxad
.
READ TABLE lit_bapiret_taxad WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
* endif.
else.
if lwa_tax-del_ind = 'Y'.
CALL FUNCTION 'BAPI_BUPA_TAX_REMOVE'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
TABLES
RETURN = lit_bapiret_taxdel
.
READ TABLE lit_bapiret_taxdel WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_BUPA_TAX_CHANGE'
EXPORTING
businesspartner = lwa_tax-partner
taxtype = ls_taxtype
taxnumber = l_taxnum
TABLES
return = lit_bapiret_taxch.
READ TABLE lit_bapiret_taxch WITH KEY type = 'S' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
CLEAR: gW_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = gW_bapiret2.
.
ENDIF.
ENDIF.
ENDIF.
CLEAR: ls_taxtype,l_taxnum,ls_identification,lv_partner,lv_identificationno.
ENDLOOP.
Thanks & Regards
Anirban
2013 Dec 24 9:36 PM
Hi,
Check for type E,if you find exit other wise call commit,
Regards,
Sreenivas.
2013 Dec 26 9:03 AM
Hi Anirban
Did you debug BAPIs and see the return table assignments ?? if really BAPIs have issue, raise a OSS msg since these BAPIs are standard ones, and SAP will fix it.
If it is urgent delivery, use BDC instead of BAPI. I know BAPI method is very easy comparatively BDC.
2013 Dec 26 9:21 AM
Hi Anirban
If you read the documentation of BAPI for return parameter it clearly status that it will be filled if an error occurs or a note should appear.
I believe you should just check if RETURN[] is initial means all well proceed with commit.
Nabheet
2013 Dec 26 10:14 AM
Hi Anirban,
Check for message type 'E' , 'A' and 'X'.
Thanks and Regards
Srimanta
2013 Dec 30 12:25 PM
Hi All,
My problem is solved. PLEASE TELL ME HOW TO CLOSE THIS THREAD.
Thanks & Regards
Anirban
2013 Dec 30 4:17 PM
Please document your completw solution here so that some one can refer to it
2013 Dec 30 6:42 PM
Hi,
The documentation of these BAPI's says that return table will be populated only when there is an error. So I have done read table on the BAPIRET Tables for message type 'E' only. If not found then COMMIT. It's working well as I have tested it.
That is why I WANT TO CLOSE THIS THREAD.
Thanks & Regards
Anirban
2013 Dec 30 6:53 PM
http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why
Check this link to understand how to close the thread
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |