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 using SCMS_TEXT_TO_BINARY

Former Member
0 Likes
1,263

**Using a unicode system ECC 5.0**

I'm getting this error with this function module "Error occurred during character conversion". I need to convert character string of length 255 to binary/raw with length also 255.

DATA: BEGIN OF itab OCCURS 0,

line(255).

DATA: END OF itab.

DATA: BEGIN OF xtab OCCURS 0.

INCLUDE STRUCTURE bapicontent255.

DATA: END OF xtab.

DATA: L_SIZE TYPE I.

CALL FUNCTION 'SCMS_TEXT_TO_BINARY'

IMPORTING

OUTPUT_LENGTH = l_size

TABLES

text_tab = I_SOLI

binary_tab = DATA_BIN

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.

Your help are highly appreciated. Thanks!

2 REPLIES 2
Read only

Former Member
0 Likes
586

hi ,

I had executed the same code as urs with itab content as itab-line = DEVELOPER.

i got output in xtab-line as 444556454C4F5045520D0A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

<b>code</b>

&----


*& Report YCHATEST *

*& *

&----


*& *

*& *

&----


REPORT YCHATEST .

DATA: BEGIN OF itab OCCURS 0,

line(255).

DATA: END OF itab.

DATA: BEGIN OF xtab OCCURS 0.

INCLUDE STRUCTURE bapicontent255.

DATA: END OF xtab.

DATA: L_SIZE TYPE I.

itab-line = 'DEVELOPER'.

append itab.

clear itab.

CALL FUNCTION 'SCMS_TEXT_TO_BINARY'

IMPORTING

OUTPUT_LENGTH = l_size

TABLES

text_tab = Itab

binary_tab = xtab

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.

loop at xtab.

write xtab-line.

endloop.

.

Read only

Former Member
0 Likes
586

Hi,

Did you get solution to this problem.

I also have same problem, with SCMS_TEXT_TO_BINARY

When I pass internal table with huge data it give Error....

How did u solve problem with this excess data...

Regards

Vijay