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: 

hide a field

Former Member
0 Kudos
137

how to hide a field(column) based on the user in basic or secondary list

5 REPLIES 5

Former Member
0 Kudos
109

hi,

No need to retrieve the field from the database if u dont want that field.

former_member188827
Active Contributor
0 Kudos
109

enclose the hide statement in if and endif.

if sy-uname = 'abc'.

hide zvar.

endif.

Former Member
0 Kudos
109

hi,

After a write stetment write

<b>hide fieldnaem</b>

We can use HIDE technique while creating LIST level to store line -specific information for later use.

syntax: HIDE <variable>.

this statement place the contents of the variable <variable> for the current output line(SY-LINNO) into the HIDE area.

you can think of the HIDE area as a table, in which the system stores the field name, field contents and line number in which field exisisting. as soon as they are needed the system reads the values from the table(HIDE) using READ LINE statement.

Keep in mind while working with HIDE.

1) Allways keep HIDE <variable> statement after WRITE statement for more readable format.

2) All way keep HIDE <variable> statement inside the LOOP statement, because syatem stores all the hide variable in system genarated table space, we can process table data throug it's work area only.

Sample Program.

Report Zreport_hide.

*table work area

tables: lfa1,ekko,ekpo.

*selection-screen logic

select-options: s_lifnr for lfa1-lifnr obligatory.

*logic for creating internal table

data: begin of it _lfa1 occurs 0,

it_lifnr like lfa1-lifnr,

name1 like lfa1-name1,

end of it_lfa1.

data: begin of it _ekko occurs 0,

it_ebeln like ekko-ebeln,

aedat like ekko-aedat,

end of it_ekko.

  • logic for genarating basic list

start-of-selection.

select lifnr name1 from lfa1 into table it_lfa1 where lifnr in s_lifnr.

*processing the data.

loop at it_lfa1.

write:/ it_lfa1-lifnr,

it_lfa1-name1,'

HIDE it_lfa1-lifnr. "here hide the varible lifnr

endloop.

*logic for genarating secondary list

at line-selection.

case sy-lsind.

when 1.

select ebeln aedat from ekko into table it_ekko where lifnr = it_lfa1-lifnr.

*processing seconadry list data.

loop at it_ekko.

write:/ it_ekko-ebeln,

it_ekko-aedat,

endloop.

regards,

Regards

Message was edited by:

ASHOK KUMAR

Former Member
0 Kudos
109

hi,

use HIDE KEYWORD TO HIDE A column as

in end of selection event, after u display clicked item to user use hide statement as

HIDE ITAB-MATNR. // MATNR IS THE CLICKED ITEM I THE INTERNAL TABLE ITAB.

IF HELPFUL REWARD SOME POINTS.

with regards,

Suresh Aluri.

former_member491305
Active Contributor
0 Kudos
109

Hi ,

Use the system field SY-UNAME to find the user name.and then set the no_out property of the field as 'X' in field catalog.

fieldcat-fieldname= 'ITAB-WRBTR'.

If sy-uname = 'VIGNESH'.

fieldcat-no_out = 'X'.

endif.

append fieldcat to it_fieldcat.