2006 Jun 19 11:46 AM
what is a hide command in reports ?and where it store hide data? any one can help me ?
what is a hide command in reports ?and where it store hide data? any one can help me ?
2006 Jun 19 11:48 AM
See the following example to know the usage of HIDE:
<b>Example
DATA TEXT(20).
START-OF-SELECTION.
PERFORM WRITE_AND_HIDE USING SPACE SPACE.
AT LINE-SELECTION.
CASE TEXT.
WHEN 'List index'.
PERFORM WRITE_AND_HIDE USING 'X' SPACE.
WHEN 'User command'.
PERFORM WRITE_AND_HIDE USING SPACE 'X'.
WHEN OTHERS.
SUBTRACT 2 FROM SY-LSIND.
PERFORM WRITE_AND_HIDE USING SPACE SPACE.
ENDCASE.
CLEAR TEXT.
FORM WRITE_AND_HIDE USING P_FLAG_LSIND P_FLAG_UCOMM.
WRITE / 'SY-LSIND:'.
PERFORM WRITE_WITH_COLOR USING SY-LSIND P_FLAG_LSIND.
TEXT = 'List index'.
HIDE TEXT.
WRITE / 'SY-UCOMM:'.
PERFORM WRITE_WITH_COLOR USING SY-UCOMM P_FLAG_UCOMM.
TEXT = 'User command'.
HIDE TEXT.
IF SY-LSIND > 0.
WRITE / 'PICK here to go back one list level'.
ENDIF.
ENDFORM.
FORM WRITE_WITH_COLOR USING P_VALUE
P_FLAG_POSITIVE.
IF P_FLAG_POSITIVE = SPACE.
WRITE P_VALUE COLOR COL_NORMAL.
ELSE.
WRITE P_VALUE COLOR COL_POSITIVE.
ENDIF.
ENDFORM.</b>
Regards,
Ravi
2006 Jun 19 11:49 AM
Hi,
Refer the program DEMO_LIST_HIDE in SE38.
<b>Reward points if it helps.</b>
2006 Jun 19 11:51 AM
Hi vijay,
1. what is a hide command in reports
Just like we use WRITE to
display text data on screen,
2. IN THE SAME WAY,
there is one screen (INSIDE THE MEMORY, WHICH IS INVISIBLE)
and HIDE puts the data on that invisible screen
/ invisible memory area.
3. This invisible screen / memory area
is just like an internal table
having many lines, just like screen lines,
and we can put data in this memory.
4. HIDE puts data in this memory,
at the position, where the current WRITE statement is.
regards,
amit m.
2006 Jun 19 11:55 AM
Hi again,
1. to get a taste of it, just copy paste in new program.
2. It will display 1,2,3 (figures)
3. Double-click on any, and it will display
one, two , three
based upon the click.
4. This will come from HIDE statement.
5.
REPORT ABC NO STANDARD PAGE HEADING.
DATA : VAR(10) TYPE C.
*----
VAR = 'ONE'.
WRITE 😕 '1'.
HIDE VAR.
VAR = 'TWO'.
WRITE 😕 '2'.
HIDE VAR.
VAR = 'THREE'.
WRITE 😕 '3'.
HIDE VAR.
*----
AT LINE-SELECTION.
WRITE VAR.
regards,
amit m.
2006 Jun 19 1:08 PM
hi
good
HIDE
The HIDE statement is one of the fundamental statements for interactive reporting. You use the HIDE technique when creating a basic list. It defines the information that can be passed to subsequent detail lists.
The HIDE Technique
You use the HIDE technique while creating a list level to store line-specific information for later use. To do so, use the HIDE statement as follows:
HIDE <f>.
This statement places the contents of the variable <f> for the current output line (system field SY-LINNO) into the HIDE area. The variable <f> must not necessarily appear on the current line.
To make your program more readable, always place the HIDE statement directly after the output statement for the variable <f> or after the last output statement for the current line.
As soon as the user selects a line for which you stored HIDE fields, the system fills the variables in the program with the values stored. A line can be selected
by an interactive event.
For each interactive event, the HIDE fields of the line on which the cursor is positioned during the event are filled with the stored values.
by the READ LINE statement.
You can think of the HIDE area as a table, in which the system stores the names and values of all HIDE fields for each list and line number. As soon as they are needed, the system reads the values from the table.
The example below presents some of the essential features of interactive reporting. The basic list contains summarized information. By means of the HIDE technique, each detail list contains more details.
The following program is connected to the logical database F1S.
REPORT demo_list_hide NO STANDARD PAGE HEADING.
TABLES: spfli, sbook.
DATA: num TYPE i,
dat TYPE d.
START-OF-SELECTION.
num = 0.
SET PF-STATUS 'FLIGHT'.
GET spfli.
num = num + 1.
WRITE: / spfli-carrid, spfli-connid,
spfli-cityfrom, spfli-cityto.
HIDE: spfli-carrid, spfli-connid, num.
END-OF-SELECTION.
CLEAR num.
TOP-OF-PAGE.
WRITE 'List of Flights'.
ULINE.
WRITE 'CA CONN FROM TO'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'BOOKING'.
WRITE sy-lisel.
ULINE.
WHEN 'WIND'.
WRITE: 'Booking', sbook-bookid,
/ 'Date ', sbook-fldate.
ULINE.
ENDCASE.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
IF num NE 0.
SET PF-STATUS 'BOOKING'.
CLEAR dat.
SELECT * FROM sbook WHERE carrid = spfli-carrid
AND connid = spfli-connid.
IF sbook-fldate NE dat.
dat = sbook-fldate.
SKIP.
WRITE / sbook-fldate.
POSITION 16.
ELSE.
NEW-LINE.
POSITION 16.
ENDIF.
WRITE sbook-bookid.
HIDE: sbook-bookid, sbook-fldate, sbook-custtype,
sbook-smoker, sbook-luggweight, sbook-class.
ENDSELECT.
IF sy-subrc NE 0.
WRITE / 'No bookings for this flight'.
ENDIF.
num = 0.
CLEAR sbook-bookid.
ENDIF.
WHEN 'INFO'.
IF NOT sbook-bookid IS INITIAL.
SET PF-STATUS 'WIND'.
SET TITLEBAR 'BKI'.
WINDOW STARTING AT 30 5 ENDING AT 60 10.
WRITE: 'Customer type :', sbook-custtype,
/ 'Smoker :', sbook-smoker,
/ 'Luggage weight :', sbook-luggweight UNIT 'KG',
/ 'Class :', sbook-class.
ENDIF.
ENDCASE.
thanks
mrutyun
2006 Jun 19 2:33 PM
Hi
HIDE command is used when you are working with Interactive reports. When you click on any particular field of your internal table, then that value is stored in the header line of the internal table.
loop at itab.
write itab-field1.
HIDE field1.
endloop.
Now when you double click on field1, the internal table header will contain the value which can be used in the AT Line-selection event.
Regards
Navneeth
2006 Jun 19 2:55 PM
HI Vijay,
Check this out
<b>HIDE</b>
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Constants in the HIDE Area.
Effect
The contents of f related to the current output line are stored. If this line is selected, f is filled automatically with the stored value.
The selection can be made using:
AT LINE-SELECTION
AT PFx
AT USER-COMMAND
READ LINE
You do not have to output the field with WRITE in order to be able to store its value.
The HIDE statement does not support structures that contain tables (deep structures).
System fields that are particularly useful in interactive reporting are listed in the system fields for lists documentation.
Note
You cannot save lines or components of lines of an internal table that is addressed using a field symbol to the HIDE area. (Compare the ASSIGNING addition to the READ and LOOP statements). Assign the contents of the line or component to a global variable and save this instead.
Exceptions
Non-Catchable Exceptions
Cause: The field is too long for HIDE.
Runtime Error: HIDE_FIELD_TOO_LARGE
Cause: Cannot apply HIDE to a table line or component of a table line.
Runtime Error: HIDE_ILLEGAL_ITAB_SYMBOL
Cause: HIDE is not possible in a local field.
Runtime Error: HIDE_NO_LOCAL: HIDE
Cause: HIDE is not possible on an empty page.
Runtime Error: HIDE_ON_EMPTY_PAGE
Regards,
Santosh
2006 Jun 19 2:56 PM
Hi Vijay,
Please refer to the code below. I have explained how hide works in my own words.
REPORT ztest.
<b>*Consider a scenario when the user asks for Material Details(Table : MARA )
*displayed in one List and based on the Material selected he wants the corresponding
*Storage Location Data for that Material (Table : MARD ).</b>
TYPES : BEGIN OF tp_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
mbrsh TYPE mara-mbrsh,
matkl TYPE mara-matkl,
END OF tp_mara.
TYPES : BEGIN OF tp_marc,
matnr TYPE marc-matnr,
werks TYPE marc-werks,
pstat TYPE marc-pstat,
ekgrp TYPE marc-ekgrp,
dispr TYPE marc-dispr,
END OF tp_marc.
TYPES : BEGIN OF tp_mard,
matnr TYPE mard-matnr,
werks TYPE mard-werks,
lgort TYPE mard-lgort,
lfgja TYPE mard-lfgja,
labst TYPE mard-labst,
umlme TYPE mard-umlme,
END OF tp_mard.
DATA : t_mara TYPE STANDARD TABLE OF tp_mara,
t_marc TYPE STANDARD TABLE OF tp_marc,
t_mard TYPE STANDARD TABLE OF tp_mard,
wa_mara TYPE tp_mara,
wa_marc TYPE tp_marc,
wa_mard TYPE tp_mard.
DATA : w_werks TYPE werks .
SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : p_matnr FOR wa_mara-matnr NO INTERVALS .
PARAMETERS : p_mtart TYPE mara-mtart .
SELECTION-SCREEN END OF BLOCK blck1.
START-OF-SELECTION.
<b>*Collecting the material details form Table MARA</b>
SELECT matnr
mtart
mbrsh
matkl
FROM mara
INTO TABLE t_mara
UP TO 200 ROWS
WHERE matnr IN p_matnr AND
mtart EQ p_mtart.
END-OF-SELECTION.
<b>*Now I am Dispalying the Material Details in the Primary List</b> CLEAR wa_mara.
LOOP AT t_mara INTO wa_mara.
IF sy-tabix EQ 1.
FORMAT INTENSIFIED ON.
FORMAT COLOR COL_KEY.
WRITE : /5(16) 'Material Number'.
FORMAT COLOR COL_NORMAL.
WRITE : 24(15) 'Material Type',
40(18) 'Industry Sector',
58(18) 'Material Group' .
ENDIF.
FORMAT INTENSIFIED OFF.
FORMAT COLOR COL_KEY.
WRITE : /5(16) wa_mara-matnr.
FORMAT COLOR COL_NORMAL.
WRITE : 24(15) wa_mara-mtart,
40(18) wa_mara-mbrsh,
58(18) wa_mara-matkl.
<b>*You can assume some sort of buffer is created in the memory and the values of
* wa_mara-matnr are put into it when you use the HIDE command</b>
HIDE wa_mara-matnr.
ENDLOOP.
<b>*Now when user Double clicks a line (AT LINE-SELECTION event is trigerred) and
*the line contents of the line selected and the contents buffered using
*command interact and the value for the hidden variable is got into the variable
*refrenced using the HIDE command i.e.. wa_mara-matnr in our case</b>
AT LINE-SELECTION.
IF sy-lsind = 1.
FORMAT INTENSIFIED ON.
WRITE: 'Plant Data for Material ' COLOR COL_NORMAL,
35 wa_mara-matnr COLOR COL_TOTAL.
REFRESH t_marc.
<b>* Now I have the value of the Material in my hidden variable wa_mara-matnr
* Based on this I am selecting the Storage Location Data</b>
SELECT matnr
werks
pstat
ekgrp
dispr
FROM marc
INTO TABLE t_marc
WHERE matnr = wa_mara-matnr.
CLEAR wa_marc.
FORMAT INTENSIFIED OFF.
FORMAT COLOR COL_NORMAL.
LOOP AT t_marc INTO wa_marc.
IF sy-tabix EQ 1.
FORMAT INTENSIFIED ON.
FORMAT COLOR COL_NORMAL.
WRITE : /24(6) 'Plant',
30(22) 'Maintenance status',
52(20) 'Purchasing Group',
72(27) 'Material: MRP profile'.
ENDIF.
WRITE : /24(6) wa_marc-werks,
30(22) wa_marc-pstat,
52(20) wa_marc-ekgrp,
72(27) wa_marc-dispr.
CLEAR wa_marc.
ENDLOOP.
SKIP 5.
FORMAT INTENSIFIED ON.
WRITE: 'Storage Data for Material ' COLOR COL_NORMAL,
35 wa_mara-matnr COLOR COL_TOTAL.
REFRESH t_mard.
SELECT matnr
werks
lgort
lfgja
labst
umlme
FROM mard
INTO TABLE t_mard
WHERE matnr = wa_mara-matnr.
CLEAR wa_mard.
FORMAT COLOR COL_NORMAL.
<b>* Display the Storage Location Data in the Secondary List</b>
LOOP AT t_mard INTO wa_mard.
IF sy-tabix EQ 1.
FORMAT INTENSIFIED ON.
FORMAT COLOR COL_NORMAL.
WRITE : /24(6) 'Plant',
30(20) 'Storage Location',
50(12) 'Fiscal Year',
62(15) 'Valuated stock',
77(20) 'Stock in transfer'.
ENDIF.
WRITE : /24(6) wa_mard-werks,
30(20) wa_mard-lgort,
50(12) wa_mard-lfgja,
62(15) wa_mard-labst,
77(20) wa_mard-labst.
ENDLOOP.
ENDIF.Regards,
Arun Sambargi.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |