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: 

Problem with HIDE statement

Former Member
0 Kudos

Hi All,

i have been working with an interactive report. while coding for the event AT LINE SELECTION i have used HIDE statement to capture the contents of the row on which click either on basic or secondary list. but the hide statment is not capturing the content of the record which i click. i have debugged the program, when the cursor comes to HIDE statement it is passing into some standard programs and still it is not holding the contents of the record on which i click.

below is the coding, can anyone let me know where the coding went wrong.

TABLES: VBAK, " Sales Document: Header Data

VBAP, " Sales Document: Item Data

VBKD, " Sales Document: Business Data

VBEP. " Sales Document: Schedule Line Data

TYPES BEGIN OF TY_VBAK.

INCLUDE STRUCTURE VBAK.

TYPES END OF TY_VBAK.

TYPES BEGIN OF TY_VBAP.

INCLUDE STRUCTURE VBAP.

TYPES END OF TY_VBAP.

TYPES BEGIN OF TY_VBKD.

INCLUDE STRUCTURE VBKD.

TYPES END OF TY_VBKD.

TYPES BEGIN OF TY_VBEP.

INCLUDE STRUCTURE VBEP.

TYPES END OF TY_VBEP.

DATA: IT_VBAK TYPE STANDARD TABLE OF TY_VBAK,

WA_VBAK TYPE TY_VBAK,

IT_VBAP TYPE STANDARD TABLE OF TY_VBAP,

WA_VBAP TYPE TY_VBAP,

IT_VBKD TYPE STANDARD TABLE OF TY_VBKD,

WA_VBKD TYPE TY_VBKD,

IT_VBEP TYPE STANDARD TABLE OF TY_VBEP,

WA_VBEP TYPE TY_VBEP.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG, " SALES ORGANIZATION

S_VTWEG FOR VBAK-VTWEG, " DISTRIBUTION CHANNEL

S_SPART FOR VBAK-SPART, " DIVISION

S_ERDAT FOR VBAK-ERDAT. " OBJECT CREATED DATE

PARAMETERS: P_ERNAM TYPE VBAK-ERNAM. " OBJECT CREATED PERSON

SELECTION-SCREEN END OF BLOCK B1.

TOP-OF-PAGE.

WRITE:/ 'THIS IS SALES DOCUMENT HEADER DATA'.

TOP-OF-PAGE DURING LINE-SELECTION.

IF SY-LSIND EQ 1.

WRITE:/ 'THIS IS SALES DOCUMENT ITEM DETAILS'.

ELSEIF SY-LSIND EQ 2.

WRITE:/ 'THIS IS SALES DOCUMENT BUSINESS DATA'.

ELSE.

WRITE:/ 'THIS IS SALES DOCUMENT SCHEDULING LINE DATA'.

ENDIF.

START-OF-SELECTION.

SELECT *

FROM VBAK

INTO TABLE IT_VBAK

WHERE VKORG IN S_VKORG

AND VTWEG IN S_VTWEG

AND SPART IN S_SPART

AND ERDAT IN S_ERDAT

AND ERNAM EQ P_ERNAM.

LOOP AT IT_VBAK INTO WA_VBAK.

WRITE:/ WA_VBAK-VBELN HOTSPOT, WA_VBAK-ERNAM, WA_VBAK-VBTYP, WA_VBAK-AUART,

WA_VBAK-SUBMI, WA_VBAK-VKORG, WA_VBAK-VTWEG, WA_VBAK-VKGRP,

WA_VBAK-VKBUR, WA_VBAK-KNUMV, WA_VBAK-KTEXT, WA_VBAK-BSTNK,

WA_VBAK-BSARK, WA_VBAK-BSTZD, WA_VBAK-KUNNR, WA_VBAK-KOSTL.

HIDE: WA_VBAK-VBELN.

ENDLOOP.

AT LINE-SELECTION.

IF SY-LSIND EQ 1.

IF NOT IT_VBAK IS INITIAL.

SELECT *

FROM VBAP

INTO TABLE IT_VBAP

WHERE VBELN EQ WA_VBAK-VBELN.

ENDIF.

LOOP AT IT_VBAP INTO WA_VBAP.

WRITE:/ WA_VBAP-VBELN HOTSPOT, WA_VBAP-POSNR, WA_VBAP-MATNR, WA_VBAP-MATWA,

WA_VBAP-PMATN, WA_VBAP-CHARG, WA_VBAP-MATKL, WA_VBAP-ARKTX,

