Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mapping logic in internal table

Former Member
0 Likes
567

I have a mapping file where i have the source n target structure,field and value.Also the mapping rule in an internal table

example:

Source-structure source-field source-field-value rule target-structure target-field target_value

abc fielda X MOVE XYZ field1

Also I have source structure with values in 2nd internal table.

I have a third empty internal table with target fields.

Now based on the above two internal tables(mapping rule in 1st internal table and values from the 2nd internal table) I have to fill the 3rd internal table.Can anyone suggest some logic how can I proceed with this?

2 REPLIES 2
Read only

Former Member
0 Likes
481

Hi,

Based on the source fields and target fields and using the mapping rules, you can build the complete program using the SUBROUTINE POOLS.

This subroutine pool will be a kind of program will get generated and executed at run time. It will fulfill your requirement.

Search SCN or Google for creation and usage of Subroutine pool.

Regards,

Santhosh.

Read only

Former Member
0 Likes
481

Hi,

Loop at itab1.

read table itab2 with key rule = itab1-rule.

if sy-subrc = 0.

move-corresponding itab1 to itab3.

move-corresponding itab2 to itab3.

append itab3.

clear itab3.

endif.

Endloop.

Regards,

Kumar Bandanadham