Skip to Content
-2

How to avoid offset length in Select query

Mar 16, 2017 at 01:51 PM

79

avatar image
Former Member

Hi Folks,

Please let me know how to avoid offset length in abap query and get the desired result.

loop at it_tab1 into wa_tab1.

read table it_tab into wa_tab with key order+4(8) = wa_tab1-order.

if sy-subrc = 0.

endif.

endloop.

eg: my wa_tab-order value = abcd12345678

wa_tab1-order = 12345678

order field is character type

now my Q is instead of offset length is there any way that i can check/compare the fields.

is comparision operators work for this.

Please throw somelight

Thanks,

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

2 Answers

Horst Keller
Mar 16, 2017 at 04:20 PM
0

See the documentation for READ WITH KEY ...

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abapread_table_free.htm

And especially how the columns can be specified ...

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenitab_components.htm

You can neither use expressions nor comparison operators there. The workaround is another LOOP with WHERE or stay with the offset/length specification.

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Mar 17, 2017 at 08:50 AM
0

why do you want to change if it works ?

Share
10 |10000 characters needed characters left characters exceeded