2007 Dec 04 10:10 AM
Hi All,
I want to call transaction CM01 from my custom report program, during the call i want to set the Plant and Workcenter field values. Please let me know how to achieve this. Also, both these fields on the screen do not have a parameter id.
Thanks and Regards,
Navneeth K.
Hi All,
I want to call transaction CM01 from my custom report program, during the call i want to set the Plant and Workcenter field values. Please let me know how to achieve this. Also, both these fields on the screen do not have a parameter id.
Thanks and Regards,
Navneeth K.
2007 Dec 04 10:15 AM
Hi Navneeth,
You should call transaction using BDC Session to do this. The syntax is something like:
CALL TRANSACTION l_tcode
USING i_bdc
MODE l_dis_mode
UPDATE 'S'
MESSAGES INTO i_messtab.
But you have to build the bdc table first. And to build the bdc table, make a recording through SM35.
Hope this'll help.
2007 Dec 04 10:37 AM
Thanks Samanta for your inputs, i tried this above syntax with mode as all screen mode and update as synchronous. during execution it is going to first screen entering the values but not going further screens. The further screens is a report, which is not captured in the recording.
2007 Dec 04 10:15 AM
hi,
CALL TRANSACTION tcod USING itab .
Addition 2
... USING itab
Effect
Calls transaction tcod and passes the internal table itab to it. itab contains one or more screens in batch input format.
If the transaction sends a message, it is placed in the fields SY-MSGID, SY-MSGTY, SY-MSGNO, SY-MSGV1, ..., SY-MSGV4.
The return code is set as follows:
SY-SUBRC = 0:
Processing successful.
SY-SUBRC <> 0:
An error occurred and the transaction terminated.
2007 Dec 04 10:17 AM
Hi,
SET PARAMETER ID: 'AGR' FIELD <Work Center Variable having Value>,
'WRK' FIELD <Plant Variable having value>.
Call Transaction 'CM01'.Regards,
Satish
2007 Dec 04 10:21 AM
Thanks Satish, i am able to set the werks value but it is not executing the transaction it just sets the value and stays there, what incase the transaction must be executed upon setting the werks value.
2007 Dec 04 10:25 AM
Call Transaction 'CM01' and skip first screen.
Regards,
Satish
2007 Dec 04 10:28 AM
the above syntax is not taking me to next screen, it is still holding on in the first screen
2007 Dec 04 10:31 AM
Is it going inside when you enter the values manually?
Regards,
Satish
2007 Dec 04 10:35 AM
2007 Dec 04 10:36 AM
2007 Dec 04 10:39 AM
2007 Dec 04 11:08 AM
Hi,
You can do as below :
First create parameter Id for both fields using below syntax :
SET PARAMETER ID pid FIELD f.
CALL TRANSACTION 'TCODE'.
Thanks,
Sriram Ponna.
2011 Feb 04 10:29 AM
Navneeth, did you solve this issue ?? i hace to call trnasaction CM01 from a report and i don't know how..
Thanks in advance !