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

Is it MOVE-CORRESPONDING?

Former Member
0 Likes
1,363

Hello,

Pl. advise me what is doing the the below code because its not giving desired results, thank you

DATA it_vbak_database TYPE STANDARD TABLE OF vbak. 
FIELD-SYMBOL <fs_vbak_database> TYPE vbak.


LOOP AT it_vbak_database ASSIGNING <fs_vbak_database>.
  DATA(wa_vbak) = CORRESPONDING z_tbl_vbak( <fs_vbak_database> ).
  APPEND wa_vbak TO tt_vbak.
ENDLOOP.

z_tbl_vbak has 21 fields from VBAK table
6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,303

What are the desired results, and what do you currently get?

Read only

alopezv74
Participant
1,303

I'm guessing, that Z_TBL_VBAK, is a table type, not an structure type, so the wa_vbak is a table.

I think that this will do the trick:

tt_vbak = CORRESPONDING #( it_vbak_database )

Assuming the tt_vbak has z_tbl_vbak type.

regards,

Adolfo

Read only

Former Member
0 Likes
1,303

Thank you for the answers. Pl. let me know does the below code,

1) Creates automatically the WA_VBAK structure of type Z_TBL_VBAK, which has 21 fields from VBAK?

2) Then moved the data from <FS_VBAK_DATABASE> to WA_VBAK for the fields which has SAME NAME in both source and target?

DATA(wa_vbak) = CORRESPONDING z_tbl_vbak(<fs_vbak_database>).
Read only

0 Likes
1,303

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.

Read only

0 Likes
1,303

What are the desired results, and what do you currently get?

Read only

Former Member
0 Likes
1,303

This is how I did it...

TYPES:
BEGIN OF tv_plaf,
plnum TYPE plaf-plnum,
rsnum TYPE plaf-rsnum,
xdel TYPE flag,
END OF tv_plaf.

DATA:
lt_plaf_temp TYPE STANDARD TABLE OF tv_plaf
WITH NON-UNIQUE SORTED KEY xdel
COMPONENTS xdel.

*MOVE CORRESPONDING
lt_plaf_temp = CORRESPONDING #( lt_plaf ).