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: 

Module pool : Hide fields

Former Member
0 Kudos
6,114

Hi,

1. I want to hide/display group of fields in module pool. MY requirement is,

based on the subty value i have to display/hide some fields...

2. I have a screen in module pool. which has table control and some fields.

If subty = 'aaaa' i want to display table control and hide fields

if subty = 'bbbb' i want to display fields and hide table control.

<removed_by_moderator>

Thanks and Regards,

Kanal.

Edited by: Julius Bussche on Aug 14, 2008 11:04 AM

6 REPLIES 6

Former Member
0 Kudos
1,008

hi,

First assign a group name to the all the fields to be modified.

Write the logic in PAI event

if subty = <value>.

loop at screen.

if screen-name = 'GRP1'.

screen-input = 1.

endif.

modify screen.

endloop.

else.

loop at screen.

if screen-name = 'GRP1'.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

regards

padma

Former Member
0 Kudos
1,008

hi,

for this u need to first set some attributes of the screen fields.

in the screen painter, for the table control field u need to set the "group1" attribute as TBC (say) and for all the other fields in the screen as FLD (say).

now in the PAI of the screen u can write the following code.


loop at screen.
if screen-group1 = 'TBC' and subty = 'aaaa'.
screen-active = 1.
elseif screen-group1 = 'TBC' and subty = 'bbbb'.
screen-active = 0.
if screen-group1 = 'FLD' and subty = 'aaaa'.
screen-active = 0.
elseif screen-group1 = 'FLD' and subty = 'bbbb'.
screen-active = 1.
endif.
modify screen.
endloop.

Former Member
0 Kudos
1,008

Hi,

In PAI,

Check the subty value..

If subty = 'aaaa' .
flag = 'X' .
elseif subty = 'bbbb' .
flag = ' ' .
endif .

Assign ur table control as Group G1.

In PBO,

If flag = 'X' .
Loop at screen
      IF screen-group1 = 'G1'.
        screen-input = 0.
        screen-invisible = 1.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
 Endloop.

elseif flag = ' ' .
Loop at screen
      IF screen-group1 = 'G1'.
        screen-input = 1.
        screen-invisible = 0.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
 Endloop.
endif .

Regards,

Prem

Former Member
0 Kudos
1,008

You can hide the fileds on the selection screen

by assigning them a group and in the code

LOOP AT SCREEN .

IF SCREEN-GROUP1 = 'HID'.

SCREEN-INVISIBLE = 1.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

If you want to hide the table control, you need to declare that table control inside a subscreen.

And Call the subscreen only if your particular condition satisfy.

Former Member
0 Kudos
1,008

to hide fields use

if screen-name = 'GRP1'.

screen-input = 1.

endif.

modify screen.

endloop.

else.

loop at screen.

if screen-name = 'GRP1'.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

to hide table control use

<table control name>-INVISIBLE = 'X'.

Former Member
0 Kudos
1,008

Hi,

In PBO, you need to add the following code:

CHECK subty IS NOT INITIAL.

LOOP AT SCREEN.

CASE screen-name.

WHEN 'FIELD1'.

IF subty = 'aaaa'.

SCREEN-INVISIBLE = 'X'.

ELSE.

SCREEN-INVISIBLE = ' '.

ENDIF.

WHEN 'FIELD2'.

IF subty = 'aaaa'.

SCREEN-INVISIBLE = 'X'.

ELSE.

SCREEN-INVISIBLE = ' '.

ENDIF.

WHEN 'TAB_CTRL'.

IF subty = 'aaaa'.

SCREEN-INVISIBLE = ' '.

ELSE.

SCREEN-INVISIBLE = 'X'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

write the similar code keeping the same logic......

Your problem will be solved...

Regards,

Kunjal