Skip to Content
Former Member
Jun 07, 2017 at 01:48 PM

ABAP 740 inline VALUE FOR - able to create a table sourced from 2 different tables?


Hi everyone,

This may be a stupid question, so apologies if so. I'm aware of the VALUE iterator and the FOR iterator in order to declare a table inline, but is it possible to use 2 FOR statements to utilize 2 separate tables during declaration?

For example, tables A and B are the same type (tables of VBELN and POSNR). Normally I'd just append 1 to the other, but for the sake of understanding what's possible syntactically, can I do something like below?:

DATA(lt_vbeln_comb) = VALUE ty_vbeln_t(
FOR ls_A IN table_A   #first table
FOR ls_B IN table_B   #second table
( vbeln = #I want to use both ls_A-vbeln and ls_B-vbeln here
  posnr = 1 )