‎2020 Feb 24 5:25 PM
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
‎2020 Feb 24 5:44 PM
What are the desired results, and what do you currently get?
‎2020 Feb 24 6:03 PM
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
‎2020 Feb 24 6:18 PM
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>).
‎2020 Feb 24 6:31 PM
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.
‎2020 Feb 24 6:33 PM
What are the desired results, and what do you currently get?
‎2020 Feb 24 7:57 PM
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 ).