Application Development 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: 

Query related to SUBMIT

Former Member
0 Kudos

Hello All

In my code I am using submit statement with variant for a particular report program. The program name can be dynamic

depending on the TCode taken as input from the user. For implementing that I have written the following code snippet:


SELECT SINGLE * FROM tstc
               INTO CORRESPONDING FIELDS OF wa_tstc
               WHERE tcode EQ wa_zscheduling_data-ztcode.

SUBMIT wa_tstc-pgmna TO SAP-SPOOL
             USING SELECTION-SET wa_zscheduling_data-zvariant
             SPOOL PARAMETERS mstr_print_parms
             WITHOUT SPOOL DYNPRO
            AND RETURN.

The code is going into dump when executed, it says "program "WA_TSTC-PGMNA" does not exist in the library.".

I am anticipating the same for the variant name also, which is also a dynamic one.

Kindly suggest me what can be done.

Thanks and Regards

Avishek

1 ACCEPTED SOLUTION

nirajgadre
Active Contributor
0 Kudos

Hi,

try to use ...

SELECT SINGLE * FROM tstc
               INTO CORRESPONDING FIELDS OF wa_tstc
               WHERE tcode EQ wa_zscheduling_data-ztcode.
 
SUBMIT (wa_tstc-pgmna) TO SAP-SPOOL
             USING SELECTION-SET wa_zscheduling_data-zvariant
             SPOOL PARAMETERS mstr_print_parms
             WITHOUT SPOOL DYNPRO
            AND RETURN.

3 REPLIES 3

nirajgadre
Active Contributor
0 Kudos

Hi,

try to use ...

SELECT SINGLE * FROM tstc
               INTO CORRESPONDING FIELDS OF wa_tstc
               WHERE tcode EQ wa_zscheduling_data-ztcode.
 
SUBMIT (wa_tstc-pgmna) TO SAP-SPOOL
             USING SELECTION-SET wa_zscheduling_data-zvariant
             SPOOL PARAMETERS mstr_print_parms
             WITHOUT SPOOL DYNPRO
            AND RETURN.

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Change the statement like below.


SUBMIT (wa_tstc-pgmna) TO SAP-SPOOL
             USING SELECTION-SET wa_zscheduling_data-zvariant
             SPOOL PARAMETERS mstr_print_parms
             WITHOUT SPOOL DYNPRO
            AND RETURN.

Make sure that variant name exists for the report you are trying to submit.

Thanks,

Vinod.

Former Member
0 Kudos

Hi,

You can check the syntax:

*Internal table for Selection Screen

DATA: BEGIN OF i_rsparams OCCURS 0.

INCLUDE STRUCTURE rsparams.

DATA: END OF i_rsparams.

DATA: mstr_print_parms LIKE pri_params.

  • submitting the spool request

SUBMIT (p_repid) WITH SELECTION-TABLE i_rsparams

TO SAP-SPOOL

SPOOL PARAMETERS mstr_print_parms

WITHOUT SPOOL DYNPRO

AND RETURN.

Hope it helps

Regards

Mansi