Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to Validate.

Moderator message: please choose more descriptive subject lines for your posts.

It's is showing all the detail of Resb-Matnr by selection-Options not by parametrs.

Please help <removed by moderator>.

TABLES: aufk, afko, makt, resb.

DATA: BEGIN OF itab OCCURS 0,

aufnr LIKE aufk-aufnr,

werks like aufk-werks,

erdat LIKE aufk-erdat,

*auart LIKE aufk-auart,

END OF itab.

DATA desc LIKE makt-maktx.

data movp like mbew-verpr.

DATA: BEGIN OF itab2 OCCURS 0,

aufnr LIKE afko-aufnr,

gmein LIKE afko-gmein,

gamng LIKE afko-gamng,

plnbez LIKE afko-plnbez,

END OF itab2.

DATA: BEGIN OF itab3 OCCURS 0,

*aufnr LIKE resb-aufnr,

enmng LIKE resb-enmng,

bdmng LIKE resb-bdmng,

matnr LIKE resb-matnr,

END OF itab3.

SELECT-OPTIONS: process FOR aufk-aufnr,

plant for aufk-werks.

TOP-OF-PAGE.

FORMAT COLOR = 1.

WRITE: 'P O No',10 'PLant', 20 'DATE', 45 'UOM', 60 'MATIRIAL NO.', 90 'DESCRIPTION', 120 'ORDERED QTY'. "150 'COMPONENT', 170 'DESCRIPTION', 200 ' REQ.QTY', 220 ' ISSUED.QTY' ,240 'PLANT'.

ULINE.

START-OF-SELECTION.

SELECT aufnr werks erdat

FROM aufk

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE aufnr IN process

AND werks IN PLANT.

SELECT aufnr gmein gamng plnbez

FROM afko

INTO CORRESPONDING FIELDS OF TABLE itab2

FOR ALL ENTRIES IN itab

WHERE aufnr = itab-aufnr.

SELECT enmng bdmng matnr

FROM resb

INTO CORRESPONDING FIELDS OF TABLE itab3

FOR ALL ENTRIES IN itab

WHERE aufnr = itab-aufnr.

LOOP AT itab.

LOOP AT itab2 WHERE aufnr = itab-aufnr.

SELECT SINGLE maktx INTO desc FROM makt WHERE matnr = itab2-plnbez.

WRITE: / itab-aufnr, 20 itab-erdat ,10 itab-werks, 45 itab2-gmein, 60 itab2-plnbez, 90 desc, 110 itab2-gamng.

CLEAR itab-AUFNR.

ENDLOOP.

ENDLOOP.

CLEAR itab-AUFNR.

AT LINE-SELECTION.

REFRESH ITAB.

ULINE.

IF SY-LSIND = 1.

FORMAT COLOR = 2.

  • TOP-OF-PAGE.

WRITE: 'Material' , 25 'Material desc' , 80'Moving Price' .

ULINE.

LOOP AT itab3.

SELECT SINGLE maktx INTO desc FROM makt WHERE matnr = itab3-matnr.

SELECT SINGLE verpr INTO movp FROM mbew WHERE matnr = itab3-matnr.

WRITE: / ITab3-matnr, 25 desc , 80 movp.

endloop.

endif.

  • endif.

  • endloop.

*AT LINE-SELECTION.

  • REFRESH Itab3.

*

  • ULINE.

  • IF SY-LSIND = 1.

  • FORMAT COLOR = 1.

  • WRITE: 'COMPONENT', 20 'DESCRIPTION', 40 ' REQ.QTY', 60 ' ISSUED.QTY'.

  • ULINE.

*

  • LOOP AT itab3 WHERE aufnr = itab-aufnr.

  • SELECT SINGLE maktx INTO desc FROM makt WHERE matnr = itab3-matnr.

  • WRITE: / itab3-matnr, 20 desc ,40 itab3-enmng, 60 itab3-bdmng .",10 itab-werks, 45 itab2-gmein, 60 itab2-plnbez, 90 desc, 110 itab2-gamng.

    • IF sy-subrc EQ 0.

    • SELECT SINGLE maktx INTO desc FROM makt WHERE matnr = itab3-matnr.

    • WRITE: itab3-matnr, 20 MAKT, 40 itab3-ENMNG, 60 itab3-BDMNG.

    • ENDIF.

**endloop.

*

    • SELECT SINGLE maktx INTO desc FROM makt WHERE matnr = itab3-aufnr.

    • WRITE: / itab3-aufnr, 20 itab3-enmng, 40 itab3-bdmng, 60 itab3-matnr.

*endloop.

*endif.

    • ENDLOOP.

Edited by: Thomas Zloch on Jun 10, 2011 12:46 PM

Former Member
Not what you were looking for? View more on this topic or Ask a question