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: 

Why Hide Command?

Former Member
0 Kudos

Hi Experts,

Why do we use HIDE command, it consums memory when we hide data.

In place of Hide we can use

1. sy-lisel

2. Get cursor

3. Read line

etc. which don't consum memory.

Please give me reason, where it is necessary.

Regards

Rajiv singh.

7 REPLIES 7

Former Member

former_member225631
Active Contributor
0 Kudos

Yes, I have used get cursor

Former Member
0 Kudos

HI.

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.

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.

*********************************************************************************

GET CURSOR

Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.

*********************************************************************************

READ LINE

Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.

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.

Reward all helpfull answers.

Regards.

Jay

Former Member
0 Kudos

Hi ,

HIDE help's u to store the values for field's and move from one list to another list interactively u use event at line selection ...............here u won't provide push button ..............

as u said with that statement's u need main under at user-command , which comes under classical list's ....

Thank's&Regard's

Bhaskar Rao.M

Former Member
0 Kudos

Hi,

Regards, Dieter

0 Kudos

Hi,

I don't need example for Hide or Read. I want to know reason to use Hide while it takes too much memory, in place of this why we not used read or get.

Regards

Rajiv singh.

0 Kudos

Hi,

it's a way for interactiv reporting!

If you need only to show any data, You don't need it.

I give you an example to show the effects of hide.

Regards, Dieter