Application Development 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: 

Convert RAW 1022 to XString

Former Member
0 Kudos

Hi,

i have got a PDF-File in a RAW 1022 table and want to convert it into a XString.

I tried to do with SCMS_TEXT_TO_XSTRING, i got a result but a wrong one. My table has 11 lines, so the xstring should have 11424 characters - but it has 15627... Can anyone help to solve this problem?


DATA: file_tab TYPE TABLE OF bapiconten,
      file_xstr TYPE xstring.

* [...] PDF into table [...]

CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
  IMPORTING
    BUFFER   = file_xstr
  TABLES
    TEXT_TAB = file_tab
.

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

This should work, you can try something similar to this.

field-symbols: <fs_line> type raw.....( give the correct data type )

<fs_x> type xstring.

assign lv_x to <fs_xc> casting.

assign lv_raw to <fs_line> casting.

<fs_x> = <fs_line>.

0 Kudos

Uh, I forgot to tell you I am doing this in a BSP-Application, so i get the message that <fs_x> and <fs_line> are not convertable in an unicode-program.

0 Kudos

I found a solution. Thank you 😃

0 Kudos

Thanks Timo for share your solution...