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: 

classical reports

Former Member
0 Kudos

hi, can any one tell me where i can get some classical report examples to practice.

5 REPLIES 5

former_member196299
Active Contributor
0 Kudos

hi Krishna ,

Welcome to SDN.

Open Transaction ABAPDOCU and you will be able to see many samples for reporting .

All the best !

Ranjita

former_member235056
Active Contributor
0 Kudos

Hi,

WELCOME TO SDN.

Must say, a very good start indeed.

<a href="http://abapcode.blogspot.com/">http://abapcode.blogspot.com/</a>

Regards,

Ameet

Former Member
0 Kudos

Check the transactions DWDM and LIBS. You have lots of examples here.

Former Member
0 Kudos

see this sample code

REPORT YSG_MATSTKREPT LINE-SIZE 125.

  • LINE-COUNT 50(5).

&----


*& DATA DECLARATION *

&----


TABLES: MARA, "GENERAL MASTER DATA

MARC, "PLANT DATA FOR MATERIAL

MARD, "STORAGE LOCATION DATA FOR MATERIAL

MAKT. "MATERIAL DESCRIPTION

DATA: BEGIN OF I_MARA OCCURS 0,

MATNR LIKE MARA-MATNR,"MATERIAL NUMBER

END OF I_MARA.

DATA: BEGIN OF I_MARC OCCURS 0,

MATNR LIKE MARC-MATNR,"MATERIAL NUMBER

WERKS LIKE MARC-WERKS,"PLANT

END OF I_MARC.

DATA: BEGIN OF I_MAKT OCCURS 0,

MATNR LIKE MAKT-MATNR,"MATERIAL NUMBER

MAKTX LIKE MAKT-MAKTX,"MATERIAL DESCRIPTION

END OF I_MAKT.

DATA: BEGIN OF I_MARD OCCURS 0,

MATNR LIKE MARD-MATNR,"MATERIAL NUMBER

WERKS LIKE MARD-WERKS,"PLANT

LGORT LIKE MARD-LGORT,"STORAGE LOCATION

LABST LIKE MARD-LABST,"VALUATED STOCK WITH UNRESTRICTED USE

END OF I_MARD.

DATA: BEGIN OF I_OUT OCCURS 0,

MATNR LIKE MARC-MATNR,

WERKS LIKE MARC-WERKS,

MAKTX LIKE MAKT-MAKTX,

LGORT LIKE MARD-LGORT,

LABST LIKE MARD-LABST,

END OF I_OUT.

DATA : TOT TYPE I, " TOT - TOTAL STOCK

PLSTK TYPE I, " PLSTK - PLZNT WISE STOCK

X TYPE C. "FLAG

&----


*& S E L E C T I O N - S C R E E N *

&----


SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR .

SELECTION-SCREEN END OF BLOCK B1.

*&----


**& I N I T I A L I Z A T I O N *

*&----


*

*INITIALIZATION.

*

    • S_MATNR-SIGN = 'I'.

    • S_MATNR-OPTION = 'EQ'.

  • S_MATNR-LOW = 'M-12'.

  • S_MATNR-HIGH = 'M-18'.

&----


*& S T A R T - O F - S E L E C T I O N *

&----


START-OF-SELECTION.

SELECT MATNR WERKS FROM MARC

INTO TABLE I_MARC

WHERE MATNR IN S_MATNR .

SELECT MATNR WERKS LGORT LABST FROM MARD

INTO TABLE I_MARD

FOR ALL ENTRIES IN I_MARC

WHERE MATNR = I_MARC-MATNR

AND WERKS = I_MARC-WERKS.

SELECT MATNR MAKTX FROM MAKT INTO TABLE I_MAKT

FOR ALL ENTRIES IN I_MARC

WHERE MATNR = I_MARC-MATNR.

LOOP AT I_MARC.

MOVE I_MARC-MATNR TO I_OUT-MATNR.

MOVE I_MARC-WERKS TO I_OUT-WERKS.

READ TABLE I_MAKT WITH KEY MATNR = I_MARD-MATNR.

MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.

LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR

AND WERKS = I_MARC-WERKS.

MOVE I_MARD-LGORT TO I_OUT-LGORT.

MOVE I_MARD-LABST TO I_OUT-LABST.

APPEND I_OUT.

ENDLOOP.

CLEAR I_OUT.

ENDLOOP.

&----


*& T O P - O F - P A G E *

&----


TOP-OF-PAGE.

WRITE:/ 'DATE:' ,SY-DATUM.

FORMAT COLOR 4 INTENSIFIED OFF.

WRITE:/2 'PLANT',

9 'STG.LOC',

20 'MATERIAL.NO.',

55 'DESCRIPTION',

88 'STOCK'.

&----


*& E N D - O F - P A G E *

&----


END-OF-PAGE.

WRITE: / SY-ULINE,

/100 'PAGNO: ',SY-PAGNO,

SY-ULINE.

&----


*& E N D -- O F -- S E L E C T I O N *

&----


END-OF-SELECTION.

SORT I_OUT ASCENDING BY WERKS LGORT.

LOOP AT I_OUT.

WRITE:/ SY-ULINE,SY-VLINE,

I_OUT-WERKS,SY-VLINE,

I_OUT-LGORT,SY-VLINE,

I_OUT-MATNR,SY-VLINE,

I_OUT-MAKTX,SY-VLINE.

AT END OF LABST.

WRITE: I_OUT-LABST,SY-VLINE.

ENDAT.

TOT = TOT + I_OUT-LABST.

AT END OF LABST.

WRITE : TOT, SY-VLINE.

ENDAT.

*AT END OF WERKS.

*NEW-PAGE.

*ENDAT.

AT LAST.

FORMAT COLOR 7 INTENSIFIED OFF.

WRITE : /87 'TOTAL STOCK = ',TOT.

ENDAT.

ENDLOOP.

also refer these quick links for various sample ABAP codes

http://www.guidancetech.com/people/holland/sap/abap/

http://www.geocities.com/SiliconValley/Grid/4858/sap/ABAPCode/index.htm

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

http://www.erpgenie.com/abap/example_code.htm

<b>best thing for you to learn is via transactio ABADOCU, or else in the sdn forums on your left side you simply type classical reports and serach in the forums rather than all.</b>

regards,

srinivas

<b>*reward for useful answers*</b>