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

Reg: select query

Former Member
0 Likes
536

Hi all ,

I have requirement of selecting the data from z table ZWM_TBL_MAT_ALOG where plant is equal to selection screen plant and there is a exclude field which if empty then that record need to be considered .Afte getting the data into internal table itab_table3 .Then correspoding to the material number and plant there are many batch numbers we need to move those records into an internal table itab_mchb.but the problem is that the entries in the z table are as follows .

plant mat type mat no. exclude

1241 COUP *

1241 ZFIP *

1241 ZFIP P9905

now when the second select query is executed then in mchb table there are no material no... with ' * '.So the batch numbers corresponding to plant material combination 1241 ZFIP P9905

are only retrieved but for the other 2 records which are below

1241 COUP *

1241 ZFIP *

batch numbers are not retrieved .Any pointers or any sample code .Thanx in advance .I have below pasted the two select queries

*--Querying the table3 for plant entered on selection screen and

*--getting material no. and type

SELECT werks mtart matnr exclude INTO TABLE

itab_table3 FROM ZWM_TBL_MAT_ALOG WHERE werks IN s_werks

AND exclude EQ ' '.

*--Filtering out the records which are obtained from table3

IF sy-subrc EQ 0.

IF NOT itab_table3[] IS INITIAL.

SELECT matnr werks charg clabs FROM MCHB

INTO TABLE itab_mchb

FOR ALL ENTRIES IN itab_table3

WHERE matnr = itab_table3-matnr

AND werks in s_werks.

ENDIF.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
415

Hi

Try to use the wild card cahracters also in the selection then check the result.

Thanks & Regards,

Chandralekha.

2 REPLIES 2
Read only

Former Member
0 Likes
416

Hi

Try to use the wild card cahracters also in the selection then check the result.

Thanks & Regards,

Chandralekha.

Read only

Former Member
0 Likes
415

hi in the second internal table try to replace the * with the % may be it is useful for that