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

Type Conversion Conflict

kasithunuguntla
Participant
0 Likes
757

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
725

field-symbols : <vstruc> type any.

decalre this one as

field-symbols : <vstruc> type table.

3 REPLIES 3
Read only

kasithunuguntla
Participant
0 Likes
725

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>.

Read only

Former Member
0 Likes
726

field-symbols : <vstruc> type any.

decalre this one as

field-symbols : <vstruc> type table.

Read only

0 Likes
725

Hi,

Try declaring like below.

field-symbols : <vstruc> type any table.

Regards,

Aravind J M