‎2008 Nov 05 2:09 PM
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
‎2008 Nov 05 2:14 PM
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
‎2008 Nov 05 2:18 PM
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
‎2008 Nov 05 2:19 PM
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@