Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

again Batch Input for Transaction MB1B

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

u need to do that programatically.

u've charg.

use concatenate 'charg(' count ')' into string. and pass this. increment count & use it.

Reward if useful

Regards

ANUPAM

5 REPLIES 5

Former Member
0 Kudos

u need to do that programatically.

u've charg.

use concatenate 'charg(' count ')' into string. and pass this. increment count & use it.

Reward if useful

Regards

ANUPAM

0 Kudos

Hi Anupam,

thanks for your reply.

Could you provide me an example how you mean that?

How do you like to assign this string to the field?

concatenate 'charg(' count ')' - if I do that, something like this should be the result:

charg1

So where in the following code would you pass it?

perform bdc_field using 'MSEG-CHARG'

itab-charg.

Thanks for your help.

0 Kudos

concatenate 'mseg-charg(' count ')'

if count is 01 then after concatenate it'll be mseg-charg(01).

u need to generate count by program .

Thanks

ANUPAM

0 Kudos

Hi,

Something like:

DATA: w_charg(40).

CONCATENATE 'LIPS-CHARG' '(' w_x ')' INTO w_charg.

perform bdc_field using w_charg itab-charg.

Regards

Raju Chitale

0 Kudos

Thanks a lot,

you solved my problem.

Best regards and a happy new Year,

Christoph