Skip to Content
avatar image
-2
Former Member

How to avoid offset length in Select query

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,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 16, 2017 at 04:20 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 17, 2017 at 08:50 AM

    why do you want to change if it works ?

    Add comment
    10|10000 characters needed characters exceeded