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

Convert file into XSTRING

marco_modenese
Explorer
0 Likes
2,831

Hi expert,

i want convert a file (es pdf txt doc) into XSTRING buffer to test some function, i do this:


    call function 'GUI_UPLOAD'
      exporting
        filename                      = UPATH
     IMPORTING
       FILELENGTH                    = length
      tables
        data_tab                      = STREAM

And now, i have the binary stream... i convert binary stream into XSTRING...


    call function 'SCMS_BINARY_TO_XSTRING'
      exporting
        input_length       = length
     IMPORTING
       BUFFER             = XSTREAM
      tables
        binary_tab         = STREAM
     EXCEPTIONS
       FAILED             = 1
       OTHERS             = 2

But STREAM is a binary table, with a defined line of some char (not char but x).... And, after, when I use the stream i have a lot of white space... because the line of binary tab is 1024...

I don't have a standard line length!!!

What I can do??? I want a correct XSTRING...

thank you...

1 REPLY 1
Read only

Former Member
0 Likes
1,364

Hi,

You might want to do this:

loop at stream

....move data to right deleting trailing space using command SHIFT.

SHIFT stream right deleting trailing space.

.. this command will remove trailing white space..

endloop.

is this you are looking for?

thnx,

<REMOVED BY MODERATOR>

ags.

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:11 PM