‎2010 Dec 07 2:18 PM
Hello there everybody,
i m facing a real awful problem right now. I'm trying to convert an variable of the type XSTRING to a table of the structure SOLISTI1. The lines of the table are 255 characters long. The XSTRING has an unknown length. For example len(XSTRING) = 1913 characters lines in table = 8 ((7 x 255) + (1x 128)) Is there any FM or any order to transform the XSTRING into this certain table??? Greetings Gollmer
‎2010 Dec 07 2:55 PM
Hello there anmol,
my input is an XSTRING variable, not a tlines-table. Do you have any idea how else i can solve my problem?
‎2010 Dec 07 2:35 PM
Use the functions of funtion group SCMS_CONV or methods of class CL_BCS_CONVERT among others.
‎2010 Dec 07 2:43 PM
Hi,
There is a FM 'SX_TABLE_LINE_WIDTH_CHANGE' for this,
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = '268'
line_width_dst = '268'
TABLES
content_in = it_pdf[]
content_out = it_pdfdata[]
* EXCEPTIONS
* err_line_width_src_too_long = 1
* err_line_width_dst_too_long = 2
* err_conv_failed = 3
* OTHERS = 4.
.
This did not worked for me, I developed a code for that
first try this else try this code
data : wa_pdf type tline,
wa_pdfdata type solisti1,
i type i,
j type i,
k type i,
l type i.
i = 134.
loop at it_pdf into wa_pdf.
move wa_pdf(i) to wa_pdfdata+j.
j = j + i.
if j >= 255.
append wa_pdfdata to it_pdfdata.
CLEAR wa_pdfdata.
clear j.
k = 134 - i.
if k > 0.
move wa_pdf+i(k) to wa_pdfdata+0(k).
endif.
j = j + k.
endif.
l = j + i.
if l >= 255.
i = 255 - j.
else.
i = 134.
endif.
endloop.
Thanks,
Anmol.
Edited by: anmol112 on Dec 7, 2010 9:46 AM
‎2025 Jun 03 1:40 PM
‎2010 Dec 07 2:55 PM
Hello there anmol,
my input is an XSTRING variable, not a tlines-table. Do you have any idea how else i can solve my problem?
‎2010 Dec 07 3:29 PM
Use the methods I gave you...And you're correct: Anmol's answer was wrong...
‎2010 Dec 07 3:34 PM
Hello Brad,
I looked up the function-group and found the FM "SCMS_XSTRING_TO_BINARY". This piece of code sounds really promising to me. Unfortunately I cannot test this FM under real conditions. But I Think this one solves the problem.
Thank you very much Brad.
Greetings Gollmer
Edited by: GollmerBZ on Dec 7, 2010 4:35 PM