What are methods for converting otf to pdf format in sap script

Hi,
I have a requirement in script i have to convert that that otf file to pdf format,when i use function modules its corrupting that pdf file,So i want convert otf to pdf using class method any one can help me for that.If any sample coding for class method.
Thanks.

ok
CALL FUNCTION 'CONVERT_OTF'
     EXPORTING
       format                = 'PDF'
*      max_linewidth         = 255
     IMPORTING
       bin_filesize          = lv_bin_filesize
*      bin_file              = pdf_xstring
     TABLES
       otf                   = lt_otf
       lines                 = lt_pdf_table
     EXCEPTIONS
       err_max_linewidth     = 1
       err_format            = 2
       err_conv_not_possible = 3
       err_bad_otf           = 4
       OTHERS                = 5.
CALL FUNCTION 'GUI_DOWNLOAD'
     EXPORTING
      bin_filesize                    = lv_bin_filesize
      filename                        = c_name
      filetype                        = 'BIN'
*     APPEND                          = ' '
*     WRITE_FIELD_SEPARATOR           = ' '
*     HEADER                          = '00'
*     TRUNC_TRAILING_BLANKS           = ' '
*     WRITE_LF                        = 'X'
*     COL_SELECT                      = ' '
*     COL_SELECT_MASK                 = ' '
*     DAT_MODE                        = ' '
*     CONFIRM_OVERWRITE               = ' '
*     NO_AUTH_CHECK                   = ' '
*     CODEPAGE                        = ' '
*     IGNORE_CERR                     = ABAP_TRUE
*     REPLACEMENT                     = '#'
*     WRITE_BOM                       = ' '
*     TRUNC_TRAILING_BLANKS_EOL       = 'X'
*     WK1_N_FORMAT                    = ' '
*     WK1_N_SIZE                      = ' '
*     WK1_T_FORMAT                    = ' '
*     WK1_T_SIZE                      = ' '
*     WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
*     SHOW_TRANSFER_STATUS            = ABAP_TRUE
*     VIRUS_SCAN_PROFILE              = '/SCET/GUI_DOWNLOAD'
*   IMPORTING
*     FILELENGTH                      =
     TABLES
       data_tab                        = lt_pdf_table
*     FIELDNAMES                      =
    EXCEPTIONS
      file_write_error                = 1
      no_batch                        = 2
      gui_refuse_filetransfer         = 3
      invalid_type                    = 4
      no_authority                    = 5
      unknown_error                   = 6
      header_not_allowed              = 7
      separator_not_allowed           = 8
      filesize_not_allowed            = 9
      header_too_long                 = 10
      dp_error_create                 = 11
      dp_error_send                   = 12
      dp_error_write                  = 13
      unknown_dp_error                = 14
      access_denied                   = 15
      dp_out_of_memory                = 16
      disk_full                       = 17
      dp_timeout                      = 18
      file_not_found                  = 19
      dataprovider_exception          = 20
      control_flush_error             = 21
      OTHERS                          = 22.
   IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
TRY.
       GET PARAMETER ID 'RECEIPTENT' FIELD lvs_recipient1.
       send_request = cl_bcs=>create_persistent( ).
*      lt_attach_bin = cl_document_bcs=>xstring_to_solix( ip_xstring = lt_solix ).
       APPEND 'Test message' TO lt_text.
       l_sub_50 = lc_test1.
       document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                    i_text    = lt_text
                                                    i_subject = l_sub_50 ).
       document->add_attachment( i_attachment_type    = 'PDF'
                                 i_attachment_subject = 'script.pdf'
                                 i_att_content_hex    =  lt_attach_bin ).
       l_sub_line = lc_test1.
       TRY.
* Build subject line for email.
           CALL METHOD send_request->set_message_subject
             EXPORTING
               ip_subject = l_sub_line.
         CATCH cx_send_req_bcs INTO loref_obj_error.
           PERFORM sub_catch_error1 USING loref_obj_error.
       ENDTRY.
       send_request->set_document( document ).
*      sender    = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
       recipient1 = lvs_recipient1-objkey.
       recipient = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
*      send_request->set_sender( sender ).
       send_request->add_recipient( i_recipient = recipient
                                    i_express   = 'X' ).
       sent_to_all = send_request->send( i_with_error_screen = 'X' ).
       COMMIT WORK.
     CATCH cx_bcs INTO bcs_exception.
       MESSAGE 'eee' TYPE 'S'.
       EXIT.
   ENDTRY.

