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

modify the selection screen

Former Member
0 Likes
1,120

Hi all ,

This is how I have defines my selection screen :


***********************************************************************
*           S E L E C T   O P T I O N S & P A R A M E T E R S         *
***********************************************************************


SELECTION-SCREEN BEGIN OF BLOCK b1
                          WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1 .
SELECTION-SCREEN BEGIN OF BLOCK b4
                          WITH FRAME TITLE text-004.

SELECT-OPTIONS : s_matnr FOR mast-matnr ,
                 s_werks FOR mast-werks OBLIGATORY ,
                 s_andat FOR mast-andat ,
                 s_aedat FOR mast-aedat ,
                 s_stlnr FOR stko-stlnr NO-DISPLAY .

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN SKIP 1 .

SELECTION-SCREEN BEGIN OF BLOCK b3
                          WITH FRAME TITLE text-003.

PARAMETERS : p_sspec  TYPE c AS CHECKBOX DEFAULT 'X',
             p_fspec   TYPE c AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b2
                          WITH FRAME TITLE text-002.

PARAMETERS : p_pr TYPE sfpoutputparams-preview  RADIOBUTTON GROUP g1 ,
             p_rm TYPE sfpoutputparams-reqimm   RADIOBUTTON GROUP g1 ,
             p_dl TYPE c                        RADIOBUTTON GROUP g1 .


SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b5
                          WITH FRAME TITLE text-017.

PARAMETERS : p_fpath LIKE rlgrap-filename .

SELECTION-SCREEN END OF BLOCK b5.

SELECTION-SCREEN END OF BLOCK b1.

Now my requirement is the file path parameter should not be displayed when I select p_pr or p_rm . It should be displayed only when I select p_dl . I know this has to be coded in at selection-screen output event but not sure how to achieve this .

Can anyone help me out with this .

Thanks,

Varun .

6 REPLIES 6
Read only

Former Member
0 Likes
848

Hi,

Check the changes in bold..

PARAMETERS : p_pr TYPE sfpoutputparams-preview

RADIOBUTTON GROUP g1 <b>USER-COMMAND USR</b>,

p_rm TYPE sfpoutputparams-reqimm RADIOBUTTON GROUP g1 ,

p_dl TYPE c RADIOBUTTON GROUP g1 .

PARAMETERS : p_fpath LIKE rlgrap-filename <b>MODIF ID M1</b>.

<b>

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF P_PR = 'X' OR P_RM = 'X' .

  • Check if the file parameter.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-ACTIVE = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.</b>

Thanks,

Naren

Read only

Former Member
0 Likes
848

See the Below Logic :

************************************************************************

  • Selection Screen

************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: s_werks LIKE zwafpo-dwerk OBLIGATORY DEFAULT '1000'.

"Plant

PARAMETERS: p_vdatu LIKE sy-datum OBLIGATORY modif id bel .

select-options : s_vdatu for sy-datum obligatory modif id rel.

SELECT-OPTIONS: s_waveno FOR zwafpo-zzrun. "Wave Run

SELECT-OPTIONS: s_dept FOR marc-zzdept OBLIGATORY. "Department

select-options : s_arbpl for RC68A-arbpl modif id arb.

select-options : s_mtart for mara-mtart modif id mta.

SELECT-OPTIONS: s_pwave FOR zwafpo-zzpwaveno.

SELECT-OPTIONS: s_swave FOR zwafpo-zzswaveno.

SELECT-OPTIONS: s_aufnr FOR zwafpo-aufnr.

SELECT-OPTIONS: s_matnr FOR zwafpo-matnr.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_conf AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(30) text-003.

SELECTION-SCREEN END OF LINE.

*selection-screen skip 1.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_pconf AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(26) text-007.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_nconf AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(25) text-004.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_teco AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(28) text-008.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_del AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(25) text-006.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.

PARAMETERS: p_sumexc RADIOBUTTON GROUP g1 DEFAULT 'X'. "Incl Summary rpt

PARAMETERS: p_suminc RADIOBUTTON GROUP g1. "Only Summary rpt

SELECTION-SCREEN END OF BLOCK b3..

selection-screen : begin of block blk with frame title text-010.

parameters : p_old radiobutton group rad default 'X',

p_new radiobutton group rad.

selection-screen : end of block blk.

  • User Dynamic Selection

at selection-screen output.

select single * from t000md.

loop at screen.

case screen-group1.

when 'REL'.

if not p_old is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

when 'BEL'.

if not p_new is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

when 'ARB'.

if p_new is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

when 'MTA'.

if p_new is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

endcase.

endloop.

Reward Points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
848

You can assign all the select options under a group using a MODIF ID addition to the select option using the syntax:

SELECT-OPTIONS:

S_PTYPE FOR SAPLANE-PLANETYPE MODIF ID ABC.

While you use AT SELECTION-SCREEN OUTPUT, if the condition holds true, then check if the group1 equals the modif id and then make it invisible.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF condition is true.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'. "<MODIF ID>

screen-output = 0.

screen-input = 0.

screen-invisible = 1.

Modify SCREEN.

ENDIF.

ENDLOOP.

ELSE.

<Do the converse>

ENDIF.

Using this approach, you can make FILE parameter invicible.

-ashish

Read only

