‎2006 Jul 04 12:37 PM
hi,
Is there any way to retrieve contract material description (TXZ01 from EKPO) irrespective of case sensitivity.
Example I need to pick Picking, PICKING and even picking if the user entered picking as input for the given input.
Kr,
Senthil.
‎2006 Jul 04 2:00 PM
this looks okay although it doesnt cover all combinations of capital and small letters.
REPORT zsearchcap .
DATA : t_makt TYPE STANDARD TABLE OF makt WITH HEADER LINE.
DATA : l_maktx(40).
PARAMETERS : p_maktx type makt-maktx.
RANGES: r_maktx FOR p_maktx .
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
TRANSLATE p_maktx TO UPPER CASE.
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
TRANSLATE p_maktx TO LOWER CASE.
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
SELECT * FROM makt INTO TABLE t_makt
WHERE maktx IN r_maktx
AND spras EQ sy-langu.
LOOP AT t_makt.
WRITE: / t_makt-maktx.
ENDLOOP.
‎2006 Jul 04 12:43 PM
I'm hoping that this is not your only selection criteria. You may have to leave this out of the WHERE clause and handle it after.
select * into table iekpo
from ekpo
where .......
* Loop table, translate the text, check against
* select-option, delete if not valid.
loop at iekpo.
translate iekpo-txz01 to upper case.
if not iekpo-txz01 in s_txz01.
delete iekpo.
continue.
endif.
endloop.
Regards,
Rich Heilman
‎2006 Jul 04 1:00 PM
Thankyou Rich
I tried this logic but if the user gives as
Picking like that or with any combination this logic is not working and also it end up with performance issues.
No problem if performance issues but cases like P or p* or *P ?????
senthil.
‎2006 Jul 04 1:02 PM
‎2006 Jul 04 1:27 PM
In my case the it is the parameter of the function module g_maktg and if I translate as
translate g_maktg to upper case.
eg. g_maktg = picking the translation will give
PICKING
but when we check in itab there will different combination of picking which i need to select everything.
eg.
tool picking
picking box
tool picking box
tool PICKING box
which has to be selected.
Kr,
Senthil.
‎2006 Jul 04 1:32 PM
‎2006 Jul 04 1:33 PM
You can use the CP command to filter the records.
IF SELECTED_TEXT CP INPUT_STRING.
CONTINUE.
ELSE.
DELETE Entry.
ENDIF.
-Kiran
‎2006 Jul 04 2:00 PM
this looks okay although it doesnt cover all combinations of capital and small letters.
REPORT zsearchcap .
DATA : t_makt TYPE STANDARD TABLE OF makt WITH HEADER LINE.
DATA : l_maktx(40).
PARAMETERS : p_maktx type makt-maktx.
RANGES: r_maktx FOR p_maktx .
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
TRANSLATE p_maktx TO UPPER CASE.
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
TRANSLATE p_maktx TO LOWER CASE.
r_maktx-low = p_maktx.
r_maktx-sign = 'I'.
r_maktx-option = 'CP'.
APPEND r_maktx.
SELECT * FROM makt INTO TABLE t_makt
WHERE maktx IN r_maktx
AND spras EQ sy-langu.
LOOP AT t_makt.
WRITE: / t_makt-maktx.
ENDLOOP.
‎2006 Jul 04 5:22 PM
thank Sharath
My problem is solved 80 % but as you specified it is not working for all the combination of given string. is there any possible way to include this also.
Kr,
Senthil.
‎2006 Jul 05 6:35 AM
Check this out -
REPORT zzsearch_allpattern .
DATA : itab1 TYPE STANDARD TABLE OF makt,
wa_itab1 TYPE makt.
PARAMETERS : p_maktx TYPE makt-maktx.
DATA : l_maktx TYPE makt-maktx.
TRANSLATE p_maktx TO UPPER CASE.
********************************************************
SELECT * FROM makt INTO TABLE itab1
WHERE spras EQ sy-langu.
LOOP AT itab1 INTO wa_itab1.
l_maktx = wa_itab1-maktx.
TRANSLATE l_maktx TO UPPER CASE.
IF wa_itab1-maktx CP p_maktx.
WRITE : / wa_itab1-matnr, wa_itab1-maktx.
ENDIF.
ENDLOOP.