2026 May 28 3:53 AM
Hi All,
I've stumbled upon a strange behaviour when calling WS_DELIVERY_UPDATE_2 in a loop.
Given 2 valid vbeln, when being executed individually both gave success response and VL33N showed an intended result.
But when using it in a loop, somehow the 2nd document gave error message instead, which consists of HU of the 1st document, even though no HU is provided in the parameter. Any ideas on successfully solving this?
Existing pseudocode looks like:
LOOP AT lt_payload_grouped INTO ls_payload_grouped.
"Some assignment logic here...
CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
EXPORTING
vbkok_wa = lw_fm_head
commit = 'X'
synchron = 'X'
delivery = lv_fm_delivery
if_database_update_1 = '1'
if_error_messages_send = ''
TABLES
vbpok_tab = lt_fm_item
prot = lt_fm_prott
EXCEPTIONS
error_message = 4
OTHERS = 99.
READ TABLE lt_fm_prott WITH KEY msgty = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDLOOP.
Thanks,
Rahman.
2026 Jun 08 7:58 PM
Incase you are still planning to use same Fm, make sure you refresh the buffer by using
CALL FUNCTION 'LE_DELIVERY_REFRESH_BUFFER'
Hi All,
I've stumbled upon a strange behaviour when calling WS_DELIVERY_UPDATE_2 in a loop.
Given 2 valid vbeln, when being executed individually both gave success response and VL33N showed an intended result.
But when using it in a loop, somehow the 2nd document gave error message instead, which consists of HU of the 1st document, even though no HU is provided in the parameter. Any ideas on successfully solving this?
Existing pseudocode looks like:
LOOP AT lt_payload_grouped INTO ls_payload_grouped.
"Some assignment logic here...
CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
EXPORTING
vbkok_wa = lw_fm_head
commit = 'X'
synchron = 'X'
delivery = lv_fm_delivery
if_database_update_1 = '1'
if_error_messages_send = ''
TABLES
vbpok_tab = lt_fm_item
prot = lt_fm_prott
EXCEPTIONS
error_message = 4
OTHERS = 99.
READ TABLE lt_fm_prott WITH KEY msgty = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDLOOP.
Thanks,
Rahman.
2026 May 28 9:09 AM
That FM is not released for public use. It's unwise to use it if you have any other alternative.
Did you checked BAPI_*_DELIVERY_CHANGE? (* for INB or OUTB)
2026 Jun 08 7:58 PM
Incase you are still planning to use same Fm, make sure you refresh the buffer by using
CALL FUNCTION 'LE_DELIVERY_REFRESH_BUFFER'
| User | Count |
|---|---|
| 5 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |