‎2007 Nov 05 4:40 PM
hi,
i do a program for search string from table and field v_pattern2 is field that the user input and the bapi search the string in table tcurc,the problem here that i can do search for just 8 or less
character if i do more then that i get dump
what couled be the problem?
Regards
CONCATENATE '%' v_pattern2 '%' INTO v_pattern2.
SELECT waers "This Search for take currency key
FROM tcurc
INTO TABLE curr_tab2
WHERE waers LIKE v_pattern2.
‎2007 Nov 05 4:59 PM
Hi,
Are you looking this?
PARAMETERS: PATTERN(38) TYPE C.
DATA: BEGIN OF CURR_TAB2 OCCURS 0,
WAERS LIKE TCURC-WAERS,
END OF CURR_TAB2.
DATA: V_PATTERN2 LIKE TCURT-LTEXT.
CONCATENATE '%' PATTERN '%' INTO V_PATTERN2.
SELECT WAERS
FROM TCURT
INTO TABLE CURR_TAB2
WHERE SPRAS = SY-LANGU
AND LTEXT LIKE V_PATTERN2.
Regards,
Ferry Lianto
‎2007 Nov 05 4:48 PM
Hi,
Please try this.
PARAMETERS: PATTERN(3) TYPE C.
DATA: BEGIN OF CURR_TAB2 OCCURS 0,
WAERS LIKE TCURC-WAERS,
END OF CURR_TAB2.
DATA: V_PATTERN2 LIKE TCURC-WAERS.
CONCATENATE '%' PATTERN '%' INTO V_PATTERN2.
SELECT WAERS
FROM TCURC
INTO TABLE CURR_TAB2
WHERE WAERS LIKE V_PATTERN2.
Regards,
Ferry Lianto
‎2007 Nov 05 4:53 PM
hi feery
thanks for your replay.
the field WAERS is type char5 so it smaller then what i wont
i declare
data v_pattern2 LIKE tcurt-ltext.
and i have dump.
Regards
‎2007 Nov 05 4:51 PM
The problem is:
Abstrct from the short dump
"
The pattern for a LIKE operator (with the exception of
closing blanks) cannot have more than 10 characters. This is the
minimum of 256 and twice as long as the database field (5) to which
the condition applies.
In this particular case, the pattern contains
"%TEST11111%"
more than the maximum permitted 10 valid characters.
"
Means you will have only 8 characther left apart from 2 % to compare with the WAERS (lenght 5).
So, make your V_PATTER2 as 8 length field.
Regards,
Naimesh Patel
‎2007 Nov 05 4:56 PM
thanks Naimesh Patel
this the erorr.
u mean that is no option at all that i can do search for more then 8 charcter?
Regards
‎2007 Nov 05 5:01 PM
Yes.. if you want to serach for the curreny description than use the text table of the TCURC.. which is TCURCT.
Regards,
Naimesh
‎2007 Nov 05 5:02 PM
Why do you want to search more than 8 characters? The field is only 5 characters long!!
Rob
‎2007 Nov 05 4:59 PM
Hi,
Are you looking this?
PARAMETERS: PATTERN(38) TYPE C.
DATA: BEGIN OF CURR_TAB2 OCCURS 0,
WAERS LIKE TCURC-WAERS,
END OF CURR_TAB2.
DATA: V_PATTERN2 LIKE TCURT-LTEXT.
CONCATENATE '%' PATTERN '%' INTO V_PATTERN2.
SELECT WAERS
FROM TCURT
INTO TABLE CURR_TAB2
WHERE SPRAS = SY-LANGU
AND LTEXT LIKE V_PATTERN2.
Regards,
Ferry Lianto
‎2007 Nov 05 5:04 PM
Hi,
If you are looking all return values of WAERS from table TCURC, then you need to declare v_pattern2 as TCURC-WAERS.
Regards,
Ferry Lianto