Idoc data definitions- TPSDL01,SHPMNT03,TPSSHT01

My translator allows me to import idoc standards.
My customer is not sure how to export the data definitions from SAP. Are the above IDOC data type definitions available on the web? 
Sample definition:
BEGIN_RECORD_SECTION
  BEGIN_CONTROL_RECORD
    BEGIN_FIELDS
      NAME                 TABNAM
      TEXT                 Name of table structure
      TYPE                 CHARACTER
      LENGTH               000010
      FIELD_POS            0001
      BYTE_FIRST           000001
      BYTE_LAST            000010
      NAME                 MANDT
      TEXT                 Client
      TYPE                 CHARACTER
      LENGTH               000003
      FIELD_POS            0002
      BYTE_FIRST           000011
      BYTE_LAST            000013
      VALUE_TABLE          T000

Similar Messages

  • Idoc - External Definitions Error

    Hi,
    I had to change the occurences of an exisiting idoc.  I had imported the xsd,changed the occurrences and reloaded it using WSDL structure.
    When i load the external definition in the mapping structure, it is giving me the following error.
    Object External Message Z_INVOICE02_MULTI |  INVOIC.INVOIC02.ZINVOIC02 | urn:sap-com:document:sap:idoc:messages not found
    Please note that when i had imported the xsd, i had removed the target namespace.

    Hi Sai,
    i need to add an additional field to the existing IDOC structure
    Is there any specific reason for usign IDOC as external definition (are you changing the occurance of IDOC)?
    what is your sender and receiver system?
    Are you expecting the value for this addition field to be populated by sap along with the rest of IDOC data? if yes then ,get a custom IDOC created in SAP with the required field.
    Or if you want to populate this additional field in PI usign any logic (assuming you are sending to any non sap system), then you can create a new ED for the targert , just export
    the ED to desktop , open with any xml editor (xml spy or microsoft  visual studio 2005) and navigate to the portion of xsd which you want to edit add the field -> reimport in PI and  use it as your target strucuture.You cannot edit ED directly in ESR.
    Regards,
    Srinivas

  • Error while adding a second template to the same data definition

    Hi,
    I am quite new to XML Publisher. I am developing a report using XML Publisher.
    I have added one template to the Data Definition. When I tried to add another Template(with different name as previous, to the same concurrent program and application) to the same Data Definition I am getting the following error.
    Error: You entered a duplicate template entry. Please change the Name, Code and/or Application and reapply.
    Can anyone help me out solving this problem. I am reaching my deadline. Please suggest me what can be done.
    Regards,
    Sita

    Hi
    Try to change the Template code name also and then check it.
    Thanks
    Sudheer

  • Customize AP Trial Balance XML Data Definition for adding Aging Buckets

    Hi
    I have to customize AP Trial Balance Report XML Data Definition Template for adding Aging Buckets & Supplier details in R12 , Could you let me know how i can modify XML file?
    Thanks
    Pravin

    Hi,
    My requirement is different from the one which is in below link.
    I need to add Aging Buckets & Supplier details to AP Trial Balance report (R12) , here i need to modify the XML Data definition template.
    Please help me, very urgent.
    Thanks
    Pravin

  • Unable to see Bursting Control file in Data definition

    I have installed the Patch 5968876. But I still dont see the upload Bursting Control File” Button . I see the new concurrent program XML Publisher Report Bursting Program being added, however Data definition screen is unchanged . Can someone pl advise what needs to be done..
    Thanks

    I think I got it... it is Patch 5968876

  • End date on data definition does not seem to work

    I made a mistake with a data definition, and have tried end dating it and starting again but when I try to create a new data definition I get an error that a data definition already exists with this Name or Code.
    How do I get around this ?
    My mistake was adding/updating the preview file to the data template in error.

    D Biel wrote:
    The Break On >> Library Errors menu item does prevent the ERANGE error. In fact it should do the same thing as the SetBreakOnLibraryErrors that you call programatically.
    Hi Darren,
    thanks, this is good news!
    D Biel wrote:
    However, the SetBreakOnLibraryErrors will supersede the menu item. So if in your code you call SetBreakOnLibraryError(1), then you will break on library errors despite the menu item's setting.
    This is not so good news as it limits (at least in this case) the menu command!
    In my code I have a few calls to SetBreakOnLibraryErrors (that are executed rarely and are not time critical). As a consequence, if a subroutine using the SetBreakOnLibraryErrors (FALSE) - critical function - SetBreakOnLibraryErrors (TRUE) sequence is called before cosh(), the menu command is without effect on cosh() errors. If the cosh() is called first, it should have an effect (I didn't try this case yet).
    This seems a bit confusing, to say the least...
    It is even more confusing if reading the help sentence:
    SetBreakOnLibraryErrors does not affect the state of the Run»Break on»Library Errors option in the Workspace window.
    Agreed, it does not change the check mark (if this is what you would call 'the state'), but it does affect the function, and what is 'not so nice', it does this secretly...
    You are already used to my comments, so here is another one: I don't like this behavior...  
    I will think about your suggested way out, thanks for providing it!
    Wolfgang

  • Error while passing date parameter to the XML data definition

    Hi All,
    I have developed a BI publisher report using XML data definition & RTF template.
    This data definition contains a SQL query in it's CDATA section and runs as a concurrent program(without RDF) . We are looking to pass a date parameter to the SQL query and its not accepting the date parameter. However, when we hardcode SYSDATE in the SQL query in place of the parameter, the report runs fine. In the log file it shows that the parameter is being treated in American date style and we are using DD-MON-RRRR format. I have tried to convert the date format however still the error exists.
    What we did ?
    Created a XML data definition which contains the SQL query in its CDATA section & p_rundate (DATE) parameter.
    Registerd the XML data definition as concurrent program with EXECUTABLE= XDODTEXE and Output format as XML with p_date as a date parameter.
    Looking for any available solution for the same.
    Thanks.

    Hi All,
    I have developed a BI publisher report using XML data definition & RTF template.
    This data definition contains a SQL query in it's CDATA section and runs as a concurrent program(without RDF) . We are looking to pass a date parameter to the SQL query and its not accepting the date parameter. However, when we hardcode SYSDATE in the SQL query in place of the parameter, the report runs fine. In the log file it shows that the parameter is being treated in American date style and we are using DD-MON-RRRR format. I have tried to convert the date format however still the error exists.
    What we did ?
    Created a XML data definition which contains the SQL query in its CDATA section & p_rundate (DATE) parameter.
    Registerd the XML data definition as concurrent program with EXECUTABLE= XDODTEXE and Output format as XML with p_date as a date parameter.
    Looking for any available solution for the same.
    Thanks.

  • XML Schema file in data definition

    Hi,
    I am creating a custom RTF template for a seeded data definition in the eBusiness Suite. The data definition has an XML Schema file loaded however this does not include all the data required for the template. Running the report to just generate the XML (i.e. no template) I can see that the additional data is available at this level just not included in the XSD.
    I have built the template including the additional elements from the XML and expected to have to create a custom data definition as well to add the additional elements to the XSD. However the template is working against the seeded definition and successfully picking up the elements that are not included in the XSD.
    Has anybody else come across this situation? And are there any potential issues? I could create a custom data definition as well to load an amended XSD but this would be a more invasive change as it would involve end dating the seeded data definition which I would prefer not to do. The report is not being generated from a concurrent request so I cannot just create a custom request and leave the seeded report untouched.
    Thanks,
    Sarah

    The XML Schema is only required if you are using a PDF template (the template file itself is PDF) with field-mapping. For other template types the schema is optional.
    The XML Schema is used to define a "class" of XML documents, so to speak. The define the semantics and structure of the XML documents more thoroughly.
    If you have closely related reports, you could use a single schema to standardize (in a sense) the XML to be output from the class of related reports. In that case you could have a single schema file uploaded to multiple reports/data-definitions.
    The W3C has good documentation on XML Schema.
    If you want to see samples, you can use tools such as dtd2xs to create sample schemas from your DTD.

  • Error while running XML data definition

    Hi,
    Want to run report using XML Publisher, created one Data Definition using xml file,
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="EmpDT" description="Employee Details" Version="1.0">
    <parameters>
    <parameter name="p_DeptNo" dataType="character"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[ SELECT Empno, Ename,Job,Mgr,Hiredate,Deptno FROM Emp WHERE deptno = nvl(:p_DeptNo,deptno) ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_EMP" source="Q1">
    <element name="EMPLOYEE_NUMBER" value="Empno"/>
    <element name="NAME" value="Ename"/>
    <element name="JOB" value="Job"/>
    <element name="MANAGER" value="Mgr"/>
    <element name="HIREDATE" value="Hiredate"/>
    <element name="DEPTNO" value="Deptno"/>
    </group>
    </dataStructure>
    </dataTemplate>
    Added concurrent program and trying to run request but it's getting completed with error, when i checked log file it was showing error like,
    XDO Data Engine Version No: 5.6.3
    Resp: 20420
    Org ID : 204
    Request ID: 5810677
    All Parameters: p_Dept_No=20
    Data Template Code: EMP_DET
    Data Template Application Short Name: AMW
    Debug Flag: N
    {p_Dept_No=20}
    Calling XDO Data Engine...
    [042811_124713802][][EXCEPTION] java.lang.NullPointerException
         at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:334)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:266)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:140)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
         at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:231)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:283)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492)
         at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
         at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(DataTemplateParser.java:1796)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:331)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:286)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    can any one help me to solve this error? it's urgent.....
    reply awaited..
    Regards,
    Priyanka.

    HI,
    We are facing some issue with CXML. I have posted a new thread [cXML with SAP PI;. 
    The content of that thread is pasted below: You can give your solution in the above mentioned thread so that I can grant points.
    We need to use cXML for our project. Based on the thread ( [Error while uploading CXML data definition.; )
    the following steps need to be done with the cXML DTD.
    1.First Delete the Multiple Declaration of "Method .ANY"
    2.replace all "ds:" character with 'ds_'
    3.replace all "xades: " with 'xades_'
    4.replace all "xmlns" with 'attr_'
    5) After this use Altova to convert the DTD to XSD.
    First of all, we could not carry out the 4th point, as in that case Altova says that it is invalid, and it fails to get imported in PI as well.
    Without step 4 , if we import it as external definition, then there are certain attributes with type xml:lang coming in Red.
    Can anybody tell us on how to fix this.
    Thanks,
    Himadri

  • How to remove an XML file from Data Template in Data Definition Screen

    Hi,
    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control File
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?
    11.0.10.2
    Regards,
    Avijit

    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.You cannot remove it but you can end-date it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control FileThis is explained in "Oracle XML Publisher Administration and Developer's Guide Release 12" manual -- http://docs.oracle.com/cd/B34956_01/current/acrobat/120xdoig.pdf
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?Correct -- See Chapter 2 "Creating the Template" and Chapter 5 "Data Templates and Chapter" in the same doc referenced above for details.
    Thanks,
    Hussein

  • Idoc data in flat file structure

    Dear Experts,
             We have  idoc data in flat file structure. We need to fetch it using ftp and map it to an idoc.
    please tell me how to proceed .
    Thanks,
    Aju

    Hi,
    For flat file you need to use the File content conversion parameters.
    Refer the blog,
    SAP Network Blog: How to process flat files with multiple documents like POs, SOs etc. in a File to IDoc scenario
    How to process flat files with multiple documents like POs, SOs etc. in a File to IDoc scenario
    Thanks
    Swarup

  • XML IDOC data (hosted on a web server)   &  handling multiple WSDLs

    Hi ALL,
    1)how to design an Interface for picking up an XML IDOC data (hosted on a web server) which will be uploaded to SAP or converted to a file
    this is what the customer has given me ..can any one explain me this and help me how to more forward
    2).This Interface must use UDDI concept because we are going to use multiple BAPIs /RFCs as WSDLs
    what is this mean can any send me some document on this
    3).Use web-service navigator concept as we will be handling multiple WSDLs
    i worked on 1. to define a place holder in WebAS for holding the
    wsdls.
    2. publish the wsdls in WebAS UDDI Repostory
    but i have never used web-service navigator concept as we will be handling multiple WSDLs what is the difference ..send me some step by step docs ..
    thanks very much
    RK..

    1.I am not clear with the requirement too. THere is no big deal in sending XML to IDOC or File. Based on your requirement you have to import IDOC structure or ify ou are using file, create a structure for the file.
    If u are asking about sendin the XML directly without mapping, even you can do that without MM and even IM.
    Please be more elaborate and if you are not clear with what client said, paraphrase them or ask again. Its not good to start work unless we are very clear with the requirement.
    you can say to my understanding i feel this, now pI will send data like this. Is it correct?
    2. More information on UDDI
    http://en.wikipedia.org/wiki/UDDI
    I dont think you need to worry much about this now with many features provided in ESR especially
    3. http://<Host>:<port>/wsnavigator/
    The webservices going out of PI are published here.
    provide host and port are host and port details of ext system.
    Once you enter link in your browser, it shows the available webservices hosted there.
    All you need is to click on the required wsdl and test it.
    It is as good as sending your data from PI to other system.
    It is similar to Altova XML spy but the difference here is you enter the values directly here but in XML spy we send XML .

  • What's wrong in this XML Data Definition

    Can someone point out the mistake in this XML Data Definition??
    <?xml version="1.0" encoding="UTF-8"?>
    <datatemplate name="CASH_BREAKUP" description="cash_breakup" version="1.0" defaultpackage="">
    <parameters>
         <parameter name="p_date" datatype="date" />
         <parameter name="p_date2" datatype="date" />
    </parameters>
    <dataQuery>
    <sqlstatement name="query1">
    select apc.CHECK_NUMBER, apc.CHECK_DATE, apc.VENDOR_NAME, apc.BANK_ACCOUNT_NUM,
    apc.AMOUNT, case when xah.EVENT_TYPE_CODE = 'PAYMENT CANCELLED' then apc.AMOUNT*-1 else apc.AMOUNT end as Accounted,
    xah.EVENT_TYPE_CODE
    from XLA_AE_HEADERS xah,
    XLA_AE_LINES xal,
    XLA_EVENTS xae,
    xla.xla_transaction_entities xte,
    ap_checks_all apc
    where xah.AE_HEADER_ID = xal.AE_HEADER_ID
    and xae.EVENT_ID = xah.EVENT_ID
    and xal.ACCOUNTING_CLASS_CODE = 'CASH'
    and xte.ENTITY_ID = xae.ENTITY_ID
    and xte.APPLICATION_ID = 200
    and apc.ORG_ID = 81
    and apc.check_id = xte.SOURCE_ID_INT_1
    and xah.ACCOUNTING_DATE >= :p_date and xah.ACCOUNTING_DATE >=:p_date2
    </sqlstatement>
    </dataQuery>
    <datastructure>
    <group name="check" source="query1">
         <element name="CHECK_NUMBER" value="Check Number"/>
         <element name="CHECK_DATE" value="Check Date"/>
         <element name="VENDOR_NAME" value="Payee"/>
         <element name="BANK_ACCOUNT_NUM" value="Bank Account"/>
         <element name="AMOUNT" value="Check Amount"/>
         <element name="ACCOUNTED" value="Accounted"/>
         <element name="EVENT_TYPE_CODE" value="Status"/>
    </group>
    </datastructure>
    </datatemplate>
    I registered this XML data definition in EBS using XML publisher but the concurrent program completes with errors...!!!

    The problem persists, So i have attached the XML Data Definition & Log file as you requested.
    Many Thanks for the reply..!!
    <?xml version="1.0" encoding="UTF-8"?>
    <datatemplate name="CASH_BREAKUP" description="cash_breakup" version="1.0" defaultpackage="">
    <parameters>
         <parameter name="p_date" datatype="date" />
         <parameter name="p_date2" datatype="date" />
    </parameters>
    <dataQuery>
    <sqlstatement name="query1">
    select apc.CHECK_NUMBER, apc.CHECK_DATE, apc.VENDOR_NAME, apc.BANK_ACCOUNT_NUM,
    apc.AMOUNT, case when xah.EVENT_TYPE_CODE = 'PAYMENT CANCELLED' then apc.AMOUNT*-1 else apc.AMOUNT end as Accounted,
    xah.EVENT_TYPE_CODE
    from XLA_AE_HEADERS xah,
    XLA_AE_LINES xal,
    XLA_EVENTS xae,
    xla.xla_transaction_entities xte,
    ap_checks_all apc
    where xah.AE_HEADER_ID = xal.AE_HEADER_ID
    and xae.EVENT_ID = xah.EVENT_ID
    and xal.ACCOUNTING_CLASS_CODE = 'CASH'
    and xte.ENTITY_ID = xae.ENTITY_ID
    and xte.APPLICATION_ID = 200
    and apc.ORG_ID = 81
    and apc.check_id = xte.SOURCE_ID_INT_1
    and xah.ACCOUNTING_DATE &gt;= :p_date and xah.ACCOUNTING_DATE &lt;= :p_date2
    </sqlstatement>
    </dataQuery>
    <datastructure>
    <group name="check" source="query1">
         <element name="CHECK_NUMBER" value="Check Number"/>
         <element name="CHECK_DATE" value="Check Date"/>
         <element name="VENDOR_NAME" value="Payee"/>
         <element name="BANK_ACCOUNT_NUM" value="Bank Account"/>
         <element name="AMOUNT" value="Check Amount"/>
         <element name="ACCOUNTED" value="Accounted"/>
         <element name="EVENT_TYPE_CODE" value="Status"/>
    </group>
    </datastructure>
    </datatemplate>
    Error Log File
    XML Publisher: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    CASH_BREAKUP3 module: Cash Account Breakup
    Current system time is 15-MAY-2013 09:34:28
    XDO Data Engine Version No: 5.6.3
    Resp: 20420
    Org ID : 81
    Request ID: 433616
    All Parameters: p_date=01-FEB-13:p_date2=28-FEB-13
    Data Template Code: CASH_BREAKUP3
    Data Template Application Short Name: XDO
    Debug Flag: N
    {p_date=01-FEB-13, p_date2=28-FEB-13}
    Calling XDO Data Engine...
    [051513_093433589][][EXCEPTION] java.lang.NullPointerException
         at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:334)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:266)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:140)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
         at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:231)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:283)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492)
         at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
         at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(DataTemplateParser.java:1801)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:331)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:286)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Output file size:
    42
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 15-MAY-2013 09:34:33
    ---------------------------------------------------------------------------

  • Read MULTIPLE idocs data with all sgmn to my internal table in a single

    Dear SAP Folks!
    I have a question, I know to read SINGLE idoc data with all segments, we have FM IDOC_READ_COMPLETELY but my requirement is to Read MULTIPLE idocs data with all segments to my internal table in a single shot without keeping this FM in loop! since it is performance issue, at a time i may want to read 1000 idocs data!
    Could anyone please let me know is there any way to get this, keeping mind of performance and any other FM?
    Best Regards,
    Srini

    Hi,
    I know idoc numbers and i can write a select Query to DB table EDID4 to get all segments data to my internal table. But i am looking for FM to do this. because i have too many number of idocs and each idoc is having many segments(I am thinking in performance point of view!) The FM IDOC_READ_COMPLETELY can accept only ONE IDOC number as import parameters at a time to get segment data. in similar way do we have any other FM? or other way? except select query to EDID4 table?
    Best Regards,
    Srini

  • IDOC data to excel file

    Hi
    I have downloaded the IDOC Data in my Excel file.
    But the problem is that I am getting all the details in a single column.
    I want the systematic data should appear on my Excel.
    Thanks

    hi,
        Sorry for the delay, just now i have seen your issue, here just i am trying to help you in case till now you have not got it....
    Thanks
    Satyasuresh
    Here the code....
    *& Report  YSAT_IDOC_TO_EXCEL                     *
    REPORT  YSAT_IDOC_TO_EXCEL line-size 275.
    data: idoc_control like EDIDC,
          NUMBER_OF_DATA_RECORDS like sy-dbcnt,
          NUMBER_OF_STATUS_RECORDS like sy-dbcnt,
          INT_EDIDS like edids occurs 0 with header line,
          INT_EDIDD like edidd occurs 0 with header line.
    data: begin of i_split1 occurs 0,
              segment(20),
              fieldname(20),
              field1(20),
              field2(20),
              field3(20),
              field4(20),
              field5(60),
              field6(20),
              field7(20),
              field8(20),
          end of i_split1.
    TYPE-POOLS : LEDID.
    data: STRUCT_TYPE TYPE LEDID_STRUCT_TYPE ,
    IDOC_STRUCT TYPE LEDID_T_IDOC_STRUCT,
    SEGMENTS TYPE LEDID_T_SEGMENT,
    SEGMENT_STRUCT TYPE LEDID_T_SEGMENT_STRUCT,
    excel_tab(2000) occurs 0 with header line.
    parameter: DOCNUM like edidc-docnum obligatory, "Idoc Number
    sap_rel like SY-SAPRL default SY-SAPRL no-display ,
    pi_ver like EDI_VERREC-VERSION default '3' no-display,
    d_excel as checkbox default 'X'. "Download ?
    start-of-selection.
      perform read_idoc.
      perform process_idoc.
      if d_excel = 'X'.
        perform download_to_excel.
      endif.
    end-of-selection.
    *& Form read_idoc
    text
    FORM read_idoc.
      CALL FUNCTION 'IDOC_READ_COMPLETELY'
        EXPORTING
          DOCUMENT_NUMBER          = docnum
        IMPORTING
          IDOC_CONTROL             = idoc_control
          NUMBER_OF_DATA_RECORDS   = NUMBER_OF_DATA_RECORDS
          NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS
        TABLES
          INT_EDIDS                = INT_EDIDS
          INT_EDIDD                = INT_EDIDD
        EXCEPTIONS
          DOCUMENT_NOT_EXIST       = 1
          DOCUMENT_NUMBER_INVALID  = 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.
    ENDFORM. " read_idoc
    *& Form process_idoc
    text
    FORM process_idoc.
      perform read_idoc_structure.
      perform display_data_records.
    ENDFORM. " process_idoc
    *& Form display_data_records
    text
    FORM display_data_records.
      data: PE_seg_HEADER like EDI_SAPI01,
      segname like EDI_IAPI12-SEGMENTTYP,
      prev_segname like EDI_IAPI12-SEGMENTTYP value ' ',
      pt_fields2 like EDI_IAPI12 occurs 0 with header line,
      PT_FVALUES2 like EDI_IAPI14 occurs 0 with header line,
      byte_first type i,
      byte_last type i,
      field_val(50),
      tmp_str(15),
      tmp_str3(15),
      seg_repeats type i value 0,
      tmp_str2(15),
      tab_cr(2) type c value '@@',
      tot_ctr type i value 0,
      ctr type i value 0,
      msg(40) type c.
      data: IDOC_STRUCT_wa TYPE LEDID_IDOC_STRUCT.
      sort int_edidd by segnum.
      describe table int_edidd lines tot_ctr.
      loop at int_edidd.
        move int_edidd-segnam to segname.
        clear msg.
        concatenate 'Reading segment ' segname
        into msg separated by space.
        if tot_ctr <> 0.
          ctr = ( 100 * sy-tabix ) / tot_ctr.
        endif.
    SAPGUI_PROGRESS_INDICATOR
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = ctr
            TEXT       = msg.
        add 1 to seg_repeats.
        clear tmp_str2.
        if int_edidd-segnam <> prev_segname.
          seg_repeats = 1.
          clear: pe_seg_header, pt_fields2, pt_fvalues2.
          refresh: pt_fields2, pt_fvalues2.
    SEGMENT_READ_COMPLETE
          CALL FUNCTION 'SEGMENT_READ_COMPLETE'
            EXPORTING
              PI_SEGTYP                 = segname
              PI_RELEASE                = sap_rel
              PI_VERSION                = pi_ver
            IMPORTING
              PE_HEADER                 = pe_seg_header
            TABLES
              PT_FIELDS                 = pt_fields2
              PT_FVALUES                = pt_fvalues2
            EXCEPTIONS
              SEGMENT_UNKNOWN           = 1
              SEGMENT_STRUCTURE_UNKNOWN = 2
              OTHERS                    = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          prev_segname = int_edidd-segnam.
        endif.
        read table idoc_struct into idoc_struct_wa with key
        segment_type = int_edidd-segnam.
        if sy-subrc = 0.
          IF IDOC_STRUCT_WA-SYNTAX_ATTRIB-MUSTFL = 'X'.
            TMP_STR = 'Mandatory'. "Mandatory
          ELSE.
            TMP_STR = 'Optional'. "Optional
          ENDIF.
          if IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-QUALIFIER = 'X'.
            tmp_str3 = 'Qualified'.
          else.
            tmp_str3 = 'Non-Qualified'.
          endif.
          shift IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
          left deleting leading '0'.
          move seg_repeats to tmp_str2.
          condense: IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX, tmp_str2.
          concatenate tmp_str2 'of' IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
          into tmp_str2 separated by space.
          write :/ IDOC_STRUCT_wa-SEGMENT_TYPE,
          tmp_str,
          TMP_STR3,
          tmp_str2,
          IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL,
          IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast,
          IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP.
          if d_excel = 'X'.
            concatenate 'Segment Name' tab_cr
            'Mand / Opt ' tab_cr
            'Qual / non-Qual' tab_cr
            'Seq of Max' tab_cr
            'Level' tab_cr
            'Owner' tab_cr
            'Description'
            into excel_tab.
            append excel_tab.
            concatenate IDOC_STRUCT_wa-SEGMENT_TYPE tab_cr
            tmp_str tab_cr
            TMP_STR3 tab_cr
            tmp_str2 tab_cr
            IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL tab_cr
            IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast tab_cr
            IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP
            into excel_tab.
            append excel_tab.
            concatenate tab_cr
            'Field Nma' tab_cr
            'Type' tab_cr
            'Length' tab_cr
            'Byte From' tab_cr
            'Byte To' tab_cr
            'Description' tab_cr
            'Value' tab_cr
            'Qualifier Meaning'
            into excel_tab.
            append excel_tab.
          endif.
        endif.
        sort pt_fields2 by field_pos.
        byte_first = 0.
        loop at pt_fields2.
          clear: field_val.
          byte_last = pt_fields2-EXTLEN.
          write int_edidd-sdata+byte_first(byte_last) to
          field_val left-justified.
          shift pt_fields2-EXTLEN left deleting leading '0'.
          shift pt_fields2-byte_first left deleting leading '0'.
          shift pt_fields2-byte_last left deleting leading '0'.
          write:/ ' ', pt_fields2-fieldname,
          pt_fields2-datatype,
          pt_fields2-EXTLEN,
          pt_fields2-byte_first ,
          pt_fields2-byte_last,
          pt_fields2-descrp,
          field_val.
          read table pt_fvalues2 with key fieldname = pt_fields2-fieldname
          fldvalue_l = field_val.
          add byte_last to byte_first.
          if sy-subrc = 0.
            write : pt_fvalues2-descrp.
          else.
            clear pt_fvalues2-descrp.
          endif.
          if d_excel = 'X'.
            concatenate tab_cr pt_fields2-fieldname tab_cr
            pt_fields2-datatype tab_cr
            pt_fields2-EXTLEN tab_cr
            pt_fields2-byte_first tab_cr
            pt_fields2-byte_last tab_cr
            pt_fields2-descrp tab_cr
            field_val tab_cr
            pt_fvalues2-descrp
            into excel_tab.
            append excel_tab.
          endif.
        endloop.
      endloop.
    ENDFORM. " display_data_records
    *& Form read_idoc_structure
    text
    FORM read_idoc_structure.
      data: idoctype type LEDID_IDOCTYPE.
      if not idoc_control-cimtyp is initial.
        STRUCT_TYPE = 'E'. "Extended
        idoctype = idoc_control-cimtyp.
      else.
        STRUCT_TYPE = 'B'. "Basic
        idoctype = idoc_control-idoctp.
      endif.
      CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
        EXPORTING
          RELEASE              = sap_rel
          STRUCT_TYPE          = STRUCT_TYPE
          IDOCTYPE             = idoctype
          VERSION              = pi_ver
        TABLES
          IDOC_STRUCT          = idoc_struct
          SEGMENTS             = segments
          SEGMENT_STRUCT       = segment_struct
        EXCEPTIONS
          IDOCTYPE_UNKNOWN     = 1
          IDOCSTRUCT_UNKNOWN   = 2
          SEGMENT_DATA_MISSING = 3
          ILLEGAL_STRUCT_TYPE  = 4
          OTHERS               = 5.
      IF SY-SUBRC <> 0 and sy-subrc <> 3.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM. " read_idoc_structure
    *& Form download_to_excel
    text
    FORM download_to_excel.
    data: name like RLGRAP-FILENAME.
      data: name TYPE STRING.
      shift docnum left deleting leading '0'.
      concatenate docnum '-' idoc_control-idoctp '.xls'
      into name.
      perform to_split.
    CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
       EXPORTING
         DATA_filename       = name
         WAIT                = 'X'
         DATA_TABLE          = excel_tab[]
       EXCEPTIONS
         NO_BATCH            = 1
         EXCEL_NOT_INSTALLED = 2
         WRONG_VERSION       = 3
         INTERNAL_ERROR      = 4
         INVALID_TYPE        = 5
         CANCELLED           = 6
         DOWNLOAD_ERROR      = 7
         OTHERS              = 8.
    IF SY-SUBRC <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      break donepus.
      CALL FUNCTION 'WS_DOWNLOAD'
        EXPORTING
          FILENAME                = 'C:\Documents and Settings\donepus\Desktop\test2.xls'
          FILETYPE                = 'DAT'
        TABLES
          DATA_TAB                = i_split1
        EXCEPTIONS
          CONVERSION_ERROR        = 1
          INVALID_TABLE_WIDTH     = 2
          INVALID_TYPE            = 3
          NO_BATCH                = 4
          UNKNOWN_ERROR           = 5
          GUI_REFUSE_FILETRANSFER = 6
          OTHERS                  = 7.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM. " download_to_excel
    *&      Form  to_split
          text
    -->  p1        text
    <--  p2        text
    FORM to_split .
       break donepus.
    loop at excel_tab.
        split excel_tab at '@@' into i_split1-segment
                                     i_split1-fieldname
                                     i_split1-field1
                                     i_split1-field2
                                     i_split1-field3
                                     i_split1-field4
                                     i_split1-field5
                                     i_split1-field6
                                     i_split1-field7
                                     i_split1-field8.
            append i_split1.
            clear i_split1.
    endloop.
    ENDFORM.                    " to_split

Maybe you are looking for

  • Is my Mac up to the task of CS6

    I'm just trialling the CS6 apps before I commit to creative cloud. However, since I've installed Pshop, Illust and Bridge, my mac is running intolerably slow. I'm running 10.7.4, Processor 2.93GHz Quad Core with 8GB 1066 MHz memory. Not the fastest I

  • Template Editable background-image

    Using Dreamweaver templates. I would like to be able to customize a background image in a DIV ID on individual pages. Can someone offer some sample code? Thanks. Dave

  • HT3805 Trouble importing into Aperture form Memory Card

    Coincidentally or not, after installing Mountain Lion, I am no longer able to import photos into Aperture from a USB connected memory card - the card does not appear in the Import Window any longer - has the method for this process changed or is it a

  • BOM Data

    Hi BW Gurus,        I have requirement where user wants report on BOM Usage. Here I m clear on data coming from R/3. BOM stucture which has parent material and its component is from transaction CS03 that is table MAST and STPO. The material consumpti

  • Open() Entry point For STREAMS Kernel Module

    Hi, I have a STREMS Kernel module having concept of read & write queue. we know there is a inbuilt concept of queue_t structure for STREAMS module, my query is " when queue_t structure get memory as we pass queue_t * as one of argument in open() call