‎2006 Jun 13 6:59 AM
Hi,
I'm using FM CONVERT_OTF to convert the OTF Data out of a smartform to XSTRING format.
Any idea about how to convert the XSTRING obtained to PDF? I tried the cl_http_response method, but it doesn't work. I'm on 4.6C, and the OO Methods work only on 4.7.
Any pointers would be helpful.
Are there any parameters in the smartform which will help me achieve this?
Regards,
Vijay
‎2006 Jun 13 7:19 AM
Hi,
Is there any purpose for converting the OTF format to XSTRING?
As you can directly convert OTF to PDF using CONVERT_OTF_2_PDF function module.
‎2006 Jun 13 7:21 AM
Hi Vijay,
I agree with Lavanya. Why do you need to convert to XSTRING.? Can you specify it clearly...?
Regards,
SP.
‎2006 Jun 13 7:27 AM
Ya there's a reason. The XSTRING format is going to be further used by Enterprise Portal EP. The EP can't convert OTF Format to PDF through browser. So the XSTRING is required, which is further passed onto the portal XSTRING conversion function, and then it should be converted to PDF. So can anybody shed some light on this? Has anybody converted XSTRINGs successfully to PDFs.
To be more specific, the problem occurs only when there are tables and templates, and any sort of figures, other than plain text in the smartform. Otherwise plain text alone gets converted properly to PDFs through XSTRINGs. Is it that XSTRINGs can't handle graphics like tables and tempaltes?
Regards,
Vijay
Message was edited by: vijay srikanth
Message was edited by: vijay srikanth
‎2006 Jun 13 7:33 AM
Hi Vijay,
Have a look at this link .
1.
http://help.sap.com/saphelp_47x200/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
<b>Thanks,
Venkat.O</b>
‎2006 Jun 13 8:08 AM
Hi Venkat,
That is just Smartform SAP Help.
Regards,
Vijay
Message was edited by: vijay srikanth
‎2006 Jun 13 8:29 AM
Ok i dont have 4.6C to check that out.
(your reference of cl_http_response class makes me think you may be in atleast 4.7)
anyhow since you have the xstring (PDF page) , do you want to save it as a pdf file in your local system?
if yes use gui_download to download the same.
here are the steps.
first convert the xstring to a binary table by calling FM
SCMS_XSTRING_TO_BINARY
(for the binary tab parameter the itab declaration should be as follows.
data: begin of int_tab1 occurs 0,
int_txt(300) type x,
end of int_tab1.
)
now use gui_download with file type 'BIN' filename with extension .pdf
and pass the table returned from SCMS_XSTRING_TO_BINARY.
Regards
Raja
‎2006 Jun 13 9:19 AM
Hi DuraiRaj,
Unfortunately I'm not in 4.7. I'm in 4.6C this FM doesn't exist here.
Regards,
Vijay
‎2006 Jun 13 9:21 AM
Hi Vijay,
Check this SMARTFORM to PDF
http://www.sap4.com/wiki/index.php/Genera_PDF_a_partir_de_Smartforms
also check this BLOG
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
Regards
vijay
‎2006 Jun 13 9:35 AM
as i said i dont have access to 4.6 c system, so you have to find a replacement for this fm SCMS_XSTRING_TO_BINARY.
this is to convert the xstring to a internal table formta.
Regards
Raja
‎2006 Jun 13 9:41 AM
Is the XSTRING format same as XSFFORMAT - an output of the smartform.
Regards,
Vijay
Message was edited by: vijay srikanth
‎2006 Jun 13 10:33 AM
To be more specific, the problem occurs only when there are tables and templates, and any sort of figures, other than plain text in the smartform. Otherwise plain text alone gets converted properly to PDFs through XSTRINGs. Is it that XSTRINGs can't handle graphics like tables and tempaltes
Regards,
Vijay
Message was edited by: vijay srikanth
‎2006 Jun 13 8:05 AM
are you sure its XSTRING. to my knowledge 4.6c dosent have data type XSTRING
Regards
Raja
‎2006 Jun 13 8:07 AM
‎2014 Dec 09 7:35 AM
Use the below Code, this will help you to convert into pdf as a spool
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
copies = 1
dest = 'ZPDI'
doctype = 'ADSP'
IMPORTING
handle = l_handle
spoolid = l_spoolid
partname = l_partname
EXCEPTIONS
device_missing = 1
no_such_device = 2
operation_failed = 3
wrong_doctype = 4
wrong_devicetype = 5
OTHERS = 6.
IF sy-subrc = 0.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = l_globaldir.
CONCATENATE l_globaldir '/' l_partname '.pdf'
INTO l_filename.
OPEN DATASET l_filename FOR OUTPUT IN BINARY MODE.
"Pass the XSTRING value here.
TRANSFER l_xstring TO l_filename.
CLOSE DATASET l_filename.
l_filesize = xstrlen( l_xstring ).
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = l_handle
partname = l_partname
size = l_filesize
no_pdf = ' '
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
RETURN.
ENDIF.
* Close the spool request
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = l_handle
EXCEPTIONS
OTHERS = 1.
Thanks,
Jegadeesh
‎2014 Dec 09 11:12 AM