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

select options editing

Former Member
0 Likes
660

I have field which has a low and a high range of field1. When the

user enters a high range of field1, I need to grey out the

bottom two fields immediately, so that the user cannot enter

anything on those fields. If the user just enters the low range

of field1, then the bottom two fields can be input by the user.

How do I do such a thing?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
608

Hi,

Check the following sample code, convert it as u required.

after entered material no, u have to press enter key.

DATA FLAG.

PARAMETERS: MATNR TYPE MARA-MATNR,

MAKTX TYPE MAKT-MAKTX MODIF ID TRY.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'TRY'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'TRY' AND FLAG = 'X'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN on matnr.

IF MATNR IS NOT INITIAL.

FLAG = 'X'.

ENDIF.

START-OF-SELECTION.

WRITE:/ MATNR.

--

Cheers,

Chaitanya

5 REPLIES 5
Read only

Former Member
0 Likes
608

Hi Sashi,

This is the code to grey out your fields.

parameters : field1(5) type c,

field2(5) type c,

field3(5) type c.

at selection-screen output.

if field1 eq 'low'.

loop at screen.

if screen-name = 'FIELD2'.

screen-input = '0'.

modify screen.

endif.

if screen-name = 'FIELD3'.

screen-input = '0'.

modify screen.

endif.

endloop.

else.

//write ur code.

endif.

Reward if useful.

Regards,

Anita.

Read only

Former Member
0 Likes
608

Hi,

Check the below code....

AT SELECTION-SCREEN.

if not s_field is initial.

If s_field-option = 'EQ'.

Loop at screen.

if screen-name = field1.

input = 1.

modify screen.

endif.

if screen-name = field2.

input = 1.

modify screen.

endif.

endloop.

else.

Loop at screen.

if screen-name = field1.

input = 0.

modify screen.

endif.

if screen-name = field2.

input = 0.

modify screen.

endif.

endloop.

endif.

Rgds,

Bujji

Read only

Former Member
0 Likes
608

Hi

you can check with this code

the screen modification will be done like this

******DATA DECLARATIONS**********

DATA : BEGIN OF IT_PLANT OCCURS 0,

MATNR LIKE MARA-MATNR,

WERKS LIKE MARC-WERKS,

PSTAT LIKE MARC-PSTAT,

EKGRP LIKE MARC-EKGRP,

END OF IT_PLANT.

DATA : BEGIN OF IT_PONO OCCURS 0,

EBELN LIKE EKKO-EBELN,

EBELP LIKE EKPO-EBELP,

MATNR LIKE EKPO-MATNR,

WERKS LIKE EKPO-WERKS,

LGORT LIKE EKPO-LGORT,

END OF IT_PONO.

TABLES EKKO.

********END OF DATA DECLARATIONS*********

********SELECTION SCREEN DESIGN ***********

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.

SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.

SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R2 RADIOBUTTON GROUP G1.

SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

******END OF SELECTION SCREEN DESIGN****************

*********INITIALIZATION OF SELECTION SCREEN ELEMENTS.*****

INITIALIZATION.

P_WERKS = '1000'.

S_EBELN-LOW = '4500016926'.

S_EBELN-OPTION = 'EQ'.

S_EBELN-SIGN = 'I'.

APPEND S_EBELN.

CLEAR S_EBELN.

************END OF INITIALIZATION***********************

***********SCREEN MODIFICATIONS*******************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

********END OF SCREEN MODIFICATIONS*****************

Read only

Clemenss
Active Contributor
0 Likes
608

Hi sashi,

the SAP screen processor does not allow an immediate reaction on field entries. The only way to start processing is to press ENTER or any other valid function key. Some kind of workaround is to connect radio buttons to function commands, I.e. first the user decides by radiobutton what he wants to fill in and then the fields are made active/inactive accordingly.

No source code here; others have already given enough and I'm conviced your keyboard has F1.

Regards,

Clemens Li

Read only

Former Member
0 Likes
609

Hi,

Check the following sample code, convert it as u required.

after entered material no, u have to press enter key.

DATA FLAG.

PARAMETERS: MATNR TYPE MARA-MATNR,

MAKTX TYPE MAKT-MAKTX MODIF ID TRY.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'TRY'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'TRY' AND FLAG = 'X'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN on matnr.

IF MATNR IS NOT INITIAL.

FLAG = 'X'.

ENDIF.

START-OF-SELECTION.

WRITE:/ MATNR.

--

Cheers,

Chaitanya