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
1,152

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

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
617

1) You can use SUBMIT to submit the data to another program or you can use

CALL TRANSACTION to call another transaction.

You can also have normal screens created in the your one report with the selection screen and then use CALL SCREEN.

Regards,

Sesh

4 REPLIES 4
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
618

1) You can use SUBMIT to submit the data to another program or you can use

CALL TRANSACTION to call another transaction.

You can also have normal screens created in the your one report with the selection screen and then use CALL SCREEN.

Regards,

Sesh

Read only

Former Member
0 Likes
617

Hi,

use SUBMIT syntax.

Regards

Read only

Former Member
0 Likes
617

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
617

Here is the sample code for calling the next program ..

use submit and return within the case condition so that it will call the new program from one program in se38 .

----------------------------------------------------------------------*
*                To generate the detailed lists                        *
*----------------------------------------------------------------------*

AT LINE-SELECTION.
  CASE sy-lsind.
    WHEN 1.
      SET PF-STATUS '0011'.

*---------To display the data for the secondary list-----------------------*
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
    format color 5 intensified off.
  LOOP AT it_ekpo where ebeln = it_ekko-ebeln .
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline,
                                                     "PURCHASE ORDER NUMBER
                       it_ekpo-ebelp UNDER text-008, 30 sy-vline,
                                                     "PO ITEM NUMBER
                       it_ekpo-werks UNDER text-009, 45 sy-vline,
                                                     "PLANT
                       it_ekpo-matnr UNDER text-010, 60 sy-vline,
                                                     "MATERIAL NUMBER
                       it_ekpo-matkl UNDER text-011, 80 sy-vline.
                                                     "MATERIAL GROUP
  ENDLOOP.

  WRITE :/ sy-uline(80).

  ENDCASE.

  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.
  ENDCASE.

*----------------------------------------------------------------------*
*                    At user-command event                             *
*----------------------------------------------------------------------*

AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'SELE' OR 'LIST1'.
      IF sy-lsind = 1.
      SET PF-STATUS '0011'.

*---------To display the data for the secondary list-----------------------*

WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
       format color 5 intensified off.

  LOOP AT it_ekpo where ebeln = it_ekko-ebeln .
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline, "PURCHASE ORDER NUMBER
                       it_ekpo-ebelp UNDER text-008, 30 sy-vline, "PO ITEM NUMBER
                       it_ekpo-werks UNDER text-009, 45 sy-vline, "PLANT
                       it_ekpo-matnr UNDER text-010, 60 sy-vline, "MATERIAL NUMBER
                       it_ekpo-matkl UNDER text-011, 80 sy-vline. "MATERIAL GROUP

  ENDLOOP.

  WRITE :/ sy-uline(80).
  endif.

  ENDCASE.

  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.

  ENDCASE.

reward points if it is usefull ...

Girish