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

getting error while moving data for append structure

Former Member
0 Likes
661

Hi All,       I have created one BADI for add some fields in LFB1.I have append structure in LFB1 related with required customized fields.       Now i need to call this structure in PAI in User_command _input,to export the in BADI class. But while declare structure its showing error. MODULE USER_COMMAND_9000 INPUT. Loop at screen. endloop. TYPES: Begin of zall_sf_bee,       ZBEE TYPE INT1,     ZEXPDT TYPE DATS,     ZBEETYP TYPE ZZBEETYP,     ZBLACK  TYPE ZZBLACK,     ZBFEM  TYPE ZZBFEM,     ZVADD  TYPE ZZVADD,     ZBFEMO  TYPE ZZBFEMO,     ZENTBEN TYPE ZZENTBEN,     END OF ZALL_SF_BEE.         Move LFB1-zall_sf_bee to w_zall_sf_bee.   EXPORT w_zall_sf_bee FROM w_zall_sf_bee TO MEMORY ID 'w_zall_sf_bee'. ENDMODULE.    zall_sf_bee its a append structure in LFb1 table. showing error zall_sf_bee does not have component of LFB1. Please let me know where I am doing wrong . Thanks and REgards Sankil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
624

Hii Sankil,

If the two structure are of not same line type i.e order of fields , number of fields and type of fields then we can't use the move x TO y.

This will only possible if the X and Y are same with each other.

So in your case you can use MOVE-CORRESPONDING LFB1 TO w_zall_sf_bee. OR

Assign the particular field of one work area to the particular field of another work area e.g

w_zall_sf_bee-ZBEE             =  lfb1-zbee.

w_zall_sf_bee-ZBEETYP  =  lfb1-ZBEETYP.

w_zall_sf_bee-ZENTBEN  = lfb1-ZENTBEN.

APPEND w_zall_sf_bee TO t_zall_sf_bee.  "t_zall_sf_bee internal table of type zall_sf_bee.

CLEAR w_zall_sf_bee.

regards

Syed

3 REPLIES 3
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
624

You can not use this Move LFB1-zall_sf_bee to w_zall_sf_bee..

Refer individual fields  or move corresponding lfb1 to w_zall_sf_bee..

w_zall_sf_bee-zbee = lfb1-zbee .

Read only

Former Member
0 Likes
624

hi,

    this line makes error.   Move LFB1-zall_sf_bee to w_zall_sf_bee

better you try like this. move lfb1 to w_zall_sf_bee.

Regards,

gopi

Read only

Former Member
0 Likes
625

Hii Sankil,

If the two structure are of not same line type i.e order of fields , number of fields and type of fields then we can't use the move x TO y.

This will only possible if the X and Y are same with each other.

So in your case you can use MOVE-CORRESPONDING LFB1 TO w_zall_sf_bee. OR

Assign the particular field of one work area to the particular field of another work area e.g

w_zall_sf_bee-ZBEE             =  lfb1-zbee.

w_zall_sf_bee-ZBEETYP  =  lfb1-ZBEETYP.

w_zall_sf_bee-ZENTBEN  = lfb1-ZENTBEN.

APPEND w_zall_sf_bee TO t_zall_sf_bee.  "t_zall_sf_bee internal table of type zall_sf_bee.

CLEAR w_zall_sf_bee.

regards

Syed