Skip to Content
-2

Alternative for / Problems with: "For all entries in data_package"

May 09 at 12:02 PM

78

avatar image

Hi Guys

I am doing something in ABAP like:

OPEN CURSOR WITH HOLD c1
FOR SELECT (COL_STR)
FROM (JOIN_STR)
UP TO ROWCOUNT ROWS
FOR ALL ENTRIES IN ZEDITPOSTMP
WHERE (WHERESTR).

Here in WHERESTR i am passing link: client eq ZEDITPOSTMP-TABKEY+000000(3) date eq ZEDITPOSTMP-TABKEY+000003(8).

TABKEY: 80000010101.

But here in ZEDITPOSTMP-TABKEY+000003(8) is returning value like 00010101 which is without single quote ' so if we compare it with date it expect that value enclosed between this ' quote. If i manually append this quote like 'ZEDITPOSTMP-TABKEY+000003(8)' then now this is just like a string so won't be processed like a function. I want this ZEDITPOSTMP-TABKEY+000003(8) function should process first and whatever o/p it return that should be enclosed b/w ' ' this quotes.

Any reply will be a great help on this.

Thank's

ompal

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Keller
May 09 at 01:28 PM
3

You have to generate exactly the same syntax in WHERESTR as you would type it in the ABAP Editor.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thank's Keller for your reply.

But my question is the syntax zeditpostmp-tabkey+000013(000008) is giving some number like 00010101 but i want it should come like '00010101' so that i can compare this with date like: date_from EQ '00010101'. Do you've any other solution??

Thank's

Ompal

0

Horst has told you. You must use exactly the same syntax in your where clause as you would type in. Write a test program that isn't using dynamic where clause etc. Does your select work as you expect? If not - then it won't work dynamically either.

1

Well yes, you have to use the means of string processing to create exactly the token you need.

0