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

problem in structure start with charecter type

Former Member
0 Likes
1,534

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.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,475

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.

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,475

You can convert arc_buffer to char string before passing it to subroutine.

Read only

0 Likes
1,475

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

Read only

Former Member
0 Likes
1,475

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,475

Hi Vik,

How did you get the structure of arc_buffer ? The OP has not provided the details in his post !!

Cheers,

Suhas

Read only

0 Likes
1,475

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.

Read only

0 Likes
1,475

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

Read only

0 Likes
1,475

hi suhas

i didnot understand your question properly can u explain me in detail & i hope u solve my problem

Read only

0 Likes
1,475

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,475

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,476

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.