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

Contract material retrieval

Former Member
0 Likes
1,270

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,229

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.

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,229

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

Read only

0 Likes
1,229

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.

Read only

0 Likes
1,229

You would have to translate the selection field as well.

parameters: P_txz01 type ekpo-txz01.


translate p_txz01 to upper case.

Regards,

Rich Heilman

Read only

0 Likes
1,229

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.

Read only

0 Likes
1,229

Right. So if you translate both, then all will be upper case and you can compare them.

Regards,

Rich Heilman

Read only

0 Likes
1,229

You can use the CP command to filter the records.

IF SELECTED_TEXT CP INPUT_STRING.

CONTINUE.

ELSE.

DELETE Entry.

ENDIF.

-Kiran

Read only

Former Member
0 Likes
1,230

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.

Read only

0 Likes
1,229

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.

Read only

Former Member
0 Likes
1,229

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.