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

Selection screen

former_member386202
Active Contributor
0 Likes
434

hi friends,,

how can we desable slect options & parameters on selection screen.

thanks,

prashant patil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
405

PARAMETERS : P_VBELN LIKE VBRK-VBELN MODIF ID MD1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'MD1'.

SCREEN-ACTIVE = 0.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

4 REPLIES 4
Read only

Former Member
0 Likes
406

PARAMETERS : P_VBELN LIKE VBRK-VBELN MODIF ID MD1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'MD1'.

SCREEN-ACTIVE = 0.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
405

Hi,

Just go through the following code segment.

Copy paste it in abap editor

*Selectionscreen elements..............................................

"----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS:

p_uname LIKE sy-uname

MODIF ID bl1. " User name

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS:

p_fname(10) TYPE c MODIF ID bl2

OBLIGATORY, " First name

p_lname(10) TYPE c MODIF ID bl2

OBLIGATORY, " Last name

p_empid(5) TYPE n MODIF ID bl2

OBLIGATORY. " Employee id

SELECTION-SCREEN END OF BLOCK b2.

*" Data declarations...................................................

"----


  • Work variables *

"----


DATA:

w_uname LIKE sy-uname. " User name

----


  • AT SELECTION-SCREEN OUTPUT EVENT *

----


AT SELECTION-SCREEN OUTPUT.

PERFORM validate.

----


  • AT SELECTION-SCREEN ON FIELD EVENT *

----


AT SELECTION-SCREEN ON p_uname.

PERFORM validate_uname.

----


  • END OF SELECTION EVENT *

----


END-OF-SELECTION.

PERFORM output.

----


  • FORM VALIDATE *

----


  • This subroutine disables all parameters if user name is not *

  • initialized or user name is not valid. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


FORM validate.

w_uname = sy-uname.

IF p_uname IS INITIAL OR p_uname NE w_uname.

LOOP AT SCREEN.

IF screen-group1 EQ 'BL2'.

screen-active = '0'.

ELSE.

screen-active = '1'.

ENDIF. " IF screen-group1 EQ 'BL2'.

MODIFY SCREEN.

ENDLOOP. " LOOP AT SCREEN.

ELSEIF p_uname EQ sy-uname.

LOOP AT SCREEN.

IF screen-group1 = 'BL1'.

screen-active = 0.

MODIFY SCREEN.

ELSEIF screen-group1 = 'BL2'.

screen-active = 1.

screen-output = 1.

screen-input = 1.

screen-invisible = 0.

ENDIF. " IF screen-group1 = 'BL1'.

MODIFY SCREEN.

ENDLOOP. " LOOP AT SCREEN.

ENDIF. " IF p_uname IS INITIAL...

ENDFORM. " VALIDATE

----


  • Form VALIDATE_UNAME *

----


  • This subroutine gives error message and validates the user name. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


FORM validate_uname .

IF p_uname IS INITIAL.

MESSAGE 'Enter the user name'(001) TYPE 'E'.

ELSEIF p_uname NE sy-uname.

MESSAGE 'Authorization unsuccessful'(002) TYPE 'E'.

ENDIF. " IF p_uname IS INITIAL.

ENDFORM. " VALIDATE_UNAME

----


  • Form OUTPUT *

----


  • This subroutine is used to print the output. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


FORM output .

IF p_fname IS NOT INITIAL.

WRITE: / 'First name:'(003),p_fname.

WRITE: / 'Last name:'(004),p_lname.

WRITE: / 'Employee id:'(005),p_empid.

ENDIF. " IF p_fname IS NOT INITIAL.

ENDFORM. " OUTPUT

Reward if helpful.

Regards,

Sandhya

Read only

Former Member
0 Likes
405

HI PRASHANT,

Check this code.

Got to screen , press F1 over that element(parameter or select option)

field of that partcular element, now go to technoical information there u'll

find screen field name of that component. This way find screen field name of all components on the selction screen which u want to hide. and set input and invisble prpoerty as required as shown in the code below, modify screen.

REPORT z1 .

DATA gv_budat TYPE erdk-budat.

PARAMETERS p_budat LIKE gv_budat.

SELECT-OPTIONS so_budat FOR gv_budat.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'SO_BUDAT-LOW'

OR screen-name = 'SO_BUDAT-HIGH'

OR screen-name = '%_SO_BUDAT_%_APP_%-TEXT'

OR screen-name = '%_SO_BUDAT_%_APP_%-VALU_PUSH'

OR screen-name = '%_P_BUDAT_%_APP_%-TEXT'

OR screen-name = 'P_BUDAT'.

screen-input = '0'.

screen-invisible = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

This is working.

Pls reward points to all answers.

Regards

Read only

Former Member
0 Likes
405

Hello prashant patil,

We can desable the select-option field using the statement SCREEN-INPUT = 0.

Just have a look on the following code :

<b>select-options: s_werks for marc-werks modif id g.

at selection-screen output.

loop at screen.

if screen-group1 eq 'G'.

screen-input = 0.

refresh s_werks.

endif.

modify screen.

endloop.</b>

here i'm selecting the select-option <b>s_werks</b> and i initialize modif id value for <b>s_werks</b> as <b>G</b>. The condition if that screen-group equals to <b>G</b> then the select-option s_werks is desables.

<b><u>For more information on MODIF ID go through the following info.:</u></b>

To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows:

PARAMETERS p ...... MODIF ID key ......

The name of modification group key should be a three-character variable name without quotation marks. The MODIF ID addition always assigns key to the screen-group1 column of internal table screen. Parameters assigned to a modification group can be processed as an entire group with the LOOP AT SCREEN and MODIFY SCREEN statements during the AT SELECTION-SCREEN OUTPUT event.

For more information on modification groups and internal table screen, see Modifying the Screen.

<b>REPORT demo_sel_screen_param_modif.

PARAMETERS: test1(10) TYPE c MODIF ID sc1,

test2(10) TYPE c MODIF ID sc2,

test3(10) TYPE c MODIF ID sc1,

test4(10) TYPE c MODIF ID sc2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-intensified = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

IF screen-group1 = 'SC2'.

screen-intensified = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.</b>

The parameters test1 and test3are assigned to the modification group sc1, while test2 and test4 are assigned to group sc2. During the AT SELECTION-SCREEN OUTPUT event, the INTENSIFIED field of internal table screen is set to 1 or 0, depending on the contents of the group1 field.

<u><b>Reward me if it is useful to you.</b></u>

Message was edited by:

Sasidhar Reddy Matli