Skip to Content
author's profile photo Former Member
Former Member

BAPI Return Table is Initial for BAPI_BUPA_TAX_ADD/CHANGE/REMOVE

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 24, 2013 at 09:36 PM

    Hi,

    Check for type E,if you find exit other wise call commit,

    Regards,

    Sreenivas.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2013 at 09: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.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2013 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2013 at 10:14 AM

    Hi Anirban,

    Check for message type 'E' , 'A' and 'X'.

    Thanks and Regards

    Srimanta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 12:25 PM

    Hi All,

    My problem is solved. PLEASE TELL ME HOW TO CLOSE THIS THREAD.

    Thanks & Regards

    Anirban

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.