Application Development and Automation 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: 
Read only

select statement

Former Member
0 Likes
621

i have extracted some data from mchb and mara using inner join then after it i am using other select staement to extract data from mseg-menge on matnr of mseg and internal table-matnr, its taking long time and not fetching the values properly for menge by comparing matnr of mseg and internal table can any one help me

6 REPLIES 6
Read only

Former Member
0 Likes
590

Hi

U should use all key fields of MCHB tables to read MSEG, the problem is these fields are not key fields for MSEG, to the select can be very slow. U should check if these fields are using in a index or try to create an index for them in MSEG.

Max

Read only

Former Member
0 Likes
590

use the follwoing function module to get the material documents from MSEG.

loop at your previous internal table

call FM 'MATERIAL_READ_DOCUMENTS'

Endloop.

otherwise fetch the fields lgort, werks, charg from MCHB

while fetching data from MSEG

put the where condition of MATNR = IT_DATA-MATNR and

LGORT = IT_data-LGORT and

WERKS = IT_DATA-WERKS and

CHARG = IT_DATA-CHARG.

Read only

Former Member
0 Likes
590

i am finding the same probelm when i have added matnr werks lgort charg in whre condition of the select st to extract menge from mseg the system ishanging on plz give me the solultion for this

Read only

0 Likes
590

Hi

Your report should work when no user works, if you want to prevent sombody changes the quantities while you report's working, you should trigger the locks for MSEG table.

Max

Read only

0 Likes
590

Can you try with the function module ''MATERIAL_READ_DOCUMENTS''

Read only

Former Member
0 Likes
590

i doesnt know how to use the function moudle what are the import and export parametes tables data need to be given.