Skip to Content

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

urgent

i hv 5 table EKKO,EKPO,MAKT,EKBE,LFA1.

I hv been used iner join in b/w ekko n ekpo n find 5 field n has been print.

after that i want to use makt for fetch single field,ekbe for fetch 2nd single field n lfa1 to fetch 3rd single field.

so how can i fetch with the use of select statement.

my problem is

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

Pending Purchase Order Requirement Specification:

1.Fields on selection screen (input screen) :

Vendor Code From to , Period From to , Material Code from to.

Field in the output List :

P.O. No, PO Date , Vendor Name , Vendor code, Material Code , Material Description , PO Qty, Qty received , Balance Qty.

n i hv done in se 38

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

TABLES: EKKO,EKPO,LFA1,MAKT,EKBE.

DATA: BEGIN OF ITAB OCCURS 0,

lifnr LIKE EKKO-LIFNR, "vendor code

AEDAT LIKE EKKO-AEDAT, "period,DATE ON WHICH THE RECORD CREATES

matnr LIKE EKPO-MATNR, "material code,MATERIAL NO

ebeln LIKE EKKO-EBELN , "po no,PURCHAGE DOCU NO

MENGE LIKE EKPO-MENGE, "Po quantity

BAL_QTY LIKE EKBE-MENGE, "bal qty

NAME1 LIKE LFA1-NAME1, "vendor name

MAKTX LIKE MAKT-MAKTX, "material description

QTY_REC LIKE EKBE-MENGE, "qty rec

END OF ITAB.

data itab1 like table of lfa1 with header line.

data itab2 like table of makt with header line.

data itab3 like table of ekbe with header line.

SELECT-OPTIONS lifnr FOR EKKO-LIFNR.

SELECT-OPTIONS AEDAT FOR EKKO-AEDAT.

SELECT-OPTIONS matnr FOR EKPO-MATNR.

select * from makt into table itab2.

itab-maktx = itab2-MAKTX.

select * from ekbe into table itab3.

itab-qty_rec = itab3-MENGE.

select BKLIFNR BKAEDAT BKEBELN BRMATNR BR~MENGE

INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM EKKO AS BK

INNER JOIN EKPO AS BR ON BKEBELN = BREBELN

where

bk~lifnr in lifnr.

write: / 'PO-NO PO-DATE VENDOR-NAME VENDOR-CODE MATERIAL-CODE MATERIAL-DESCRIPTION PO-QTY QTY-RECEIVED BALANCE-QTY'.

loop at ITAB .

write : / ITAB-ebeln,' ' ,ITAB-AEDAT,ITAB-NAME1 ,' ',ITAB-lifnr,' ',ITAB-matnr,' ',ITAB-MENGE,' ',ITAB-MENGE,' ',ITAB-MENGE.

endloop.

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