Application Development and Automation 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: 
Read only

classical reports

Former Member
0 Likes
862

can i get coding for classical reports

6 REPLIES 6
Read only

amit_khare
Active Contributor
0 Likes
811

Check this link -

http://www.sap-img.com/abap.htm

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
811

Hi

try this code:

REPORT zREPORTS NO STANDARD PAGE HEADING.

  • MESSAGE-ID 38 LINE-SIZE 132 LINE-COUNT 65(3).

*----


  • PROGRAM # Z_ABAP_STD_PGM

  • DATE WRITTEN # 31.12.9999

  • SYSTEM # ADC

  • TYPE # REPORT

  • AUTHOR # Your Name

*----


  • TITLE # GL item list

  • PURPOSE # List all GL items

  • COPIED FROM # Zrxxxxxx

*----


  • DESCRIPTION

  • Read through all GL documents and list the values " Description

*

*----


  • include some common code

*include ZIaxxxxx. " If you are including any includes or prgms

*----


----


  • Parameters and select options OR SELECTION SCREEN

----


----


  • Tables *

----


----


  • Internal Tables *

----


  • work areas

*data: begin of itab occurs 0,

  • line(100) type c,

*end of itab.

  • an internal table

DATA: BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBAP-VBELN,

MATNR LIKE VBAP-MATNR,

POSNR LIKE VBAP-POSNR,

ERDAT LIKE VBAK-ERDAT,

ERNAM LIKE VBAK-ERNAM,

AUART LIKE VBAK-AUART,

END OF ITAB.

DATA: BEGIN OF ITAB1 OCCURS 0,

VBELN LIKE VBKD-VBELN,

POSNR LIKE VBKD-POSNR,

KONDA LIKE VBKD-KONDA,

KDGRP LIKE VBKD-KDGRP,

END OF ITAB1.

DATA: BEGIN OF ITAB2 OCCURS 0,

VBELN LIKE VBAP-VBELN,

MATNR LIKE VBAP-MATNR,

POSNR LIKE VBAP-POSNR,

ERDAT LIKE VBAK-ERDAT,

ERNAM LIKE VBAK-ERNAM,

AUART LIKE VBAK-AUART,

KONDA LIKE VBKD-KONDA,

KDGRP LIKE VBKD-KDGRP,

END OF ITAB2.

----


  • Variables *

----


DATA: XPOS LIKE SY-TABIX,

PAGE_NO LIKE SY-PAGNO, " the page no.

NO_LINES TYPE P, " no of lines

REC_NO LIKE SY-TABIX. " Record number

DATA: V1_MATNR TYPE VBAP-MATNR,

V1_VBELN TYPE VBAP-VBELN,

V1_POSNR TYPE VBAP-POSNR.

----


  • Constants *

----


DATA:

YES(1) TYPE C VALUE 'X',

NO(1) TYPE C VALUE ' '.

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

  • Start of Program *

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

----


  • INITIALIZATION. *

----


INITIALIZATION.

----


----


  • SELECTION-SCREEN *

----


AT SELECTION-SCREEN.

----


----


  • START-OF-SELECTION *

----


START-OF-SELECTION.

----


  • initialise values

  • first = yes.

  • Getting data

PERFORM GET_DATA.

PERFORM GET_DATA1.

  • populate internal tables

  • perfrom fill_itab.

----


  • END-OF-SELECTION *

----


END-OF-SELECTION.

----


LOOP AT ITAB.

ITAB2-VBELN = ITAB-VBELN.

ITAB2-MATNR = ITAB-MATNR.

ITAB2-POSNR = ITAB-POSNR.

ITAB2-ERDAT = ITAB-ERDAT.

ITAB2-ERNAM = ITAB-ERNAM.

ITAB2-AUART = ITAB-AUART.

READ TABLE ITAB1 WITH KEY VBELN = ITAB-VBELN

POSNR = ITAB-POSNR.

IF SY-SUBRC = 0.

ITAB2-KONDA = ITAB1-KONDA.

ITAB2-KDGRP = ITAB1-KDGRP.

ENDIF.

APPEND ITAB2.

ENDLOOP.

SORT ITAB2 BY VBELN POSNR MATNR.

WRITE : / 'vbeln', 15 'posnr', 25 'matnr', 40 'erdat',

50 'ernam', 60 'auart', 70 'konda', 80 'kdgrp'.

LOOP AT ITAB2.

AT NEW VBELN.

WRITE : / ITAB2-VBELN.

ENDAT.

WRITE: ITAB2-POSNR,

ITAB2-MATNR,

ITAB2-ERDAT,

ITAB2-ERNAM,

ITAB2-AUART,

ITAB2-KONDA,

ITAB2-KDGRP.

ENDLOOP.

  • Print Report Footers

  • Write the end of the report

----


  • TOP-OF-PAGE *

----


TOP-OF-PAGE.

----


  • write report header

  • write out the column headings.

----


  • TOP-OF-PAGE-DURING-LINE-SELECTION *

----


  • top-of-page-during-line-selection.

----


  • write report header

  • write out the column headings.

----


  • END-OF-PAGE *

----


*end-of-page.

----


  • write report footers

----


  • AT LINE-SELECTION *

----


AT LINE-SELECTION.

----


----


  • AT PFXX *

----


AT PFXX.

----


----


  • AT USER-COMMAND *

----


AT USER-COMMAND.

----


  • process screen selection

CASE SY-UCOMM.

WHEN 'UP '.

WHEN OTHERS.

ENDCASE.

*

----


  • process formxxxxx *

----


FORM FORMXXXXX.

  • do something

ENDFORM.

*

&----


*& Form get_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA .

*select matnr vbeln posnr into (itab_matnr, itab_vbeln, v1_posnr)

  • from vbap.

*endselect.

*

SELECT P~VBELN

P~MATNR

P~POSNR

K~ERDAT

K~ERNAM

K~AUART

INTO TABLE ITAB

FROM VBAP AS P INNER JOIN VBAK AS K

ON PVBELN = KVBELN.

  • inner join vbkd as d

  • on dvbeln = pvbeln

  • and dposnr = pposnr.

ENDFORM. " get_data

&----


*& Form get_data1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA1 .

SELECT VBELN

POSNR

KONDA

KDGRP

INTO TABLE ITAB1

FROM VBKD

FOR ALL ENTRIES IN ITAB

WHERE VBELN = ITAB-VBELN

AND POSNR = ITAB-POSNR.

ENDFORM. " get_data1

Hope it helps.

>>>reward points if useful<<<

Read only

Former Member
0 Likes
811

Hi,

You will find all the program in ABAPDOCU

This is a Transaction code, enter this in the command box, you will find all the examples from there

Regards

Sudheer

Read only

Former Member
0 Likes
811

Classical reports is a normal report.

The output u get in the output screen using 'WRITE' statement is the classical report which uses EVENTS.

Read only

Former Member
0 Likes
811

Hi,

classical report is a simple program.

this below line is an example for classical report.

write:/ 'welocme'.

rgds,

bharat.

Read only

Former Member
0 Likes
811

I depends on the way u like to get the output

1. To print a horizontal line-> write sy-uline(180). -u will get horizontal line up to 180 characters

2. To print a vertical line -> write sy-vline.

3. To print vertical line at 50 th position -> write 50 sy-vline.

I think this will solve ur question.

Reward points if helpful.

Karthick.