04-03-2009 5:40 PM
Dear Experts,
I am getting a short dump when i am trying to maintain my Z table. the error is "The statement "MOVE src TO dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply. In this case, these rules were violated.
the actual short dump is appearing at Move total to fs_zsdslsbud.
ZSDSLSBUD table has a NUMC, 4 char field but in total internal table it is appearing as 0000####. I guess this is the error. I tried to replicate the same code where there are only char type fields and i dont have any issues with below code.
My Z table also have a currency field. How to handle the unicode conversion in this case? can i use Try and Catch statements. A piece of code would be appriciated.
Thanks in advance.
FORM f_trigger_before_save.
DATA: wf_index TYPE sy-tabix. "Index to note the lines found
DATA: BEGIN OF fs_zsdslsbud.
INCLUDE STRUCTURE zsdslsbud.
INCLUDE STRUCTURE vimtbflags.
DATA: END OF fs_zsdslsbud.
LOOP AT total.
IF <action> = neuer_eintrag .
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0.
wf_index = sy-tabix.
ELSE.
CLEAR wf_index.
ENDIF.
* (make desired changes to the line total)
MOVE total TO fs_zsdslsbud.
fs_zsdslsbud-ernam = sy-uname.
fs_zsdslsbud-erdat = sy-datum.
fs_zsdslsbud-erzet = sy-uzeit.
total = fs_zsdslsbud.
MODIFY total.
CHECK wf_index GT 0.
extract = total.
MODIFY extract INDEX wf_index.
ELSEIF <action> = aendern.
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0.
wf_index = sy-tabix.
ELSE.
CLEAR wf_index.
ENDIF.
* (make desired changes to the line total)
MOVE total TO fs_zsdslsbud.
fs_zsdslsbud-aenam = sy-uname.
fs_zsdslsbud-aedat = sy-datum.
fs_zsdslsbud-aezet = sy-uzeit.
total = fs_zsdslsbud.
MODIFY total.
CHECK wf_index GT 0.
extract = total.
MODIFY extract INDEX wf_index.
ENDIF.
ENDLOOP.
sy-subrc = 0.
ENDFORM. "f_trigger_before_save
Thanks,
Rajesh.
04-03-2009 5:48 PM
Hi,
Use this FM instead of Move statement.. In Unicode environments the left and right operands should be of same data type. to over come this you can use the below FM
CALL FUNCTION 'HR_99S_COPY_STRUC1_STRUC2'
EXPORTING
P_STRUCT1 = total
IMPORTING
P_STRUCT2 = fs_zsdslsbud.
04-03-2009 5:48 PM
Hi,
Use this FM instead of Move statement.. In Unicode environments the left and right operands should be of same data type. to over come this you can use the below FM
CALL FUNCTION 'HR_99S_COPY_STRUC1_STRUC2'
EXPORTING
P_STRUCT1 = total
IMPORTING
P_STRUCT2 = fs_zsdslsbud.
04-03-2009 6:00 PM