I figured out that the solution for my program I wanted to create is not working 😉
So I tried a new way to program the batch Input for the transaction MB1B.
The problem is, I want to write my the material number (matnr) and the batch number (charg) in this transaction.
Both numbers are stored in an internal table (looks like the following).
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'RM07M-WERKS'
perform bdc_field using 'XFULL'
perform bdc_field using 'RM07M-WVERS3'
loop at itab.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'MSEG-MATNR'
perform bdc_field using 'MSEG-CHARG'
call transaction 'MB1B' using BDC mode 'A'.
Dynpro-Selection for Batch Input *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
BDC-PROGRAM = PROGRAM.
BDC-DYNPRO = DYNPRO.
BDC-DYNBEGIN = 'X'.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
BDC-FNAM = FNAM.
BDC-FVAL = FVAL.
The problem now is, every time I try to run the program, it says "the field MSEG-CHARG does not exist on the screen 0421".
In the batch input recording the field is called MSEG-CHARG(01) - the (01) is for the line I think.
So I am searching for a possibility to call this field dynamically?!?!
something like this:
perform bdc_field using 'MSEG-MATNR(n)'
with n as a counter?!?!
Can anybody help me out with that?