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: 

Interactive report

Former Member
0 Kudos

Can anyone help me about interactive with 3 levels ( No ALV Report )

Thanks

Bab

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check the below program :

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

Thanks

Seshu

3 REPLIES 3

Former Member
0 Kudos

hi,

&----


*& Report ZSALESORDERDETAILS_ASHOK

*&

&----


*&

*&

&----


REPORT ZSALESORDERDETAILS_ASHOK

NO STANDARD PAGE HEADING

LINE-SIZE 50

LINE-COUNT 35(5).

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

*data declaration.

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

tables :vbak.

tables: VBAP.

DATA : TVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE,

TVBAP LIKE VBAP OCCURS 0 WITH HEADER LINE,

TEMP TYPE p decimals 5 VALUE '0.0' ,

A type i,

FIELDNAME TYPE STRING,

FIELDVALUE TYPE VBAP-VBELN.

DATA G_CB.

  • ----------------------------------------------------------------------

selection-screen begin of block screen1 with frame title TEXT-001.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN COMMENT /32(35) COMM1.

SELECTION-SCREEN ULINE /27(35).

SELECTION-SCREEN SKIP.

SELECT-OPTIONS TVBELN FOR VBAK-VBELN.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN ULINE.

SELECTION-SCREEN COMMENT /30(50) COMM2.

SELECTION-SCREEN ULINE /27(40).

SELECTION-SCREEN SKIP.

SELECT-OPTIONS TERDAT FOR VBAK-ERDAT.

SELECTION-SCREEN SKIP.

selection-screen end of block screen1.

*----


*Initialization

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

Initialization .

TVBELN-low = 4000.

TVBELN-high = 5000.

TVBELN-option = 'BT'.

TVBELN-sign = 'I'.

APPEND TVBELN.

TERDAT-low = '19960202'.

TERDAT-high = '20020302' .

APPEND TERDAT.

*----


AT SELECTION-SCREEN .

SELECT *

FROM VBAK

INTO TABLE TVBAK

WHERE VBELN IN TVBELN AND erdat IN Terdat .

IF sy-subrc ne 0.

MESSAGE 'ENTERED ORDER NOT FOUND' type 'E'.

ENDIF.

*----


START-OF-SELECTION.

REFRESH TVBAK.

SELECT *

FROM VBAK

INTO TABLE TVBAK

WHERE VBELN IN TVBELN AND ERDAT IN TERDAT.

*----


END-OF-SELECTION.

LOOP AT TVBAK.

WRITE: /2 SY-VLINE,

TVBAK-VBELN INPUT ON ,

15 SY-VLINE,TVBAK-ERDAT hotspot on,

30 SY-VLINE, 35 TVBAK-ERNAM,

46 SY-VLINE,

g_cb AS CHECKBOX.

ENDLOOP.

A = SY-LINCT - SY-LINNO - 1.

  • SKIP A .

RESERVE A LINES.

*----


AT SELECTION-SCREEN OUTPUT.

comm1 ='SELECT SALES ORDER RANGE'.

comm2 ='SELECT SALES ORDER CREATION DATE'.

*----


TOP-OF-PAGE.

ULINE.

WRITE /15 ' SALES ORDER REPORT ' COLOR = 1 .

ULINE.

WRITE : /7 ' VBELN ' COLOR = 5 ,

19 ' ERDAT ' COLOR = 5,

34 ' ERNAM ' COLOR = 5.

ULINE.

*----


END-OF-PAGE.

IF SY-LSIND = 0.

ULINE.

WRITE : /2 'NUMBER OF LINE IN THIS PAGE = ', SY-LINNO.

SKIP.

WRITE: /30 'PAGE NUMBER = ', SY-PAGNO.

ULINE.

ELSEIF SY-LSIND = 1.

ULINE.

WRITE : /12 'TOTAL PRICE = ' ,TEMP.

CLEAR TEMP.

SKIP.

WRITE : /30 'PAGE NUMBER = ', SY-PAGNO.

ULINE.

ENDIF.

*----


at line-selection.

GET CURSOR FIELD FIELDNAME VALUE FIELDVALUE.

IF FIELDNAME = 'TVBAK-VBELN'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = FIELDVALUE

IMPORTING

OUTPUT = FIELDVALUE.

WINDOW STARTING AT 60 2 ENDING AT 120 25.

IF SY-LSIND = 1.

SELECT

*

FROM VBAP

INTO TABLE TVBAP

WHERE VBELN EQ FIELDVALUE.

LOOP AT TVBAP.

TEMP = TEMP + TVBAP-NETPR.

WRITE : /2 SY-VLINE, TVBAP-matnr,

17 SY-VLINE,TVBAP-VBELN,

30 SY-VLINE,TVBAP-NETPR currency 'IN',

49 SY-VLINE.

ENDLOOP.

ULINE.

A = SY-LINCT - SY-LINNO - 1.

  • SKIP A .

RESERVE A LINES.

ENDIF.

ELSEIF SY-LSIND = 2.

call transaction 'MM01' .

ENDIF.

*----


TOP-OF-PAGE DURING LINE-SELECTION.

WRITE : / SY-ULINE,

/7 ' DETAIL OF GIVEN SALES ORDER ' COLOR = 5,

/ SY-ULINE,

/4 'MATNR',

22 'VBELN',

35 'NETPR',

/ SY-ULINE.

*----


<b>Rewars point</b>

Regards

Ahok kumar

Former Member
0 Kudos

Check the below program :

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

Thanks

Seshu