Application Development 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: 

Select_options

rnb86
Participant
0 Kudos
190

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

Former Member
0 Kudos
116

<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

Former Member
0 Kudos
117

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

0 Kudos
116

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

Former Member
0 Kudos
116

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.

0 Kudos
116

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.

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos
116

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.

0 Kudos
116

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

Former Member
0 Kudos
116

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.

rnb86
Participant
0 Kudos
116

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.

Former Member
0 Kudos
116

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