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 or SUBMIT

Former Member
0 Likes
5,448

Hi guys,

I have a problem with calling a program(or transaction code).

I want to call a program with a variant by "CALL TRANSACTION" or "SUBMIT".

I checked that "SUBMIT" is possible by using "SELECTION-SET" but I can't use it because it doesn't allow calling a program with a variable which has the program name like below.

'SUBMIT gv_program SELECTION-SET gv_variant.'

Is there a solution for this?

Thanks.

1 ACCEPTED SOLUTION
Read only

Private_Member_7726
Active Contributor
0 Likes
2,962

Hi,

Shouldn't it simply be written: SUBMIT (gv_program) USING SELECTION-SET gv_variant. ?


cheers

Janis

8 REPLIES 8
Read only

Private_Member_7726
Active Contributor
0 Likes
2,963

Hi,

Shouldn't it simply be written: SUBMIT (gv_program) USING SELECTION-SET gv_variant. ?


cheers

Janis

Read only

0 Likes
2,962

Thank you this is the thing I was looking for.

Read only

sivaganesh_krishnan
Contributor
0 Likes
2,962

Hi,

Have you tried

SUBMIT (g_pname) USING SELECTION-SET g_varnt .

Or you can pass values through this method also

SUBMIT Program

                           WITH  p_field1 EQ  value

                           WITH  p_field2  EQ  value

                           WITH  p_field3 EQ  value                    

                           AND RETURN.


Refer: ABAP Keyword Documentation

Read only

0 Likes
2,962

Hi, I needed to call with saved variants.

Thanks.

Read only

Former Member
0 Likes
2,962

Hello Janghwan,

you can directly as shown below.

Program Name : zm_forecast

variant name : 'ZTEST'

submit zm_forecast USING SELECTION-SET 'ZTEST'.

Read only

0 Likes
2,962

I can't use the program name directly because the program name is not fixed.

Thanks.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,962

Read the online documentation of SUBMIT statement or press F1. A SUBMIT (variablename) is allowed, also many solutions are provided to pass values from USING SELECTION-SET variant to explicit values for parameters WITH expr_syntax1 WITH expr_syntax2 ...

Regards,

Raymond

Read only

bishwajit_das
Active Contributor
0 Likes
2,962

No, it is not possible to call a program/transaction using a variable in place of program name.

As SUBMIT statement executes a report. Can only execute reports of type '1'.And the  ways that it could be used are :-

*Code used to execute a report
SUBMIT Zreport.


*Code used to populate 'select-options' & execute report

SUBMIT zreport with selection-table seltab
                 via selection-screen.


*Code used to populate 'parameters' & execute report

SUBMIT zreport with p_param1 = 'value'

                with p_param2 = 'value'.


*Submit report and return to current program afterwards

SUBMIT zreport AND RETURN.


*Submit report via its own selection screen

SUBMIT zreport VIA SELECTION-SCREEN.


*Submit report using selection screen variant

SUBMIT zreport USING SELECTION-SET 'VARIANT1'.

*Submit report but export resultant list to memory, rather than
*it being displayed on screen

SUBMIT zreport EXPORTING LIST TO MEMORY.

And CALL TRANSACTION statement calls the transaction whose transaction code is contained in data object ta.

CALL TRANSACTION ta

{ [AND SKIP FIRST SCREEN]  ---- suppresses the display of a screen of the initial dynpro

| [USING bdc_tab [bdc_options]] }. -----  enables the transaction to be executed using a batch input table. This requires an internal table bdc_tab of row type BDCDATA to be passed from ABAP Dictionary to a dialog transaction

Wish this helps you...


Regards,

Bishwajit