Submit program to send a smartform to the spool and obtain a PDF

Hi all,
I wanna know if there is a way to submit (execute) a program that print a smartform for print this smartform to the spool and then obtain a PDF file from the spool order.
I wanna do this because the program that allows to print the smartform is already implemented and its logic is complicated, and I need to get the smartform as a PDF to show it into a WDP Java application.
If it's posible to do this, could you explain me how can I do it?
Regards,
Gregory.

Hi,
To get the PDF format output of smartform you can try with the following Function Module.Before that you have to declare the function module for calling the smartform.
DATA:
  W_bin_filesize TYPE i,                            " Binary File Size
Internal table to hold the OTF data*
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
Internal table to hold OTF data record from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
Internal table to hold the data from the FM CONVERT_OTF
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
Function Module CONVERT_OTF is used to convert the OTF format to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Suvajit

Similar Messages

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • I can't read a file with the ext PDF the sender informed me that the file was reset to PDF.

    I can't read a file with the .ext PDF the sender informed me that the file was reset to PDF. But when I tried to open it the caption box informed me"the file is not in PDF format. I suspect the sender simply changed the file .ext which is why I can't open it! What can I do about it! I am working on an iPad.
    Thanks
    Mr Jim Lapthorn

    If the document is not, in fact, a PDF, then you will need to get your sender to provide a PDF.
    Can you open this document in any other application?

  • Smartforms to the printer and the spool queue

    Dear Expert,
    I'd like the smartforms to print to the printer which i can decide on the selection screen, at the same time, the smartforms can generate spool id to the spoll queue.
    Thanks to the documents on the page
    http://www.sdn.sap.com/irj/sdn
    Now I can get the spool , but there is a infomation message "OTF end command // missing in OTF data"  .
    If there any method to hide this message? Is there any example to get the spool and also make the smartforms print on the printer which i can select on the screen ?
    Ross
    Edited by: ross.wang on Jan 6, 2011 4:07 AM

    just set the parameters and that's will be ok.
    the parameters as follows:
    G_WA_ST_CONTROL_PARAMETERS-NO_DIALOG ='X'          (SMARTFORM一般标识符)          
    G_WA_ST_CONTROL_PARAMETERS-LANGU = P_LANGU          (语言选择)          
    G_WA_ST_CONTROL_PARAMETERS-PREVIEW = ''          (无预览)          
    G_WA_ST_OUTPUT_OPTIONS-TDNEWID  = 'X'          (生成新SPOOLLIST号)          
    G_WA_ST_OUTPUT_OPTIONS-TDDEST   = G_V_DEVICE          (设置打印设备)     
    G_WA_ST_OUTPUT_OPTIONS-TDIMMED = 'X'          (立即打印)

  • Print the smartform to the spool

    Hi all,
    How to Print the smartform to the spool  ?
    Thanks in advance
    Krupa

    DATA: p_out LIKE ssfcompop,
    p_ctrl LIKE ssfctrlop.
    CLEAR: p_out,
    p_ctrl.
    p_out-tdnoprev = 'X'.
    p_out-tdnoprint = 'X'.
    p_out-tdnoarch = 'X'.
    p_out-tddelete = 'X'.
    p_out-tddest = p_dest.
    p_out-tdnewid = ''.
    p_out-tdimmed = ' '.
    p_out-tdcopies = 1.
    p_out-tddataset = sy-repid.
    p_out-tddelete = ' '.
    CALL FUNCTION fm_name
    EXPORTING
    inv_header = tmp_header
    output_options = p_out
    control_parameters = p_ctrl
    user_settings = ' '
    TABLES
    t_item = tmp_item
    The lines in bold are the main key statements for spool.
    tdnewid is the name of the spool.
    awrd points if useful
    Bhupal

  • "A problem caused the program stop working," after I accepted the TERMS and Conditions for Adobe Reader 11 installstion. What I need to do next? Thanks.

    "A problem caused the program stop working," after I accepted the TERMS and Conditions for Adobe Reader 11 installstion. What I need to do next? Thanks.

    Thanks for your reply. I did get upgraded to 10. something. Not on that computer now. 11 is not supported on Vista
    Pat Willener <[email protected]> wrote:
    Pat Willener  created the discussion
    ""A problem caused the program stop working," after I accepted the TERMS and Conditions for Adobe Reader 11 installstion. What I need to do next? Thanks."
    To view the discussion, visit: https://forums.adobe.com/message/6442262#6442262

  • My dad has the original software and i can't install the program because my dad is in the US and I'm in the Philippines. Now, I asked the serial number of his adobe lightroom. How can I download the software using the serial number? thanks.

    My dad has the original software and i can't install the program because my dad is in the US and I'm in the Philippines. Now, I asked the serial number of his adobe lightroom. How can I download the software using the serial number? thanks.

    If you just need a copy of the software, then download the trial copy of Lr available from Adobe. On entering your serial number it will then become a full copy.

  • Send email notification when the baseline and actual values are different in project

    Hi
    I am working with MS Project 2013 and Project Server 2013.
    I need to the send email notification to the program manager (or to a user) whenever the project manager changes the task finish date for a task. Comparison should happen with the baseline finish and the difference needs to be updated to the Program Manager
    over mail.
    How to configure/customize email notification for changes in MPP.
    Please suggest.
    Regards,
    Sudhir

    If you are not having developer skills it will be complicated for you.
    You need to create event handler by code, as in the below link:
    http://msdn.microsoft.com/en-us/library/office/gg615466%28v=office.14%29.aspx
    Then compare your values and finally send email by code.
    Twitter : @MShoubaki | http://jo.linkedin.com/in/mshoubaki

  • I need help with closing a running program. It seems like it does not count as a program. Tried to turn of the computer and closing all programs. Please help!?

    I have a problem with a grey text box. It writes and says all i do. For example: When i now write it says all the letters one for one. If i open a new rogram it says so. If i click on something it gives me information about it. I can click the box and drag it, but dont close it. I have restarted the computer and closing all windows and programs. It just popped out when i was pressing some buttons on the mac. I think it is a easy way to fix it, but i cant find out what it is named and search for it. I think it is made for help and i did not download anything to get it. If i change user on the mac it does go away when I am on the other user, but i really want to keep the one i have because off all the settings and programs i have.
    Please reply if you know anything about this.
    This is a printscreen of the box, the language is Norwegian if someone wonder...
    It is really annoying, I hope someone can help me out.

    Oh thanks alot! Really happy that people take the time to answer my `noob`questions! Would not find that out by my own.
    Thanks!

  • TS2755 After upgrading to IOS 7.0.2 sending messages doesn't work right.  It gets stuck on "sending", until I click the message and select the option "send as text".  What's wrong?

    When using Message after upgrading to IOS 7, it get stuck on "sending" and stays there forever until I click the message and hit "send as text" and then the message changes from blue to green and goes through.

    I turned the phone off and then back on and now it works.

  • In the new Pages, how does one send an image to the background (and make it selectable)?

    How does one send an image to the background in the new Pages and how does one make it selectable?

    Also why don't TEXT to Speech short cuts established in system preferences work in the new Pages?
    I am confused (and not completely happy)

  • Send a signal, acquire the response and analyse

    Hello,
    I am quite beginner in Labview.
    I want to send a signal to a loudpeaker and acquire the signal of a microphone and a photomultipier.
    I have already done the VI to acquire and record, and the VI to send the signal to the loudpseaker.
    Now , I would like to merge the both Vi to send and acquire simutaneously.
    I use labview v.8

    These is my two VIs.
    Moreover when I open and run the sinewavegenerator end then want to run the VI " pm+micro record" the error 50130 occures.
    I suppose that I have to change something in my Daqmx task but I dont kmow what:
    Thank you for any help
    Eva Comble
    Attachments:
    micro+pm record.vi ‏106 KB
    sinewavegenerator.vi ‏161 KB

  • Delay in the opening the HFReports and books in PDF format on workspace

    Hi,
    When i am opening the financial reports in PDF format on workspace - it's taking long time.
    Please help me on this!!
    Thanks in Advance!!

    I think it is normal for books to take longer when they include multiple big size reports. I had a similar problem at a client. We ended up not including all the reports in one book and create several books instead. In another situation, we scheduled batches and the books ran automatically. This way, the users just received an email with the whole book in one pdf instead of running it on an ad-hoc basis and wait for the outcome.
    Hope this helps.
    Cheers,
    Mehmet

  • HT3500 I keep getting an error message that the "spools are full".  How do I access the spools and how do I empty them?

    I keep getting an error message that the "spools are full". Where do I find them and how to empty them?

    You may be able to determine the reason for this error by examining your Mac's logs with Console. To do that find the Console app - it is in your Utilities folder and looks like this
    You can find it by selecting Utilities from the Finder's Go menu.
    Open Console.
    If the log list column on the left is not already displayed, show the log list by selecting Show Log List from Console's View menu.
    Locate system.log in the list and select it. Many date and time-stamped entries will appear, hundreds of them, and you must find the entries relevant to your Mac's problem. To do that choose Clear Display from Console's toolbar. Leave Console running while you choose Print from iPhoto again. Examine any new entries logged in Console. If there are any, copy and paste them in a reply.

  • Difference between the .ps2pdf and export as pdf

    Dear All,
    Find the below, if you known about this colomns plese fill this out and update here itself.
    .ps2.pdf
    export
    Quark
    Indesign
    Quark
    Indesign
    resolution of photoshop files
    transparency related
    (CID) font
    color management
    layers
    reduce page size
    bookmarks
    hyperlinks
    Will see how many replies i get from you all.
    PRithivi

    PS Distill
    Export
    resolution of photoshop files
    Can be downsampled *
    Can be
    downsampled *
    transparency related
    No
    Depends on export setting
    (CID) font
    Yes * *
    Yes * *
    color management
    Yes * * *
    Yes * * *
    layers
    No
    Yes
    reduce page size
    Yes
    No
    bookmarks
    No
    Yes
    hyperlinks
    No * * * *
    Yes
    * As long as the settings between the two methods are identical, you will not see a difference.
    * * Factors such as application version, font and glyphs used have more influence on font encoding.
    * * * Color management is possible through a ps distill method, however many other factors will cause the variance and difference in cm outcome.
    * * * * Internal hyperlinks will not be retained, however URL hyperlinks can exist through default Acrobat settings.

Maybe you are looking for

  • PLease help me to configure

    Hello Friends, I need your help to configure my voice setup.I have two location connected with a point-to-point leased line. Both the ends have different brand pbx installed. One is connected with R1 with the help pf a T1 voice card and Other is conn

  • I need to know how to repair a currupt installation of Acrobat XI

    I had a hard drive crash that corrupted a number of files and apparently damaged my Creative Cloud installation of Acrobat XI Pro.  The AAM still lists Acrobat Pro XI as "installed" so I can't access the Install function to redownload the files.  The

  • Muvo NX prob

    I am having a bit of a problem with my Muvo NX. It's been working great for about 6 months now, but yesterday when I was moving some files onto it, it stopped mid-transfer. I tried to restart the transfer but it froze again. I tried to delete the fil

  • How can I prevent spam on a forum create in my BC site?

    We have a forum on our site and we get a lot of spam in our topics. How can I prevent that from happening and only ledget thread to be preserved?

  • 5508 design - best practice

    So thanks to Nicolas, I have our 5508 wireless controller up and running in the lab with 2 AP's. Right now I have 2 WLANS defined, 1 for internal users and 1 for guests. They are on seperate vlans which allows me to ACL the guest connections to inter