Skip to Content
0
Former Member
Dec 03, 2008 at 03:53 PM

I was just wondering... (dynamic "with key" condition)

38 Views

Dear ABAP community!

I was just wondering if it works to use a dynamic "with key" - condition for "read table" statements.

Please have a look at the following piece of coding:

syntax is correct, but sy-subrc = 4 when processing the read table statement...

Is it possible or not? Any suggestions??

Best regards,

Christoph : )

Data: lt_spfli type STANDARD TABLE OF spfli,

ls_spfli type spfli,

lv_key type char255.

Select * from spfli into table lt_spfli.

Loop at lt_spfli into ls_spfli.

if sy-tabix gt 1.

exit.

endif.

CONCATENATE 'CARRID =' '''' into lv_key SEPARATED BY space.

CONCATENATE lv_key ls_spfli-CARRID '''' into lv_key.

endloop.

clear ls_spfli.

Read table lt_spfli into ls_spfli

with key lv_key.

Edited by: Christoph Aschauer on Dec 3, 2008 4:54 PM