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

problem in select

Former Member
0 Likes
830

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. 

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
808

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

8 REPLIES 8
Read only

ferry_lianto
Active Contributor
0 Likes
808

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

Read only

0 Likes
808

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

Read only

naimesh_patel
Active Contributor
0 Likes
808

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

Read only

0 Likes
808

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

Read only

0 Likes
808

Yes.. if you want to serach for the curreny description than use the text table of the TCURC.. which is TCURCT.

Regards,

Naimesh

Read only

0 Likes
808

Why do you want to search more than 8 characters? The field is only 5 characters long!!

Rob

Read only

ferry_lianto
Active Contributor
0 Likes
809

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

Read only

ferry_lianto
Active Contributor
0 Likes
808

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