‎2009 Sep 05 4:57 PM
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 .
‎2009 Sep 05 5:01 PM
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
‎2009 Sep 05 5:03 PM
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
‎2009 Sep 05 7:06 PM
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
‎2009 Sep 06 8:33 AM
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
‎2009 Sep 06 11:40 AM
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
‎2009 Sep 07 9:13 AM
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
‎2010 Feb 12 1:15 PM