Application Development 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: 

Delivery Update: Handling unit : BAPI?

Former Member
0 Kudos

Could not make BAPI_HU_CHANGE_HEADER to update the handling unit header field "INHALT - Description of Handling Unit Content". Also referred to SAP note 581282.

It is required to update the handling unit of the delivery using remote FM. So BDC is not possible.

Can someone share code of how to acheive this using WS_DELIVERY_UPDATE or other FM/BAPI? Thanks in advance.

2 REPLIES 2

Former Member
0 Kudos

Does anyone found a FM to update this field ? I have to update it in Batch.

rattaiah88
Discoverer
0 Kudos

Yes we have to call the 3 FMs then only we update reequired fields..

BAPI_HU_CHANGE_HEADER is not working getting error if not 06 -VPOBJ

Please find the below piece of code:

DATA:ef_rcode LIKE sy-subrc,
et_vekp TYPE vsep_t_vekp,
et_vepo TYPE vsep_t_vepo,
et_vevw TYPE vsep_t_vevw,
et_highest_level TYPE vsep_t_venum,
et_messages TYPE huitem_messages_t.
DATA : is_flags TYPE v51p_select_flags.



DATA:lt_hut TYPE hum_exidv_t,
ls_hut LIKE LINE OF lt_hut.
ls_hut-exidv = '00000000000200000017'.
APPEND ls_hut TO lt_hut.

CALL FUNCTION 'V51P_FILL_GT'
EXPORTING
if_langu = sy-langu
it_hus = lt_hut
IMPORTING
* ef_rcode = ef_rcode
* et_vekp = et_vekp
* et_vepo = et_vepo
* et_vevw = et_vevw
* et_highest_level = et_highest_level
et_messages = et_messages
EXCEPTIONS
hu_locked = 1
no_hu_found = 2
fatal_error = 3
OTHERS = 4.
IF sy-subrc = 0.
BREAK-POINT.
DATA: it_new_values TYPE hum_update_header_t,
wa_new_values LIKE LINE OF it_new_values.
wa_new_values-hdl_unit_exid = ls_hut-exidv .

wa_new_values-field_name = 'INHALT'.

wa_new_values-field_value = 'NEW Values to Pupulate'.

APPEND wa_new_values TO it_new_values.

CALL FUNCTION 'HU_HEADER_UPDATE'
EXPORTING
it_new_values = it_new_values
IMPORTING
et_messages = et_messages
EXCEPTIONS
not_possible = 1
OTHERS = 2.

CALL FUNCTION 'HU_PACKING_UPDATE'
EXPORTING

if_synchron = 'X'.