Hello,
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).
matnr charg
111000 10000000000
112001 10532432000
133013 13423423512
My coding:
start-of-selection.
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'RM07M-WERKS'
'1000'.
perform bdc_field using 'XFULL'
'X'.
perform bdc_field using 'RM07M-WVERS3'
'X'.
----
Loop *
----
loop at itab.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'MSEG-MATNR'
itab-matnr.
perform bdc_field using 'MSEG-CHARG'
itab-charg.
endloop.
call transaction 'MB1B' using BDC mode 'A'.
----
Dynpro-Selection for Batch Input *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDC.
BDC-PROGRAM = PROGRAM.
BDC-DYNPRO = DYNPRO.
BDC-DYNBEGIN = 'X'.
APPEND BDC.
ENDFORM.
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDC.
BDC-FNAM = FNAM.
BDC-FVAL = FVAL.
APPEND BDC.
ENDFORM.
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)'
itab-matnr.
with n as a counter?!?!
Can anybody help me out with that?
many thanks