Converting OTF data from script to Spool Request

Hello,
Is there any way to convert OTF data into Spool Request.
Actual scenario is for the Order Acknowledgement form they have configured the output type for Print Medium and here the spool is generated through Close_Form . Based on the spool no they are converting the spool to PDF and then placing a copy in the Unix Directory.
They have also configured the form for Fax Medium , but here in the close_form they are getting the Fax number instead of spool number. As this way it just Fax the output to required destination , user require a copy of the output should be converted to PDF and then it has to be placed in Unix directory as it is happening for print medium.
The problem here in the close form for first  case , i can see the spool id but in the second case that is not happening . So only OTF data is available with me. So is there any way where i can pass OTF data get spool id . So that if i have spool id rest will be taken care by my existing logic.
I Appreciate your valuable inputs.
Thanks,
Subash

Check this code snippet.
data : it_spool      TYPE STANDARD TABLE OF rsporq     ,
                     it_pdf        TYPE STANDARD TABLE OF tline      ,
                     v_objtype     TYPE rststype-type   ,
                    v_name        TYPE rststype-name  .
*&      Form  find_spool_request_id
FORM find_spool_request_id.
  CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
    EXPORTING
      allclients          = '320'
      datatype            = '*'
      has_output_requests = '*'
      rq0name             = nast-dsnam
      rq1name             = '*'
      rq2name             = '*'
      rqdest              = 'LOCL'
      rqowner             = sy-uname
    TABLES
      spoolrequests       = it_spool
    EXCEPTIONS
      no_permission       = 1
      OTHERS              = 2.
  IF sy-subrc <> 0.
    MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " find_spool_request_id
*&      Form  convert_spool_to_pdf
FORM convert_spool_to_pdf .
  READ TABLE it_spool INTO wa_spool INDEX 1.
  v_spoolno = wa_spool-rqident.
*Get Spool request attributes
  SELECT SINGLE *
    FROM tsp01
    INTO tsp01
    WHERE rqident EQ v_spoolno.
  IF sy-subrc <> 0.
    MESSAGE i000 DISPLAY LIKE 'E'
                      WITH text-003 v_spoolno text-034.
    LEAVE LIST-PROCESSING.
  ENDIF.
  v_client = tsp01-rqclient.
  v_name   = tsp01-rqo1name.
  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      authority     = 'SP01'
      client        = v_client
      name          = v_name
      part          = 1
    IMPORTING
      objtype       = v_objtype
    EXCEPTIONS
      fb_error      = 1
      fb_rsts_other = 2
      no_object     = 3
      no_permission = 4
      OTHERS        = 5.
  IF sy-subrc <> 0.
    MESSAGE i000(zz) DISPLAY LIKE 'E'
                       WITH text-003 v_spoolno text-034.
    LEAVE LIST-PROCESSING.
  ENDIF.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = v_spoolno
        no_dialog                = ' '
      TABLES
        pdf                      = it_pdf
      EXCEPTIONS
        err_no_otf_spooljob      = 1
        err_no_spooljob          = 2
        err_no_permission        = 3
        err_conv_not_possible    = 4
        err_bad_dstdevice        = 5
        user_cancelled           = 6
        err_spoolerror           = 7
        err_temseerror           = 8
        err_btcjob_open_failed   = 9
        err_btcjob_submit_failed = 10
        err_btcjob_close_failed  = 11
        OTHERS                   = 12

