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