Application Development and Automation 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: 
Read only

Call Transaction ?

Former Member
0 Likes
1,438

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.

13 REPLIES 13
Read only

Former Member
0 Likes
1,284

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.

Read only

0 Likes
1,284

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.

Read only

pavel_parshenkov2
Participant
0 Likes
1,284

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.

Read only

Former Member
0 Likes
1,284

Hi,

SET PARAMETER ID: 'AGR' FIELD <Work Center Variable having Value>, 
                    'WRK' FIELD <Plant Variable having value>.

Call Transaction 'CM01'.

Regards,

Satish

Read only

0 Likes
1,284

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.

Read only

0 Likes
1,284

Call Transaction 'CM01' and skip first screen.

Regards,

Satish

Read only

0 Likes
1,284

the above syntax is not taking me to next screen, it is still holding on in the first screen

Read only

0 Likes
1,284

Is it going inside when you enter the values manually?

Regards,

Satish

Read only

0 Likes
1,284

yes

Read only

0 Likes
1,284

Try executing your program now.

Regards,

Satish

Read only

0 Likes
1,284

Still, it is not moving to next screen.

Read only

Former Member
0 Likes
1,284

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.

Read only

maria_merino
Active Participant
0 Likes
1,284

Navneeth, did you solve this issue ?? i hace to call trnasaction CM01 from a report and i don't know how..

Thanks in advance !