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

Moving only non key fields to structure.

ronaldo_aparecido
Contributor
0 Likes
3,223

Hi Guys.

I have two fields "type ref to " :

<fl_entity_data>-tabl and <fl_entity_data2>-tabl .

I pass both to field symbols:

ASSIGN <fl_entity_data>-tabl->* TO <fl_sttabl2>.

ASSIGN <fl_entity_data2>-tabl->* TO <fl_sttabl3>.

Now I want to move Only non key fields of <fl_sttabl2> to <fl_sttabl3> , but i

do not want to move one by one.

i could use " value" statement but there are many collums in some cases i want a way to move only non key fields.


thanks

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
3,087

In recent versions, you could use an EXCEPT clause in a CORRESPONDING component operator, somethink such as

<fl_sttabl3> = CORRESPONDING #( <fl_sttabl2> EXCEPT material werks ).

Hi Guys.

I have two fields "type ref to " :

<fl_entity_data>-tabl and <fl_entity_data2>-tabl .

I pass both to field symbols:

ASSIGN <fl_entity_data>-tabl->* TO <fl_sttabl2>.

ASSIGN <fl_entity_data2>-tabl->* TO <fl_sttabl3>.

Now I want to move Only non key fields of <fl_sttabl2> to <fl_sttabl3> , but i

do not want to move one by one.

i could use " value" statement but there are many collums in some cases i want a way to move only non key fields.


thanks

9 REPLIES 9
Read only

SimoneMilesi
Active Contributor
0 Likes
3,087

The first question is: how do you know a key is field or not?

You are showing us just some field symbols in your snippet and a debug screenshot.

Read only

former_member539238
Participant
0 Likes
3,087

You can use 'move-corresponding' for that. Check the documentation.

Read only

0 Likes
3,087

Move-corresponding wil move all fields with the same names, he wants to exclude some fields.

While he could use it to move the fields and clearing the fields he doesn't want afterwards, I don't think that's what he's searching for.

Read only

former_member539238
Participant
3,087

He can have two structures for it no? He can have one with all the data and the other with only the needed ones.

Read only

0 Likes
3,087

That's the solution I've used, of old.

Read only

Ankit_Maskara
Product and Topic Expert
Product and Topic Expert
0 Likes
3,087

As Simone pointed out, what determines a key field and what a non-key field. The algo will be based on that.

Read only

RaymondGiuseppi
Active Contributor
3,088

In recent versions, you could use an EXCEPT clause in a CORRESPONDING component operator, somethink such as

<fl_sttabl3> = CORRESPONDING #( <fl_sttabl2> EXCEPT material werks ).
Read only

0 Likes
3,087

Just take into account it will override the values of material and werks in <fl_sttabl3> with empty values. See the program DEMO_CORRESPONDING_MAPPING

Read only

3,087

There is a BASE addition to avoid that.