Similar Messages

  • How can i convert the data from mutiple-table to the other database(MSSQL)?

    Dears,
    How can i convert the data from mutiple-table to the other database such as MS-SQL?
    I have a third party system based on MS-SQL 2000.
    Now we want to make a integration between SAP R/3(Oracle) and SQL server.
    When my user releases the purchase order in R/3, the application we coded will convert the releated data to the temp database on the SQL server.
    But i don't know which tools will help me reach the purpose.  BAPI, LSMW, IDoc... ???
    Would anybody tell me which way is better and how to do?
    Thanks a lot!
    Kevin Wang

    Hello Kevin,
    The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier.

  • Copy Z field data from SO to Purchase Requestion

    Hi
    I am facing one problem
    I have created one Z-field in Sales Order and have created the same field in Purchase Requestion also.
    Now how i want to transfer Z-field data from SO to PR.
    What is the procedure and configuration i have to do OR what is the process in copy control for copying Z-field data from SO to Purchase Requestion.
    Pls confirm.
    Regards
    Vicky

    Hi
    Thanks for the reply
    I know there is no standrad procedure but how i can tranfer Z field data from Sales Order to Purchase Requestion.
    Pl help me
    Regards
    Vicky

  • Converting modbus data from two registers into float

    I am reading modbus data from a DUT from two holding registers- 40609 and 40610. The register content I get is an array of two elements (12458, 14019). I want to convert these numbers into a floating point value. Does modbus library has a VI that does it? If not, how do you convert it?
    Thanks!
    Solved!
    Go to Solution.

    Like this
    That is join numbers and also typecast.
    Attachments:
    sample1.png ‏11 KB

  • How can i convert the date from M to MM ?

    Dear Guru ,
    I need to upload my list to SAP table , and in the list , we are using YYYY/M/D format ( Eg. 2010/5/20 , 2010/10/1 ) .
    And now i want to convert all date format to YYYY/MM/DD , Is it possibile to do that ?
    Here is my code , but it doesn't work . It returned "2009//3//5" format .
    data: ld_date_int type datum.
    data : test(10) type c.
    test = '2009/3/5' .
    ld_date_int = test .
    WRITE : SY-SUBRC , LD_DATE_int .
    Does SAP provide a standard function can convert the date format ?
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Dear
    You can try in this way :::
    data: ld_date_int type string.
    DATA : ld_string TYPE string.
    data : test(10) type c,
           ld_res1(4) TYPE c,
           ld_res2(2) TYPE c,
           ld_res3(2) TYPE c.
    DATA : ll_res2 TYPE i,
           ll_res3 TYPE i.
    test = '2009/03/5' .
    ld_date_int = test .
    ld_string = strlen( ld_date_int ).
    CASE ld_string.
      WHEN 10.
       WRITE : SY-SUBRC , LD_DATE_int.
      WHEN OTHERS.
        SPLIT ld_date_int at '/' INTO ld_res1 ld_res2 ld_res3 in CHARACTER MODE.
        ll_res2 = strlen( ld_res2 ).
        ll_res3 = strlen( ld_res3 ).
        IF NOT ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE: '0' ld_res2 INTO ld_res2.
          CONCATENATE: '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF NOT ll_res2 eq 2 and ll_res3 eq 2.
           CONCATENATE: '0' ld_res2 INTO ld_res2.
            CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
             WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
    ENDCASE.

  • Converting raw data from memory to OTF format

    hi all,
         i have a requirment where i need to submit a report and move the corresponding output to memory get the same back in OTF format and export it in an RFC.  i tried using different function modules but could not find the exact where i can convert from memory to OTF format or directly at the time of submit can store it in OTF format.
          tried converting list to asci but could not get the same report output,
    thanks,
    raju,

    Hi krishnam,
    You can try this function module
    SX_OBJECT_CONVERT_OTF_RAW
    Regards
    Sumit Bhutani

  • Convert Palm data from XP to Vista

    Recently my PC (WINXP) broke down.  In order to convert the palm data to notebook (VISTA), I have installed the Palm OS Desktop software.  But I cannot access the old palm data.
    My palm is Tungsten T3, and data is accidental wiped off. 
    I have tried to copy the user.dat file but it fails.
    Anyone has a better idea!?
    Post relates to: Tungsten T3
    Message Edited by lwluk225 on 05-15-2009 08:39 AM
    This question was solved.
    View Solution.

    When you click on the HotSync Manager icon, you will immediately see the connection options.  Do not click "Setup".
    You should see "Local", "Local USB", "Network", etc.   If you using the USB port, "Local" should NOT be checked, and Local USB should have a check next to it.
    If you don't see "Local USB" as an option, then you need a newer version of Palm Desktop.  I suggest you follow the instructions given you above to rectify the script error you were getting.
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • How to bind data from script created variable to embed element of XML schema (xsd) in "Data View"

    Hi, i have got another problem with livecycle designer scripting.
    I have got script line which is defining of string variable:
    var aaa = "this is my string";
    and i have got embed XML schema like this (it`s only short part of whole file):
    ... xs:element name="bbb" type="xs:string"/ ...
    After saving data to XML i would like to get "this is my string" as a value of my "bbb" XML element.
    To save this data i`m using submit button which is connect with submit.php file on my server.
    How to connect script created variable and embed XML schema element which is present on my "Data View" tab.
    Please help me a bit becouse i don`t know even where to search answer of it...
    Of course i know possibilities to create fake unvisible text field object and bind it with 'bbb' and than put "this.rawValue = aaa" to connect those two variables but i think that is not a good idea to solve it in that way. It`s too primitive

    i solve it, i should write this:
    xfa.datasets.data.bbb.value = aaa;

  • How do i convert my data from a blackberry bold to an iphone?

    I'm going to be migrating from Blackberry Bold to iPhone 4S and I need to know what will be involved to move all my data (contacts, calendar, etc.) to the iPhone.

    You are going to need to be using a supported application to manage your calendar/contacts once you get to the iPhone. It is designed to work with a number of supported applications, and Outlook is one of them. It depends on the OS platform you are using. This allows you to sync the calendar/contacts to the computer and it will then provide a copy of them for you in case you ever have a problem with the iPhone. You can also sync them to iCloud after you get to the iPhone, but initially, you will need to use something to import the calendar/contacts to the computer for that first sync.

  • How to convert a date from "yyMMddHHmmss" into "yyyy-MM-dd HH:mm:ss format

    hi
    please help i got the date "yyMMddHHmmss this format, how do i convert this into "yyyy-MM-dd HH:mm:ss" format using java code
    please help me anybody having idea

    YoungWinston wrote:
    jverd wrote:
    ...you don't need to know anything about dates or calendars to do that transformation, other than the rules for converting a 2-digit year to a 4-digit one.
    @OP: And for that, you have [SimpleDateFormat.set2DigitYearStart()|http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/text/SimpleDateFormat.html#set2DigitYearStart%28java.util.Date%29].
    WinstonRight. But I was talking about the case where we just use string manipulation directly, and skip DateFormat altogether. In this case we just need and if check against the int value of the first two digits.

  • Converting string data from a web service respons into XML structure of XI

    Hi,
    We receive a string structure from a web service.
    The string structure has an xml type format, that is all the tags and its content are in one line .
    The WSDL file of the webservice defines its response structure as a string type.
    How do i convert this string into proper XML structure (predefined by me in Integration repository).
    OR how do i make XI understand this string as an XML structure for further processing.
    Later i have to map this XML message type into IDoc.
    Himani

    Hi Himani,
    Please find the code for ur requirement -
    String need to parse -<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>
    Below mentioned code will convert it to -<MT_DATA><FROMDATE>20080202</FROMDATE><TODATE>20080101</TODATE></MT_DATA>
    Create a Message type and map it like this using java mapping ( no need to use Graphical mapping).
    Use MT_DATA as source and map it to your target structure .
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.StringReader;
    import java.util.HashMap;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.TransformerFactoryConfigurationError;
    import org.w3c.dom.DOMException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    public class XMLParser {
         private Map param = null;
         public static void main(String[] args) {
              try {
                   XMLParser wdb = new XMLParser();
                   wdb.parse();
              } catch (Exception e) {
                   e.printStackTrace();
         public void setParameter(Map param) {
              this.param = param;
              if (param == null) {
                   this.param = new HashMap();
         public void parse() {
              String document = "<response_webservice><from_date>20080101</from_date><to_date>20080202</to_date></response_webservice>";
              try {
                   Document sdoc;
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   // Using factory get an instance of document builder
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   // parse using builder to get DOM representation of the XML file
                   sdoc = db.parse(new InputSource(new StringReader(document)));
                   Element docEle = sdoc.getDocumentElement();
                   NodeList nl = docEle.getElementsByTagName("from_date");
                   Element lstElmnt = (Element) nl.item(0);
                   NodeList nl1 = docEle.getElementsByTagName("to_date");
                   Element fstElmnt = (Element) nl1.item(0);
                   System.out.println(fstElmnt.getFirstChild().getNodeValue());
                   System.out.println(lstElmnt.getFirstChild().getNodeValue());
                   Document tdoc = db.newDocument();
                   Element structure = createElement("MT_DATA", null, tdoc);
                   tdoc.appendChild(structure);
                   Element statement = createElement("FROMDATE", fstElmnt.getFirstChild().getNodeValue(), tdoc);
                   structure.appendChild(statement);
                   Element statement2 = createElement("TODATE", lstElmnt.getFirstChild().getNodeValue(), tdoc);
                   structure.appendChild(statement2);
                   System.out.println("Struct is :::"+tdoc.getDocumentElement().toString());               
              } catch (DOMException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }  catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (FactoryConfigurationError e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (ParserConfigurationException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SAXException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (TransformerFactoryConfigurationError e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         static Element createElement(String elementName, String content,
                   Document document) {
              Element returnElement;
              returnElement = document.createElement(elementName);
              if (content != null) {
                   Text T = document.createTextNode(content);
                   returnElement.appendChild(T);
              return returnElement;
         static Element createElement(String elementName, String content,
                   String attributeName, String attributeValue, Document document) {
              Element returnElement = createElement(elementName, content, document);
              returnElement.setAttribute(attributeName, attributeValue);
              return returnElement;
    Regards,
    Kishore

  • How to convert/restore data from SO_DOCUMENT_READ_API1 in a file ?

    Hi all,
    I have succeed in finding where my attachment data were stored thanks to the SO_DOCUMENT_READ_API1.
    But how could I convert/restore those data in the original file ? (data seems to be in a RAW format store in table Object_Content)
    If I want my file back, how could I do it ?
    Hope you undestand ^^
    Thanks for answering !
    Smoltok

    Hie
    just pass your table to the FM and specify the destination.  If you do not wish to hard code your destination folder you could call another function to specify the destination.
    data: path like rlgrap-filename default 'C://my documents/immunitiesdata2009'.
    *path will be be the destination location where you download the contents on PC
    datatab[] = contents_bin[].
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        BIN_FILESIZE                  = bin_filesize
        FILENAME                      = path
        FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = datatab
    *   FORMAT_TAB                    =
      EXCEPTIONS
        FILE_WRITE_ERROR              = 1
        NO_BATCH                      = 2
        GUI_REFUSE_FILETRANSFER       = 3
        INVALID_TYPE                  = 4
        NO_AUTHORITY                  = 5
        UNKNOWN_ERROR                 = 6.

  • SQLDeveloper export data from script question

    Yes I can right click on a result set in the SQL editor and export to CSV, TEXT, EXCEL, XML, etc.
    Very nice.
    But is there a way to automate the export from the SQL Editor
    to avoid the manual right clicking
    using the engine built into SQL Developer to do the export
    and feed it my parameters, like export file name??

    No, and they currently don't plan to add this later either.
    You do can vote on these existing requests on the SQL Developer Exchange.
    Have fun,
    K.

  • Convert Type Date from Siebel to Date (or Char) to SAP-BW

    Hello people !
    I take informations from Siebel (in a Oracle table) to an Ods in BW (with SystemSource, DataSource...)
    But i've got a problem about the type of Date of Atributes from Siebel.
    In my DataSource (BW), this type is "Dats", but in fact, it shows for example : "28/07/2004 22:10:59" (in a Oracle Table)
    So i try to put this "information" in 3 Types (in order to test) : Type c, Type d, and Type t.
    Nothing appears with Type d and t.
    And for Type c only appears : "28-JUL-0"
    So i need your help in order to solve this problem !!
    Thanks.
    V.

    Hello,
    I'm using in a formula :
    DATECONV( /BIC/ZCS_DDCH, "mm/dd/yyyy hh:nn:ss", "/" )
    with  /BIC/ZCS_DDCH Type D, Or Type C doesn't work !
    I try in a routine and o sourcezone, but seccessless.

  • Creating SQL Date from DD/MM/YYYY request parameters

    G'day,
    I have question regarding creating SQL Date so that it can inserted into MySQL database. In my JSP screen I have two drop downs boxes (One for day and one for month) and a textbox for year.
    In my servlet I want to make a SQL date object so that I can insert it into the database. Right now what I do is create GregorianCalendar object by passing year, month and day integers. Then I create java.util.Date object using GregorianCalendar's getTime method. Finally I create SQL Date object by using java.util.Date's getTime method.
    Iam having problems using this method. When the date gets inserted in the database the month is one more then it should be. (e.g instead of date as being 20/10/1973 it will be 20/11/1973).
    What is a better way to create SQL Date object?
    btw, Iam using PreparedStatement's setDate method that is why I want to create SQL Date object.
    Thanks for your help!

    Another way is to use the SimpleDateFormat class to convert that String to a Date object, and then convert that to SQL date the same way you already do. That has the advantage that you don't have to put in all that logic you already have (right?) to check that the month is between 1 and 12, and that the day is between 1 and whatever depending on the month...

Maybe you are looking for