2007 Apr 20 4:00 PM
Hi,
I want to process a goods receipt to PO (mvt: 101) via Idoc for a batch managed part and also add some data into the batch classification.
The idoc processing works (including the creation of the classification data). but as soon as I want to add data to the classification within the same function module I get a lock entry error.
Can someone give me a hint of how to do that? what is the best option to fill additional classification data (maybe a BAPI?)
Thanks for any help!
Right now I added the following coding to the function module (copy of IDOC_INPUT_MBGMCR) which processes the idoc (here I get the error that the data of material XXX is blocked!):
PERFORM dynpro USING:
'X' 'SAPMM03S' '0105',
' ' 'RM03S-MATNR' batch_data-matnr,
' ' 'RM03S-WERKS' batch_data-werks,
' ' 'RM03S-CHARG' batch_data-batch,
' ' 'RM03S-LGORT' ' ',
'X' 'SAPMM03S' '0200',
' ' 'BDC_OKCODE' '/7',
'X' 'SAPLCTMS' '0109'.
IF batch_data-trace1 NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(1)' 'TRACECODE1',
' ' 'RCTMS-MWERT(1)' batch_data-trace1.
ENDIF.
IF batch_data-trace2 NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(2)' 'TRACECODE2',
' ' 'RCTMS-MWERT(2)' batch_data-trace2.
ENDIF.
IF batch_data-lotno NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(4)' 'STM_LOT',
' ' 'RCTMS-MWERT(4)' batch_data-lotno.
ENDIF.
IF batch_data-difflot NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(5)' 'STM_DIFFUSION_LOT',
' ' 'RCTMS-MWERT(5)' batch_data-difflot.
ENDIF.
PERFORM dynpro USING:
' ' 'BDC_OKCODE' '/3',
'X' 'SAPMM03S' '0200',
' ' 'BDC_OKCODE' '/11'.
post changes
CLEAR: msg, msg[].
l_mode = 'N'.
CALL TRANSACTION 'MSC2' USING tbdc MODE l_mode UPDATE 'S'
MESSAGES INTO msg.
Hi,
I want to process a goods receipt to PO (mvt: 101) via Idoc for a batch managed part and also add some data into the batch classification.
The idoc processing works (including the creation of the classification data). but as soon as I want to add data to the classification within the same function module I get a lock entry error.
Can someone give me a hint of how to do that? what is the best option to fill additional classification data (maybe a BAPI?)
Thanks for any help!
Right now I added the following coding to the function module (copy of IDOC_INPUT_MBGMCR) which processes the idoc (here I get the error that the data of material XXX is blocked!):
PERFORM dynpro USING:
'X' 'SAPMM03S' '0105',
' ' 'RM03S-MATNR' batch_data-matnr,
' ' 'RM03S-WERKS' batch_data-werks,
' ' 'RM03S-CHARG' batch_data-batch,
' ' 'RM03S-LGORT' ' ',
'X' 'SAPMM03S' '0200',
' ' 'BDC_OKCODE' '/7',
'X' 'SAPLCTMS' '0109'.
IF batch_data-trace1 NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(1)' 'TRACECODE1',
' ' 'RCTMS-MWERT(1)' batch_data-trace1.
ENDIF.
IF batch_data-trace2 NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(2)' 'TRACECODE2',
' ' 'RCTMS-MWERT(2)' batch_data-trace2.
ENDIF.
IF batch_data-lotno NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(4)' 'STM_LOT',
' ' 'RCTMS-MWERT(4)' batch_data-lotno.
ENDIF.
IF batch_data-difflot NE space.
PERFORM dynpro USING:
' ' 'RCTMS-MNAME(5)' 'STM_DIFFUSION_LOT',
' ' 'RCTMS-MWERT(5)' batch_data-difflot.
ENDIF.
PERFORM dynpro USING:
' ' 'BDC_OKCODE' '/3',
'X' 'SAPMM03S' '0200',
' ' 'BDC_OKCODE' '/11'.
post changes
CLEAR: msg, msg[].
l_mode = 'N'.
CALL TRANSACTION 'MSC2' USING tbdc MODE l_mode UPDATE 'S'
MESSAGES INTO msg.
2007 Apr 20 4:35 PM
Sorry! resolved it myself. I was jsut a commit missing.
I called the BAPI_TRANSACTION_COMMIT before processing my routine to update the classification data and it worked.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |