cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Internal Table Value Expression with FOR & Base Corresponding

saurabh__khare38
Participant
0 Likes
1,720

Hello,

Consider the following value expression for building an internal table:

 

 

mt_analysis = VALUE #( BASE mt_analysis
                       FOR ls_tile_tm IN lt_tile_tm
                       ( VALUE #( BASE CORRESPONDING #( ls_tile_tm )
                                  catalog_id    = ls_analysis-catalog_id
                                  catalog_title = ls_analysis-catalog_title
                                  catalog_type  = ls_analysis-catalog_type
                                  system_alias  = ls_analysis-system_alias
                                  scope         = ls_analysis-scope
                                  created_on    = ls_analysis-created_on
                                  created_by    = ls_analysis-created_by
                                  modified_on   = ls_analysis-modified_on
                                  modified_by   = ls_analysis-modified_by ) ) ).

 

 

This works fine but what I would like to do is this:

 

 

mt_analysis = VALUE #( BASE mt_analysis
                       FOR ls_tile_tm IN lt_tile_tm
                      ( VALUE #( BASE CORRESPONDING #( ls_tile_tm ) 
                                 CORRESPONDING #( ls_analysis ) ) ) ).

 

 

But that gives me a syntax error. Is there a way I can do this without having to assign all components individually after the BASE CORRESPONDING? @DoanManhQuynh @Sandra_Rossi 

EDIT: Found a solution

mt_analysis = VALUE #( BASE mt_analysis
                             FOR ls_tile_tm IN lt_tile_tm
                             ( CORRESPONDING #( BASE ( ls_analysis ) ls_tile_tm ) ) ).

 

Accepted Solutions (0)

Answers (0)