‎2008 Oct 27 4:47 PM
Guy , if I write N* in a parameter or select option field , and I want the system to bring me all coincidences with N in a select , How can I do that ?. How it works , thank you.
‎2008 Oct 27 5:46 PM
Hi Jose,
I have done the following successfully:
CONCATENATE '''' '%' LN_INPUT '%' '''' INTO LN_COND.
CONCATENATE 'NCHMC LIKE' LN_COND INTO condition SEPARATED BY SPACE.
SELECT PERNR
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0002
WHERE (condition).
Good luck.
SL
‎2008 Oct 27 4:53 PM
Hi
U should obtain automatically what you need for select-options, for parameters u should replace * with % before doing the select.
PARAMETERS: P_PARAM(10).
REPLACE '*' WITH '%' INTO P_PARAM.
IF SY-SUBRC = 0.
SELECT * FROM <TABLE> WHERE <FIELD> LIKE P_PARAM
..............................................
ELSE.
SELECT * FROM <TABLE> WHERE <FIELD> = P_PARAMMax
‎2008 Oct 27 5:27 PM
Even this exampled code must works, I passed sales organization first one letter with '*' and it returned all the records which satisfies.
tables: tvko.
select-options: s_vkorg for tvko-vkorg.
data: t_tvko like standard table of tvko with header line.
select * into table t_tvko
from tvko
where vkorg in s_vkorg.
‎2008 Oct 27 5:46 PM
Hi Jose,
I have done the following successfully:
CONCATENATE '''' '%' LN_INPUT '%' '''' INTO LN_COND.
CONCATENATE 'NCHMC LIKE' LN_COND INTO condition SEPARATED BY SPACE.
SELECT PERNR
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0002
WHERE (condition).
Good luck.
SL
‎2008 Oct 27 6:15 PM
thank you guys ,bout i ve forgotten to mention that i´m working with field afvc-projn, in a select option , so in order to have it like character i have to pass it for a function first CONVERSION_EXIT_ABPSP_OUTPUT, and just then i got it like a string of character , the things is if I try to put N* it gave me the message 'PEP element doesnt exist' . so I need it like string before do replaces , any iidea ?
‎2008 Oct 27 6:56 PM
Hi Jose,
I am not familiar with the field you are working with, but as I can recall, the part that gave me the most difficulty when creating the "dynamic select" condition was getting the correct quotation marks included in the statement. Debug your program and make sure you are creating the correct condition, to ensure that the select statement will be executed correctly.
Thx
SL
‎2008 Oct 27 6:56 PM
I think you're making this too complicated. Rather than trying to solve this with code, it would probably be better to educate your users so that they understand what they need to enter in the parameter in order to get the results they want.
Rob
‎2008 Oct 27 8:16 PM
If you really need a wildcard for parameters, then instead of using parameters use Select-Options with
no-extension no intervals options. That will make the field look loke parameter with just one single value but you can use wild cards easily there
select-options : so_matnr for mara-matnr no extension no intervals.