In the following code snippet you can find an example on how to trigger a transaction HU03 (display handling unit details) with given HU number via batch input.
Because HU number does not have its own PARAMETER ID, we can’t do it in the simple way, e.g.
SET PARAMETER 'DTB' FIELD 'MARA'.
CALL TRANSACTION 'SE16' AND SKIP FIRST SCREEN.
Luckily there’s an alternative way using batch input.
You can record/simulate the batch sequence in transaction SHDB
From here you can take all the necessary information to build up your program:
DATA:
lt_bdc TYPE TABLE OF bdcdata,
lv_exidv TYPE exidv VALUE '123456789'.
FIELD-SYMBOLS:
<ls_bdc> TYPE bdcdata.
* Macro to fill the necessary BDC data
DEFINE add_bdc.
APPEND INITIAL LINE TO lt_bdc ASSIGNING <ls_bdc>.
<ls_bdc>-fnam = &1.
<ls_bdc>-fval = &2.
<ls_bdc>-program = &3.
<ls_bdc>-dynpro = &4.
<ls_bdc>-dynbegin = &5.
END-OF-DEFINITION.
* Rewrite the commands from SHDB
add_bdc: ' ' ' ' 'RHU_DISPLAY_HANDLING_UNITS' '1000' 'X',
'BDC_CURSOR' 'VEKP-EXIDV(01)' ' ' ' ' ' ',
'BDC_OKCODE' '=CREATE' ' ' ' ' ' ',
'VEKP-EXIDV(01)' lv_exidv ' ' ' ' ' '.
* Call transaction with the batch input data
CALL TRANSACTION 'HU03' "#EC CI_CALLTA
USING lt_bdc
MODE 'E'.