Former Member
0 Likes
848

hi,

I have done changes to your code, check it.


SELECTION-SCREEN BEGIN OF BLOCK b1
                          WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1 .
SELECTION-SCREEN BEGIN OF BLOCK b4
                          WITH FRAME TITLE text-004.

SELECT-OPTIONS : s_matnr FOR mast-matnr ,
                 s_werks FOR mast-werks OBLIGATORY ,
                 s_andat FOR mast-andat ,
                 s_aedat FOR mast-aedat ,
                 s_stlnr FOR stko-stlnr NO-DISPLAY .

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN SKIP 1 .

SELECTION-SCREEN BEGIN OF BLOCK b3
                          WITH FRAME TITLE text-003.

PARAMETERS : p_sspec  TYPE c AS CHECKBOX DEFAULT 'X',
             p_fspec   TYPE c AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b2
                          WITH FRAME TITLE text-002.

PARAMETERS : p_pr TYPE sfpoutputparams-preview  RADIOBUTTON GROUP g1 USER-COMMAND ABCD,
             p_rm TYPE sfpoutputparams-reqimm   RADIOBUTTON GROUP g1 ,
             p_dl TYPE c                        RADIOBUTTON GROUP g1 .


SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b5
                          WITH FRAME TITLE text-017.

PARAMETERS : p_fpath LIKE rlgrap-filename .

SELECTION-SCREEN END OF BLOCK b5.

SELECTION-SCREEN END OF BLOCK b1.

DATA: V_PATH TYPE C.
AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF SCREEN-NAME CP '*P_FPATH*'.
      IF V_PATH EQ 'X'.
        SCREEN-ACTIVE = 1.
      ELSE.
        SCREEN-ACTIVE = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN.

  IF P_DL EQ 'X'.
    V_PATH = 'X'.
  ELSE.
    V_PATH = ' '.
  ENDIF.

Regards

Sailaja.

Read only

Former Member
0 Likes
848

Hi all,


***********************************************************************
*           S E L E C T   O P T I O N S & P A R A M E T E R S         *
***********************************************************************


SELECTION-SCREEN BEGIN OF BLOCK b1
                          WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1 .
SELECTION-SCREEN BEGIN OF BLOCK b4
                          WITH FRAME TITLE text-004.

SELECT-OPTIONS : s_matnr FOR mast-matnr ,
                 s_werks FOR mast-werks OBLIGATORY ,
                 s_andat FOR mast-andat ,
                 s_aedat FOR mast-aedat ,
                 s_stlnr FOR stko-stlnr NO-DISPLAY.

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN SKIP 1 .

SELECTION-SCREEN BEGIN OF BLOCK b3
                          WITH FRAME TITLE text-003.

PARAMETERS : p_sspec  TYPE c AS CHECKBOX DEFAULT 'X',
             p_fspec   TYPE c AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b2
                          WITH FRAME TITLE text-002.

PARAMETERS : p_pr TYPE sfpoutputparams-preview  RADIOBUTTON GROUP g1 USER-COMMAND usr ,
             p_rm TYPE sfpoutputparams-reqimm   RADIOBUTTON GROUP g1 ,
             p_dl TYPE sfpoutputparams-reqimm   RADIOBUTTON GROUP g1 DEFAULT 'X' .


SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b5
                          WITH FRAME TITLE text-017.

PARAMETERS : p_fpath LIKE rlgrap-filename MODIF ID pf1.

SELECTION-SCREEN END OF BLOCK b5.

SELECTION-SCREEN END OF BLOCK b1.


***********************************************************************
*            I N I T I A L I Z A T I O N                              *
***********************************************************************
INITIALIZATION .

  v_repid = sy-repid .
  v_title = 'BOM Specifications and Spec sheet' .

***********************************************************************
*            A T   S E L E C T I O N   S C R E E N                    *
***********************************************************************

AT SELECTION-SCREEN .

  IF s_andat[] IS INITIAL AND s_aedat[] IS INITIAL AND s_matnr[] IS INITIAL.
    MESSAGE e000 WITH text-014 .
    p_dl = 'X' .
  ENDIF .

  IF p_sspec NE 'X' AND p_fspec NE 'X' .
    MESSAGE e000 WITH text-015 .
    p_dl = 'X' .

  ENDIF .

  IF p_dl EQ 'x' AND p_fpath IS INITIAL .
    MESSAGE e000 WITH text-018 .
  ENDIF .

  PERFORM check_date TABLES s_andat .
  PERFORM check_date TABLES s_aedat .

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF p_dl = 'X'  .

* Check if the file parameter.
      IF screen-group1 = 'PF1'.
        screen-active = 1.
      ENDIF.

    ENDIF.

    MODIFY SCREEN.

  ENDLOOP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath .

  PERFORM f_get_file_server_path .

If you take a look at the code it has some other checks also . The solution you have provided is not working for all scenarios .

For example I have set p_dl default x. When I am at the selection screen I give the plant and change the option to p_rm or p_pr it gives me a error saying the date range is not given but the option p_pr is selected and the file path is still seen . Where as to my expectation it has to work in such a way that still p_dl should be selected or the file path should be missing . How do we change the code in that way .

Thanks ,

Daniel

Read only

Former Member
0 Likes
848

Self