Skip to Content
0
Former Member
Apr 22, 2010 at 11:04 AM

Problem with HIDE statement

32 Views

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.