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 querry

Former Member
0 Likes
696

Hi Friends,

Can I code my select querry like this.

SELECT ponumber

inv_no

vendor_no

podate

poamount

typeofmat

buyer

porecdate

inv_amount

status

FROM zpo_input INTO CORRESPONDING FIELDS OF TABLE

lt_final WHERE porecdate GT bsis-budat and porecdate LT bsis-bldat

ponumber GT bsik-zuonr AND ponumber LT bseg-hzuon.

Regards,

Line

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
670

if bsis-budat, bsis-bldat, bsik-zuonr, bseg-hzuon are the input field then you can write the select query as you mentioned but if you are trying to match the data with table fields then you have to go for inner join with those tables.

regards

shiba dutta

5 REPLIES 5
Read only

Former Member
0 Likes
670

Hi Line,

Yes u can write it.

Regards

SAB

Read only

Former Member
0 Likes
670

Hi,

Yes you can write code like this.

There is only one AND missing in your code.

SELECT ponumber

inv_no

vendor_no

podate

poamount

typeofmat

buyer

porecdate

inv_amount

status

FROM zpo_input INTO CORRESPONDING FIELDS OF TABLE

lt_final WHERE porecdate GT bsis-budat and porecdate LT bsis-bldat

<b>AND</b>

ponumber GT bsik-zuonr AND ponumber LT bseg-hzuon.

Regards,

Atish

Read only

Former Member
0 Likes
670

The following fields bsis-budat, bsis-bldat, bsik-zuonr, bseg-hzuon are only the input fields on the screen it is not referening to any table. Just what ever the values entered in the screen are captured in the following fields.

Regards,

Line

Read only

0 Likes
670

If the field name is bsis-bldat, .......so on.. are named like that in screen fields, then it fetches all records.

for testing purpose.. put a break point on select query and check the bsis-bldat and all these fields r carrying the values entered in screen or not?

Regards

SAB

Read only

Former Member
0 Likes
671

if bsis-budat, bsis-bldat, bsik-zuonr, bseg-hzuon are the input field then you can write the select query as you mentioned but if you are trying to match the data with table fields then you have to go for inner join with those tables.

regards

shiba dutta