07-19-2007 7:59 AM
Hi,
Why we use HIDE key in our programming. if we use SY-LISEL it will copy the line from the program and the user can easily understand. Then why we use HIDE key and what is the additional functionality it does compared to SY-LISEL?
Thanks
07-19-2007 8:02 AM
Hi
Hide is used
To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities. At the end of the processing block END-OF-SELECTION, delete the contents of one or more fields you previously stored for valid lines using the HIDE statement. At the event AT LINE-SELECTION, check whether the work area is initial or whether the HIDE statement stored field contents there. After processing the secondary list, clear the work area again. This prevents the user from trying to create further secondary lists from the secondary list displayed.
SY-LISEL is used to fetch the details of the selected line by reading a line,
so the info of that line we get on the current list.
<b>Reward points for useful Answers</b>
Regards
Anji
07-19-2007 8:02 AM
Hide statement is used to pass the current list to buffer so that you can later come back to the same listing and select some other data and bring up other secondary listing.
Regards,
Himanshu
07-19-2007 8:02 AM
Hi
Hide is used
To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities. At the end of the processing block END-OF-SELECTION, delete the contents of one or more fields you previously stored for valid lines using the HIDE statement. At the event AT LINE-SELECTION, check whether the work area is initial or whether the HIDE statement stored field contents there. After processing the secondary list, clear the work area again. This prevents the user from trying to create further secondary lists from the secondary list displayed.
SY-LISEL is used to fetch the details of the selected line by reading a line,
so the info of that line we get on the current list.
<b>Reward points for useful Answers</b>
Regards
Anji
07-19-2007 8:02 AM
<b>HIDE</b>
Effect
This statement stores - in the current list level - the content of the variable dobj together with the current list line whose line number is contained in sy-linno. The data type of the variables dobj must be flat and no field symbols can be specified that point to rows of internal tables, and no class attributes can be specified. The stored values can be read as follows:
For each user action in a displayed screen list that leads to a list result, all the row values stored using HIDE - that is, the row on which the screen cursor is positioned at the time of the event - are assigned to the respective variables.
If a list row of an arbitrary list level is read or modified using the statements READ LINE or MODIFY LINE, all the values of this row stored using HIDE are assigned to the respective variables.
Notes
The HIDE statement works independently of whether the list cursor was set. In particular, variables for empty list rows can be stored - that is, rows in which the list cursor was positioned using statements like SKIP.
The HIDE statement should be executed immediately at the statement that has set the list cursor in the row.
Outside of classes, constants and literals that cannot be read in list results and in the statement READ LINE can be specified for dobj outside of classes.
Example.
DATA: square TYPE i,
cube TYPE i.
START-OF-SELECTION.
FORMAT HOTSPOT.
DO 10 TIMES.
square = sy-index ** 2.
cube = sy-index ** 3.
WRITE / sy-index.
HIDE: square, cube.
ENDDO.
AT LINE-SELECTION.
WRITE: square, cube.
Regards,
Pavan
07-19-2007 8:04 AM
hi,
you can use any fo these in interactive list but its little difficult to use sy-lisel.we have to find the starting position and length of the field
so better to use HIDE instead of sy-lisel .
The system field SY-LISEL is a type C field with length 255. Although it contains the selected line, it is only of limited use for passing the values of single fields, since it is a character string. To process certain parts of SY-LISEL, you must specify the corresponding offsets.
To pass data therefore, it is better to use one of the methods (HIDE,READ LINE,GET CURSOR,DESCRIBE LIST). SY-LISEL is, however, suitable for designing the headers of detail lists, or for checking that a selected line is not a space or an underscore.
Prajith
07-19-2007 8:04 AM
Hi rams,
chk this.
HIDE
Basic form
HIDE f.
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Constants not allowed in HIDE area.
Effect
Retains the contents of f related to the current output line. When the user selects the line from the list f is automatically filled with the retained value.
The selection can occur in:
AT LINE-SELECTION
AT PFx
AT USER-COMMAND
READ LINE
The contents of the field do not have to have been displayed using WRITE in order for you to retain them.
The HIDE statement does not support deep structures (structures that contain internal tables).
Useful system fields for interactive reporting are listed in the System Fields for Lists documentation.
Note
Lines or components of lines of an internal table that you address using a field symbol (see ASSIGNING addition to the READ and LOOP statements), cannot be retained using HIDE. You can store them using a global variable instead.
Note
Runtime errors:
HIDE_FIELD_TOO_LARGE: The field is too long for HIDE.
HIDE_ON_EMPTY_PAGE: HIDE not possible on an empty page.
HIDE_NO_LOCAL: HIDE not possible for a local field.
HIDE_ILLEGAL_ITAB_SYMBOL: HIDE not possible for a table line or component of a table line.
and also a sample program.
report zxy_0003.
data: begin of itab occurs 0,
field type c,
end of itab.
itab-field = 'A'. append itab.
itab-field = 'B'. append itab.
itab-field = 'C'. append itab.
itab-field = 'D'. append itab.
itab-field = 'E'. append itab.
loop at itab.
format hotspot on.
write:/ itab-field.
hide itab-field.
format hotspot off.
endloop.
at line-selection.
write:/ 'You clicked', itab-field.
It kind of "remembers" what is written, so that when you click on it, it knows what the value is.
Reward points if it helps..
Regards,
Omkar.
07-19-2007 8:05 AM
<b>HIDE </b>
<b>
Basic form </b>
HIDE f.
<b>Effect </b>
Retains the contents of f related to the current output line. When the user selects the line from the list f is automatically filled with the retained value.
You can hide any field which is linked to the printed/displayed line, like an order number, a date or so, so when user will interact with the line, the value of the field will be available and not only the text of the line.
Regards
07-19-2007 8:11 AM
Hello Rams,
Sy-Lisel will copy the line from the program, Its OK.
But using hide statement in a loop will copy the what ever the fields we are defining in the hide statement will be copied in to the buffer. The buffer is a typically a INTERNAL TABLE with fields: LINE NUMBER, FIELD NAME, FIELD VALUE.
When ever if the following actions :
AT LINE-SELECTION
AT PFx
AT USER-COMMAND
READ LINE
happend then automaticaaly, based on the line number, appropriate line will be copied in to the work area.
For more info.... See bellow...
HIDE f.
In an ABAP Objects context, a more severe syntax check is
performed that in other ABAP areas. See Constants not allowed
in HIDE area.
Retains the contents of f related to the current output line.
When the user selects the line from the list f is
automatically filled with the retained value.
The selection can occur in:
1. AT LINE-SELECTION
2. AT PFx
3. AT USER-COMMAND
4. READ LINE
The contents of the field do not have to have been displayed
using WRITE in order for you to retain them.
The HIDE statement does not support deep structures
(structures that contain internal tables).
Useful system fields for interactive reporting are listed in
the System Fields for Lists documentation.
Lines or components of lines of an internal table that you
address using a field symbol (see ASSIGNING addition to the
READ and LOOP statements), cannot be retained using HIDE. You
can store them using a global variable instead.
Runtime errors:
- HIDE_FIELD_TOO_LARGE: The field is too long for HIDE.
- HIDE_ON_EMPTY_PAGE: HIDE not possible on an empty page.
- HIDE_NO_LOCAL: HIDE not possible for a local field.
- HIDE_ILLEGAL_ITAB_SYMBOL: HIDE not possible for a table
line or component of a table line.
Reward Points if Helpful
Regards
--
Sasidhar Reddy Matli.