Skip to Content
0
Former Member
Dec 13, 2006 at 06:37 AM

Simple Program - - - - Help

32 Views

I am Farooq, working on ABAP in a Tulip IT from abt 3 months & this is my first assignment & frst company on ABAP. Above all, I am the Only guy working on ABAP in the whole company. So I have lot of trouble at work.Pllzz look into the Program below. I am unable to get the data from MKPF table. all SELECT statements r correct. I am getting the data when I debugged. But am unable to show it in the list (Output). May be some Problem in the code after "PERFORM TOP_OF_PAGE. & ULINE."

Plzz gothru this Prog below...

&----


*& Report ZMMSF01

*&

&----


*&

*&

&----


REPORT ZMMSF01 NO STANDARD PAGE HEADING LINE-SIZE 137.

INITIALIZATION.

TABLES : MKPF,

MSEG.

DATA : BEGIN OF ITAB OCCURS 1000,

  • MBLNR LIKE MSEG-MBLNR, "Material Document

MBLNR LIKE MKPF-MBLNR, "Material Document

BUDAT LIKE MKPF-BUDAT, "Posting Date in the Document

  • MATNR LIKE MSEG-MATNR, "Material

  • BWART LIKE MSEG-BWART, "Movement Type

  • WERKS LIKE MSEG-WERKS, "Supplying Plant

  • UMWRK LIKE MSEG-UMWRK, "Receiving plant

END OF ITAB.

DATA : BEGIN OF ITAB1 OCCURS 1000,

  • MBLNR LIKE MKPF-MBLNR, "Material Document

MATNR LIKE MSEG-MATNR, "Material

BWART LIKE MSEG-BWART, "Movement Type

WERKS LIKE MSEG-WERKS, "Supplying Plant

UMWRK LIKE MSEG-UMWRK, "Receiving plant

END OF ITAB1.

DATA : BEGIN OF ITFINAL OCCURS 1000,

MBLNR LIKE MKPF-MBLNR, "Material Document

  • MBLNR LIKE MSEG-MBLNR, "Material Document

MATNR LIKE MSEG-MATNR, "Material

BWART LIKE MSEG-BWART, "Movement Type

WERKS LIKE MSEG-WERKS, "Supplying Plant

UMWRK LIKE MSEG-UMWRK, "Receiving plant

BUDAT LIKE MKPF-BUDAT, "Posting Date in the Document

END OF ITFINAL.

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

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS: S_MBLNR FOR MKPF-MBLNR, "Material Document

S_MATNR FOR MSEG-MATNR, "Material

S_BUDAT FOR MKPF-BUDAT, "Posting Date in the Document

S_BWART FOR MSEG-BWART, "Movement Type

S_WERKS FOR MSEG-WERKS, "Supplying Plant

S_UMWRK FOR MSEG-UMWRK. "Receiving plant

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN.

ULINE.

START-OF-SELECTION.

SELECT MBLNR BUDAT

FROM MKPF

INTO TABLE ITAB

WHERE MBLNR IN S_MBLNR.

**BREAK-POINT.

if not ITAB[] is INITIAL.

SELECT MATNR BWART WERKS UMWRK

INTO TABLE ITAB1

FROM MSEG FOR ALL ENTRIES in ITAB

WHERE MBLNR EQ ITAB-MBLNR

AND MATNR in S_MATNR

AND BWART in S_BWART

AND WERKS in S_WERKS

AND UMWRK in S_UMWRK.

ENDIF.

*BREAK-POINT.

perform top_of_page.

ULINE.

LOOP AT ITab. "Problem Starts here

ITFINAL-mblnr = ITAB-mblnr.

ITFINAL-budat = ITAB-budat.

ITFINAL-MATNR = ITAB1-MATNR.

ITFINAL-BWART = ITAB1-BWART.

ITFINAL-WERKS = ITAB1-WERKS.

ITFINAL-UMWRK = ITAB1-UMWRK.

APPEND ITFINAL.

CLEAR ITFINAL.

ENDLOOP. "Ends Here

Loop at ITFINAL.

WRITE :/ '|',(20) ITFINAL-MBLNR, "Material Document

'|',(25) ITFINAL-MATNR, "Material Number

'|',(17) ITFINAL-WERKS, "Supplying Plant

'|',(17) ITFINAL-UMWRK, "Receiving plant

'|',(14) ITFINAL-BWART, "Movement Type

'|',(25) ITFINAL-BUDAT,'|'. "Date Last Goods Movmnt

ULINE.

ENDLOOP.

&----


*& Form top_of_page

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM top_of_page .

ULINE.

WRITE:/ '|',(20) 'Material Document' COLOR 4,

'|',(25) 'Material Number' COLOR 4,

'|',(17) 'Supplying Plant' COLOR 4,

'|',(17) 'Receiving plant' COLOR 4,

'|',(14) 'Movement Type' COLOR 4,

'|',(25) 'Date Last Goods Movmnt' COLOR 4,'|'.

ENDFORM. " top_of_page