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: 

Skipping Selection Screen for a report program

former_member125661
Contributor
0 Kudos

Hi guys,

I have a report program that works in 2 modes - Create and modify ( There is a toggle button in the ALV report). Its an editable ALV grid. There are 2 tcodes - zcreate and zmodify to access the same report in 2 above modes. For zmodify, i have a selection screen. How do i skip the selection screen for zcreate ?

Here is my report program

REPORT ZSWR_RCKDVOLS .

INCLUDE ZSWR_RCKDVOLS_TOP.

INCLUDE ZSWR_RCKDVOLS_CLDEF.

INCLUDE ZSWR_RCKDVOLS_CLIMP.

INCLUDE ZSWR_RCKDVOLS_SELSCR. " Selection Options are written in this.

INCLUDE ZSWR_RCKDVOLS_PBO.

INCLUDE ZSWR_RCKDVOLS_PAI.

INCLUDE ZSWR_RCKDVOLS_FORM.

*----


  • INITIALIZATION

*----


initialization.

perform layout_build.

*----


  • AT SELECTION-SCREEN

*----


at selection-screen on s_locid.

clear lv_plnt.

select single werk from oijrra

into lv_plnt

where locid in s_locid and rpart = gc_rpart.

perform memory_id_build.

*----


  • START-OF-SELECTION

*----


start-of-selection .

perform fieldcatalog.

perform fill_internal_table.

perform build_outtab.

END-OF-SELECTION.

CHECK: NOT gi_zswt_rckdvols[] IS INITIAL.

set SCREEN 100. "Main Screen

-


A sample code will be greatly helpful.

Thanks,

SHK

1 ACCEPTED SOLUTION

hymavathi_oruganti
Active Contributor
0 Kudos

GIVE NUMBER TO UR SELECTION SCREEN,

IF IT IS CREATE MODE

USE

CALL SELECTION-SCREEN NO,

IF IT IS MODIFY, DO NOT CALL!!

14 REPLIES 14

hymavathi_oruganti
Active Contributor
0 Kudos

GIVE NUMBER TO UR SELECTION SCREEN,

IF IT IS CREATE MODE

USE

CALL SELECTION-SCREEN NO,

IF IT IS MODIFY, DO NOT CALL!!

0 Kudos

Dear Hymavathi,

My selection screen is the regular Screen No. 1000.I need selection screen for Modify mode and skip it for create mode. Can u please tell me, where to write this ? I mean under what event ?

Thanks,

SHK

0 Kudos

Hi

Try this:

- Create the transaction for updating as trx for a report,

- Create the transaction for inserting as trx with parameters: assign the trx for updating and set the flag SKIP INITIAL SCREEN;

Max

0 Kudos

Hi,

You can use the statement CALL SELECTION_SCREEN at any point of the program flow ..pl see the following <a href="http://help.sap.com/saphelp_47x200/helpdata/EN/9f/dba83d35c111d1829f0000e829fbfe/frameset.htm">SAP Help</a>

Regards,

Suresh Datti

0 Kudos

You can achieve this by doing a recursive call to the program. Pleas see the sample program below. Notice that it is checking if it is being run in SE38, if so it calls itself again and sets the switch, the switch will make it so that it doesn't submit itself again. Here the list display is shown without the selection screen.




report zrich_0003.


parameters: p_check type c.
parameters: p_switch type c no-display.


at selection-screen output.

  if sy-tcode = 'SE38'
    and p_switch = space.
    submit zrich_0003
           with p_check = space
           with p_switch = 'X'
                 and return.
    leave program.
  endif.


start-of-selection.

  do 100 times.
    write:/ sy-index.
  enddo.

Regards,

Rich Heilman

0 Kudos

So if we were to implement this in your program.....



report zswr_rckdvols .

  include zswr_rckdvols_top.

  include zswr_rckdvols_cldef.

  include zswr_rckdvols_climp.

<b>  include zswr_rckdvols_selscr. " Selection Options are written in this ".
* Add this line into your selection screen include.
  parameters: p_switch type c no-display.</b>

  include zswr_rckdvols_pbo.

  include zswr_rckdvols_pai.

  include zswr_rckdvols_form.

*------------------------------------
* INITIALIZATION
*------------------------------------

initialization.

  perform layout_build.

*------------------------------------
* AT SELECTION-SCREEN
*------------------------------------

<b>at selection-screen output.

  if sy-tcode = 'ZCREATE'
    and p_switch = space.
    submit zswr_rckdvols
           with p_switch = 'X'
                 and return.
    leave program.
  endif.</b>



at selection-screen on s_locid.

  clear lv_plnt.
  select single werk from oijrra
  into lv_plnt
  where locid in s_locid and rpart = gc_rpart.
  perform memory_id_build.

*------------------------------------
* START-OF-SELECTION
*------------------------------------

start-of-selection .

  perform fieldcatalog.
  perform fill_internal_table.
  perform build_outtab.

end-of-selection.

  check: not gi_zswt_rckdvols[] is initial.
  set screen 100. "Main Screen



Regards,

Rich Heilman

0 Kudos

Thanks a lot Rich, this solved my problem

0 Kudos

Cool. Glad that it helped.

Regards,

Rich Heilman

0 Kudos

Look at these links where I gave the same solution to several others. May be a little more clarity on the requirement would help giving answers. Also searching the forum may help finding solutions like these that may be there already, before asking the question.

former_member188685
Active Contributor
0 Kudos

Hi Shareen,

you can do one thing...

for zcreate

you create another program , now create the tcode for this report as<b> ZCREATE</b>

<b>REPORT  ZCREATE_CALL                              .

all transaction 'ZCREATE1' AND SKIP FIRST SCREEN.</b>

Regards

vijay

0 Kudos

create the transaction code for your report as ZCREATE1,for create ok,

now create one report which call the above one

REPORT  ZCREATE_CALL                              .
call transaction 'ZCREATE1' AND SKIP FIRST SCREEN.

create the tcode for ZCREATE_CALL as ZCREATE.

that solves your problem..

0 Kudos

Hi Vijay,

Creating another report to skip the selection screen is a maintainance problem at our work place. I thought about it. I could have aswell written the whole create mode in another report. Is there any better solution or any event where i can put the following.

if sy-tcode eq 'Zcreate'.

skip selection-screen.

endif.

Someone suggested use screen group '04'. I am not sure how and what it is.

Thanks,

Shareen

0 Kudos

Hi,

can you tell me what is the difference between Create and modify in your Program..

Regards

vijay

Former Member
0 Kudos

I am sorry if I am not understanding this correctly. Your ALV report ZSWR_RCKDVOLS comes after you pass through the selection screen and there they have 'create' and 'modify' buttons. So if they press one of the buttons, does it take them to a different program(associated with the corresponding tcode)?

Please post your selection screen definition. Also, here in this program, you are calling screen 0100. What is this doing? Do you show the ALV in this screen? If so, do you have some code in the PAI of this screen that calls the tcodes you mentioned based on the user input? Can you also post that PAI logic?

Srinivas