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

error in SELECT Statement

Former Member
0 Likes
1,385

Hi friends,

I want to pass the date to MCHB table to my internal table in module pool program.

PROCESS BEFORE OUTPUT.

select * from MCHB into table etab .

( error is : u201Cwhereu201D missing )

If I am using :

select * from MCHB into table etab where matnr = mchb-matnr.

(Error is : unprocessed component with POSIT)

plz guide me the correct select statement.

Thanking you.

Regards,

Subash

1 ACCEPTED SOLUTION
Read only

jaideepsharma
Active Contributor
0 Likes
1,281

Hi,

I guess you will have to write the query in a module. You can write abap code in the PBO. Try to create a module in PBO and write your query there.

KR Jaideep,

9 REPLIES 9
Read only

jaideepsharma
Active Contributor
0 Likes
1,282

Hi,

I guess you will have to write the query in a module. You can write abap code in the PBO. Try to create a module in PBO and write your query there.

KR Jaideep,

Read only

Former Member
0 Likes
1,280

Hi,

I think the select statement itself is wrong. How you are getting the material field. Is it from the selection screen. THen it should be

select * from mchb into table ..... where matnr = s_matnr (or) p_matnr.

Regards

Ramesh Sundaram

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,280

want to pass the date to MCHB table to my internal table in module pool program ==> Which date ?

In where clause you have used , mchb-matnr , from where this is coming?

Read only

Former Member
0 Likes
1,280

hi

your 2nd query will not work

select * from MCHB into table etab where matnr = mchb-matnr.

because here matnr and mchb-matnr are the same fields

you should use a variable or some thing else in place of mchb-matnr

and ya try to write this code in a module under PBO

Read only

Former Member
0 Likes
1,280

select * from MCHB into table etab where matnr = mchb-matnr.

this statement is wrong because you where matnr = with same table mchb matnr that is incorect compare matnr of different table then MCHB

Read only

Former Member
0 Likes
1,280

Hi,

Itu2019s very simple

1) Create any module or just uncomment that module like in the PBO

MODULE STATUS_0101.

2) Then Write ur code in that module

SELECT * FROM MCHB INTO TABLE ETAB.

Salil....

Edited by: salil chavan on May 28, 2009 10:09 AM

Read only

Former Member
0 Likes
1,280

You are using module pool program. it seems to me that you would be having the material number on the module pool screen and for that material you need to fetch the date.

If user can keep on changing the material and you need corresponding date then move the logic under PAI. If your material cannot be changed by user then you can do it in PBO.

Process before output.

  module get_date.


Module get_date.
  select * from mchb into table etab where matnr = mchb-matnr. "Assuming MCHB-MATNR is the                                                                                
"screen field OR

  select * from mchb into table etab.
endmodule.

ETAB has same structure as that of MCHB.

Hope this will help.

Read only

Former Member
0 Likes
1,280

hi,

try this

select matnr werks field3 field4 .....

into table itab

from MCHB

where matnr in l_matnr .

Read only

Former Member
0 Likes
1,280

you cannot write a Query directly in Process Before Output(PBO).

You have to create a module and write the query in that.