Skip to Content
0
Former Member
Jan 17, 2006 at 02:49 PM

Regarding report

11 Views

Hi all,

I need some help for this report.

The report is syntactically correct, it is not compiling why i dont know. I need the reply urgent.

How many ways are there to retrieve the data from database.

Or else give the other way.Is there any other ways to retrieve the data.And also i want the information regarding how to use 'IF' conditions & system variables in this same report.

&----


*& Report ZSTOCKDETAILS4 *

*& *

&----


*& *

*& *

&----


REPORT zstockdetails4 NO STANDARD PAGE HEADING

LINE-SIZE 100

LINE-COUNT 60(3).

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

  • tables declaration *

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

TABLES : mara, "general material data

marc, "plant data for material

mard, "storage location data for material

makt. "material description

*

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

  • internal table declaration *

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

*

DATA : BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

werks LIKE marc-werks,

lgort LIKE mard-lgort,

labst LIKE mard-labst,

maktx LIKE makt-maktx,

END OF itab.

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

  • selection screen *

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

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_matnr FOR mara-matnr OBLIGATORY,

s_werks FOR marc-werks.

SELECTION-SCREEN END OF BLOCK b1.

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

  • start-of-selection *

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

START-OF-SELECTION.

SELECT matnr

FROM mara

INTO TABLE itab

WHERE matnr IN s_matnr.

SELECT werks

FROM marc

APPENDING TABLE itab

WHERE matnr = itab-matnr

AND werks IN s_werks.

SELECT lgort labst

FROM mard

APPENDING TABLE itab

WHERE matnr = itab-matnr.

SELECT maktx

FROM makt

APPENDING TABLE itab

WHERE matnr = itab-matnr.

*CALL FUNCTION 'SPELL_AMOUNT'

  • EXPORTING

  • AMOUNT =

  • CURRENCY = ' '

  • FILLER = ' '

  • LANGUAGE = SY-LANGU

  • IMPORTING

  • IN_WORDS =

    • EXCEPTIONS

    • NOT_FOUND = 1

    • TOO_LARGE = 2

    • OTHERS = 3

  • .

  • *IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    *ENDIF.

    • DATA: tot_lgort TYPE labst,

    • tot_werks TYPE labst,

    • tot TYPE labst.

    *

    • LOOP AT t_out.

    *

    • AT NEW werks.

    • NEW-PAGE.

    • ENDAT.

    • NEW-LINE.

    LOOP AT itab.

    WRITE :/ sy-vline, itab-werks,

    15 itab-lgort,

    35 itab-matnr,

    52 itab-maktx,

    70 itab-labst, 100 sy-vline.

    ENDLOOP.

    *

    • tot_lgort = tot_lgort + t_out-labst.

    • tot_werks = tot_werks + t_out-labst.

    • tot = tot + t_out-labst.

    *

    • AT END OF lgort.

    • ULINE.

    • WRITE : / 'THE SUBTOTAL IS', 70 tot_lgort.

    • CLEAR tot_lgort.

    • ENDAT.

    *

    • AT END OF werks.

    • ULINE.

    • WRITE : / 'THE SUBTOTAL IS', 70 tot_werks.

    • CLEAR tot_werks.

    • ENDAT.

    *

    • AT LAST.

    • WRITE : / 'THE GRAND TAOTAL IS', 70 tot.

    • ENDAT.

    • ENDLOOP.

    *

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

    • TOP-OF-PAGE *

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

    *

    TOP-OF-PAGE.

    ULINE.

    WRITE : sy-vline, 'PLANT',

    15 'SLOCATION',

    32 'MATERIAL',

    56 'DESCRIPT',

    80 'STOCK', 100 sy-vline.

    ULINE.