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

Control after call selection-screen is not getting back

Former Member
0 Likes
803

Hi All,

My requirement is I'm calling another report using SUBMIT AND RETURN from one report , and after that Im calling the Selection Screen 'coz when i click on BACK button of the called report its coming out completely.

So, i've used the following code .

SUBMIT ymt_called VIA SELECTION-SCREEN AND RETURN .

CALL SELECTION-SCREEN 100.

If i've to give give different inputs and execute, its exiting the program.

Pl help me in what actually has to be done after the Call Selection-screen 100 statement

Note: After Call Selection-screen 100, the screen is displayed but no processing happens. It just quits.

Regards,

Iyswarya

Hi All,

My requirement is I'm calling another report using SUBMIT AND RETURN from one report , and after that Im calling the Selection Screen 'coz when i click on BACK button of the called report its coming out completely.

So, i've used the following code .

SUBMIT ymt_called VIA SELECTION-SCREEN AND RETURN .

CALL SELECTION-SCREEN 100.

If i've to give give different inputs and execute, its exiting the program.

Pl help me in what actually has to be done after the Call Selection-screen 100 statement

Note: After Call Selection-screen 100, the screen is displayed but no processing happens. It just quits.

Regards,

Iyswarya

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
715

SUBMIT ymt_called VIA SELECTION-SCREEN AND RETURN .

CALL SELECTION-SCREEN 100.

after ymt_called gets executed the control will return to the first program for the code above.

what do u want exactly....where should the control go

to the screen of ymt_called or to the first program screen ?

Read only

0 Likes
715

Hi Keshu,

Thanq for ur reply.

After the submit the control is coming back.....

but after CALL SELECTION-SCREEN 100 the control is going out.... and when i want to give different input and execute its quitting completely...

Edited by: Iyswarya Godi on Aug 6, 2009 2:49 PM

Read only

0 Likes
715

Example


REPORT  y_prg1.

TABLES:mara.

SELECT-OPTIONS:so_matnr FOR mara-matnr.
PARAMETERS:pa_mtart TYPE mara-mtart.


DATA:lt_param  TYPE TABLE OF rsparams.
DATA:wa_param LIKE LINE OF  lt_param.
DATA:var1 TYPE c.
DATA:it_mara TYPE TABLE OF mara.
DATA:it_makt TYPE TABLE OF makt.


START-OF-SELECTION.

  wa_param-selname = 'S_MATNR'.
  wa_param-kind    = 'S'.                      "select-options
  wa_param-low     = so_matnr-low.
  wa_param-high    = so_matnr-high.
  wa_param-sign    = so_matnr-sign.
  wa_param-option  = so_matnr-option.
  APPEND wa_param TO lt_param.
  CLEAR wa_param.

  wa_param-selname = 'P_MATNR'.
  wa_param-kind    = 'P'.                         "Parameter
  wa_param-low     = pa_mtart.
  wa_param-sign    = 'I'.
  wa_param-option  = 'EQ'.
  APPEND wa_param TO lt_param.
  CLEAR wa_param.

  wa_param-selname = 'C_1'.
  wa_param-kind    = 'P'.                       "Parameter
  wa_param-low     = 'X'.
  wa_param-sign    = 'I'.
  wa_param-option  = 'EQ'.
  APPEND wa_param TO lt_param.
  CLEAR wa_param.


  CALL FUNCTION 'SUBMIT_REPORT'
    EXPORTING
      report                 = 'Y_PRG2'
      ret_via_leave          = ' '         "When needed to return keep initial or 'X'
      skip_selscreen         = 'X'
 TABLES
      selection_table        = lt_param
 EXCEPTIONS
   JUST_VIA_VARIANT       = 1
   NO_SUBMIT_AUTH         = 2
   OTHERS                 = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


tables:mara.


SELECT-OPTIONS:s_matnr for mara-matnr.
parameters:p_mtart type mara-mtart.
PARAMETERS:c_1 as CHECKBOX USER-COMMAND C1.


data:var1 type c.


data:it_mara type table of mara.
data:it_makt type table of makt.


var1 = 'A'.
select * INTO table it_mara UP TO 10 rows from mara where matnr in s_matnr
                                              and mtart = p_mtart.

  if c_1 = 'X'.
    select * into table it_makt from makt for all ENTRIES IN it_mara where matnr = it_mara-matnr.
  endif.

Edited by: Keshu Thekkillam on Aug 6, 2009 6:29 PM

Edited by: Keshu Thekkillam on Aug 6, 2009 6:29 PM

Edited by: Keshu Thekkillam on Aug 6, 2009 6:29 PM

Edited by: Keshu Thekkillam on Aug 6, 2009 6:30 PM

Read only

0 Likes
715

so you want to give different input in your first program right..

remove via selection screen,CALL SELECTION-SCREEN 100

pass your data via selection table

check f1 help for submit or search in SCN for more details

Read only

MarcinPciak
Active Contributor
0 Likes
715

You simply need to use


"calling program
report A.
  parameters:  ... "selection screen of program A

START-OF-SELECTION.
  SUBMIT B VIA SELECTION-SCREEN AND RETURN . "calling program B

"called program
report B.
  parameters :... "selecion screen of program B

START-OF-SELECTION.
 write: .... "here is your list generated

what you would get is:

- when you run report A and its selection screen is displayed

- when you execute it, report B is called and its selection screen is displayed (VIA SELECTION-SCREEN)

- when you execute this called report B, you get ouptut as a list

- when you choose BACK button, you are back in selection screen of program B

- when you hit again BACK button, you are back in selection screen of program A

At any time you can reexecute the report (either A or B), after you change your selection screen entries.

Regards

Marcin