Skip to Content
0
Jun 22, 2007 at 02:18 PM

maximum permitted 8 (= 2 * 4) valid characters.- dump?

38 Views

Hi,

I am getting this short dump. This dump not coming every time this report execute.

I am getting this dump once in a while.

ABAP/4 Open SQL statement with WHERE ... LIKE and pattern too long.

-


Error analysis

-


An exception occurred. This exception is dealt with in more detail below

. The exception, which is assigned to the class 'CX_SY_DYNAMIC_OSQL_SEMANTICS',

was neither

caught nor passed along using a RAISING clause, in the procedure

"F_SELECT_UNIQUE_DOCNO" "(FORM)"

.

Since the caller of the procedure could not have expected this exception

to occur, the running program was terminated.

The reason for the exception is:

The current ABAP/4 program attempted to execute an ABAP/4 Open SQL

statement in which the WHERE condition contains an LIKE operator.

The format for a LIKE operator should be (with the exception of

closing blanks) no more than twice as long as the

database field to which the condition applies.

In this particular case, the pattern contains

"%40R22.5%"

more than the maximum permitted 8 (= 2 * 4) valid characters.

-


Source code extract

-


003550 dynamic_where: s_awerk text-082 'werks'. " text-082 - YARSAUTHPLNTS

-


> get_unique yarsauthplnts.

003570

003580 endform. " F_select_unique_docno

003590 *

003600 &----


003610 * Form f_select_records *

003620 &----


003630 * For selecting records *

003640 &----


<b>

This is my source code

</b>

*&---------------------------------------------------------------------*
* macro declaration                                                    *
*&---------------------------------------------------------------------*
define dynamic_where.
  if not &1[] is initial.
    clear l_ds_range. refresh frange_t.
    move &2 to l_ds_range-tablename.
    frange-fieldname = &3.
    loop at &1.
      selopt_t-sign   = &1-sign.
      selopt_t-option = &1-option.
      selopt_t-low    = &1-low.
      selopt_t-high   = &1-high.
      append selopt_t.
    endloop.
    frange-selopt_t[] = selopt_t[].
    append frange to frange_t.
    l_ds_range-frange_t = frange_t.
    append l_ds_range to l_ds_trange.
  endif.
end-of-definition.

define get_unique.
  if not l_ds_trange is initial.
    refresh: i_where. clear: i_where.
    call function 'FREE_SELECTIONS_RANGE_2_WHERE'
      exporting
        field_ranges  = l_ds_trange
      importing
        where_clauses = i_where.
    if not i_where is initial.
      read table i_where with key 'YSCC' into t_where.
      if sy-subrc eq 0.
        select docno from &1
            appending table i_docno
            where (t_where-where_tab).
      endif.
    endif.
    refresh: l_ds_trange. clear: l_ds_range.
  endif.
end-of-definition.

aRs