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 statement

Former Member
0 Likes
420

Hi,

Hi,

I have a query to search on the below three fields.

1)Product Company (VBPA-PERNR)

2)Network Company (VBPA-PERNR)

3)Account Manager (VBPA-PERNR)

Need to get VBELN field based on the search parameter given.

Here if we search on Product company then need to get all the VBELN where PARVW = 'ER' and in the same way if we search on network company then need to get all the VBELN where

PARVW = 'ZL' and for account manger PARVW = 'Z8'.

We can also pass all the three parameters at a time i.e. Product company, Network company and Account manager. We need to get all the VBELN based on the search condition given. Hope this is clear now.

Regards,

Ramesh

Message was edited by:

Ram Mohan Naidu Thammineni

2 REPLIES 2
Read only

Former Member
0 Likes
358

Ram,

Your requirement is not that much clear.as per my understanding check the below code.

select single PARVW into VBPA-PARAW

from VBPA

where conditions.....

case VBPA-PARAW.

WHEN 'ER'.

WHEN 'ZL'.

WHEN 'Z8'.

Endcase.

Don't forget to reward if useful...

Read only

Former Member
0 Likes
358

Ram,

DATA : Begin of i_VBPA occurs 0,

VBELN like VBPA-VBELN,

PARVW like VBPA-PARVW,

END OF i_VBPA.

This is for single search parameter...

-


Select vbeln parvw into table i_vbpa from VBPA Where PARVW eq = 'Z8'.

-


This is for all search parameters

Select vbeln parvw into table i_vbpa from VBPA

Where PARVW in ('ER','ZL','ER').

SORT i_VBPA by VBELN PARVW.

Pls. reward if useful