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

multiple selection-screens for fetching the data in one program

Former Member
0 Likes
1,786

Sir,

               I had a requirement where there will be 3 blocks of selection-screens having parameters.

               If user provides the input values for 1st block that part of code (subroutine) has to execute.

               same with rest of two blocks.

               pls explain how could i link this selection-screens with the subroutines.

Thanks & Regards.                

Sir,

               I had a requirement where there will be 3 blocks of selection-screens having parameters.

               If user provides the input values for 1st block that part of code (subroutine) has to execute.

               same with rest of two blocks.

               pls explain how could i link this selection-screens with the subroutines.

Thanks & Regards.                

7 REPLIES 7
Read only

Former Member
0 Likes
1,334

Hi

Provide 3 radio buttons on the selection-screen and write the logic to execute the part of code to be executed when that particular radio button is selected.

Regards

Vamshi

Read only

0 Likes
1,334

Why not use the SAP model and create a tab strip with the needed elements on each tab?

Read only

0 Likes
1,334

Provide 3 radio button for 3 block of the selection screen.

AT SELECTION-SCREEN OUTPUT, if user select 1st radio button, make other selection screen block disable.

write the code

if first_radio button eq 'X'.

Execute code1

else if second_radiobuton eq 'X'

Execute code 2.

else.

Execute code3.

endif.

if you want to displaay output also depend on the selection screen block, put the

same condition as above.

Regards,

Udupi

Read only

Former Member
0 Likes
1,334

Hi Satish,

Put your selection screens in tabbed block and based on the tab selected call perform subroutines.

thanks.

Read only

rosenberg_eitan
Active Contributor
0 Likes
1,334

Hi,

Try this, This way you let the user decide which set of parameters should be used.

Using the "KISS principle" http://en.wikipedia.org/wiki/KISS_principle

----------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK block04 WITH FRAME .

PARAMETERS: p_opt_0 TYPE radiob RADIOBUTTON GROUP g01 USER-COMMAND c01 DEFAULT 'X' .

PARAMETERS: p_opt_1 TYPE radiob RADIOBUTTON GROUP g01 .

PARAMETERS: p_opt_2 TYPE radiob RADIOBUTTON GROUP g01 .

PARAMETERS: p_opt_3 TYPE radiob RADIOBUTTON GROUP g01 .

SELECTION-SCREEN SKIP .

PARAMETERS: p_01 TYPE char16 MODIF ID s01 .

PARAMETERS: p_02 TYPE char16 MODIF ID s01 .

PARAMETERS: p_03 TYPE char16 MODIF ID s01 .

PARAMETERS: p_04 TYPE char16 MODIF ID s01 .

SELECTION-SCREEN SKIP .

PARAMETERS: p_11 TYPE char16 MODIF ID s02 .

PARAMETERS: p_12 TYPE char16 MODIF ID s02 .

PARAMETERS: p_13 TYPE char16 MODIF ID s02 .

PARAMETERS: p_15 TYPE char16 MODIF ID s02 .

SELECTION-SCREEN SKIP .

PARAMETERS: p_21 TYPE char16 MODIF ID s03 .

PARAMETERS: p_22 TYPE char16 MODIF ID s03 .

PARAMETERS: p_23 TYPE char16 MODIF ID s03 .

PARAMETERS: p_25 TYPE char16 MODIF ID s03 .

SELECTION-SCREEN SKIP .

*PARAMETERS: p_debug TYPE debug_flg .

SELECTION-SCREEN END OF BLOCK block04 .

*----------------------------------------------------------------------*

AT SELECTION-SCREEN OUTPUT .

  PERFORM at_selection_screen_output .

*----------------------------------------------------------------------*

FORM at_selection_screen_output .

  LOOP AT SCREEN .

    CASE screen-group1 .

      WHEN 'S01' .

        screen-input  = '0' .

        IF p_opt_1 EQ abap_true .

          screen-input  = '1' .

        ENDIF .

      WHEN 'S02' .

        screen-input  = '0' .

        IF p_opt_2 EQ abap_true .

          screen-input = '1' .

        ENDIF .

      WHEN 'S03' .

        screen-input  = '0' .

        IF p_opt_3 EQ abap_true .

          screen-input = '1' .

        ENDIF .

    ENDCASE .

    MODIFY SCREEN .

  ENDLOOP.

ENDFORM .                    "at_selection_screen_output

*----------------------------------------------------------------------*

Read only

amy_king
Active Contributor
0 Likes
1,334

Hi Satish,

With a selection-screen, there's really not a way to say "if the block_1 fields are filled, then execute subroutine x". Ultimately, you'll need to check the parameters belonging to a block and decide whether you want to execute the block's corresponding subroutine, e.g.,

 SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS p1 TYPE flag.
PARAMETERS p2 TYPE flag.
PARAMETERS p3 TYPE flag.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2.
PARAMETERS p4 TYPE flag.
PARAMETERS p5 TYPE flag.
PARAMETERS p6 TYPE flag.
SELECTION-SCREEN END OF BLOCK b2.

START-OF-SELECTION.

   IF p1 IS NOT INITIAL OR
       p2 IS NOT INITIAL OR
       p3 IS NOT INITIAL.
     PERFORM block_1_subroutine.
   ENDIF.

   IF p4 IS NOT INITIAL OR
       p5 IS NOT INITIAL OR
       p6 IS NOT INITIAL.
     PERFORM block_2_subroutine.
   ENDIF.

You can get fancy, but in the end you're really just checking the individual parameters, no matter how you dress it up.

DATA: BEGIN OF ls_block1,
         p1 TYPE REF TO flag,
         p2 TYPE REF TO flag,
         p3 TYPE REF TO flag,
       END OF ls_block1.

DATA: BEGIN OF ls_block2,
         p4 TYPE REF TO flag,
         p5 TYPE REF TO flag,
         p6 TYPE REF TO flag,
       END OF ls_block2.

SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS p1 TYPE flag.
PARAMETERS p2 TYPE flag.
PARAMETERS p3 TYPE flag.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2.
PARAMETERS p4 TYPE flag.
PARAMETERS p5 TYPE flag.
PARAMETERS p6 TYPE flag.
SELECTION-SCREEN END OF BLOCK b2.

INITIALIZATION.

   GET REFERENCE OF p1 INTO ls_block1-p1.
   GET REFERENCE OF p2 INTO ls_block1-p2.
   GET REFERENCE OF p3 INTO ls_block1-p3.

   GET REFERENCE OF p4 INTO ls_block2-p4.
   GET REFERENCE OF p5 INTO ls_block2-p5.
   GET REFERENCE OF p6 INTO ls_block2-p6.

START-OF-SELECTION.

   IF ls_block1 IS NOT INITIAL.
     PERFORM block_1_subroutine.
   ENDIF.

   IF ls_block2 IS NOT INITIAL.
     PERFORM block_2_subroutine.
   ENDIF.

Cheers,

Amy

Read only

ravi_lanjewar
Contributor
0 Likes
1,334

Hi,

It better to create the tabstrip using module pool. In tabstrip you can identify the which screen is active. From active subscreen you process the you logic or put chain...endchain to process the module.

Kind Regards

Ravishankar Lanjewar