Using JCo : IDoc to XML and XML to IDoc

Hey guys,
I need some guidance on Creating an xml file out of an IDoc using JCo and vice versa.
Can anybody please provide with the code samples or any kind of documentation on this topic.
Points will be rewarded
+| Eleana West

Hi,
what you are looking for is the sapidocjco.jar. You can get if from the service marketplace and it comes with a couple of example Java code which shows how to implement it. You will also need the normal JCo jar to use the sapidocjco.jar.
Bye,
Sameer

Similar Messages

  • I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to customer. Can you please help me on the same?

    HI Experts,
    I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to vendor. Can you please help me on the same?
    Thanks
    SaiSreevastav

    Hi Sai,
    you can use XSLT or java mapping or adapter module to convert IDOC xml to XLS. Please refer the below blog
    Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way
    Convert incoming XML to Excel Sheet Part 2 – Adapter Module way
    Convert incoming XML to Excel Sheet
    then after converting to Excel, you can use the payloadswap bean in mail adapter
    XI: Sender mail adapter - PayloadSwapBean - Step by step
    regards,
    Harish

  • IDoc to JDBC  and JDBC to IDoc Scenario

    Dear All,
    I am working on IDoc to JDBC and JDBC to IDoc Scenario.
    I have to send Idoc from SAP to Non SAP system(.NET application) i almost configured in XI but still i don't know when my INTEGRATION will INVOKE how my data will proceed from IDOC to Oracle database(Through JDBC) and in case of revese how and when Data flow will start.
    Does anyone have completed STEP by STEP scenario document for this?
    How my Idoc will sent to XI?
    How XI will pick up data from IDoc?
    How XI will Convert data to JDBC and UPDATE in Oracle Database?
    And i reverse case(JDBC to IDoc) when my INTEGRATION will INVOKE?
    Where and When i can watch my process and data?
    How can i test the whole integration?
    I AM GETTING ERROR WHILE TESTING CONFIGURATION IN Integration Directory "Error while refreshing the XI runtime cache" and when i check this in SXI_CACHE  it gives me error
    "Unable to refresh cache "NO_BUSINESS_SYSTEM"
    "Error during last refresh to cache"LCR_GET_OWN_BUSINESS_SYSTEM - NO_BUSINESS_SYSTEM"
    Please solve all the above problems i will reward u points
    thanks,
    RP

    Hi,
    While we working on IDOC to JDBC interface..
    We have to deploy JDBC Drivers?
    Go through this links,
    /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci1246926,00.html
    To install JDBC driver follow the how to guide.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
    Configuration of JDBC Adapter for SQL Server
    JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
    UserID and Password.
    If the connection is not working find the correct port number.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
    JDBC- X I -  R/3 Scenario
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Please check the driver path as mentioned below.
    JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
    Connection:jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//location of DB table.mdb;
    No JDBC driver required.
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    follow this thread
    Re: Problem when connecting to MS Access through JDBC Adapter.
    SAP Note 850116 has details
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Configuring the Sender JDBC Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm
    Configuring the Receiver JDBC Adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm
    Idoc Reveiver adapter..
    http://help.sap.com/saphelp_erp2004/helpdata/en/b9/c5b13bbeb0cb37e10000000a11402f/content.htm
    Thanks,
    Satya Kumar
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Edited by: SATYA KUMAR AKKARABOYANA on May 8, 2008 5:51 PM

  • IDOC to PDF and XML via EMail: using InputAttachment interface in mapping

    Hello Together,
    I am working on the following scenario:
    IDOC --> Transformation Nr. 1 IDOC-XML; Transformation Nr.2 XML- PDF --> Email with 2 Attachments XML and PDF.
    Till now Iu2019ve managed "IDOC to Email" with XML-Attachment. Therefore I used MailPackage and SwapBean. Unfortunately I didnu2019t see any possibility to send PDF attachment with MailPackage approach.
    Thatu2019s why I decided to change the scenario in this way to avoid using of MailPackage:
    u2022     first step: IDOC to FTP (2 XML files)
    u2022     second step: FTP (1. file = payload + 2. file= attachment) to Email with one XML-attachment
    It works without MailPackage, but I still need the PDF-attachment. In the moment I am trying to read the XML-attachment,  to transform XML2PDF and to add the second attachment to the message inside of mapping . I use InputAttachment and OutputAttachment interfaces.
    http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/InputAttachments.html
    Unfortunately the reading of the XML-attachment with u201CInputAttachementu201D interface inside of mapping doesnu2019t work. Tracing says: "there is no attachment".
    So my questions are:
    1. Is it possible to work with Input- and OutputAttachement interfaces inside of mapping? Or does it work only inside of adapter module?
    2. If it works inside of mapping, how can I test it in design time?
    If you see any other way to solve my problem, let me know please.
    Thank you a lot, regards Anna

    Question Nr. 1:
    "... Mapping programs are executed in the Java part of SAP NetWeaver AS. Consequently, the mapping runtime transfers the message payload from the ABAP part of the SAP NetWeaver Application Server to the Java part before the mapping program is executed. Since mapping programs do not usually access any MIME attachments in a message, the default setting is for the mapping runtime to transfer the payload only and not the attachments. This applies for both attachments that are removed as part of MTOM optimization in the Web services runtime, as well as for attachments that a sender sends together with a payload by using proxy methods in the XI runtime.
    If you want to access an attachment from a mapping program, it must have been transferred from the ABAP part to the Java part prior to execution. You can configure this in the basic settings of the operation mapping in which you reference the mapping program (select the Read Attachments checkbox)..."

  • Using resourceDescription in SUBSCRIPTIONBUNDLED_Email.xsl and xml's.

    Hello all,
    We are trying to use the Primitive Template "resourceDescription" (as described in "Customizing Notifications"-pdf) in the SUBSCRIPTIONBUNDLED_EMAIL.xsl and SUBSCRIPTIONBUNDLED_en.xml.
    Could anyone urgently let me know if it's possible to use this Primitive Template in the xsl and xml mentioned?
    It looks like the "resourceDescription" is not being passed on to the bundlednotificationdata-section in the xml?
    Any other suggestion in how to get the "resourceDescription" available in Daily Summary Subscription emails?
    Thanks in advance,
    Tim.

    Hello Alan,
    Yes; as far as I know the only way to get your changes to any of the email notification xml files visible is by restarting the server
    The notification email xsl I'm working on is the one for the daily notifications (subscriptionbundled_email.xsl).
    My problem is that it seems that the resourceDescription is not being passed on by the java code that is populating the section in the xml file containg the resource information...
    Unfortunately no confirmation about this yet (raised OSS with SAP as well).
    I'm expecting this resourceDescription to contain the text that you can fill in using standard KM in the Description field of a resource.
    I do wonder how/where your users populate the subject and description fields? Standard SAP KM or custom app?
    Cheers,
    Tim.

  • How to Convert internal table data into xml and xml data into internal tab

    Hi Guys,
          I have a requirement  that  i have to convert the internal table data into xml format and viceversa . for my requirement  i came to know that i have to use Transformations concept.  i done the converting the data from internal table into xml data by using standard Tranformations. My Question is 
    1) Can i use same Transformation to convert the xml data into abap internal table. if it is possible then how ???
    2) Is it possible using the standard Transformation  or I have to go for XSLT approach
    Please help me out from this guys,
    Thanks and Regards
    Koti

    Hi Koti,
    This is possible. There is a link. With the help of this link you can convert ABAP data to XML and vice versa.
    Link: http://www.heidoc.net/joomla/index.php?option=com_content&view=article&id=15:sapxslt&catid=22:sap-xslt&Itemid=31

  • Error handling problem with outbound idoc status 02 and  XML HTTP Port

    I set up an ALE scenario to send master data out of SAP via an XML HTTP port.  All goes well until the idoc receives error 02. 
    It looks like idocs in this error status with the use of an XML HTTP port can not be reprocessed via the standard SAP techniques.  Program RBDAGAIN takes them out of the list for reprocessing (even though the connection is back up and running).
    Is there any solution to still use the standard ALE error handling ?

    Hi Karin,
    Looks like based on note 701597, you can only reprocess these idocs manually via a workitem.  I qouted the relevant text below:
    3. Error handling with status '02':
    An HTTP IDoc in status '02' should not automatically be sent once again.
    Up to now, the RBDAGAIN report was used to resend incorrect IDocs.
    However, this report was adjusted and now deletes all IDocs in status 02
    to be routed to a HTTP port from the list of selected IDocs. IDocs to a
    HTTP port in status '02' should only be sent manually via a work item.
    Regards:
    Rex

  • Using a SQL data source and XML data source in the same template

    I am trying to develop a template for the Request for Quote report generated in Apps 11.5.10. I have loaded the data from the XML output into the template, but I am missing one field - I need the org_id from the po_headers table. Is it possible to use a sql data source (i.e., "select org_id from po_headers_all where po_header_id = [insert header_id from xml data]...") in addition to the xml data source to populate the template at runtime? When you use the Insert > SQL functionality is it static at the time the template is created, or does it call to the database at runtime? I've looked through all the docs I could find, but this isn't clear.
    Thanks for any help or suggestions you may have.
    Rhonda

    Hi Pablo
    Thats a tough one ... if you go custom with a data template you will at least get support on the data template functionality ie you have a problem when you try and build one. You will not get support on the query inside the data template as you might have gotten with the Oracle Report, well you could at least log a bug against development for a bad query.
    Eventually that Oracle Report will be converted by development anyway, theres an R12 project going on right now to switch the shipped OReports to data templates. AT this point you'll be fully supported again but:
    1. You have to have R12 and
    2. You'll need to wait for the patch
    On reflection, if you are confident enough in the query then Oracle will support you on its implementation within a data template. Going forward you may be able to swap out your DT and out in the Oracle one without too much effort.
    Regards, Tim

  • Defining XSLT from Abap to XML and XML to Abap (Internal Table)

    Hi Experts, I need help with this XSLT for call transformation. I have defined an internal table and intend to use it as a source for Call Tranformation. But I have a Problem defining its XSLT and help would be greatly appreciated! I also wonder if this XSLT can be used for XML to internal table? Or do I have to define another XSLT again.... Hope to hear from any of u soon!
    CODES->>>
    TYPES: BEGIN OF CONTENT,
             CONTENT1(20),
             CONTENT2(20),
           END OF CONTENT.
    TYPES: T_CONTENT TYPE TABLE OF CONTENT.
    DATA: BEGIN OF I_DATA OCCURS 0,
            KEY1(10),
            KEY2(10),
            CONT TYPE T_CONTENT,
          END OF I_DATA.
    DATA: WA_TBL TYPE CONTENT.
    DATA: LI_TBL TYPE T_CONTENT.
    START-OF-SELECTION.
    populate data 1
      CLEAR I_DATA.
      I_DATA-KEY1 = 'AMI'.
      I_DATA-KEY2 = 'LEE'.
      CLEAR WA_TBL.
      REFRESH LI_TBL.
      WA_TBL-CONTENT1 = 'PENHAS ROAD'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      WA_TBL-CONTENT1 = 'GILLMAN ROAD'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      I_DATA-CONT = LI_TBL.
      APPEND I_DATA.
    populate data 1
      CLEAR I_DATA.
      I_DATA-KEY1 = 'KAI'.
      I_DATA-KEY2 = 'LEE'.
      CLEAR WA_TBL.
      REFRESH LI_TBL.
      WA_TBL-CONTENT1 = 'SUNSET WAY'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      WA_TBL-CONTENT1 = 'BEDOK NORTH'.
      WA_TBL-CONTENT2 = 'SG'.
      APPEND WA_TBL TO LI_TBL.
      I_DATA-CONT = LI_TBL.
      APPEND I_DATA.
    call transformation (xslt)
        source i_data = i_data
        result xml xmlstr.

    here is the code sample using ixml library .
    just create a report program and copy paste the following code.
    if time permits, later on i will post the xslt program which you can use it call transformation.
    REPORT  y_test_xml.
    DATA: l_ixml                                 TYPE REF TO if_ixml,
            l_ixml_sf                              TYPE REF TO if_ixml_stream_factory,
            l_istream                              TYPE REF TO if_ixml_istream,
            l_ostream                              TYPE REF TO if_ixml_ostream,
            l_booklist                   TYPE REF TO if_ixml_element,
            l_document                             TYPE REF TO if_ixml_document,
            l_parser                               TYPE REF TO if_ixml_parser,
            l_root_element                         TYPE REF TO if_ixml_element,
            l_book_record                            TYPE REF TO if_ixml_element,
            l_date TYPE REF TO if_ixml_element ,
                    l_time TYPE REF TO if_ixml_element ,
            l_book_group                            TYPE REF TO if_ixml_element,
            l_book_cat                            TYPE REF TO if_ixml_element ,
            others                                  TYPE REF TO if_ixml_element ,
            link                                    TYPE REF TO if_ixml_element ,
            description                            TYPE REF TO if_ixml_element ,
            xml                                    TYPE xstring ,
            size TYPE  i ,
             l_xml  TYPE REF TO cl_xml_document  .
    DATA: xml_out TYPE string ,
          temp_string TYPE string .
    TYPES: BEGIN OF add_category,
    category_id(10),
    category_desc(40),
    END OF add_category,
    add_t_category TYPE add_category OCCURS 0 .
    TYPES: BEGIN OF add_book_grp,
    book_category TYPE add_t_category,
    END OF add_book_grp,
    add_t_book_grp TYPE add_book_grp OCCURS 0.
    TYPES: BEGIN OF add_book,
    book_num(10) TYPE c,
    short_desc(40) TYPE c,
    book_group TYPE add_t_book_grp,
    END OF add_book,
    add_t_book TYPE add_book OCCURS 0.
    TYPES: BEGIN OF type_data,
    date TYPE sy-datum,
    time TYPE sy-uzeit,
    book_record TYPE add_t_book,
    END OF type_data.
    DATA: i_data TYPE type_data OCCURS 0 WITH HEADER LINE.
    DATA: itab LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: cat_wa TYPE add_category ,
          bk_gp_wa TYPE add_book_grp ,
          bk_rec_wa TYPE add_book ,
          bk_wa LIKE LINE OF i_data .
    DATA: cat_tab TYPE STANDARD TABLE OF add_category ,
          bk_gp_tab TYPE STANDARD TABLE OF add_book_grp ,
          bk_rec_tab TYPE STANDARD TABLE OF add_book .
    MOVE: '03' TO cat_wa-category_id  ,
          ' BK GP 3' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    MOVE: '02' TO cat_wa-category_id  ,
          ' BK GP 2' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    bk_gp_wa-book_category  = cat_tab.
    APPEND bk_gp_wa TO bk_gp_tab .
    MOVE: '0012345678' TO bk_rec_wa-book_num ,
          'OMS book' TO bk_rec_wa-short_desc .
    bk_rec_wa-book_group = bk_gp_tab .
    APPEND bk_rec_wa TO bk_rec_tab .
    CLEAR:bk_gp_tab, cat_tab .
    REFRESH :bk_gp_tab, cat_tab .
    MOVE: '01' TO cat_wa-category_id  ,
          ' BK GP 1' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    MOVE: '09' TO cat_wa-category_id  ,
          ' BK GP 9' TO cat_wa-category_desc .
    APPEND cat_wa TO cat_tab .
    bk_gp_wa-book_category  = cat_tab.
    APPEND bk_gp_wa TO bk_gp_tab .
    MOVE: '00123456789' TO bk_rec_wa-book_num ,
          'SAP book' TO bk_rec_wa-short_desc .
    bk_rec_wa-book_group = bk_gp_tab .
    APPEND bk_rec_wa TO bk_rec_tab .
    MOVE: sy-datum TO bk_wa-date ,
          sy-uzeit TO bk_wa-time .
    bk_wa-book_record = bk_rec_tab .
    APPEND bk_wa TO i_data .
    CLEAR: cat_wa , bk_gp_wa ,bk_rec_wa , bk_wa .
    l_ixml = cl_ixml=>create( ).
    l_ixml_sf = l_ixml->create_stream_factory( ).
    l_document = l_ixml->create_document( ).
    l_root_element = l_document->create_element( name = 'asx:abap' ).
    l_root_element->set_attribute( name = 'xmlns:asx' value = 'http://www.sap.com/abapxml' ) .
    l_root_element->set_attribute( name = 'version' value = '1.0' ).
    l_document->append_child( new_child = l_root_element ).
    others = l_document->create_simple_element( parent = l_root_element name = 'asx:values' ).
    l_booklist = l_document->create_simple_element( parent = others name = 'BOOKLIST' ).
    LOOP AT i_data INTO bk_wa .
      CLEAR temp_string .
      MOVE: bk_wa-date TO temp_string .
      l_date = l_document->create_simple_element( parent = l_booklist name = 'DATE' value = temp_string  ).
      CLEAR temp_string .
      MOVE: bk_wa-time TO temp_string .
      l_time = l_document->create_simple_element( parent = l_booklist name = 'TIME' value = temp_string ).
      LOOP AT bk_wa-book_record INTO bk_rec_wa .
        l_book_record = l_document->create_simple_element( parent = l_booklist name = 'BOOK_RECORD' ) .
        CLEAR temp_string .
        MOVE: bk_rec_wa-book_num TO temp_string .
        l_date = l_document->create_simple_element( parent = l_book_record name = 'BOOK_NUM' value = temp_string ).
        CLEAR temp_string .
        MOVE: bk_rec_wa-short_desc TO temp_string .
        l_time = l_document->create_simple_element( parent = l_book_record name = 'SHORT_DESC' value = temp_string ).
        l_book_group = l_document->create_simple_element( parent = l_book_record name = 'BOOK_GROUP' ).
        LOOP AT bk_rec_wa-book_group INTO bk_gp_wa .
          LOOP AT bk_gp_wa-book_category INTO cat_wa .
            l_book_cat = l_document->create_simple_element( parent = l_book_group name = 'BOOK_CATEGORY' ).
            CLEAR temp_string .
            MOVE: cat_wa-category_id TO temp_string .
            l_date = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_ID' value = temp_string ).
            CLEAR temp_string .
            MOVE: cat_wa-category_desc TO temp_string .
            l_time = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_DESC' value = temp_string ).
          ENDLOOP .
        ENDLOOP .
      ENDLOOP .
    ENDLOOP .
    l_ostream = l_ixml_sf->create_ostream_xstring( xml ).
    l_document->render( ostream = l_ostream ).
    CREATE OBJECT l_xml.
    CALL METHOD l_xml->parse_xstring
      EXPORTING
        stream = xml.
    l_xml->render_2_string(
      EXPORTING
        pretty_print = 'X'
      IMPORTING
    *    RETCODE      = RETCODE
        stream       = xml_out
        size         = size
    CALL METHOD l_xml->display.
    Hope this is helpful.
    do let us know how it goes.
    Regards
    Raja

  • Conversion of ABAP struct to XML and XML back to ABAP structure in ECC

    We would like to convert many ABAP structure and internal tables into an XML string and later on convert these XML strings back to ABAP structures and internal tables. Can someone let us know if there are any function modules in ECC which can import the structures or internal tables and export the XML. Also if there are any function modules which can do the reverse i.e. import the XML string and convert it back to Structure or internal table.
    We found the some method called "Call transformation" but it gives an error such as version not active. CRM has FMs which do these functionalities.
    Any guidance would be appreciated.
    Thanks.

    If you look into the FM's BANK_API_PP_UT_DATA_TO_XML and BANK_API_PP_UT_XML_TO_DATA they again use CALL TRANSFORMATION, so probably u might have to figure how to eliminate the errors ur getting using CALL TRANSFORMATION.

  • Generating itab- xml and xml- pdf

    i am generating a report program, content of a table is store in itab and i want my report program to generate xml file for the content of itab first and after that, by using that xml file i want to generate pdf file

    hi
    try this  ...
    tables:
      tsp01.
    *-- STRUCTURES
    data:
      mstr_print_parms like pri_params,
      mc_valid(1)      type c,
      mi_bytecount     type i,
      mi_length        type i,
      mi_rqident       like tsp01-rqident.
    *-- INTERNAL TABLES
    data:
      mtab_pdf    like tline occurs 0 with header line,
      mc_filename like rlgrap-filename.
    *-- SELECTION SCREEN
    data :
      p_repid like sy-repid value '<i><b>ur prg name havin the itab to b displayed</b></i>', " Report to execute
      p_linsz like sy-linsz value 132, " Line size
      p_paart like sy-paart value 'X_65_132'.  " Paper Format
    If user want use this as common program for all PDF Conversion
    then use the parameter option, which will get the report name
    Line size & Paper Format as input
    *parameters:
    p_repid like sy-repid, " Report to execute
    p_linsz like sy-linsz default 132, " Line size
    p_paart like sy-paart default 'X_65_132'.  " Paper Format
    start-of-selection.
    concatenate 'c:\'
                p_repid
                '.pdf'
      into mc_filename.
    *-- Setup the Print Parmaters
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    exporting
         no_dialog = 'X'
      IMPORTING
        out_parameters       = mstr_print_parms
        valid                = mc_valid
      EXCEPTIONS
        invalid_print_params = 2
        OTHERS               = 4.
    *-- Make sure that a printer destination has been set up
    *-- If this is not done the PDF function module ABENDS
      if mstr_print_parms-pdest = space.
        mstr_print_parms-pdest = 'LOCL'.
      endif.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
      mstr_print_parms-linsz = p_linsz.
      mstr_print_parms-paart = p_paart.
      submit (p_repid) to sap-spool without spool dynpro
                       spool parameters mstr_print_parms
                       via selection-screen
                       and return.
    *-- Find out what the spool number is that was just created
      perform get_spool_number using sy-repid
                 sy-uname
        changing mi_rqident.
    *-- Convert Spool to PDF
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid = mi_rqident
          no_dialog  = space
          dst_device = mstr_print_parms-pdest
        importing
          pdf_bytecount                  = mi_bytecount
        tables
          pdf        = mtab_pdf
        exceptions
          err_no_abap_spooljob           = 1
          err_no_spooljob                = 2
          err_no_permission              = 3
          err_conv_not_possible          = 4
          err_bad_destdevice             = 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.
    call function 'DOWNLOAD'
         exporting
              bin_filesize            = mi_bytecount
              filename                = mc_filename
              filetype                = 'BIN'
         importing
              act_filename            = mc_filename
         tables
              data_tab                = mtab_pdf.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    -->  F_REPID               *
    -->  F_UNAME               *
    -->  F_RQIDENT             *
    form get_spool_number using f_repid
         f_uname
                    changing f_rqident.
      data:
        lc_rq2name like tsp01-rq2name.
      concatenate f_repid+0(9)
                  f_uname+0(3)
        into lc_rq2name.  " separated by '_'.
      select * from tsp01 where  rq2name = lc_rq2name
      order by rqcretime descending.
        f_rqident = tsp01-rqident.
        exit.
      endselect.
      if sy-subrc ne 0.
        clear f_rqident.
      endif.
    endform." get_spool_number
    *reward if useful.
    Message was edited by:
            neha gupta

  • IDOC to JMS and JMS to IDOC.

    Hi All,
       I read most of the thread and found also some good link . But failed to get the exact thing that i need to carry out for this implementation. So , i am looking forward for your valuable help to get a clear understanding on this.
    Scenerio : IDOC to JMS.
    1. What need to carry out for configuring the JMS adapter as the receiver.
       I know the configuration side from SAP[IDOC] to XI side. But dont have any idea on configuring the JMS adapter.
    2. What drivers that i need to instal on ? & how can i know which driver should i use for my scenerio ?
    3. What details do i need from the client ?
    Scenerio : JMS to IDOC.
    1. I have the same thing to configure from JMS to SAP[IDOC], SO for this what else do i need to configure?
    2. What need to carry out for configuring the JMS adapter as sender?
    Can anyone, please provide me the details on this..
    Thanks in advance.
    Jay.

    Hi,
    Check the links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c1/739c4186c2a409e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/65/52693cab05e079e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f8/24ee41c334c717e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/frameset.htm
    Thanks!

  • Procedure for using Webserices and XML data button

    I am developing a report in xcelsius and I have huge data like 10000 records in my excel sheet  for one report because of which the report performance is very bad as I am increasing the max. no of rows from 512 to 10000 .Is their any way I can make those records come dynamically to the excel sheet by using XML Data Button, or Web Services etc if yes how can I use this or is their any other way to accomplish this
    As of now I am using the trial versron of XCELSIUS 2008 so can I use the option of webservices and XML in the trial version if so what I need to enter in WEbservice URL for trial versions
    Can any body send me the step by step process of using webservices & XML  when loading the data from excel to xcelsius
    if I use these options when I select the source data do I need to select the entire 10000 records , if so then again my performance will be bad , so can any one help me out please
    Thanks in advance
    Regards,
    Sany

    Dynamic datasources for Xcelsius
    http://resources.businessobjects.com/support/cx/samples/learning/downloads/ttv4-xml_data_button.pdf
    unable to use web services
    hope this helps you
    good luck
    Amr

  • Read .csv file to XI and convert to IDOC

    Hi XI  Gurus,
    We have a requirement at work where we need to import .csv files to XI ehich then XI converts it to xml and posts an IDOC to SAP. I have tried creating this in XI with File Adapter with File Content Conversion.
    I gave all the things required for File Content Conversion but still my .csv file is not being picked up and read by XI. Iam not sure why this is happening but can anayone please help me with this.
    Also please do let me know if anyone has a tutorial related to this scenario.
    Thanks,
    Mayuresh.

    Hi All,
    I tried checking the error via Run Time Workbench (RWB) and going to Communication Channel Monitoring. It shows that there are some errors in the Communication Channel but when i go inside  it does not open an error window for me containing the error details.
    Just wanted to explain my file structure and the settings i have done in the 'File Content Conversion' of the 'File Adapter' so that you guys can tell me where i am wrong:
    Message Type: VENDOR_MT
    VENDOR_MT
        VendorNumber
        LastName
        SearchTerm
        Currency
      Address
          Street
          City
          Zip
          Country
    I am using IDOC receiver at the other end (CREMAS.CREMAS03).
    CSV File Structure: (Sample)
    34567, Reed, Jon, AUD, Smith Street, Melbourne, 3066, AU
    The settings that i have used in the File Adapter (Content Conversion tab) are:
    RecordSet Structure: VendorNumber, LastName, SearchTerm, Currency, Street, City, Zip, Country
    RecordSet Sequence: Ascending
    ignoreRecordSetName: true
    Vendor_MT.fieldNames: VendorNumber, LastName, SearchTerm, Currency
    Vendor_MT.keyFieldValue: 01
    Vendor_MT.fieldSeperator: ','
    Vendor_MT.endSeperator: nl
    Address.fieldNames: Street, City, Zip, Country
    Address.keyFieldValue: 02
    Address.fieldSeperator: ','
    Address.endSeperator: nl
    Please do let me know if the communicatioon channel settings i have made are correct. Also let me know if i am missing some major setting.
    Thanks,
    Mayuresh.

  • Error in Connecting to BAPI (Error connecting using JCO.Client: null)

    Hi,
        I am trying to connect to a BAPI to extract data. However, I am getting this error
        Error connecting using JCO.Client: null
        Pls explain the meaning of the error and solution to the problem
    TIA
    Himanshu

    Hi,
    This means you are getting error while executing your model. its not able to use the JCO's.
    as I asked previously check your JCO status... its up and running????
    Here are some threads having same problem
    URGENT :Error connecting using JCO.Client: null
    Model and MetaData configarations  in JCO Connection
    Exception while executing
    PradeeP
    Edited by: pradeep bondla on Jul 31, 2008 11:53 AM

Maybe you are looking for