‎2010 Feb 23 3:58 PM
HI
I have to convert an internal table in a binary string.
I red several threads referring to this FM.
This is my code
*OUTPUT STRUCTURE
TYPES: BEGIN OF tp_tab,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
kunnr LIKE vbak-kunnr,
name1 LIKE kna1-name1.
TYPES: END OF tp_tab.
*GENERAL TABLE
DATA: it_data TYPE standard table of tp_tab,
lt_att_content_hex TYPE TABLE OF solix.
.....omissis
CALL FUNCTION 'SCMS_TEXT_TO_BINARY'
EXPORTING
FIRST_LINE = 1
LAST_LINE = 10
APPEND_TO_TABLE = 'X'
MIMETYPE = ' '
IMPORTING
OUTPUT_LENGTH =
TABLES
text_tab = it_data
binary_tab = lt_att_content_hex
EXCEPTIONS
FAILED = 1
OTHERS = 2
.
As you can see my internal table consist of 4 fields. the table consist of 10 rows
The problem is that the binary table contains only the first fields of the table (so VBELN)
Any Idea?
Thanks in advance
‎2010 Feb 23 4:44 PM
Hi, <li>Once you get Binary data using SCMS_TEXT_TO_BINARY, You need call SCMS_BINARY_TO_XSTRING to convert that binary data to xstring format, use it . Thanks Venkat.O
‎2010 Feb 25 10:28 AM
i agree with Venkat.O as he told u do like
Example:
*- Convert the string into xstring
call function 'SCMS_STRING_TO_XSTRING'
exporting
TEXT =k_string
IMPORTING
BUFFER = v_xstring
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.
*- Convert the string into binary table
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = v_xstring
TABLES
binary_tab = ta_excelx.
‎2015 Sep 24 10:10 AM
Hello Krupa janiji,
i am also following same way. first i am converting my document path to xstring format using scms_text_to_xstring. then next i want convert xstring to binary format i am using this fm scms_xstring_to_binary. still i am getting xstring format only. can you please suggest me. how solve this issue.
i am pasting my code here.
data: buffer type xstring,
lv_string type string.
lv_string = 'file name'.
call function 'SCMS_STRING_TO_XSTRING'
exporting
TEXT = lv_string
IMPORTING
BUFFER = buffer
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.
*- Convert the string into binary table
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = buffer
TABLES
binary_tab = lt_binary.