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

multiple choices in d input

Former Member
0 Likes
1,782

selection screen parameters r plant : P_WERKS(VBAP-WERKS),sales doc : S_VBELN(VBAP-VBELN) & sales doc item : S_POSNR(VBAP-POSNR).

PARAMETER: p_werks like vbap-werks.

select-options : s_vbeln for vbap-vbeln,

s_posnr for vbap-posnr.

rite now im using d query :

select VBELV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

now this query is not workin if we give multiple choices in d input.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,748
PARAMETER:  p_werks like vbap-werks.
select-options : s_vbeln for vbap-vbeln,
                       s_posnr for vbap-posnr.

select VBELV LFIMG 
          from LIPS 
          into table ITAB 
          where VBELN in S_VBELN 
          and POSNR in S_POSNR.

U have to check with the key fiels, VBELN and POSNR.

Now it will work.

Reward poinst if this helps.

selection screen parameters r plant : P_WERKS(VBAP-WERKS),sales doc : S_VBELN(VBAP-VBELN) & sales doc item : S_POSNR(VBAP-POSNR).

PARAMETER: p_werks like vbap-werks.

select-options : s_vbeln for vbap-vbeln,

s_posnr for vbap-posnr.

rite now im using d query :

select VBELV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

now this query is not workin if we give multiple choices in d input.

15 REPLIES 15
Read only

Former Member
0 Likes
1,748

Hi ,

Could you please check whether there is data in the table for the set of inputs you give.

Regards

Arun

Read only

0 Likes
1,748

yes... data is present..

now wat modifications i should make in dat query...

Read only

0 Likes
1,748

well if data is present, your statement HAS to work.

Only problem you may run into now is that your internal table is of y wrong type.

maybe just decalre it like following:

data itab type lips.

Read only

0 Likes
1,748

does it work when you give a single set of values

Read only

0 Likes
1,748

OMG, YEAH the one who can read is in clear advantage.

listen to the LADIES, they really know the answers 😛

Read only

0 Likes
1,748

yes it is working for single set of values......

Read only

0 Likes
1,748

Hi

Just as I said in my previuos answer try this:

DATA: BEGIN OF ITAB OCCURS 0,

VBELV LIKE LIPS-VBELV,

POSNV LIKE LIPS-POSNV,

LFIMG LIKE LIPS-POSNV,

END OF ITAB.

select VBELV POSNV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

U make sure to have all keys fields in ITAB to miss any records, it should be better your table was like this:

DATA: BEGIN OF ITAB OCCURS 0,

VBELN LIKE LIPS-VBELN

POSNR LIKE LIPS-POSNR,

VBELV LIKE LIPS-VBELV,

  • POSNV LIKE LIPS-POSNV,

LFIMG LIKE LIPS-POSNV,

END OF ITAB.

select VBELN POSNR VBELV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

Now it should work

Max

Read only

0 Likes
1,748

then i am not sure why this is not working for you , because i tried it on my server and it worked fine. the only thing i can say , please again carefully check the whether you have values in your table LIPS for the field <b>VBELV</b>.

Regards

Arun

Read only

0 Likes
1,748

hi.........

if it is workin on ur server then could you pls mail d whole pgm u've written to test this query ?

my email id is [email protected].....

Read only

Former Member
0 Likes
1,748

Hi

It can depend on how you've defined ITAB, you should insert POSNV field too: INTO TABLE option loads only one record if there are hits with the same key, so you can risk to load one records for every sales order (VBELV) with several items.

select VBELV POSNV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

Max

Read only

Former Member
0 Likes
1,748

Hi,

Your Internal table should have the same field names, if the Itab is not contain the same field names, then use

select VBELV LFIMG from LIPS into corresponding fields of table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

Regards

Sudheer

Read only

0 Likes
1,748

DATA : BEGIN OF ITAB OCCURS 0,

VBELV LIKE LIPS-VBELV,

LFIMG LIKE LIPS-LFIMG,

END OF ITAB.

i've used the above declaration....

Read only

Former Member
0 Likes
1,749
PARAMETER:  p_werks like vbap-werks.
select-options : s_vbeln for vbap-vbeln,
                       s_posnr for vbap-posnr.

select VBELV LFIMG 
          from LIPS 
          into table ITAB 
          where VBELN in S_VBELN 
          and POSNR in S_POSNR.

U have to check with the key fiels, VBELN and POSNR.

Now it will work.

Reward poinst if this helps.

Read only

Former Member
0 Likes
1,748

<b>VBAK-VBELN /VBAP -VBELN = LIPS-VGBEL .</b>

VBELN IN LIPS -> DELIVERY

VBELN IN VBAP/VBAK IS SALES DOCUMENT NUMBER

Get the flow of the tables first and then build the query .

vbak-vbeln = vbap-vbeln. } sales

sales->delivery

vbap-vbeln = lips-vgbel.

vbap-ponsr = lips-vgpos.

regards,

vijay

Read only

Former Member
0 Likes
1,748

select VBELV LFIMG from LIPS into table ITAB where VBELV in S_VBELN and POSNV in S_POSNR.

This query will not work . The reason is u are comparing VBELV & S_VBELN . Thats not the right field to comnpare as both are diff fields.

vbelv - Originating document

vbeln- Delivery

In LIPS table these fields will have different values.

reward points if found useful.

regards,

barath.