Skip to Content
0
May 14, 2021 at 05:41 PM

Changing RESB in WORKORDER_UPDATE

1578 Views

Dears,

I want to change storage location components inside BadI WORKORDER_UPDATE.

I need to change storage location at production order creation according to a rule.

I have tried to access RESB by calling (SAPLCOBC)RESB_BT[] with reference to a field symbol.

Anyway I can access to the inline (SAPLCOBC)RESB_BT[] table but i can't modify it.

This is my code

FIELD-SYMBOLS: <fs_resb> TYPE ANY TABLE.
CONSTANTS: lc_resb(19) TYPE c VALUE '(SAPLCOBC)RESB_BT[]'.
ASSIGN (lc_resb) TO <fs_resb>.
lt_resb_bt = <fs_resb>.

<code...>

This is the point where I want to change RESB

IF sy-subrc = 0.
CASE lv_result.
WHEN lc_extrak.
IF ls_resb_bt-lgort IS NOT INITIAL.

CLEAR ls_resb_bt-lgort.
MODIFY lt_resb_bt FROM ls_resb_bt INDEX sy-tabix.
ENDIF.
WHEN lc_kanban.
IF ls_resb_bt-lgort <> ls_para-zpplgort.
ls_resb_bt-lgort = ls_para-zpplgort.
MODIFY lt_resb_bt FROM ls_resb_bt INDEX sy-tabix.

ENDIF.
ENDCASE.
ENDIF.

At the end of this i find that my internal table '(SAPLCOBC)RESB_BT[]' is not updated.

where is the mistake?