Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Author: Tejas Jani
Submitted: 19/04/2007

Description

This Sample Code Illustrates the Use of HIDE Statement to create a NON-ALV Interactive Report upto 3 Levels for SD module. 

Error rendering macro 'code': Invalid value specified for parameter 'lang'
* 3 Level Interactive Report *
*&---------------------------------------------------------------------*
*& Report  ZTEJ_INTAB1                                                 *
*&                                                                     *
*&---------------------------------------------------------------------*
REPORT  ztej_intab1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE HEADING.

*TABLES DECLARATION

TABLES : kna1, vbak, vbap.

*SELECT OPTIONS

SELECT-OPTIONS: cust_no FOR kna1-kunnr.


*INITIALIZATION

INITIALIZATION.

  cust_no-low = '01'.
  cust_no-high = '5000'.
  cust_no-sign = 'I'.
  cust_no-option = 'BT'.
  APPEND cust_no.


*SELECTION SCREEN VALIDATION

AT SELECTION-SCREEN ON cust_no.

  LOOP AT SCREEN.
    IF cust_no-low < 1 OR cust_no-high > 5000.
      MESSAGE e001(ztj1).
    ENDIF.
  ENDLOOP.


*BASIC LIST SELECTION

START-OF-SELECTION.

  SELECT kunnr name1 ort01 land1 INTO
         (kna1-kunnr, kna1-name1,kna1-ort01,kna1-land1)
         FROM kna1
         WHERE kunnr IN cust_no.

    WRITE:/1 sy-vline,
          kna1-kunnr UNDER 'CUSTOMER NO.' HOTSPOT ON,
          16 sy-vline,
          kna1-name1 UNDER 'NAME',
          61 sy-vline,
          kna1-ort01 UNDER 'CITY',
          86 sy-vline,
          kna1-land1 UNDER 'COUNTRY',
          103 sy-vline.

    HIDE: kna1-kunnr.

  ENDSELECT.

  ULINE.

*SECONDARY LIST ACCESS

AT LINE-SELECTION.

  IF sy-lsind = 1.
    PERFORM sales_ord.
  ENDIF.
  IF sy-lsind = 2.
    PERFORM item_det.
  ENDIF.


*TOP OF PAGE

TOP-OF-PAGE.

  FORMAT COLOR 1.

  WRITE : 'CUSTOMER DETAILS'.

  FORMAT COLOR 1 OFF.


  ULINE.

  FORMAT COLOR 3.

  WRITE : 1 sy-vline,
          3 'CUSTOMER NO.',
          16 sy-vline,
          18 'NAME',
          61 sy-vline,
          63 'CITY',
          86 sy-vline,
          88 'COUNTRY',
          103 sy-vline.

  ULINE.

  FORMAT COLOR 3 OFF.


*TOP OF PAGE FOR SECONDARY LISTS

TOP-OF-PAGE DURING LINE-SELECTION.

*TOP OF PAGE FOR 1ST SECONDARY LIST

  IF sy-lsind = 1.

    ULINE.

    FORMAT COLOR 1.

    WRITE : 'SALES ORDER DETAILS'.
    ULINE.
    FORMAT COLOR 1 OFF.


    FORMAT COLOR 3.

    WRITE : 1 sy-vline,
            3 'CUSTOMER NO.',
            16 sy-vline,
            18 'SALES ORDER NO.',
            40 sy-vline,
            42 'DATE',
            60 sy-vline,
            62 'CREATOR',
            85 sy-vline,
            87 'DOC DATE',
            103 sy-vline.
    ULINE.

  ENDIF.

  FORMAT COLOR 3 OFF.

*TOP OF PAGE FOR 2ND SECONDARY LIST

  IF sy-lsind = 2.

    ULINE.

    FORMAT COLOR 1.

    WRITE : 'ITEM DETAILS'.

    ULINE.

    FORMAT COLOR 1 OFF.

    FORMAT COLOR 3.

    WRITE : 1 sy-vline,
            3  'SALES ORDER NO.',
            40 sy-vline,
            42 'SALES ITEM NO.',
            60 sy-vline,
            62 'ORDER QUANTITY',
            103 sy-vline.
    ULINE.

  ENDIF.

  FORMAT COLOR 3 OFF.

*END OF PAGE

END-OF-PAGE.

  ULINE.
  WRITE :'USER :',sy-uname,/,'DATE :', sy-datum, 85 'END OF PAGE:',
  sy-pagno.
  SKIP.


*&---------------------------------------------------------------------*
*&      Form  SALES_ORD
*&
*&      FIRST SECONDARY LIST FORM
*&---------------------------------------------------------------------*

FORM sales_ord .

  SELECT kunnr vbeln erdat ernam audat INTO
         (vbak-kunnr, vbak-vbeln, vbak-erdat, vbak-ernam, vbak-audat)
         FROM vbak
         WHERE kunnr = kna1-kunnr.

    WRITE:/1 sy-vline,
            vbak-kunnr UNDER 'CUSTOMER NO.' HOTSPOT ON,
            16 sy-vline,
            vbak-vbeln UNDER 'SALES ORDER NO.' HOTSPOT ON,
            40 sy-vline,
            vbak-erdat UNDER 'DATE',
            60 sy-vline,
            vbak-ernam UNDER 'CREATOR',
            85 sy-vline,
            vbak-audat UNDER 'DOC DATE',
            103 sy-vline.
    HIDE : vbak-vbeln.
  ENDSELECT.

  ULINE.


ENDFORM.                    " SALES_ORD
*&---------------------------------------------------------------------*
*&      Form  ITEM_DET
*&
*&      SECOND SECONDARY LIST FORM
*&---------------------------------------------------------------------*
FORM item_det .

  SELECT vbeln posnr kwmeng INTO
         (vbap-vbeln, vbap-posnr, vbap-kwmeng)
         FROM vbap
         WHERE vbeln = vbak-vbeln.

    WRITE : /1 sy-vline,
              vbap-vbeln UNDER 'SALES ORDER NO.',
              40 sy-vline,
              vbap-posnr UNDER 'SALES ITEM NO.',
              60 sy-vline,
              vbap-kwmeng UNDER 'ORDER QUANTITY',
              103 sy-vline.

  ENDSELECT.

  ULINE.
ENDFORM.                    " ITEM_DET