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 from Program by Skipping Initial Screen & Pass the Value

Former Member
0 Likes
1,739

Hi All,

Can anybody help me to call a transaction from my program. I do not want to display the initial screen of the transaction but that TCODE should get opened by passing the values to the parameter of the initial screen.

For Example, in my program I want to call 'SE38' and in that, my Program of Name 'ZTEST' should get opened. So I need to call Transaction SE38, but I donot want to display initial screen of that. Instead of that, I want to put the value of Program 'ZTEST' and thus my program should get opened.

Sandip

6 REPLIES 6
Read only

christian_wohlfahrt
Active Contributor
0 Likes
832

Hi Sandip,

just create an recording where you enter your values in first screen(s). Abort recording with cancel (or whatever) and remove last ok-code filling out of your program.

Then you can call transaction with mode 'E' - stop on error, which is missing ok-code.

Regards,

Christian

Read only

0 Likes
832

Hi Christian,

Do You mean to do recording through SHDB?

Sandip

Read only

christian_wohlfahrt
Active Contributor
0 Likes
832

Hi,

yes - the fastest way to get correct call transaction parameters. Convert recording into $tmp-program (or function module) and use the parts you need.

Of course you can fill fields 'manually', too

Christian

Read only

Former Member
0 Likes
832

Hello Sandip,

Since you have not made any references to Batch Processing, I shall tell you the normal way to do it. First look at the code below and execute it.


set parameter id 'DTB' field 'VBAK'.

call transaction 'SE16' and skip first screen.

There are a few things that you need to keep in mind before you use this statement:

1. All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters.

2. For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number. However, if the next screen can be reached from the first screen by just hitting the Enter key, this will work.

The following will not work as you expect, because the next screen in the transaction cannot be reached by just hitting the Enter Key.


set parameter id 'RID' field 'ZTEST'.

call transaction 'SE38' and skip first screen.

Regards,

Anand Mandalika.

Please reward points if this helps.

Read only

Former Member
0 Likes
832

You can also invoke the editor directly using:

    CALL FUNCTION 'RS_TOOL_ACCESS'
         EXPORTING
              operation           = 'EDIT'
              object_name         = 'ZTEST'
              object_type         = 'PROG'
         EXCEPTIONS
              not_executed        = 1
              invalid_object_type = 2
              OTHERS              = 3.

Read only

Former Member
0 Likes
832

Hi All,

I could solve the problem by using Export to Memory and the calling tcode is also a ztcode so I Import from memory there and solved the problem.

Sandip