08-14-2008 11:21 AM
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
08-14-2008 11:26 AM
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
08-14-2008 12:19 PM
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.
08-14-2008 12:32 PM
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
08-14-2008 12:53 PM
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.
09-02-2008 9:40 AM
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'.
09-02-2008 10:04 AM
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