‎2008 Jul 07 11:52 AM
Hi experts,
I want to modify the selection below.
v_repid is the program name, tvarv-name is tvarv variable name. I need the record from tvarv only if the t_varv-name contains the string of v_repid. How can I check for example the first eight characters of the name, during the selection. I hope I was clear.
SELECT name
type
numb
sign
opti
low
high
FROM tvarv
INTO TABLE i_tvarv
WHERE name EQ v_repid
AND type EQ i_type.
‎2008 Jul 07 11:59 AM
HI,
you can use the selction like below
concatenate v_repid(8) '%' into v_repid1.
SELECT SINGLE parva INTO v_kokrs FROM usr05
WHERE parid = 'CAC'
AND bname like v_repid1. *
i hope this slves ur probelm.
‎2008 Jul 07 11:56 AM
here what you can do is use string operations.
1>select the records as per your need.
2>check if t_varv-name CA v_repid
hope it helps and i guess ths is what 1 of the option that can be done
regards
bhanu
‎2008 Jul 07 11:59 AM
HI,
you can use the selction like below
concatenate v_repid(8) '%' into v_repid1.
SELECT SINGLE parva INTO v_kokrs FROM usr05
WHERE parid = 'CAC'
AND bname like v_repid1. *
i hope this slves ur probelm.
‎2008 Jul 07 11:59 AM
Hi,
Try this:
Data: lv_repid(9) type c,
lv_repid = 'abcdefg%' (your repid with %).
SELECT name
type
numb
sign
opti
low
high
FROM tvarv
INTO TABLE i_tvarv
WHERE name like lv_repid
*WHERE name EQ v_repid
AND type EQ i_type.
Kind Regards
‎2008 Jul 07 12:02 PM
hi friend ,
put a loop and use offset.
loop at i_tvarv into wa_tvarv.
if tvarv-name0(7) = v_repid0(7).
do your operation
else.
exit
endif.
endloop.
regards
sandeep
‎2008 Jul 07 12:04 PM
U can use LIKE in the select to search the name from TVARV table.
Check this sample code:
REPORT zdemo LINE-SIZE 180 LINE-COUNT 60(10) NO STANDARD PAGE
HEADING.
data: i_tvarv type standard table of tvarv.
data: l_search_text(10) type c.
data: v_repid like sy-repid.
v_repid = sy-repid.
concatenate v_repid+0(8) '%' into l_search_text in character mode.
SELECT name
type
numb
sign
opti
low
high
FROM tvarv
INTO TABLE i_tvarv
WHERE name like l_search_text.
AND type EQ i_type.
check sy-subrc = 0.
Regards,
Joy.
‎2008 Jul 07 1:20 PM