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

SYNTAX_ERROR

Former Member
0 Likes
1,052

hi friends,

i am getting dump when the below code exicuted in user exit which is ECC 6.0. But it was exicuted properly in ECC 5.0.

The error is <empty>-dar01 is not defined as field symbol.

ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO

<empty>-dar01.

Error in the ABAP Application Program

The current ABAP program "SAPFP50M" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

The following syntax error occurred in program "SAPLXPAD " in include "ZXPADF01

" in

line 458:

""<EMPTY>-DAR01" is not defined as a field symbol"

The include has been created and last changed by:

appreciation for faster answeres.

ysr .

7 REPLIES 7
Read only

Former Member
0 Likes
955

Hi,

This error is coming because you have declared <empty> as field symbol not <empty>-DAR01 and you are assinging to <empty>-DAR01 you should only be assigning to <empty> rather that <empty>-dar01 like below:


ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO
<empty>.

Rgeards,

Himanshu

Read only

Former Member
0 Likes
955

Hi

ZXPADF01 is an include of user-exit.

U should check how the variable <empty>-dar01 is defined.

ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO <empty>-dar01.

This line code means the program uses a field symbol, so u should find out a field-symbol defination there, something like:

FIELD-SYMBOLS: <EMPTY>.

U need to check how the field-symbol is defined, because if defined as generic data it can't know the name of field:

FIELD-SYMBOLS: <EMPTY> TYPE ANY.

In this case the line should be:

ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO <empty>.

It can indicate a field name (in your case DAR01, only if the defination is referenced to a structure

FIELD-SYMBOLS: <EMPTY> TYPE structure.

Max

Read only

0 Likes
955

hi Max,

You are right if in case of Generic Case the <FS> should be declared like below .

FIELD-SYMBOLS: <EMPTY> TYPE ANY.

as per below statement . <empty>-dar01 is not a generic .

ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO <empty>-dar01.

so the declaration of <FS> will be like below.

FIELD-SYMBOLS: <EMPTY> TYPE structure.

~linganna

Read only

0 Likes
955

HI max,

thanks for u r reply..

field symble is declared as below w_mara is also

DATA: BEGIN OF w_mara .

INCLUDE STRUCTURE mara.

DATA: END OF w_mara .

data mara like mara.

FIELD-SYMBOLS <empty> LIKE w_mara.

ASSIGN COMPONENT w_index OF STRUCTURE mara TO <empty>-dar01.

the error is <empty>-dar01 is not assign as field symbol.

can you correct in the above case where i am wrong .

ysr.

Edited by: ysr@jay on Sep 6, 2009 12:27 PM

Read only

0 Likes
955

Hi,

As Max has already suggested:



ASSIGN COMPONENT w_index OF STRUCTURE ps0041 TO <empty>.

As the field symbol you have declared is <empty>

Regards,

Himanshu

Read only

0 Likes
955

Hi

The code should be:

tables ps0041.
data w_mara  like mara.
data w_index type sy-index.

field-symbols: <empty> like w_mara,
               <value> type any.



assign w_mara to <empty>.

assign component w_index of structure ps0041 to <value>.
if sy-subrc = 0.
  <empty>-matnr = <value>.
endif.

U need to assign the whole structure to field-symbol, not a single field, the u can manage the fields of field-symbol structure as a normal structure.

In my system MARA hasn't a field called DAR01.

Max

Read only

0 Likes
955

resolved by self...