‎2008 Jan 14 11:20 AM
Hi All,
select *
INTO TABLE ITAB
FROM ypbs
WHERE name IN s_name.
the entries in ypbs
ab
AB
Ab
aB
now in selection screen i will give A* then the output will be
AB and Ab but my requirement is to get all the entries starts with A/a.
helpme in this regard
ponts will rewarded
thanks
‎2008 Jan 14 11:33 AM
Hi Padmasri
What you can do is when you are filling the data into your internal table fill in UPERCASE
use this FM
call function 'AIPC_CONVERT_TO_UPPERCASE'
exporting
i_input =
I_LANGU = 'EN'
importing
e_output =
Now it will work fine
reward points if helpful
regards
hitesh
‎2008 Jan 14 11:35 AM
Hi,
previously client have the data in the table both in lower/upper case,now we have to retrieve both
‎2008 Jan 14 11:34 AM
Hi,
do like this
select *
INTO TABLE ITAB
FROM ypbs
WHERE name = 'A%' or 'a%'.
Regards,
Nagaraj
‎2008 Jan 14 11:34 AM
Hi,
Check whether you have rightly declared the type of the select option with the field which you are trying to query.
i.e., Check whether the declaration for your select options is ,
select-options s_name for ypbs-name.
From the values that you have mentioned I gather that the domain of the field
YPBA-NAME is made case sensitive(Lowercase is checked). So the Select option will also behave in the same way.
Also convert the case of the input value and append into the range s_name before passing it on to the select query.
loop at s_name.
s_name1 = s_name.
append s_name1.
TRANSLATE s_name-low TO UPPER CASE.
append s_name1.
TRANSLATE s_name-low TO LOWER CASE.
append s_name1
endloop.
sort s_name1.
delete adjacent duplicates from s_name1.
s_name[] = s_name1[] .
Hope this helps.
Reward points if helpful.
Edited by: majisha bharathan on Jan 14, 2008 12:42 PM
‎2008 Jan 14 12:47 PM
Hi Majisha,
here is my code
SELECT-OPTIONS : S_NAME FOR Ypbs-NAME OBLIGATORY.
RANGES: s_name1 FOR ypbs-name.
loop at s_name.
TRANSLATE s_name-low TO UPPER CASE.
append s_name1.
TRANSLATE s_name-low TO LOWER CASE.
append s_name1.
endloop.
s_name] = s_name1[.----
>>>>plz check here
SELECT *
INTO TABLE ITAB
FROM Ypbs
WHERE NAME IN s_name. "or NAME IN s_name2.
IF SY-SUBRC = 0.
LOOP AT ITAB.
WRITE :/05 ITAB-NAME.
ENDLOOP.
ENDIF.
‎2008 Jan 14 1:06 PM
Hi,
By mistake they may be printed by the concerned person
remove the braces and try.
s_name = s_name1
Regards
‎2008 Jan 14 1:06 PM
try like this...
SELECT-OPTIONS : s_name FOR ypbs-name OBLIGATORY.
RANGES: s_name1 FOR ypbs-name.
RANGES: s_name2 FOR ypbs-name.
TRANSLATE s_name-low TO LOWER CASE.
s_name1-low = s_name-low.
s_name1-sign = s_name-sign.
s_name1-option = s_name-option.
APPEND s_name1.
TRANSLATE s_name-low TO UPPER CASE.
s_name2-low = s_name-low.
s_name2-sign = s_name-sign.
s_name2-option = s_name-option.
APPEND s_name2.
SELECT *
INTO TABLE itab
FROM ypbs
WHERE name IN s_name1 OR name IN s_name2 .
IF sy-subrc = 0.
LOOP AT itab.
WRITE :/05 itab-name.
ENDLOOP.
ENDIF.
‎2008 Jan 14 2:16 PM
Hi Padmasri,
The browser is acts in a very wierd way,
I was trying to move the entire table contents of s_name1 to s_name using square braces. But somehow its not getting displayed prperly.
Use S_NAME[ ] = S_NAME1[ ] .
‎2008 Jan 14 11:39 AM
Hi,
You use following code..
range s_name2 for s_name.
s_name2 = s_name[].
loop at s_name2.
translate s_name2-low to upper.
translate s_name2-low to upper.
modify s_name2.
endloop.
loop at s_name.
translate s_name-low to lower.
translate s_name-low to lower.
modify s_name.
endloop.
select *
INTO TABLE ITAB
FROM ypbs
WHERE name IN s_name or name IN s_name2.
L.Velu
‎2008 Jan 14 11:42 AM
Hi Padmasri
The code below will work only for when user gives one latter and does patternr search
-
constants c_rule type char52 value 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'.
loop at s_name.
translate s_name-low+0(1) using c_rule.
append r_name1.
endloop.
append lines of r_name1 to s_name.
select *
INTO TABLE ITAB
FROM ypbs
WHERE name IN s_name.
-
May be on similar lines you can try to write a generic code which will take care of all possible cases. Other option would be retrieve all the data then using String Comparision operators, delete the unwanted records. Second options looks more reasonable and feasibly.
~ Ranganath
‎2008 Jan 14 12:21 PM
Hi All,
help me ..requirement is urgent
my question is not answered