Similar Messages

  • What is code for to open a pdf format for scripts and smartforms

    hi
    experts
    can we help for this

    Hi Raviteja,
    Here is the code for converting a smartform into a PDF File..
    DATA: BIN_FILESIZE TYPE I,
    BIN_FILE TYPE XSTRING,
    T_OTF LIKE ITCOO OCCURS 200 WITH HEADER LINE,
    T_DOC LIKE DOCS OCCURS 200 WITH HEADER LINE,
    T_LINES1 LIKE TLINE OCCURS 200 WITH HEADER LINE,
    T_FINAL_PDF LIKE TLINE OCCURS 500 WITH HEADER LINE,
    filename TYPE string VALUE 'EXP.pdf',
    path TYPE string VALUE 'C:\DESKTOP\..',
    fullpath TYPE string VALUE 'C:\DESKTOP\PDF\EXP.pdf',
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
    EXPORTING
    use_otf_mc_cmd = 'X'
    ARCHIVE_INDEX =
    IMPORTING
    bin_filesize = bin_filesize
    TABLES
    otf = t_otf
    doctab_archive = t_doc
    lines = t_lines1
    EXCEPTIONS
    err_conv_not_possible = 1
    err_otf_mc_noendmarker = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT t_lines1 INTO t_lines1.
    APPEND t_lines1 TO t_final_pdf.
    ENDLOOP.
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    default_file_name = 'EXPO_INVpdf'
    prompt_on_overwrite = 'X'
    CHANGING
    filename = filename
    path = path
    fullpath = fullpath.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = bin_filesize
    filename = fullpath
    filetype = 'BIN'
    append = 'X'
    IMPORTING
    filelength = bin_filesize
    TABLES
    data_tab = t_final_pdf.
    IF sy-subrc EQ 0.
    MESSAGE s018(zmsg) WITH 'PDF Generated Successfully'.
    ELSE.
    MESSAGE s011(zmsg) WITH 'PDF Not Generated !!!'.
    ENDIF.

  • How to Print PDF Format In SAP SCRIPT

    Hi All,
    I have a requirement to print the output in PDF format.
    First we can pass the parameter from Excel sheet,through on the parameters , we can fetch the output and print the PDF format.
    Please help me.
    regards
    raghava

    Hi Ragha,
    SAP has created a standard program RSTXPDFT4 to convert your Sapscripts spools into a PDF format.
    You will get the spool number from transaction SP02.
    Also go through the following document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556
    Regards,
    Nitin.

  • Oracle IBR : API for converting files in PDF

    IBR and WCC Version : 11.1.1.6.0
    Currently We have configured IBR with UCM for converting documents to PDF format. Is there ant IBR API available so that without checking in the document in WCC , we can call the IBR API and get the document converted to PDF and it would be done through synchronous call.
    thanks in advance.
    Yogesh
    Edited by: user10285200 on Mar 28, 2013 12:18 AM

    Hi Yogesh ,
    Without having the content in WCC server you can convert it to PDF using the OIT Modules which is the actual engine that does the processing in WCC as well . For doing this you will need to have the PDFExport module deployed on your client machine and then with that conversion can be done .
    This is the link for OIT PDF Export module : http://www.oracle.com/technetwork/middleware/content-management/downloads/oit-dl-otn-097435.html
    Infact all the modules of content processing / conversion can be done as an independent stand alone application using OIT . Each of those modules are available from the above link.
    Hope this helps .
    Thanks,
    Srinath

  • Print JPEG/PDF Files in SAP Script

    Hi,
      I just want to know is it possible to print an Image of type JPEG/JPG in SAP Script, these images are
      uploaded from transaction OAOR not from Se78, so is it possible to display images uploaded from
      OAOR in SAP Script, if it is possible then please tell how to display these Images in SCript?
    Thanks In advance..
    Kalyan..

    Hi,
    [How to Print PDF Format In SAP SCRIPT]
    [Re: How to Print PDF Format In SAP SCRIPT]
    [https://forums.sdn.sap.com/click.jspa?searchID=22871024&messageID=7056757]

  • I download itext  for convert jsp to PDF. How to set content type for PDF.

    I download itext for convert jsp to PDF. How to set content type for PDF. I try
    <%@ page contentType = "application/pdf;charset=TIS-620" %>
    , but the page does not PDF.
    Thank.

    PDF files are usually binary files, JSPs are not well-suited for binary content.
    (If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
    "%PDF-" without whitespace.
    You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
    Try using a Servlet instead.

  • Is there any native method for converting String value to Hungarian notat..

    Hello. there.
    This might be very simple question. but I'm just curious about this.
    I am wondering if Java API offer the any native method for converting uppercased string value to lowercase which obey the Hungarian notation.
    What I'm going to do is using Reflection for excuting RFC function on SAP. I was found it is very similar to JDBC Programming.
    Please refer to blow codes.
    //mTable
    JCoTable mTable = function.getTableParameterList().getTable(rtnTblNm);
        for (int i = 0; i < mTable.getNumRows(); i++) {
         mTable.setRow(i);
         HashMap tmpData = new HashMap ();
              for (int j=0; j < mTable.getNumColumns(); j++) {
                     // I want to set key String [userNo] instead of  [USER_NO] here.
              tmpData.put(mTable.getMetaData().getName(j).toLowerCase(), mTable.getString(j));
              result.add(tmpData);
    } Basically, The idea was from ibatis framework [com.ibatis.common.beans.classInfo] dropcase();
    Any idea would be very helpful for me. Thank you.
    Edited by: hosung.seo on Aug 30, 2009 10:42 PM
    Edited by: hosung.seo on Aug 30, 2009 10:50 PM

    ejp wrote:
    Hungarian notation is a representation of logical/arithmetic expressions in postfix form. Not what you're talking about.
    So your title is very confusing to the people here who know what it means, which is probably all of them, because people read threads based on their title.From now on, I will pay more attention when I post an question.
    If the titile as " +Is there any native method for converting String value to camelcase?"+ would be easier to what i'm pointing at.
    As I mentioned in above sorce code, converting [USER_NO] to [userNo] isn't relevant Hungarian notation. yes, it was ambiguous. Agree! :)
    But some answer wasn't fit to converting case or recognizing "underscore" delimiter. I was expecting toCamelCase() such as blew. Thanks.
        public static String toCamelCase(String name) {
            String lowerName = name.toLowerCase();
            String[] pieces = lowerName.split("_");
            if (pieces.length == 1) {
                return lowerName;
            StringBuffer result = new StringBuffer(pieces[0]);
            for (int i = 1; i < pieces.length; i++) {
                result.append(Character.toUpperCase(pieces.charAt(0)));
    result.append(pieces[i].substring(1));
    return result.toString();

  • Converting Script from OTF to PDF format

    Hi Experts,
    Using FM CONVERT_OTF in SAP Script print program I am converting data of Script from OTF to PDF format but the data in PDF document srinks and looks like slightly overlapping one leter on the other, can any ony please tell me that how can I avaoid this.
    Thanks in Advance
    Best Regards
    Venkat

    Dear Venkatesh,
    I have the same scenario. I have to convert Script to PDF and then write it to FTP Server.
    Could you please provide me the code which you have used?
    Regards,
    Chaitanya A

  • My company loaded profiles onto my iPad for email and calendars.. There is also a signing certificate and a certificate. What are these for? Additionally are they able to monitor apps and usage, ie Internet usage when it is not on their wifi?

    My company loaded profiles onto my iPad for email and calendars.. There is also a signing certificate and a certificate. What are these for?
    Additionally are they able to monitor apps and usage, ie Internet usage when it is not on their wifi?
    I do not have any VPN enabled?

    Do you happen to have an Android?  If so and depending on what version there is a great data usage analyse tool built-in.  See if you can go to Settings -> Data Usage  from there you can pick a current or previous billing cycle and then use the vertical sliders to select a date range and it will filter the usage data per app to show you exactly what app(s) were using data during that time frame.

  • Service/Database Accounts - NT SERVICE\MSSQLSERVER & NT SERVICE\SQLSERVERAGENT - what are they for?

    Hi Guys,
    I’ve done a fair amount of research for this question but just cannot seem to find the answer to my question in simple, non-DBA, terms.
    Server 2008 R2
    SQL 2008 R2
    There are 2 users in the system database logins (NT SERVICE\MSSQLSERVER, NT SERVICE\SQLSERVERAGENT) … what are they for? It appears that they
    are accounts to run the corresponding Windows services but yet they cannot be selected from the list of available built-in accounts, local accounts or domain accounts.
    Also, I am using a couple of domain user accounts to run the services, do I need to add them to the database? I changed the service accounts from NETWORK
    SERVICE to the domain user accounts using the SQL Configuration Manger which is supposed to take care of managing the user group membership and registry changes but the domain accounts are not in the database …. The services appear to be running fine.
    Thanks

    In basic terms:
    As you say, in the SQL Server Database Engine there are two logins;
    NT SERVICE\MSSQLSERVER and NT SERVICE\SQLSERVERAGENT. The Database Engine runs in Windows as a Windows service named
    MSSQLSERVER. The NT SERVICE\MSSQLSERVER login is used by the service to connect to the Database Engine. Basically, this is how it connects to itself. The SQL Server Agent runs as a Windows service named
    NT SERVICE\SQLSERVERAGENT. The NT SERVICE\SQLSERVERAGENT
    login is how the Windows process that is SQL Server Agent connects to the Database Engine to read the
    msdb database to find out what it should do; and then do it. Both of these logins are members of the
    sysadmin fixed server role, so they can do anything in the Database Engine. And they need to stay that way.
    No, they can't be selected in the list of available built-in accounts, local accounts or domain accounts. This is because they are services, not accounts. They have a security identifier (SID) in Windows,
    but Windows knows they aren't real users. Windows can authenticate them, but they don't have passwords that any human can use. If you run
    lusrmgr.msc and look at the groups, you will see groups like
    SQLServerMSSQLUser$computername$MSSQLSERVER and NT SERVICE\MSSQLSERVER
    is a member of the group.
    As for the account that you used to run the services, this is complicated and has changed from SQL Server 2005 to SQL Server 2008 and now again in SQL Server Code Named 'Denali'. The short answer is that
    the account you specify will be used when a process tries to reach outside of the current Windows environment. But within the computer, there is a mix of authorization granted to the domain user, the service, and the Windows group
    SQLServerMSSQLUser$computername$MSSQLSERVER.
    The good news is that SQL Server Configuration Manager figures out all the stuff you need when you change the accounts. If you are a glutton for punishment, you can get an idea for how complicated this
    is by looking at the Denali documentation where I have tried to provide more specific information. (Note this is not the same as SQL Server 2008.) You can see it at:
    Configure Windows Service Accounts and Permissions
    http://msdn.microsoft.com/en-us/library/ms143504(SQL.110).aspx
    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

  • What are attributes for a row?

    What are attributes for a row?
    Are these the column names associated with the row?

    Attribute is the object-oriented term for an object's data holders. So attributes are analogous to columns in a table.
    Of course, attribute also has a couple of non-OO meanings. So the answer to your question really depends upon context.
    Cheers, APC

  • What are alternatives for passing DB credentials to rwrun/rwclient command line instead of USERID parameter?

    What are alternatives for passing DB credentials to rwrun/rwclient command line instead of USERID parameter?
    As per application security, the DB details should be mentioned in command line.
    I am looking for alternatives which I can use?
    Please help.
    Regards
    Gaurav Anand

    If you want a database username/password for every user that runs a report, you need to include un/pw in the command.
    An option that you see quite often is that Reports use a general database user to run any report. In that case you can include the un/pw of this special user in the Key Map File:
    http://docs.oracle.com/cd/E17904_01/bi.1111/b32121/pbr_run013.htm#RSPUB23557
    Of course, in that case you need an application in front of the call to the report to check if the user is allowed to run the report. This is how most web applications work anyway: there is one database user, and application users are maintained in the application itself.
    Or you can use single sign on:
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24479/pbr_sso002.htm#RSPUB23512

  • Hello.what is the best converter for iPhone(for converting variety of file formats to mp3)?

    hello.what is the best converter for iPhone(for converting variety of file formats to mp3)?

    the way the total video convert works is really easy you put the song in that you want to convert you tell it to convert into mp3 format and stay the same quality
    Message was edited by: Robert1986nb

  • What are rule for adding names to photos?

    what are rule for adding names to photos in iphoto?

    Since your profile indicates you have a Mac, I am guessing you are asking how to add a face name using iPhoto on your Mac.
    You would open the photo in iPhoto, click "Info" on the bottom, and then the "Faces" tab on the right.
    Once you have added the face name in iPhoto on your Mac, once you sync the photo to your iPhone, the name will appear there as well.

  • What are prerequisite for Design Studio Client tool behind firewall?

    Hi Experts,
    Can you tell me what are prerequisites for Design Studio Client tool behind firewall?
    Best Regards,
    Pushkar

    Hi Pushkar,
    In which 'mode' would you like to use the Design Studio Client application. Connected to the BI platform, SAP HANA, etc?
    With kind regards,
    Martijn

Maybe you are looking for

  • Data acquisition with daq card 6533

    Hi all, i need to develop a c++ (visual studio .net, no measurement studio) program that performs data acquisition at a sampling rate of 10Khz using a windows xp laptop and the daq6533 card. The program must sample 8 digital signals. Each signal has

  • HT1444 how do i upgrade my Mac OS on my MacBook Pro

    I have MacBook Pro with Mac OS 10.6.8. I want to install iBook Author software but when I try to install, I get error message stating that I need Mac OS X 10.7.4 or later to able to install this application. There seem to be no software updates avail

  • How to set queuname from the payload

    Hi,   My scenario deals with file to Proxy, I am using sender file adapter with EOIO and I am give queue name "xyz". In integration engine monitoring i can see outbound queue of integration engine as some XBQ0_XYZ i.e. fine. But I need to replace xyz

  • Error testing locally; works fine on remote server

    I was about to post that I'd hit an error when trying to create a conditional region in DW 8 with ASP, CF & PHP: Training from the Source. Rather than paste the non-PHP code, I uploaded the page to my remote server. When I browsed to the link, the er

  • Time-indepement Scheduling agreement with reference to contract

    I want to attach pricing procedure to scheduling agreement, so I change LPA SA from time-dependent to time-independent. But after the change, I can't reference contract to create SA. error message as below "Contr. release order only allowed for sch.