2010 Jul 01 9:33 AM
i am doing a upgrade of an abap program which is written in 4.6 to ecc 6.0 i am facing a unicode error problem
in the old program there is a sap standrad structure called arc_buffer so in this program they have used the structure as
below code
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING arc_buffer(record_len)
error_handling
p_message.
so when it is used as arc_buffer(record_len) system is giving unicode error like
'' the structure arc_bufffer(record_len) does not start with a charecter type field'
as the structure is sap standard i think i cannot change the stadard structure so what should be done to get out of this error.
2010 Jul 02 1:24 PM
the structure arc_buffer has following fields
RCSZK
RNAME
CHECKSUM
FLAGS
SEGMENT
so in the routine
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING arc_buffer(record_len) "here just use it like arc_buffer-<field_name>(record_len)
error_handling
p_message.or before calling the perform statement
data:lv_string type string.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = arc_buffer
importing
ex_container = lv_string
exceptions
illegal_parameter_type = 1
others = 2.
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING lv_string(record_len) "here just use it like arc_buffer-<field_name>(record_len)
error_handling
p_message.
i am doing a upgrade of an abap program which is written in 4.6 to ecc 6.0 i am facing a unicode error problem
in the old program there is a sap standrad structure called arc_buffer so in this program they have used the structure as
below code
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING arc_buffer(record_len)
error_handling
p_message.
so when it is used as arc_buffer(record_len) system is giving unicode error like
'' the structure arc_bufffer(record_len) does not start with a charecter type field'
as the structure is sap standard i think i cannot change the stadard structure so what should be done to get out of this error.
2010 Jul 01 9:45 AM
You can convert arc_buffer to char string before passing it to subroutine.
2010 Jul 01 11:09 AM
hi manish thanks for ur replie
can u tell me how can you convert the standard sap structure to char
i will be waiting for ur replie
2010 Jul 01 12:04 PM
Hello,
Try something like this,
data: begin of lv_buffer,
RCSZK(2) type c,
RNAME type RKZ_DBNA,
CHECKSUM(4) type c,
FLAGS type CHAR08,
SEGMENT type MAX_SEGM,
end of lv_buffer.
move-corresponding arc_buffer to lv_buffer.
* Use SCMS_BIN_TO_TEXT to convert arc_buffer-RCSZK and CHECKSUM to char type
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING arc_buffer(record_len)
error_handling
p_message.
move-corresponding lv_buffer to arc_buffer.
* Use SCMS_TEXT_TO_BIN again to convert arc_buffer-RCSZK and CHECKSUM to raw type
Vikranth
Edited by: Vikranth.Reddy on Jul 1, 2010 4:37 PM
2010 Jul 01 12:35 PM
Hi Vik,
How did you get the structure of arc_buffer ? The OP has not provided the details in his post !!
Cheers,
Suhas
2010 Jul 01 2:34 PM
hello vikranth
i have tried to change the data type to Charecter type using fm but it doesnt change
CALL FUNCTION 'SCMS_BIN_TO_TEXT'
EXPORTING
bin_line = arc_buffer-rcszk
IMPORTING
TEXT_LINE =
EXCEPTIONS
FAILED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if sy-subrc = 0.
write: 'successful'.
ENDIF.
2010 Jul 01 10:36 PM
elinuk,
did you see Suhas remark/question?
Anyway, you should have a look at documentations how to migrate programs to unicode: [SAP library - ABAP and Unicode|http://help.sap.com/saphelp_nw2004s/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/frameset.htm]
To help you a little bit, I think this one might help you more: http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c554d3b3dc11d5993800508b6b8b11/frameset.htm
2010 Jul 02 12:20 PM
hi suhas
i didnot understand your question properly can u explain me in detail & i hope u solve my problem
2010 Jul 02 12:23 PM
thank you very much sadra for your help & i hope u could me help in solving my unicode problems & u can also give me any information reg this unicode problems
2010 Jul 02 12:34 PM
You should provide the structure details of the arc_buffer for better analysis of your problem.
In Non-UC systems you could use offsets on structures ( like you do on character / string variables ). Although this is not a good programming practice.
In UC systems you cannot use offsets on non-character variables b'coz of which you are getting this error.
There is no standard solution to this problem & needs to be handled on a case-to-case basis. Debug the code in the non-UC system & check what the code is doing with the offset on the structure & try to replicate the same.
BR,
Suhas
2010 Jul 02 1:24 PM
the structure arc_buffer has following fields
RCSZK
RNAME
CHECKSUM
FLAGS
SEGMENT
so in the routine
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING arc_buffer(record_len) "here just use it like arc_buffer-<field_name>(record_len)
error_handling
p_message.or before calling the perform statement
data:lv_string type string.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = arc_buffer
importing
ex_container = lv_string
exceptions
illegal_parameter_type = 1
others = 2.
PERFORM read_file USING handle_tab_wa-offset record_len
CHANGING lv_string(record_len) "here just use it like arc_buffer-<field_name>(record_len)
error_handling
p_message.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |