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

regarding calling another program from current report

Former Member
0 Likes
462

hello all

(1) how can we call 1 pgm from another pgm in se38 .

(2) This is required because i wan to have many selection screens but i dun want to use dialog programming also i dun want to write all the selection screens in a single report pgm in se38 , so when (say) i click on 'NEXT' button on selection screen in first pgm in se38, it should call the other pgm having another slection screen.

can i do like this ?, please help

Thanks and regards

Nilesh

3 REPLIES 3
Read only

Former Member
0 Likes
439

Hi,

Try command 'SUBMIT' or 'CALL TRANSACTION'.

Read only

Former Member
0 Likes
439

Hi,

You can call one selection screen from other selection screen program using <i><b>SUBMIT</b></i> command.

The syntax is as follows -

SUBMIT... [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>].

e.g.

The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:

REPORT  demo_program_submit_rep1.

DATA number TYPE i.
PARAMETERS      paramet(14) TYPE c.
SELECT-OPTIONS  selecto FOR number.

The program DEMO_PROGRAM_SUBMIT_REP1 is called by the following program using various parameters:

REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.

DATA: int TYPE i,
      rspar TYPE TABLE OF rsparams,
      wa_rspar LIKE LINE OF rspar.

RANGES seltab FOR int.

WRITE: 'Select a Selection!',
     / '--------------------'.
SKIP.

FORMAT HOTSPOT COLOR 5 INVERSE ON.
WRITE: 'Selection 1',
     / 'Selection 2'.

AT LINE-SELECTION.
  CASE sy-lilli.
    WHEN 4.
      seltab-sign = 'I'. seltab-option = 'BT'.
      seltab-low  = 1.   seltab-high   = 5.
      APPEND seltab.
      SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                      WITH paramet eq 'Selection 1'
                      WITH selecto IN seltab
                      WITH selecto ne 3
                      AND RETURN.
    WHEN 5.
      wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
      wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
      wa_rspar-low  = 14.  wa_rspar-high = 17.
      APPEND wa_rspar TO rspar.
      wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
      wa_rspar-low  = 'Selection 2'.
      APPEND wa_rspar TO rspar.
      wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
      wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
      wa_rspar-low  = 10.
      APPEND wa_rspar TO rspar.
      SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                      WITH SELECTION-TABLE rspar
                      AND RETURN.
  ENDCASE.

=> To leave a called program, you can use <i><b>SUBMIT .... AND RETURN.</b></i> by choosing F3 or F15 from list level 0 of the called report.

Hope this helps.

PS If the answer solves your query, plz close the thread by rewarding each reply and mark it Solved.

Regards

Read only

Former Member
0 Likes
439

When the Next button clicked, invoke the Code using the following Code

Submit Report_Prog_Name via Selection-screen

Press F1 help for Submit statement and there you can see the added features of the statement like seltab-which contains the parameter values of current selection screen(populated by programmer.

You can return to the calling Program after its execution.

Regards

Vijai

*Reward pnts if useful