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: 

MB1B - 309 Movement - BDC Recording Error

Former Member
0 Kudos

HI Everyone,

Basically I need to create a 309 Movement in transaction MB1B to do a batch to batch transfer. Unfortunately I cannot use a BAPI for this because there is configuration in the system that will create the destination batch so I need to use BDC.

I can record the transaction without problems, but I cannot get the recording to work in my program. For some reason it doesnot seem to be able to overwrite the defaulted batch no that comes in when specifying the batch to transfer into. If I run the program in mode 'E' the MB1B screen pops up and does nothing. If I click on warning message and close window it then prompts me to Post. I cannot see why it wont post using my BDC Logic (see below).

I have tried recording this transaction many many times but it wont work - Maybe i am missing something.

Please find the code below that i have recorded.....

Your help is greatly appreciated.

************************************************************

PERFORM BDC_DYNPRO USING 'SAPMM07M' '0400'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RM07M-LGORT'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'MKPF-BLDAT'

'01.03.2012'.

PERFORM BDC_FIELD USING 'MKPF-BUDAT'

'01.03.2012'.

PERFORM BDC_FIELD USING 'RM07M-BWARTWA'

'309'.

PERFORM BDC_FIELD USING 'RM07M-WERKS'

FS_DATATAB-WERKS.

PERFORM BDC_FIELD USING 'RM07M-LGORT'

FS_DATATAB-LGORT.

PERFORM BDC_FIELD USING 'XFULL'

'X'.

PERFORM BDC_FIELD USING 'RM07M-WVERS2'

'X'.

PERFORM BDC_DYNPRO USING 'SAPMM07M' '0421'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'MSEG-CHARG(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'MSEGK-UMWRK'

FS_DATATAB-WERKS.

PERFORM BDC_FIELD USING 'MSEGK-UMLGO'

FS_DATATAB-LGORT.

PERFORM BDC_FIELD USING 'MSEGK-UMMAT'

FS_DATATAB-MATNR.

PERFORM BDC_FIELD USING 'MSEG-MATNR(01)'

FS_DATATAB-MATNR.

PERFORM BDC_FIELD USING 'MSEG-ERFMG(01)'

FS_DATATAB-ERFMG.

PERFORM BDC_FIELD USING 'MSEG-CHARG(01)'

FS_DATATAB-CHARG.

PERFORM BDC_FIELD USING 'DKACB-FMORE'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'COBL-KOSTL'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENTE'.

PERFORM BDC_FIELD USING 'COBL-KOSTL'

FS_DATATAB-KOSTL.

PERFORM BDC_DYNPRO USING 'SAPMM07M' '0410'.

PERFORM BDC_FIELD USING 'MSEG-UMCHA'

FS_DATATAB-CHARG1.

PERFORM BDC_FIELD USING 'DKACB-FMORE'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'COBL-KOSTL'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENTE'.

PERFORM BDC_FIELD USING 'COBL-KOSTL'

FS_DATATAB-KOSTL.

PERFORM BDC_DYNPRO USING 'SAPMM07M' '0421'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/EBCK'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'MSEG-ERFMG(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=BU'.

PERFORM BDC_FIELD USING 'DKACB-FMORE'

'X'.

PERFORM BDC_DYNPRO USING 'SAPLKACB' '0002'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'COBL-KOSTL'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENTE'.

CALL TRANSACTION 'MB1B' USING BDCDATA[] MODE 'A'

MESSAGES INTO IT_BDC_MSGS.

5 REPLIES 5

Former Member
0 Kudos

Hi,

I could not give the exact solution as i dont have access to my SAP system temporarily. According to your inputs i can guess that the issue happened because of pop-up or message prompt will be coming for MB1B movement.

Generally we could not capture the pop-up kind of things using SHDB recording. You must include one BDC_OKCODE logic in the place where POP-UP is coming inside your BDC Coding part.

I hope this will give you some idea.

Thanks:)

Harsh_Bansal
Contributor
0 Kudos

Hi,

Find the screen number of that pop up screen and function code of the button you click on it.

Then manually insert the code in BDC recording for it.

Regards,

Harsh Bansal

Former Member
0 Kudos

Hi,

Please run your BDC code using mode 'A' such that you will come to know what inputs the system is taking on each and every screen. Mode 'E' does not always help.

Regards,

Danish.

Former Member
0 Kudos

Hi,

May be while recording you may be missing some fields or OK_CODES so you are getting this issues. Check your recording program using debugging i hope you may get some solution.

Regards,

Goutam Kolluru.

0 Kudos

Hi Goutham,

I have tried all the BDC_OKCODE s. Actually i could not place the cursor on receiving batch. I am getting information message and the execution is perfect if i open and close the information message.....otherwise the bdc is getting stopped.

Thanks,

Rakesh.