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: 

Need help in report

Former Member
0 Kudos

hi friends

iam doing a report, which has to display the list of material number and descrption and vendor

number and name which have unrestricted stock as on today and the material which have transaction

done in last year .

and i dont have specs only i have table names ,,mkpf and mseg can anybody help me in this how ro do

it.....

i am creating a itab

TYPES: BEGIN OF T_OUT,

MATNR LIKE MARD-MATNR,

WERKS LIKE MARD-WERKS,

LGORT LIKE MARD-LGORT,

LABST LIKE MARD-LABST,

MTART LIKE MARA-MTART,

MAKTX LIKE MAKT-MAKTX,

END OF T_OUT.

by using inner joinn retriving matnr but ..how to go in mkpf and what field should i take

SELECT MARD~MATNR

MARD~WERKS

MARD~LGORT

MARD~LABST

MARA~MTART

FROM MARD

INNER JOIN MARA ON

MARAMATNR = MARDMATNR

INNER JOIN MAKT ON

MAKTMATNR = MARDMATNR

INTO TABLE ITAB

WHERE MARD~MATNR IN S_MATNR

AND MARA~MTART IN S_MTART

AND SPRAS = SY-LANGU.

i think iam wrong... this is the first report i got .

thks

regards

farukh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Farukh,

MKPF and MSEG table are linked on fields MBLNR ( Material document) and MJAHR ( Year).

You need to select data from table MKPF for all entries you found in your previous query (Join of MARA, MARD and MAKT ) with restriction on MKPF-BUDAT or any other field which is required as per business rules.

Suggestion: You should not use join on large volume tables in SAP. MSEG is table which grows quickly in production enviroment.

1 REPLY 1

Former Member
0 Kudos

Hi Farukh,

MKPF and MSEG table are linked on fields MBLNR ( Material document) and MJAHR ( Year).

You need to select data from table MKPF for all entries you found in your previous query (Join of MARA, MARD and MAKT ) with restriction on MKPF-BUDAT or any other field which is required as per business rules.

Suggestion: You should not use join on large volume tables in SAP. MSEG is table which grows quickly in production enviroment.