Skip to Content
0
Jun 03, 2020 at 06:05 PM

Handle null value as input to BAPI-X structure dynamically.

253 Views Last edit Jun 03, 2020 at 06:07 PM 2 rev

Hi All,

Could you please suggest how to input null value / 0 / Space to bapix structures.

To be more accurate please find the below example.

BAPI: BAPI_MATERIAL_SAVEREPLICA

Field XCHPF (It accepts only "X" or "").

currently I am update the plantdatax-xchpf as following:

lw-xchpf = 'X'.
append lw to lt_plant.

If lw-xchpf is not initial.
 lw_plantx-xchpf = 'X'.
endif.
append lw_plantx to lt_plantx.

The above is working fine. (Note: I am trying to make the solution dynamic)

Now I have a scenario where I need to update the value to null.

lw-xchpf = ''.
append lw to lt_plant.

If lw-xchpf is not initial. "------This is causing Issue
 lw_plantx-xchpf = 'X'.
endif.
append lw_plantx to lt_plantx.

Thanks in Advance.