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: 

Batch Input using Transaction Mb1b

Former Member
0 Kudos
226

Hello,

I want to use batch input for the transaction MB1B.

I already used the batch input recorder to get the right fieldnames and values.

My problem is that the ok_codes seems not to be used.

I just want to skip the first screen and enter in the second one only materials and batch no via batch input (I already have these data in an internal table) - so on the second screen (0421) the user should enter the quantity for each single line at the end.

My coding is following:

*perform oben using 'SAPLMM07M' '0400' 'X'.

*perform unten using 'BDC_CURSOR' 'RM07M-LGORT'.

*perform unten using 'BDC_OKCODE' '/00'.

*perform unten using 'MKPF-BLDAT' '27.12.2007'.

*perform unten using 'MKPF-BUDAT' '27.12.2007'.

*perform unten using 'RM07M-BWARTWA' '311'.

*perform unten using 'RM07M-WERKS' '1000'.

*perform unten using 'RM07M-LGORT' '1000'.

*perform unten using 'XFULL' 'X'.

*perform unten using 'RM07M-WVERS3' 'X'.

*perform unten using 'RM07M-XNAPR' 'X'.

*

*loop at itab.

*n = n + 1.

*perform oben using 'SAPMM07M' '0421' 'X'.

*perform unten using 'MSEG-MATNR(n)' itab-matnr.

*perform unten using 'mseg-charg(n)' itab-charg.

*

*endloop.

Looks like it is not working properly, it is not continuing after the first screen (0400).

Another question:

Can I use the batch input with this loop???

Thanks for your help,

Christoph

6 REPLIES 6

Former Member
0 Kudos
95

hi,

The first screen generally contains headder data, which you need to give input, it is must. As per my knowledge u can't skip that screen.

2) you can loop like that.

regards,

pavan

0 Kudos
95

Thanks for your reply,

good to know that I can use this loop in that way. But why, even if I am not trying to skip the first screen, it is not going to the next screen automatically?

This is the code I am using to start the transaction:

call transaction 'MB1B' using bdc mode 'A' update 'S'.

What I am doing wrong?

Thanks,

Christoph

0 Kudos
95

hi,

make sure that all ok codes are at the end of the screen in recording.

eg)

*perform oben using 'SAPLMM07M' '0400' 'X'.

*perform unten using 'BDC_CURSOR' 'RM07M-LGORT'.

*perform unten using 'BDC_OKCODE' '/00'. This should be

*perform unten using 'MKPF-BLDAT' '27.12.2007'.

*perform unten using 'MKPF-BUDAT' '27.12.2007'.

*perform unten using 'RM07M-BWARTWA' '311'.

*perform unten using 'RM07M-WERKS' '1000'.

*perform unten using 'RM07M-LGORT' '1000'.

*perform unten using 'XFULL' 'X'.

*perform unten using 'RM07M-WVERS3' 'X'.

*perform unten using 'RM07M-XNAPR' 'X'.

*perform unten using 'BDC_OKCODE' '/00'.

still problem exists kindly post the code

regards,

pavan

0 Kudos
95

I tried this, still not working...

Here is the code - table itab is an internal table with 2 rows (matnr and charg).

perform bdc.

form bdc.

perform oben using 'SAPLMM07M' '0400' 'X'.

perform unten using 'BDC_CURSOR' 'RM07M-LGORT'.

perform unten using 'BDC_OKCODE' '/00'.

perform unten using 'RM07M-BWARTWA' '311'.

perform unten using 'RM07M-WERKS' '1000'.

perform unten using 'RM07M-LGORT' '1000'.

perform unten using 'BDC_OKCODE' '/00'.

perform oben using 'SAPMM07M' '0421' 'X'.

loop at itab.

n = n + 1.

perform unten using 'MSEG-MATNR(n)' itab-matnr.

perform unten using 'mseg-charg(n)' itab-charg.

endloop.

call transaction 'MB1B' using bdc.

endform.

form oben using programm dynpro dynbegin.

bdc-program = programm.

bdc-dynpro = dynpro.

bdc-dynbegin = dynbegin.

bdc-fnam = ''.

bdc-fval = ''.

append bdc.

endform.

form unten using fnam fval.

bdc-program = ''.

bdc-dynpro = ''.

bdc-dynbegin = ''.

bdc-fnam = fnam.

bdc-fval = fval.

append bdc.

endform.

Thanks for your help,

Christoph

It seems like the transaction is called without using the information from bdc table... What I am doing wrong?

Edited by: Christoph Schle on Dec 27, 2007 8:14 AM

0 Kudos
95

hi

perform bdc.

form bdc.

perform oben using 'SAPLMM07M' '0400' 'X'.

perform unten using 'BDC_CURSOR' 'RM07M-LGORT'.

perform unten using 'BDC_OKCODE' '/00'. delete this one

perform unten using 'RM07M-BWARTWA' '311'.

perform unten using 'RM07M-WERKS' '1000'.

perform unten using 'RM07M-LGORT' '1000'.

perform unten using 'BDC_OKCODE' '/00'.

perform oben using 'SAPMM07M' '0421' 'X'.

loop at itab.

n = n + 1.

perform unten using 'MSEG-MATNR(n)' itab-matnr.

perform unten using 'mseg-charg(n)' itab-charg.

endloop. this is wrong

to achieve the same

loop at itab

perform oben using 'SAPMM07M' '0421' 'X'.

perform unten using 'MSEG-MATNR' itab-matnr.

perform unten using 'mseg-charg' itab-charg.

perform unten using 'BDC_OKCODE' '/00'. Check the Ok code in recordingendloop.

call transaction 'MB1B' using bdc.

endform.

regards,

pavan

Edited by: pavan kumar pisipati on Dec 27, 2007 8:22 AM

0 Kudos
95

Hi Pavan,

thanks for your replies.

I solved the problem now in a little bit different way, will post the coding here when it is finish.

Thanks a lot for your help and a happy new year!

Christoph