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: 

help in reports

Former Member
0 Kudos

i have to create a report that gives existing stock for the material.report should have sub-total of stock for each storage location and grand total of stock in a plant.

i used IT events like at end of and at last for totals.

can anyone give me steps and tables for the above report.thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

First fetch the data from table MARD with Plant Stlocation Material and the stocks like LABST etc. into an internal Table ITAB

For all entries of this ITAB for this Material,Plant,Stlocation combination fetch the data from MSEG and MKPF table based on the different movement types(BWART) and consider the Receipts and issues for that material and calculate the stocks.

reward if sueful

regards,

ANJI

2 REPLIES 2

Former Member
0 Kudos

Hi,

First fetch the data from table MARD with Plant Stlocation Material and the stocks like LABST etc. into an internal Table ITAB

For all entries of this ITAB for this Material,Plant,Stlocation combination fetch the data from MSEG and MKPF table based on the different movement types(BWART) and consider the Receipts and issues for that material and calculate the stocks.

reward if sueful

regards,

ANJI

Former Member
0 Kudos

Hi,

check this program it will help u.

REPORT ZINTERACTIVE_FINAL.

INCLUDE <COLOR>.

TABLES:SFLIGHT,SPFLI,SBOOK.

TYPES: BEGIN OF STRUCTURE,

CITYFROM LIKE SPFLI-CITYFROM,

CITYTO LIKE SPFLI-CITYTO,

CARRID LIKE SPFLI-CARRID ,

CONNID LIKE SPFLI-CONNID,

FLDATE LIKE SFLIGHT-FLDATE,

SEATSMAX LIKE SFLIGHT-SEATSMAX,

SEATSOCC LIKE SFLIGHT-SEATSOCC,

END OF STRUCTURE.

DATA : ITAB TYPE STRUCTURE OCCURS 0.

DATA: WA TYPE STRUCTURE.

DATA:LINE LIKE SY-LILLI.

SELECT SPFLICITYFROM SPFLICITYTO SPFLICARRID SPFLICONNID

SFLIGHTFLDATE SFLIGHTSEATSMAX SFLIGHT~SEATSOCC INTO (WA-CITYFROM,

WA-CITYTO,WA-CARRID,WA-CONNID,WA-FLDATE,WA-SEATSMAX,WA-SEATSOCC) FROM

SPFLI INNER JOIN SFLIGHT ON SPFLIMANDT = SFLIGHTMANDT AND SPFLI~CARRID

= SFLIGHTCARRID AND SPFLICONNID = SFLIGHT~CONNID.

*GET SPFLI.

*SELECT * FROM SPFLI.

  • MOVE-CORRESPONDING SPFLI TO WA.

*ENDSELECT.

*GET SFLIGHT.

*SELECT * FROM SFLIGHT.

  • MOVE-CORRESPONDING SFLIGHT TO WA.

*ENDSELECT.

APPEND WA TO ITAB.

ENDSELECT.

SET PF-STATUS 'GRUND'.

SET TITLEBAR 'GRU' .

SORT ITAB BY CITYFROM CITYTO CARRID CONNID SEATSOCC.

*LOOP AT ITAB INTO WA.

*WRITE:/ WA-CARRID,WA-CONNID,WA-CITYFROM,WA-CITYTO.

*ENDLOOP.

LOOP AT ITAB INTO WA.

AT FIRST.

WRITE:/ 'START OUTPUT INTERNAL TABLE'.

ULINE.

ENDAT.

AT NEW CITYFROM.

WRITE:/ WA-CITYFROM COLOR COL_KEY.

ENDAT.

AT NEW SEATSOCC.

WRITE:/10 WA-CARRID,WA-CONNID,WA-FLDATE COLOR COL_NORMAL,

WA-SEATSOCC COLOR COL_NORMAL,WA-SEATSMAX COLOR COL_NORMAL.

HIDE : WA-CONNID, WA-CARRID, WA-FLDATE.

ENDAT.

AT END OF CONNID.

SUM.

WRITE:/ WA-SEATSOCC COLOR COL_TOTAL UNDER WA-SEATSOCC,

WA-SEATSMAX COLOR COL_TOTAL.

  • ULINE .

ENDAT.

AT END OF CARRID.

SUM.

  • ULINE.

WRITE:/ WA-SEATSOCC COLOR COL_TOTAL INTENSIFIED UNDER

WA-SEATSOCC, WA-SEATSMAX COLOR COL_TOTAL INTENSIFIED.

ULINE.

ENDAT.

ENDLOOP.

CLEAR WA.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

WRITE:/' AIRLINE ', WA-CARRID ,

/'FLIGHT CONNECTION',WA-CONNID ,

/'FLIGHT DATE',WA-FLDATE.

ULINE.

SELECT * FROM SBOOK WHERE CARRID = WA-CARRID AND CONNID = WA-CONNID

AND FLDATE = WA-FLDATE .

WRITE 😕 SBOOK-BOOKID,SBOOK-CUSTOMID,SBOOK-ORDER_DATE.

ENDSELECT.

CLEAR WA.

WHEN 2.

LINE = SY-LILLI.

IF LINE > 4.

LINE = LINE - 4.

WRITE:/ 'SELECTED LINE NUMBE:',LINE.

ENDIF.

ENDCASE.

rgds,

bharat.