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_options

rnb86
Participant
0 Likes
1,107

Hi freinds,

i am joining lfa1 and lfb1 tables, and want to get an output out of tese 2 tables.

i declared lifnr as select-options.

i want to display all the vendors details that are entered by the user at runtime in the selection-screen and print all the vendors details present in that range in the output.

But, when i try it, i am not able to get the vendor details in the given range.i am getting the general list, like as it is present in the database table.

can you suggest me the process to capture the vendors list in the given range.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,033

<b>If Data is not there in the Table Then How SAP will show more than that ? If u think u may have more data , then check ur Join conditions itself.</b>

<b>But, when i try it, i am not able to get the vendor details in the given range.i am getting the general list, like as it is present in the database table.</b>

9 REPLIES 9
Read only

Former Member
0 Likes
1,034

<b>If Data is not there in the Table Then How SAP will show more than that ? If u think u may have more data , then check ur Join conditions itself.</b>

<b>But, when i try it, i am not able to get the vendor details in the given range.i am getting the general list, like as it is present in the database table.</b>

Read only

0 Likes
1,033

Hi prabhu,

i took 3 fields from lfa1 and 2 fields from lfb1 tables. The join condition is correct. I am getting the values for fields from both lfa1 and lfb1 in the report output.

The output is same even if i enter values in selection-screen or not.

how to write code to capture the values entered in the selection screen and display the result in the report output.l

Read only

Former Member
0 Likes
1,033

check ur select query . u might have used inner join to fetch the data.

Like this.

select * into corresponding fields of table IT from lfa1 inner join lfb1 on lfa1lifr = lfb1lifnr where lifnr in <select-option field name>.

check whether u have specified the select-option field name correctly in where condition.

Read only

0 Likes
1,033

Hi,

my select query is:

SELECT lfa1lifnr lfa1name1 lfa1adrnr lfa1telf1 lfa1~telfx

lfb1bukrs lfb1zterm

INTO TABLE itab

FROM lfa1 INNER JOIN lfb1 ON lfa1lifnr EQ lfb1lifnr

WHERE lifnr IN vend.

But when i execute this , the error says that "COLUMN NAME LIFNR HAS TWO MEANINGS".

I think my select query right?? It hapend previously too.i did not change anything now.

Read only

0 Likes
1,033

Hi,

Try this:

In Where clause :WHERE lfa1lifnr IN vend (or lfb1ifnr ).

As lifnr is present in both the tables so u have tos pecify as which DB table LIFNR should be used.

Hope this helps.

Read only

0 Likes
1,033

HI Raghu,

Change your <b>where condition with LFA1~LIFNR</b>



SELECT lfa1~lifnr lfa1~name1 lfa1~adrnr lfa1~telf1 lfa1~telfx

lfb1~bukrs lfb1~zterm

INTO TABLE itab

FROM lfa1 INNER JOIN lfb1 ON lfa1~lifnr EQ lfb1~lifnr

WHERE lfa1~lifnr IN vend.

Regards,

Raghav

Read only

Former Member
0 Likes
1,033

Check this.......

SELECT lfa1lifnr lfa1name1 lfa1adrnr lfa1telf1 lfa1~telfx

lfb1bukrs lfb1zterm

INTO TABLE itab

FROM lfa1 INNER JOIN lfb1 ON lfa1lifnr EQ lfb1lifnr

WHERE <b>lfa1~lifnr</b> IN vend.

Read only

rnb86
Participant
0 Likes
1,033

Hi friends,

thanx for helping me out. The problem is solved.i actually forgot the syntax of the select query when we use select-options. I got the output now after your help.

Thank you ALL.

Read only

Former Member
0 Likes
1,033

u are having a wrong join statement for suere please check wheter the where condition is correct or not and if you are using left inner join then teere must be no dta in the other table hence its selection all,

please reward point if of any use to you