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

Hide fields on screen without loop at screen/endloop

Former Member
0 Likes
10,940

Dear gurus,

Is there any way to hide fields on screen without using loop at screen statement? There are too many fields on the screen and it would take a lot of time to loop through them.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

varma_narayana
Active Contributor
0 Likes
3,189

Hi...

1. Assign the Screen fields to Modification group (in the Screen painter field attributes)

Then in the PBO module.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 1.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

this will give a better performance of LOOP.

<b>reward if Helpful</b>

6 REPLIES 6
Read only

Former Member
0 Likes
3,189

SELECT-OPTIONS S_PTYPE FOR SAPLANE-PLANETYPE <b>NO-DISPLAY</b>.

Read only

0 Likes
3,189

Hi Prashant,

I believe I mentioned screen not selection screen. The field is a dictionary field.

Thanks.

Read only

varma_narayana
Active Contributor
0 Likes
3,190

Hi...

1. Assign the Screen fields to Modification group (in the Screen painter field attributes)

Then in the PBO module.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 1.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

this will give a better performance of LOOP.

<b>reward if Helpful</b>

Read only

0 Likes
3,189

@Varma,

That would definitely improve performance, but can't it be done without the 'LOOP AT SCREEN' statement???

Thanks.

Read only

0 Likes
3,189

Hi Sanjay..

If you want to Hide the fields only during runtime based on the Condition then it is must to use the LOOP...

<b>reward if Helpful..</b>

Read only

Former Member
0 Likes
3,189

You can use MODIF-ID

E.g.

PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p1 TYPE c LENGTH 10,

p2 TYPE c LENGTH 10,

p3 TYPE c LENGTH 10.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: p4 TYPE c LENGTH 10 MODIF ID bl2,

p5 TYPE c LENGTH 10 MODIF ID bl2,

p6 TYPE c LENGTH 10 MODIF ID bl2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF show_all <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Please reward points if useful.

Regards,

Taranam