Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic where clause: Urgent

Hi,

I am facing a problem with data retrieval in a BADI with dynamic where clause.

I have a variable defined as:

data: lv_where_condn TYPE string.

I concatenate the data in the string based on the user's input and perform the following select:

SELECT *

FROM zd_apo_prodvar1

INTO TABLE lt_data

WHERE (lv_where_condn).

The sy-subrc returns a value 4 although there is data in the system for the users data input.

Earlier it used to give a short dump which I have now take care of with the catch statement.

SAP has suggested the following:

This problem happens if an attempt was made to bind or define a variable character string with a buffer length less than the two-byte minimum requirement. Please check the variable definition in your custom code and increase the buffer size or use a different type.

Any inputs will b appreciated in declaring the dats type for lv_where_condn.

cheers

Aveek

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question