‎2013 Sep 30 1:02 PM
Hi,
I have developed one screen.In that i have already hide one field,now i want to hide one more field.The same way i have followed for the second field also,but it is not working.Please help me.
Thanks
‎2013 Sep 30 4:24 PM
Hi Ganesha,
Please follow the below procedure for hiding the multiple fields in the screen.
Parameters:
x type c modif id abc,
y type c modif id abc,
z type c modif id abc.
At selection-screen output.
Loop at screen.
If Screen-group1 = 'abc'.
Screen-active = 0.
Modify Screen.
Endif.
Endloop.
Please let me know if still problem persist.
Warm Regards
Rock Start
‎2013 Sep 30 4:44 PM
OK use loop at screen ,but before the field must have a group and use loop at screen and inside the loop if scrren-gruop......
‎2013 Sep 30 5:10 PM
‎2013 Oct 01 5:20 AM
Hi Susmitha,
Here is my code for hiding Material Number only.
IF true EQ 'X'.
LOOP AT SCREEN.
IF screen-name = 'ARTICLE'.
screen-required = '0'.
screen-intensified = '1'.
screen-invisible = '0'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'MATNR'.
screen-required = '0'.
screen-intensified = '1'.
screen-invisible = '0'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF .
IF true EQ ' '.
LOOP AT SCREEN.
IF screen-name = 'ARTICLE'.
screen-required = '0'.
screen-intensified = '0'.
screen-invisible = '1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'MATNR'.
screen-required = '0'.
screen-intensified = '0'.
screen-invisible = '1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Thanks
‎2013 Oct 01 5:38 AM
Hi Sai,
To make a field invisible the attributes that you need to set are
screen-invisible = '1'. " Field will be visible but Input will come as ****
screen-input = '0'. " Field will be invisible.
modify screen.
Also make sure that the field names are correct.
‎2013 Oct 01 5:52 AM
‎2013 Oct 01 5:55 AM
‎2013 Oct 01 5:57 AM
One more clarification.
Is this your selection screen or screen created as module pool through SE51?
‎2013 Oct 01 6:04 AM
‎2013 Oct 01 6:08 AM
I dont find screen field name HSDAT in the code you shared, I just saw 'ARTICLE'.
If its the same, do change the name to the correct screen field name.
‎2013 Oct 01 6:10 AM
‎2013 Oct 01 6:11 AM
‎2013 Oct 01 6:11 AM
Hi Sai,
Try creating the group name for text fields and input fields , say 'G2' in group1 field in toolbar .
then IN PBO try using the code that i have given .
‎2013 Oct 01 6:14 AM
‎2013 Oct 01 6:15 AM
Hi Farid,
Previously Only MATNR field is hiding,Now my requirement is i want to hide both MATNR and HSDAT fields.HSDAT field is in Table control.I have given same group name for both fields,and write code like this.But it is hiding only MATNR and not HSDAT.
Loop At Screen.
If screen-group1 = 'GR1'.
Screen-active = 0.
Modify Screen.
Endif.
Endloop.
Thanks
‎2013 Oct 01 6:18 AM
Hi Siva,
I have tried what you told,But only one field is hiding and other field is not hiding.
Thanks
‎2013 Oct 01 6:33 AM
for Table Control columns, you would have to code it a little differently.
please check out this previous post on SDN https://scn.sap.com/thread/1053227
hope it helps!
‎2013 Oct 01 6:38 AM
try wih giving the same group name for MATNR & HSDAT (input ant text), and dont write separate code for MATNR & HSDT.
Loop At Screen.
If screen-group1 = 'GR1'.
Screen-active = 0.
Modify Screen.
Endif.
Endloop.
‎2013 Oct 01 6:45 AM
Hai Sai,
For table control , there is a little different way to code for field hiding.
DO like this,
Use table cols
data: x_bool like LINE OF tc-cols. "Workarea for table control tc-cols
LOOP at tc-cols INTO x_bool. "TC is table control here
if x_bool-index EQ 1. "table control position
x_bool-invisible = 1.
endif.
modify tc-cols FROM x_bool.
ENDLOOP.
Hope this Helps,
regards,
Sivaganesh
‎2013 Oct 01 11:29 AM
Use :
1. IF true NE 'X' instead of ' '.
2. Check your field names. If part of a structure use complete name e.g 'MARA-MATNR'
regards,
Ashish Rawat
‎2013 Oct 01 1:07 PM
Hii Ganesha,
do the following,
put both MATNR and HSDT into same group in like G10r G2 or G3 or G4 ur choice screen layout design.
then in the screen PBO
PROCESS BEFORE OUTPUT.
LOOP AT t_trans INTO x_trans WITH CONTROL tcont. "t_TRANS is internal table
MODULE modify_screen. "To Modify the Table Control Screen
ENDLOOP.
module modify_screen output.
loop at screen.
if screen-group1 eq 'G1'.
screen-active = 0.
endif.
modify screen.
endloop.
Note: if ur group name G1 then screen-group1 eq G1 like wise
hope this will resolve ur issue.
regards
Syed
‎2013 Oct 01 5:14 AM
hi
wht u can do is go to the screen layout and click on all the fields that you want to hide and give a common group name in the properties.
in the program you can type
loop at screen.
if screen-group1 = groupname you have given the screen layout
screen-invisible = 1.
modify screen
endif.
with regards
suneesh
‎2013 Oct 01 5:41 AM
Hi suneesh,
To which i will make group name,i mean for text field and for input/output field.
Thanks
‎2013 Oct 01 5:52 AM
‎2013 Oct 01 5:21 AM
Hi,
If i have got your question right then Please goto LAYOUT of your program and then group both your fields as suppose say G1. The screen provided by Ronaldo can be helpful.
Then use the below code.
Loop At Screen.
If screen-group1 = 'G1'.
Screen-active = 0.
Modify Screen.
Endif.
Endloop.
Regards
‎2013 Oct 01 5:46 AM
Hi Amaranatha,
I have already tried that one,But only one field is hiding and other field is not hiding.
Thanks
‎2013 Oct 01 5:21 AM
Hi,
U can try like this (in PBO) but its better if u share ur code.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'FIELD1'.
SCREEN-INVISIBLE = 'X'.
WHEN 'FIELD2'.
SCREEN-INVISIBLE = 'X'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
‎2013 Oct 01 5:28 AM
Hi,
Have the same group name for both the fields.
by using the below code
loop at screen.
If screen-group1 = 'xyz'.
screen-active = 0.
Modify Screen.
Endif.
endloop.
‎2013 Oct 01 5:31 AM
Hi Sai,
Create a group for fields by setting a name of the group on the right side tool bar , specify same group to both the fields,
IN PBO try to use LOOP AT SCREEN . with in that
write like if screen-group1 EQ 'groupname'.
screen-active = 0.
modify screen.
endif .
this will work .
regards,
Sivaganesh
‎2013 Oct 01 5:32 AM
Dear Sai Ganesha,
No need to add the screen group to the field which want to make invisible in the screen layout .
Just add the following code
In the PBO (process before output) of the screen
Loop at screen.
if screen-name eq 'Field_name'.
screen-input = 0.
endif.
endloop.
Thanks and Regards,
Madhukumar
‎2013 Oct 01 5:57 AM
Hi Sai Ganesha,
In PBO use the below logic,
loop at screen.
if screen-group1 eq <GROUP_NAME>.
screen-active = 0.
modify screen.
endif.
end loop.
‎2013 Oct 01 6:05 AM
Hi Sai Ganesha,
Please check the Name of the Table Control and if u have only one field in that table control u can use the below code , where u can hide the tab.
Loop at screen.
if <screen-name> eq 'Field_name'.
screen-input = 0.
endif.
endloop.
If u need to hide only the field. You may use
Example . cont_stc is name of the table control (Structure)
cont_tab is refrence of structur con_stc.
code:-
loop at cont_tab into cont_stc.
if cont_stc-index = 2. "your target hidden column
cont_stc-invisible = 1.
endif.
modify cont_tab from cont_stc.
endloop.
Please reply this above doesnt help you.
Thanks,
S.Rajendranath
‎2013 Oct 01 7:15 AM
Hello Sai,
please put below mentioned code in PBO module.
MODULE DISABLE_OUTPUT OUTPUT.
loop at screen.
if screen-group1 = 'ABC'.
screen-active = 0.
modify screen.
endif.
endloop.
ENDMODULE.
Regards,
Deepak kansal.
‎2013 Oct 01 9:11 AM
Hi,
First group the two fields 'MATNR' and 'HSDAT' using the field properties in the layout.
Loop at screen and change the screen attributes and modify the screen in PBO.
if screen-group1 = 'G1'
screen-invisible = '1'.
screen-input = '0'.
modify screen.
Still you are not able hide the field then Make sure that you are not modifying the screen attributes of the field HSDAT after the current loop at screen in the PBO.
‎2013 Oct 01 10:14 AM
If one field is directly on dynpro and the second one in the records of a table control, they wont be managed in the same LOOP AT SCREEN.
PROCESS BEFORE OUTPUT.
* Fields on the dynpro
MODULE mainscreen_attr.
LOOP AT itab with control control cursor control-current_line.
* Fields one one displayed record
MODULE itab_attr.
ENDLOOP.
So call your module(s) at both steps, you could use same module.
Regards,
Raymond
‎2013 Oct 01 12:39 PM
Hi Sai,
As Raymond suggested you can create a module within the loop at block in PBO and inside this module you can check for the group and hide it like you have done for MATNR field.
This module will be called for each line of the internal table with which you are looping.
Thanks,
Ajay Bose