Skip to Content

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

How to Validate.

After inserting the Process Order and plant range. its show the range of a process order. but when we click on process order it's shows all RESB-MATNR value of all process order(All range). How to validate? Plz help soon.

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.

Moderator message :Duplicate post locked.

Edited by: Vinod Kumar on Jun 16, 2011 12:09 PM

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