2019 Jan 22 10:48 AM
Hi Experts,
I have declared as follows:
->DATA: BEGIN OF ACTIVITY,
RF_NUMBER LIKE ZUIHNVLB-RF_NUMBER,
SPACE1(3) TYPE C VALUE ' ',
CREATE_DT LIKE ZUIHNVLB-CREATE_DT,
SPACE2(3) TYPE C VALUE ' ',
CREATE_TM LIKE ZUIHNVLB-CREATE_TM,
SPACE3(3) TYPE C VALUE ' ',
ELPSD_TM LIKE ZUIHNVLB-ELPSD_TM,
SPACE4(3) TYPE C VALUE ' ',
CREATE_ID LIKE ZUIHNVLB-CREATE_ID,
CHANGE_ID LIKE ZUIHNVLB-CHANGE_ID,
END OF ACTIVITY.
->DATA: DESCRIPTION LIKE ZUWB01-WB_DESC.
->LOOP AT RF_TABLE.
ACTIVITY-RF_NUMBER = RF_TABLE-RF_NUMBER.
ACTIVITY-CREATE_DT = RF_TABLE-CREATE_DT.
ACTIVITY-CREATE_TM = RF_TABLE-CREATE_TM.
ACTIVITY-ELPSD_TM = RF_TABLE-ELPSD_TM.
ACTIVITY-CREATE_ID = RF_TABLE-CREATE_ID.
ACTIVITY-CHANGE_ID = RF_TABLE-CHANGE_ID.
MOVE ACTIVITY TO DESCRIPTION. ----->Here iam moving
MOVE RF_TABLE-RF_NUMBER TO KEYINFO.
MOVE ' ' TO DISPLAY_FM.
MOVE VB_OBEX TO EXECUTE_FM.
MOVE INDICATOR_ON TO CHANGE_FLAG.
MOVE INDICATOR_ON TO CREATE_FLAG.
INCLUDE ZUIN0138.
ADD 1 TO SEQ.
APPEND LEVEL_TABLE.
ENDLOOP.
ERROR: "Description" & "Activity" are not mutually convertible in Unicode program.
Please suggest what to do, a fast response would be appreciated.
2019 Jan 23 8:50 AM
"One field in ACTIVITY is a decimal type". Yeah - that's why you can't do a straight move. You need to get the decimals into a character format. For that use WRITE ... TO...
Let's say that field is called "AMOUNT".
Create a new structure, ACTIVITY_CHAR with the same field names as ACTIVITY, except for AMOUNT, which you call AMOUNT_CHAR (Type C length 17... or whatever).
MOVE-CORRESPONDING activity TO activity_char.
WRITE activity-amount TO activity_char-amount_char NO-GROUPING RIGHT-JUSTIFIED.
description = activity_char.
Hi Experts,
I have declared as follows:
->DATA: BEGIN OF ACTIVITY,
RF_NUMBER LIKE ZUIHNVLB-RF_NUMBER,
SPACE1(3) TYPE C VALUE ' ',
CREATE_DT LIKE ZUIHNVLB-CREATE_DT,
SPACE2(3) TYPE C VALUE ' ',
CREATE_TM LIKE ZUIHNVLB-CREATE_TM,
SPACE3(3) TYPE C VALUE ' ',
ELPSD_TM LIKE ZUIHNVLB-ELPSD_TM,
SPACE4(3) TYPE C VALUE ' ',
CREATE_ID LIKE ZUIHNVLB-CREATE_ID,
CHANGE_ID LIKE ZUIHNVLB-CHANGE_ID,
END OF ACTIVITY.
->DATA: DESCRIPTION LIKE ZUWB01-WB_DESC.
->LOOP AT RF_TABLE.
ACTIVITY-RF_NUMBER = RF_TABLE-RF_NUMBER.
ACTIVITY-CREATE_DT = RF_TABLE-CREATE_DT.
ACTIVITY-CREATE_TM = RF_TABLE-CREATE_TM.
ACTIVITY-ELPSD_TM = RF_TABLE-ELPSD_TM.
ACTIVITY-CREATE_ID = RF_TABLE-CREATE_ID.
ACTIVITY-CHANGE_ID = RF_TABLE-CHANGE_ID.
MOVE ACTIVITY TO DESCRIPTION. ----->Here iam moving
MOVE RF_TABLE-RF_NUMBER TO KEYINFO.
MOVE ' ' TO DISPLAY_FM.
MOVE VB_OBEX TO EXECUTE_FM.
MOVE INDICATOR_ON TO CHANGE_FLAG.
MOVE INDICATOR_ON TO CREATE_FLAG.
INCLUDE ZUIN0138.
ADD 1 TO SEQ.
APPEND LEVEL_TABLE.
ENDLOOP.
ERROR: "Description" & "Activity" are not mutually convertible in Unicode program.
Please suggest what to do, a fast response would be appreciated.
2019 Jan 22 11:26 AM
Welcome to Unicode world...
2019 Jan 22 11:59 AM
fields are correctly defined and I cannot change it as it may be used anywhere else.
When using:
call method cl_abap_container_utilities=>read_container_c
exporting
im_container = activity
importing
ex_value = description
exceptions
illegal_parameter_type = 1
others = 2.
it gives error as: "Activity" is not type-compatible with formal parameter "Im_container"
but if I pass any particular field like, activity-rf_number in "Im_conatiner" parameter then its not showing error. But I need all contents of Activity. Please guide for he same.
2019 Jan 22 12:50 PM
2019 Jan 22 12:12 PM
Hi Experts,
I would like to mention that :
ELPSD_TM LIKE ZUIHNVLB-ELPSD_TM,
field in ACTIVITY is decimal type.
While Description's field: ZUWB01-WB_DESC is char type.
2019 Jan 22 3:51 PM
2019 Jan 23 7:18 AM
Hi Raymond,
Yes that's what I am getting when using
"cl_abap_container_utilities=>fill_container_c". How can I get non-garbage values please suggest.
Thanks.
2019 Jan 23 8:25 AM
2019 Jan 22 2:38 PM
If the structure contains non-character type field, it will lead to mutually unconvertible error in unicode system. You can use following code to move data from structure to string .
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = activity
IMPORTING
ex_container = description
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
2019 Jan 23 7:17 AM
Hi Monalisa,
I tried your suggestion but the value in 'description' is not coming correct. The decimals value are coming like '#########'. Any suggestion on this like how can I get exact values from activity into description?
2019 Jan 23 7:44 AM
Unicode system dont accept that kind of move thats why you have error. Solution is depend on what you want to do.
in your code, i see that you move data from a table to ACTIVITY structure which have all the fields as character type. If data in activity already correct,i think it quite simple by just CONCATENATE all the activity fields into description....
2019 Jan 23 8:32 AM
Hi Quynh,
Iam moving data from ACTIVITY to DESCRIPTION. One field in ACTIVITY is a decimal type.
2019 Jan 23 8:54 AM
So you may have to use RTTS to check the field type....you may find solution from bellow thread, i dont have time right now to check the solution:
https://archive.sap.com/discussions/thread/1136219
2019 Jan 23 8:50 AM
"One field in ACTIVITY is a decimal type". Yeah - that's why you can't do a straight move. You need to get the decimals into a character format. For that use WRITE ... TO...
Let's say that field is called "AMOUNT".
Create a new structure, ACTIVITY_CHAR with the same field names as ACTIVITY, except for AMOUNT, which you call AMOUNT_CHAR (Type C length 17... or whatever).
MOVE-CORRESPONDING activity TO activity_char.
WRITE activity-amount TO activity_char-amount_char NO-GROUPING RIGHT-JUSTIFIED.
description = activity_char.
2019 Jan 23 12:33 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |