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

wild card problems

Former Member
0 Likes
481

Hi ,

My requirement is:

first in the selction screen i need to enter--

from and to values of cost centre

imagine-- from:9999912

to: 9999920

now, i need to concatenate from and to vaues like this

from :KL + WWWW + 9999912 + *

= KLWWWW9999912*

to : KL + WWWW + 9999920 + *

= KLWWWW9999920*

now i need to get the records from COEP table

by passing these values to the OBJNR field of COEP

table.

SELECT * from COEP into I_COEP

where OBJNR in between KLWWWW9999912*

and KLWWWW9999920*

can any body please let me know how to code where condition

for this wild card in select-options [where objnr ?????????? ]

because i need to enter multiple cost centers in the selcetion screen...........

Thanks and Regards,

Vasu

3 REPLIES 3
Read only

Former Member
0 Likes
460

Hi Kiran,

Do it in this way.

First create a Range


RANGES: R_OBJNR FOR JEST-OBJNR.
 

Now concatenate the text like this.


R_OBJNR-SIGN = 'I'.
R_OBJNR-OPTION = 'CP'.
R_OBJNR-LOW = 'KLWWWW9999912*'.
R_OBJNR-HIGH = 'KLWWWW9999920*'.
 
APPEND R_OBJNR.

Now execute your Select query like this.


SELECT * from COEP into I_COEP
where OBJNR in R_OBJNR.

Thanks,

Chidanand

Read only

Former Member
0 Likes
460

Hi

Try this :


TABLES coep.
SELECT-OPTIONS so_date FOR sy-datum.

DATA r_objnr TYPE RANGE OF coep-objnr WITH HEADER LINE.

DATA itab_coep TYPE TABLE OF coep.

START-OF-SELECTION.

  LOOP AT so_date.
    CONCATENATE 'KLWWWW' so_date-low INTO r_objnr-low.
    IF so_date-high IS NOT INITIAL.
      CONCATENATE 'KLWWWW' so_date-high INTO r_objnr-high.
    ENDIF.
    MOVE so_date-sign TO r_objnr-sign.
    MOVE so_date-option TO r_objnr-option.
    APPEND r_objnr.
  ENDLOOP.

  SELECT * FROM coep INTO TABLE itab_coep
  WHERE objnr IN r_objnr.

regards,

Advait

Read only

Former Member
0 Likes
460

Hi Kiran,

I have shown you simple concatenation where you can concatenate KL wwww and your value 999....

data: c1(2) value 'KL',

c2(4) value 'WWWW',

c3(20) value '9999912'.

DATA: c4(20) type c.

concatenate c1 c2 c3 into c4.

write: c4.

Now pass your value using Variable C4.

And follow the above post suggestions too.

Cheers!!

VEnk@