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 QUERY PROBLEM

Former Member
0 Likes
617

Dear all,

I need to fetch data from MSEG table by passing eblen and where movement type is 105, 106, 124, 125.

i use the select query like.

but here i am not geting all the data which is matched with 105 movement type. In the sence one record is missing.

please help me on this.........

IF IT_EKKO IS NOT INITIAL.

SELECT MBLNR

BWART

MATNR

WERKS

LGORT

CHARG

SHKZG

MENGE

ERFME

FROM MSEG

INTO TABLE IT_MSEG

FOR ALL ENTRIES IN IT_EKKO

WHERE EBELN = IT_EKKO-EBELN

AND BWART IN ('105', '106', '124', '125').

ENDIF.

Best Regards

margani

5 REPLIES 5
Read only

Former Member
0 Likes
596

Dear All,

Is there any logic for this select query other than this. or any modification is need for this select query..

plz help me

Regards

margani

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
596

Hi,

Select all key fields of the table MSEG

IF IT_EKKO IS NOT INITIAL.
SELECT MBLNR
"add these two flds to ur query
MJAHR
ZEILE
"add 
BWART
MATNR
WERKS
LGORT
CHARG
SHKZG
MENGE
ERFME
FROM MSEG
INTO TABLE IT_MSEG
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN = IT_EKKO-EBELN
AND BWART IN ('105', '106', '124', '125').
ENDIF

Thanks

- Always Learner

Read only

Former Member
0 Likes
596

Hi,

I dont see a reason for the data to be selcted for all other values except for one, just that either there is no data for it in DB table, or is it that latter there is some delete statements.

Have you debug your select query?

Regards,

Sana.

Read only

0 Likes
596

Hi dear,

IN my dev server MSEG table has data. i saw both in data base table and in my debug mode.

Read only

Former Member
0 Likes
596

This is a duplicate post - you have your answer in the other one.

Rob