Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_HU_DELETE

kiran_k8
Active Contributor
0 Likes
1,642
FORM bapi USING pv_exidv.
  CALL FUNCTION 'BAPI_HU_DELETE'
    EXPORTING
      hukey    = pv_exidv
      ifpacked = 'X'
    TABLES
      return   = it_return.
  IF sy-subrc = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
    wa_final-comments = 'Deleted Successfully'.
  ELSE.
    wa_final-comments = 'BAPI Failed'.
  ENDIF.
ENDFORM.                    " BAPI


I am calling the above mentioned FMs in a LOOP. Suprisingly both the FMs return sy-subrc as zero but failing to update the table (vekp-status) when we are running this for multiple HUs.If we run for a single HU it is working but not for multiple.Kindly let me know where I am going wrong.

1 ACCEPTED SOLUTION
Read only

Former Member
1,470

Evaluation of SY-SUBRC is only meaningful if you call the function module with exception handling (with option EXCEPTIONS).

As a convention BAPI's do not raise exceptions. Instead the content of parameter RETURN can be used to determine whether the call was successful (by checking if any messages with type error are returned).

3 REPLIES 3
Read only

Former Member
1,471

Evaluation of SY-SUBRC is only meaningful if you call the function module with exception handling (with option EXCEPTIONS).

As a convention BAPI's do not raise exceptions. Instead the content of parameter RETURN can be used to determine whether the call was successful (by checking if any messages with type error are returned).

Read only

0 Likes
1,470

Hi, I checked the return table from BAPI and it doesn't have any type E messge.

If I run for single HU, it is working but not for multiple.

Read only

kiran_k8
Active Contributor
0 Likes
1,470

Refreshing the IT_RETURN table from the BAPI, for every iteration solved the issue.Thanks.