In ABAP HIDE is an important technique and is used in interactive reporting. The HIDE statement defines the information that needs to be passed to the subsequent lists.
We will see a very simple example of the HIDE statement to understand the concept. In this example we will select the Header data of all the sales order into an internal table. We will then display only the customer numbers. Once the user clicks on the customer number the Following information will be displayed as the Secondary list.
CUSTOMER NUMBER PURCHASE ORDER NUMBER SALES ORDER NUMBER SALES ORGANIZATION DISTRIBUTION CHANNEL DIVISION
To achieve this we will hide the above mentioned fields using the HIDE statement. The Program is given below.
REPORT ZEX_HIDE . *&---------------------------------------------------------------------* *& ABAPLOVERS THE HIDE STATEMENT *&---------------------------------------------------------------------*
* Tables TABLES VBAK. * Internal table DATA int_VBAK LIKE VBAK OCCURS 100 WITH HEADER LINE. * Processing data START-OF-SELECTION.
SELECT * FROM VBAK INTO TABLE INT_VBAK.
LOOP AT int_vbak. WRITE / int_vbak-kunnr HOTSPOT ON. HIDE: int_VBAK-VBELN, int_VBAK-KUNNR, int_VBAK-BSTNK, int_VBAK-VKORG, int_VBAK-VTWEG, int_VBAK-SPART.
ENDLOOP.
* Secondary List AT LINE-SELECTION. WRITE: / 'Sales Order Details', int_VBAK-KUNNR, int_VBAK-BSTNK, int_VBAK-VBELN, int_VBAK-VKORG, int_VBAK-VTWEG,
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
No comments:
Post a Comment