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

Field synmobl code

Former Member
0 Likes
405

Hi Experts,

Pls see the below code:

TYPES: BEGIN OF Y_LIPS,

VBELN LIKE LIPS-VBELN,

POSNR LIKE LIPS-POSNR,

MATNR LIKE LIPS-MATNR,

LFIMG LIKE LIPS-LFIMG,

ARKTX LIKE LIPS-ARKTX,

VGBEL LIKE LIPS-VGBEL,

VRKME LIKE LIPS-VRKME,

VBELV LIKE VBFA-VBELV,

END OF Y_LIPS.

TYPES: BEGIN OF Y_LIPS2,

VBELN LIKE LIPS-VBELN,

POSNR LIKE LIPS-POSNR,

KUNAG LIKE LIKP-KUNAG,

MATNR LIKE LIPS-MATNR,

LFIMG LIKE LIPS-LFIMG,

ARKTX LIKE LIPS-ARKTX,

VGBEL LIKE LIPS-VGBEL,

WADAT_IST LIKE LIKP-WADAT_IST,

VRKME LIKE LIPS-VRKME,

VBELV LIKE VBFA-VBELV,

END OF Y_LIPS2.

DATA:T_LIPS TYPE STANDARD TABLE OF Y_LIPS,

DATA:T_LIPS2 TYPE STANDARD TABLE OF Y_LIPS2.

FIELD-SYMBOLSl:<FS_T_LIPS> TYPE Y_LIPS,

<FS_T_LIPS2> TYPE Y_LIPS2.

IF NOT T_LIPS IS INITIAL.

SORT T_LIPS BY VBELN MATNR.

UNASSIGN <FS_T_LIPS>.

LOOP AT T_LIPS ASSIGNING <FS_T_LIPS>.

if <fs_t_lips> is assigned.

<FS_T_LIPS2>-VBELN = <FS_T_LIPS>-VBELN.

<FS_T_LIPS2>-MATNR = <FS_T_LIPS>-MATNR.

<FS_T_LIPS2>-LFIMG = <FS_T_LIPS>-LFIMG.

<FS_T_LIPS2>-ARKTX = <FS_T_LIPS>-ARKTX.

<FS_T_LIPS2>-VGBEL = <FS_T_LIPS>-VGBEL.

<FS_T_LIPS2>-VRKME = <FS_T_LIPS>-VRKME.

<FS_T_LIPS2>-VRKME = <FS_T_LIPS>-VRKME.

<FS_T_LIPS2>-VBELV = <FS_T_LIPS>-VBELV.

COLLECT <FS_T_LIPS2> INTO T_LIPS2.

endif.

ENDLOOP.

ENDIF.

SO HERE THE PGM IS GOING TO DUMP AND GIVING ERROR IN DUMP LIKE:

FILED-SYMBOL Field symbol has not yet been assigned.

THE DUMP IS AT THE STATEMENT:<FS_T_LIPS2>-VBELN = <FS_T_LIPS>-VBELN.

Can any body tell me what may be the wrong the above code.

2 REPLIES 2
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
376

Hi,

You can as well use normal Workarea's instead of Field-Symbols in this case.

And use MOVE-CORRESPONDING TO move the data instead of using FIELD-BY-FIELD assignment.

I could not get why you want to use FIELD-SYMBOLS in this case.

Regards,

Sesh

Read only

Former Member
0 Likes
376

Hi Ravi,

As far as i understand Field-Symbols: Unless you assign a Data Object to a field symbol you cannot use it i.e., unless a ASSIGN statement is there for a field symbol that field symbol cannot be used.

In you program: the MOVE between the field symbols is not the problem, but:

in the statement

<FS_T_LIPS2>-VBELN = <FS_T_LIPS>-VBELN.

<FS_T_LIPS2> is not yet assigned to any data object and hence is the DUMP in your program. Try assigning a data object and then do this move stmt. It works fine.

Regards,

Goutham.

This is fully based on my understanding on Field Symbols.