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

Unicode problem

Former Member
0 Likes
1,189

Hello guys,

I am trying to figure out SM30 table events. I have lots of coding samples from the forum, but most of them doesn't work, because of a unicode short-dump.

I am trying to implement a Before save event (01) in this form:

FORM update_user_date_time.

DATA: f_index LIKE sy-tabix.

DATA: BEGIN OF l_total.

INCLUDE STRUCTURE zztable.

INCLUDE STRUCTURE vimtbflags.

DATA END OF l_total.

DATA: s_record TYPE zztable.

LOOP AT total INTO l_total.

IF l_total-vim_action = aendern OR

l_total-vim_action = neuer_eintrag.

MOVE-CORRESPONDING l_total TO s_record.

s_record-zz_user = sy-uname.

s_record-zz_date = sy-datum.

s_record-zz_time = sy-uzeit.

READ TABLE extract WITH KEY l_total.

IF sy-subrc EQ 0.

f_index = sy-tabix.

ELSE.

CLEAR f_index.

ENDIF.

MOVE-CORRESPONDING s_record TO l_total.

MODIFY total FROM l_total.

CHECK f_index GT 0.

MODIFY extract INDEX f_index FROM l_total.

ENDIF.

ENDLOOP.

ENDFORM. " UPDATE_USER_DATE_TIME

The short dump is this:

Runtime Error UC_OBJECTS_NOT_CONVERTIBLE

Date and Time 27.11.2006 14:28:10

ShrtText

Data objects in a Unicode program are not convertible.

on this line:

>>>>> LOOP AT total INTO l_total.

Can someone help me please?

Thank you!

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,060

Hi,

U can give a try with this:

Declare a field symbol of type VIM_TOTAL_KEY as given in the docu.

Loop at total assigning <fiel symbol> .

after this we can do one to one dat transfer to s_record or if the structur eof both s_rcord and field symbol is same then we can directly use the MOVE-corresponding statement.

Hope this helps.

8 REPLIES 8
Read only

Former Member
0 Likes
1,060

hi,

As per my knowledge the problem would be in the declaration of "toal" and "l_total".

Can you please send me the declaration of data object "total"?

So that I can understand the problem more clearly and will try to find a solution.

Regards,anjireddi

Read only

0 Likes
1,060

Total is a Global data object in that event.

More details here:

http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm

Read only

0 Likes
1,060
Read only

0 Likes
1,060

I saw that document, thank you.

But no example there for event 01 ( Before save ) , or with total data object.

Read only

Former Member
0 Likes
1,060

i think local internal table definition should be

DATA: BEGIN OF l_total OCCURS 0.

INCLUDE STRUCTURE zztable.

INCLUDE STRUCTURE vimtbflags.

DATA END OF l_total.

OCCURS 0 will create an implicit work area with the name same as internal table name. Award points if it helps.

Regards,

Amol

Read only

0 Likes
1,060

Thank you for reply!

I tried your solution, but same result, I don't know what is the problem....

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,061

Hi,

U can give a try with this:

Declare a field symbol of type VIM_TOTAL_KEY as given in the docu.

Loop at total assigning <fiel symbol> .

after this we can do one to one dat transfer to s_record or if the structur eof both s_rcord and field symbol is same then we can directly use the MOVE-corresponding statement.

Hope this helps.

Read only

0 Likes
1,060

Hi again,

VIM_TOTAL_KEY is not a type, is a <fs> type ANY .

I can use a <fs> type ANY , bun I cannot access the individual components of table line total...