WA_VBAP-PRODH, WA_VBAP-ZWERT, WA_VBAP-ZMENG, WA_VBAP-MEINS,

WA_VBAP-ABDAT, WA_VBAP-ABSFZ, WA_VBAP-KDMAT, WA_VBAP-KBVER.

HIDE: WA_VBAP-VBELN.

ENDLOOP.

ENDIF.

IF SY-LSIND EQ 2.

IF NOT IT_VBAP IS INITIAL.

SELECT *

FROM VBKD

INTO TABLE IT_VBKD

WHERE VBELN EQ WA_VBAP-VBELN.

ENDIF.

LOOP AT IT_VBKD INTO WA_VBKD.

WRITE:/ WA_VBKD-VBELN HOTSPOT, WA_VBKD-POSNR, WA_VBKD-KONDA, WA_VBKD-KDGRP,

WA_VBKD-BZIRK, WA_VBKD-PLTYP, WA_VBKD-INCO2, WA_VBKD-KURRF,

WA_VBKD-VALDT, WA_VBKD-PRSDT, WA_VBKD-FKDAT, WA_VBKD-STCUR,

WA_VBKD-FPLNR, WA_VBKD-BSTDK, WA_VBKD-AKWAE, WA_VBKD-AKPRZ.

HIDE: WA_VBKD-VBELN.

ENDLOOP.

ENDIF.

IF SY-LSIND EQ 3.

IF NOT IT_VBKD IS INITIAL.

SELECT *

FROM VBEP

INTO TABLE IT_VBEP

WHERE VBELN EQ WA_VBKD-VBELN.

ENDIF.

LOOP AT IT_VBEP INTO WA_VBEP.

WRITE:/ WA_VBEP-VBELN HOTSPOT, WA_VBEP-POSNR, WA_VBEP-ETENR, WA_VBEP-ETTYP,

WA_VBEP-EDATU, WA_VBEP-EZEIT, WA_VBEP-WMENG, WA_VBEP-BMENG,

WA_VBEP-LMENG, WA_VBEP-MEINS, WA_VBEP-BDDAT, WA_VBEP-BDART,

WA_VBEP-VBELE, WA_VBEP-POSNE, WA_VBEP-ETENE, WA_VBEP-BSART.

ENDLOOP.

ENDIF.

in the output iam getting the basic list and the subsequent secondary lists but in the secondary lists iam having the data of the last record of the basic list.

let me know why the HIDE statement is not getting triggered.

Thanks,

BJR.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Alternatively the clicked record it will get stored on system variable SY-LISEL. The whole record it will get sotred in the fileld.

For your logic purpose you can split or you can use offsetting. Check and let me know for further assitance.

8 REPLIES 8

Former Member
0 Kudos

Hi,

Alternatively the clicked record it will get stored on system variable SY-LISEL. The whole record it will get sotred in the fileld.

For your logic purpose you can split or you can use offsetting. Check and let me know for further assitance.

0 Kudos

Hi,

yes the content get stored in SY-LISEL, but i want to know what went wrong with HIDE statement and how i can better use of HIDE statement.

BJR.

0 Kudos

Could be helpful to you if you can format your code in a readable format using code tags.

0 Kudos

Hi,

iam trying to format the code in a readable way by using the code tags.

but after also the code appears as continuous text as it is appearing in my initial post.

Thanks,

BJR.

0 Kudos

Hi,

Try by this, in Report statement increase your line-size.


Report <name> Line-size 1000.

I hope this resolves You Issue.

Regards,

Raghava Channooru

0 Kudos

Hi,

Line-size addition solved the problem.

now iam able to get the details of the record which i clicked.

can i know how this addition made the difference.

Thanks all for your replies.

BJR.

0 Kudos

Hi,

Hide statement stores according to sy-linno.

The Problem is with the empty fields in your Work area. When they are empty it goes for next line and 'write:/' statement will not trigger next line . so, the next work area prints on the same sy-lino which is already reserved for previous one .

You can read Documentation in that



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.

You can try this piece of code for your understanding,



DATA:
  w_hide LIKE sy-index.
  DO 20 TIMES.
   w_hide = sy-index.
    WRITE w_hide.
    NEW-LINE.
    HIDE w_hide.
  ENDDO.

AT LINE-SELECTION.
  IF sy-lsind = 1.
    WRITE w_hide.
  ENDIF.

Hope you understand.

Regards,

Raghava Channooru

Pawan_Kesari
Active Contributor
0 Kudos

refer program DEMO_LIST_HIDE .

Here secondary list is created in event AT USER-COMMAND not in AT LINE-SELECTION.