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: 

screen chnages

Former Member
0 Kudos

Hi all,

My requirement is I need to display to new fields depending on the check box..?

if the check box is checked then I need to show the two fields,

before that it should not be visible...

I can do it at event AT SELECTION-SCREEN OUTPUT.

but how to make it visible when after

LOOP AT SCREEN.....

please resopnd....

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Vinay,

Try this...

PARAMETERS: p_chk AS CHECKBOX .

PARAMETERS: p_f1(5) TYPE c MODIF ID p1,

p_f2(5) TYPE c MODIF ID p1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_chk = 'X'.

IF screen-group1 = 'P1'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ELSE.

IF screen-group1 = 'P1'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

But after clickin the chkbox u need to press enter to display those fields...it is better to use radiobuttons instead of chkbox.

10 REPLIES 10

Former Member
0 Kudos

Loop at screen.

screen-invisible = 1.

screen-visible = 0.

Check the various field properties of the Screen of which you can use some of them to make fields visible/invisible.

Former Member
0 Kudos

Hi Vijay Kumar,

Attach USER COMMAND with your checkbox.

In event AT USER COMMAND, use loop at screen.....

to make it visible.

Regards,

Mohaiyuddin

Former Member
0 Kudos

Hi,

During initialization event, write code for not displaying those two fields.

so you will not get those two fields initially..

after selection check box....

through at selection-screen event, you can write code for displaying those two fields.

Regards,

Smit

Former Member
0 Kudos

HI

PFB sample code,,,,...

PARAMETERS: pa_sbi AS CHECKBOX MODIF ID sc2 .

Loop at screen.

IF pa_sbi = 'X'.

IF screen-group1 = SC2.

screen-input = '0'.

screen-invisible = '1'.

MODIFY SCREEN.

endloop.

assign screen group to check box.

Former Member
0 Kudos

Hi Vinay,

Welcome To sdn

https://forums.sdn.sap.com/click.jspa?searchID=15094906&messageID=5820488

https://forums.sdn.sap.com/click.jspa?searchID=15094962&messageID=5820539

The above 2 linksshould help you slove the issue.

Have A Good Day

Chaitanya.

former_member206439
Contributor
0 Kudos

Hi

Screen-invisible = 0.

then it will be invisible

but the logic should be like this.

see this report you can understand by executing this

if u had any doubts inform me.

REPORT ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).

******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*****************

Former Member
0 Kudos

hi,

FIELD.Visible = True;

Regards

Former Member
0 Kudos

Hi Vinay,

Try this...

PARAMETERS: p_chk AS CHECKBOX .

PARAMETERS: p_f1(5) TYPE c MODIF ID p1,

p_f2(5) TYPE c MODIF ID p1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_chk = 'X'.

IF screen-group1 = 'P1'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ELSE.

IF screen-group1 = 'P1'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

But after clickin the chkbox u need to press enter to display those fields...it is better to use radiobuttons instead of chkbox.

Subhankar
Active Contributor
0 Kudos

Hi

Please see this example..

TABLES: faglflext.

PARAMETER: p_fob TYPE char01 AS CHECKBOX

USER-COMMAND ucomm.

SELECT-OPTIONS: s_fobgl FOR faglflext-racct

DEFAULT '144800' MODIF ID fob,

s_fobfa FOR faglflext-rfarea MODIF ID fob.

AT SELECTION-SCREEN OUTPUT.

IF sy-ucomm = 'ONLI' OR sy-ucomm = 'SPOS' OR

sy-ucomm = 'PRIN' OR sy-ucomm = 'SJOB' OR

sy-ucomm = space.

LOOP AT SCREEN.

IF p_fob IS INITIAL.

IF screen-group1 = 'FOB'.

screen-active = 0.

ENDIF.

ENDIF.

  • Modify the screen

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Former Member
0 Kudos

Hey no need to press enter if u add this ...

PARAMETERS: p_chk AS CHECKBOX user-command ch.

PARAMETERS: p_f1(5) TYPE c MODIF ID p1,

p_f2(5) TYPE c MODIF ID p1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_chk = 'X'.

IF screen-group1 = 'P1'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ELSE.

IF screen-group1 = 'P1'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Thanx for awardin points...

Gud luk...