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

offset operation in select statements where clause

Former Member
0 Likes
3,989

dear experts,

if i use offset operation in select query , syntactically giving

me a warning message.

how to avoid warning message

without using another internal table populated with only jtab+0(10).

ex:

select field1 field2

into table itab

from ztable1

for all entries in jtab

where field = jtab+0(10).

thanks in advance.

13 REPLIES 13
Read only

Former Member
0 Likes
2,282

Ramesh,

Ignore the warning message.

But i amazed to see your query:

for all entries in jtab
where field = jtab+0(10)."--->>>can we use offset for internal table?

if yes than please provide a source documentation from where you got this info.

Amit.

Read only

0 Likes
2,282

hi amit, here's the query

SELECT vbeln "Billing Document number

waerk "SD Document Currency

FROM vbrk

INTO TABLE fp_gi_vbrk

FOR ALL ENTRIES IN fp_gi_bsid

WHERE vbeln = fp_gi_bsid-zuonr+0(10)

AND fkart IN s_fkart.

Read only

0 Likes
2,282

Ramesh,

WHERE vbeln = fp_gi_bsid-zuonr+0(10)

First collect fp_gi_bsid-zuonr+0(10) value in another temp field than use select query like:

SELECT vbeln "Billing Document number
waerk "SD Document Currency
FROM vbrk
INTO TABLE fp_gi_vbrk
FOR ALL ENTRIES IN fp_gi_bsid
WHERE vbeln = fp_gi_bsid-temp"-->>Look here
AND fkart IN s_fkart.

Amit.

Read only

0 Likes
2,282

friend ,

that's what i have mentioned in my thread

Read only

0 Likes
2,282

You have to use the LIKE operator in your where Clause. Do an F1 on LIKE & you will get the idea..

Ignore my response.. when using FOR ALL ENTRIES, the fields should match, you cannot use the OFFset like you are trying..

~Suresh

Edited by: Suresh Datti on Aug 23, 2008 12:40 PM

Read only

0 Likes
2,282

Ramesh,

friend ,
that's what i have mentioned in my thread

????

Am not using another itab am just using another temp variable which i think you must use else i have no idea!

Amit.

Read only

0 Likes
2,282

amit,

variable can be used only to hold a single value,

if multiple values then ?

Edited by: ramesh kalvakota on Aug 23, 2008 12:54 PM

Read only

0 Likes
2,282

Ramesh,

Did you read my second last post carefully or Are you pulling my leg?

SELECT vbeln "Billing Document number
waerk "SD Document Currency
FROM vbrk
INTO TABLE fp_gi_vbrk
FOR ALL ENTRIES IN fp_gi_bsid
WHERE vbeln = fp_gi_bsid-temp"-->>Look here(It is not a variable its a field of internal table fp_gi_bsid )
AND fkart IN s_fkart.

I hope now you understood.

Amit.

Read only

0 Likes
2,282

amit,

you mean to say that once i get values in fp_gi_bsid,

then loop this fp_gi_bsid and fill temp field with

zuonr+0(10) value, then use fp_gi_bsid-temp .

thanks in advance.

Read only

0 Likes
2,282

Exactly Brother

Amit.

Read only

0 Likes
2,282

friend amit,

thanks for spending your precious time for answering

the thread.

Read only

0 Likes
2,282
friend amit,

thanks for spending your precious time for answering 
the thread.

Welcome.

PS:dont forget to close your thread once it answered.

Enjoy cheers

Read only

Former Member
0 Likes
2,282

No need to populate another internal table...

when populating jtab from database select ur field twice

structure for jtab..

types: begin of ty_jtab,

.....

field type ...

field1 type char10,

.....

end of ty_jtab.

  • populate the field twice..

select ...

field

field

......

into table jtab

........

Now u can use the field field1 in the next select

select field1 field2

into table itab

from ztable1

for all entries in jtab

where field = jtab-field1.