‎2009 Jan 22 10:28 PM
Hi,
The following code does not work and gives a dump UC_OBJECTS_NOT_CONVERTIBLE. I know that this is happening due to internal type conversion for DEC data type field. but do I have any other options? The same program uses different tables which does not have fields with DEC data type and it works fine. We started getting this problem after we started using this new table. See code and table structure below.
field-symbols : <vstruc> type any.
data: v_tabkey(250) type c.
*-create a data reference of type selected table
create data s_struc type ZRULES.
assign s_struc->* to <vstruc>.
v_tabkey = '100Grule00001Lineid0002X0002'
<vstruc> = v_tabkey. <<< This is where I am getting the dump.
As a temperory solution, I have hard coded in the program and this works fine. Request Gurus to please help me.
if i_tabnam = 'ZRULES.
<vstruc>+0(36) = v_tabkey.
else.
<vstruc> = v_tabkey.
endif.
ZRULES
MANDT X CLNT 3
RULES X CHAR 10
LINEID X NUMC 10
LOC X CHAR 1
KOKRS X CHAR 4
BEGDA DATS 8
PERCT DEC 7 2decimals
Regards
Kasi
‎2009 Jan 23 1:57 AM
field-symbols : <vstruc> type any.
decalre this one as
field-symbols : <vstruc> type table.
‎2009 Jan 22 10:41 PM
Or to make my question precise, how do I make a field symbol <vstruc>.have only key fields from ZRULES table (see code below).
*-create a data reference of type selected table
create data s_struc type (t_tables-tabname). <<< this is ZRULES table
assign s_struc->* to <vstruc>.
‎2009 Jan 23 1:57 AM
field-symbols : <vstruc> type any.
decalre this one as
field-symbols : <vstruc> type table.
‎2009 Jan 23 2:24 AM
Hi,
Try declaring like below.
field-symbols : <vstruc> type any table.
Regards,
Aravind J M