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

BASE FOR WHERE ABAP 7.4

shubham_banerjee
Participant
35,626

Hello Experts,

I am trying to achieve MOVE-CORRESPONDING with following scenario.

Internal Table #1: lt_plant

werks fabkl country

1000 01

Internal Table #2: lt_name

ident ltext

01 <Country Name>

I am trying to move the country name to from internal table #2 to internal table #1 using FOR with following code, however it's resulting in appending new rows from internal table #2.

lt_plant = value #( base lt_plant
for <fs_name> in lt_name
for <fs_plant> in lt_plant
where ( fabkl = <fs_name>-ident )
(
ltext = <fs_name>-ltext
) ).

Please help me to solve this using BASE/CORRESPONDING, FOR and WHERE.

Thanks in advance.

View Entire Topic
shubham_banerjee
Participant
0 Kudos

Hi sandra.rossi,

Greetings for the day !!

Thank you so very much for your support. Your code is working properly in terms of returning exact number of records as I have 114 records in the source table lt_plant. However, the werks field is getting initialized. Perhaps I will have to add werks too in the value assignment.I am attaching the screenshots, please suggest.

Thanks in advance.

Sandra_Rossi
Active Contributor

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Sandra_Rossi
Active Contributor

When it takes 10 seconds to test it yourself, I think you should try first, then ask if there's something you can't achieve or don't understand. So let's "spoon feeding": yes, the line is constructed from scratch so you must initialize all the components you want (I edited my answer too).