DOWNLOAD HEADER & ITEM RECORD INTO EXCEL FILE

I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .
Header structure : rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item  structure    : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Final internal table : Combination of these 2 fields. i need to populate these and download.

Hi,
fill at first your ITAB with header-date and append it. Then append your items.
Do not SORT after appending.
Regards Mario

Similar Messages

  • Reg: Downloading the internal table into excel file.

    Hi,
    My requirement is i am collecting data in the internal table and i have to download the contents in an excel file and i have declared like this.
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt'.
    I have given the default file path  like this and i am using the function module .
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          FILENAME                      = OUTPUT_PATH
          FILETYPE                      = 'DAT'
    IMPORTING
      FILELENGTH                      =
        TABLES
          DATA_TAB                        = INT_INPUT
      FIELDNAMES                      =
       EXCEPTIONS
         FILE_WRITE_ERROR                = 1
         NO_BATCH                        = 2
         GUI_REFUSE_FILETRANSFER         = 3
         INVALID_TYPE                    = 4
         NO_AUTHORITY                    = 5
         UNKNOWN_ERROR                   = 6
         HEADER_NOT_ALLOWED              = 7
         SEPARATOR_NOT_ALLOWED           = 8
         FILESIZE_NOT_ALLOWED            = 9
         HEADER_TOO_LONG                 = 10
         DP_ERROR_CREATE                 = 11
         DP_ERROR_SEND                   = 12
         DP_ERROR_WRITE                  = 13
         UNKNOWN_DP_ERROR                = 14
         ACCESS_DENIED                   = 15
         DP_OUT_OF_MEMORY                = 16
         DISK_FULL                       = 17
         DP_TIMEOUT                      = 18
         FILE_NOT_FOUND                  = 19
         DATAPROVIDER_EXCEPTION          = 20
         CONTROL_FLUSH_ERROR             = 21
         OTHERS                          = 22.
    My requirement is i dont want to change my extension as .txt from .exl to my parameter addition and in the function module the file type should be 'dat' only and in the runtime i want to change the file name which i have given in the .
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt' this file.txt into datas.xls.
    it would be grateful if some one share some valuable views to wards this query
    Thanks and Regards,
    Keny

    Hi,
    Use this code.
    It will ask for the file name...there u can change.
      data : l_filename type string,
             l_filetype type char10,
             l_path type string,
             l_fullpath type string.
      l_filetype = 'DAT'.
    *Get the file name
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          FILE_FILTER          = '*.DAT'
          INITIAL_DIRECTORY    = 'C:\'
        CHANGING
          FILENAME             = l_filename
          PATH                 = l_path
          FULLPATH             = l_fullpath
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_GUI = 3
          others               = 4.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      check l_fullpath is not initial.
    *Download file
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = l_fullpath
          FILETYPE                = l_filetype
        CHANGING
          DATA_TAB                = t_data_sum[]
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          others                  = 24.
      IF sy-subrc NE 0.
        MESSAGE e398(00) WITH sy-subrc ' Error downloading file' '' ''.
      ENDIF.
    Regards
    Sandeep REddy

  • Unable to read E$ table records into excel file in linux machine

    Hi
    I am using below code in ODI procedure to read E$ table record and store it in excel file
    ODI Procedure: Technology=Java Beanshall and Command on Target I written below code and placed it in CKM Oracle KM
    <@
    String OS = System.getProperty("os.name").toLowerCase();
    String v_path="";
    if((OS.indexOf("win") >= 0))
    v_path="D:\Unload_Dir\<%=snpRef.getSession("SESS_NO")%>.xlsx";
    else if (OS.indexOf("mac") >= 0)
    v_path="path details";
    else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 )
    v_path="/odi_a/oracle/Middleware/logs/wcds/odi_logs/<%=snpRef.getSession("SESS_NO")%>.xlsx";
    else if (OS.indexOf("sunos") >= 0)
    v_path="soliaris path";
    @>
    OdiSqlUnload "-FILE=<@=v_path@>" "-DRIVER=<%=odiRef.getInfo("DEST_JAVA_DRIVER")%>" "-URL=<%=odiRef.getInfo("DEST_JAVA_URL")%>" "-USER=<%=odiRef.getInfo("DEST_USER_NAME")%>" "-PASS=<%=odiRef.getInfo("DEST_ENCODED_PASS")%>" "-FILE_FORMAT=VARIABLE" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    select * from <%=odiRef.getTable("L","ERR_NAME", "W")%>
    But is not reading the data into .xlsx file ,
    Please help me it is very urgent
    Can I use below code
    String os = "";
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
    os = "windows";
    } else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
    os = "linux";
    } else if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
    os = "mac";
    T
    his is high priority, please help me urgent
    Regards,
    Phanikanth
    Edited by: Phanikanth on Feb 28, 2013 5:43 AM
    Edited by: Phanikanth on Feb 28, 2013 6:00 AM
    Edited by: Phanikanth on Feb 28, 2013 7:42 AM

    Hi,
    can you describe what is happening when you run the ODI procedure described below:
    - Does the procedure fail with an error, if yes, which error(full details)?
    - Does the procedure pass but no xslx file is been created?
    - Does the procedure pass and an xslx file is been created, but Excel can't read it? If yes, what is the structure of the xslx file when read in an editor?
    What I can see from your code below is that you have choosen -FILE_FORMAT=VARIABLE, but the XSLX format is supposed to be XML.
    Regards,
    Alex

  • Reg: Download report into Excel file

    Hi All,
    While downloading the ALV report into excel file(System -> List -> Save -> Local file) or (List -> Export -> Local file), i cannot download full report in to excel. Even though the report contains just 200 rows(I can able to download about 90 lines).
    Some reports can able to download all the data, even the report is very big. Currently I am blind to solve, anyone can help me to solve this issue.
    Thanks in advance.

    The most elegant way of downloading ALV display data to EXCEL is displaying the excel in the SAP GUI screen itself.  Select "Excel in Place" and then save it from there. Before that you need to let the VB script of SAP know as trusted macro. This is done by opening a blank excel file then go to Tools > options > Security > Macro Security > Trusted Publishers (tab) > (check) Trust access to Visual Basic Project.  This activation is one time activation. Once you do this you can see ALV display exactly like in normal ALV with all the colors fields etc.

  • Problem in Download data into Excel File

    Hi Friends,
    I have one doubt on WDJ.
             I have got the data from the Back and display the data into Table UI Element. Depending upon po_status equals to OA Pending that time conf_Ship_date Column is Empty. That time we can Select All Checkbox Click on Download Button Excel file is not download. Why it not download? Conf_Ship_date Column is Empty. Conf_Ship_date Column is data available that time data download into Excel File.
    My Req: if Conf_Ship_date Column is empty that time click on Download that data will download in to Excel. In Excel Conf_Ship_date Column will display in NULL or 00.00.0000 Like this also.
    Code:ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date()); 
    This means I am getting date from PoDetails_OutTab(StockEle)this node and add this date to PoDetails_ExcelData(ExcelEle) this node.Finally the date will available in PoDetails_ExcelData this node. By Using this node I will download data.
    How to do this work?
    Regards
    Vijay

    Hi Arun,
    For Example in Table 4 rows and 14 columns data is available. Select all check boxes click on download button total 4 rows and 14 columns data is downloaded.
    Table 4 rows and 14 columns data is available. But in some cells data not available in that time I m getting null values from ECC System. That time I am not able to download.
    In Particularly this problem I am getting only date colums.
    So now I have develop this code
    public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondownloadToExcel(ServerEvent)
         IPrivatePO_Details_ResultView.IPoDetails_ExcelDataNode ExcelNode = wdContext.nodePoDetails_ExcelData();
         IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle; 
         IPrivatePO_Details_ResultView.IPoDetails_OutTabNode StockNode = wdContext.nodePoDetails_OutTab();
         IPrivatePO_Details_ResultView.IPoDetails_OutTabElement StockEle ;
         for(int i = 0 ;i<StockNode.size();i++)
         StockEle = StockNode.getPoDetails_OutTabElementAt(i);
         if(StockEle.getCheckBox()== true)
         ExcelEle = ExcelNode.createPoDetails_ExcelDataElement();// Create Element
         if(StockEle.getConf_Shp_Date()==null)
         java.sql.Date deliverydate1=new java.sql.Date(0,0,0);
         ExcelEle.setConf_Shp_Date(deliverydate1);
         else
         ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date()); 
    By using this code i have to download total Records but in this Conf_Shp_Date colums i am getting 31-12.1899 this output in Excel. But i need in Excel to print Null or 00.00.0000 like
         ExcelEle.setQuantity(StockEle.getQuantity());
         ExcelEle.setDeliv_Date(StockEle.getDeliv_Date());
         if(StockEle.getExpt_Shp_Date()==null)
         java.sql.Date deliverydate2=new java.sql.Date(0,0,0);
         ExcelEle.setExpt_Shp_Date(deliverydate2);
         else
         ExcelEle.setExpt_Shp_Date(StockEle.getExpt_Shp_Date());
         ExcelEle.setVendor_Material(StockEle.getVendor_Material());
         ExcelNode.addElement(ExcelEle);
         if(ExcelNode.size()>0)
         wdThis.wdGetCO_POPendingController().downloadData(wdContext.nodePoDetails_ExcelData());// This is for Downalod data Method
         wdThis.wdGetCO_POPendingController().DownLoadToExcel();// This is for Open Popup Window
         wdContext.nodePoDetails_ExcelData().invalidate();
         else
         wdComponentAPI.getMessageManager().reportException("Please select any one po item from the table",true);
        //@@end
    Regards
    Vijay
    Edited by: KalluriVijay on May 18, 2010 10:05 AM

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • How to Download colours of ALV outout into Excel file ?

    Hi All,
    I have a requirement, Download ALV output into Excel file
    but the ALV output contains colors,
    I need to download as it is ALV output into Excel,
    Please guide me, how to do ?
    If it is not possible, Pls provide any other solution for this ?
    Appreciate your valuable answers,
    Thanks.
    Regards,
    Prasad.

    Hi,
    Instead of ALV,  ucan directly write the output to EXCEL along with the required attributes.  Find the below sample code. This might solve ur problem.
    Venkat.
    *& Report  Y_ALV_OLE
    REPORT  YALV_OLE.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    include ole2incl.
    handles for OLE objects
    data: h_excel type ole2_object, " Excel object
    h_mapl type ole2_object, " list of workbooks
    h_map type ole2_object, " workbook
    h_zl type ole2_object, " cell
    h_f type ole2_object, " font
    h_c type ole2_object. " color
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    tables: spfli.
    data h type i.
    table of flights
    data: it_t100 like T100 occurs 10 with header line.
    *& Event START-OF-SELECTION
    start-of-selection.
    read flights
    select *
    from t100
    up to 100 rows
    into table it_t100
    where SPRSL = sy-langu .
    tell user what is going on
    call function 'SAPGUI_PROGRESS_INDICATOR'
    exporting
    PERCENTAGE = 0
    text = text-007
    exceptions
    others = 1.
    start Excel
    create object h_excel 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
    set property of h_excel 'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 =
    *'c:\kis_excel.xls' .
    PERFORM ERR_HDL.
    tell user what is going on
    call function 'SAPGUI_PROGRESS_INDICATOR'
    exporting
    PERCENTAGE = 0
    text = text-008
    exceptions
    others = 1.
    get list of workbooks, initially empty
    call method of h_excel 'Workbooks' = h_mapl.
    perform err_hdl.
    add a new workbook
    call method of h_mapl 'Add' = h_map.
    perform err_hdl.
    tell user what is going on
    call function 'SAPGUI_PROGRESS_INDICATOR'
    exporting
    PERCENTAGE = 0
    text = text-009
    exceptions
    others = 1.
    output column headings to active Excel sheet
    perform fill_cell using 1 1 1 200 'Language Key'.
    perform fill_cell using 1 2 1 200 'Application Area'.
    perform fill_cell using 1 3 1 200 'Message number'.
    perform fill_cell using 1 4 1 200 'Message text'.
    perform fill_cell using 1 5 1 200 'Dep. Time'.
    loop at it_t100.
    copy flights to active EXCEL sheet
    h = sy-tabix + 1.
    perform fill_cell using h 1 0 000145000 it_t100-SPRSL.
    perform fill_cell using h 2 0 246156138 it_t100-ARBGB.
    perform fill_cell using h 3 0 111230222 it_t100-MSGNR.
    perform fill_cell using h 4 0 130230230 it_t100-text.
    perform fill_cell using h 5 0 115115105 it_spfli-deptime.
    endloop.
    EXCEL FILENAME
    CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
    SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
    CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
    free object h_excel.
    perform err_hdl.
    FORM FILL_CELL *
    sets cell at coordinates i,j to value val boldtype bold *
    form fill_cell using i j bold col val.
    call method of h_excel 'Cells' = h_zl
    exporting
    #1 = i
    #2 = j.
    perform err_hdl.
    set property of h_zl 'Value' = val .
    perform err_hdl.
    get property of h_zl 'Font' = h_f.
    perform err_hdl.
    set property of h_f 'Bold' = bold .
    perform err_hdl.
    set property of h_f 'Color' = col.
    perform err_hdl.
    endform. "FILL_CELL
    *& Form ERR_HDL
    outputs OLE error if any *
    --> p1 text
    <-- p2 text
    form err_hdl.
    if sy-subrc <> 0.
    write: / 'OLE-Automation Error:'(010), sy-subrc.
    stop.
    endif.
    endform. " ERR_HDL

  • Downloading into excel file , the is alignment is out

    The  reports when downloading into excel file is not what we usually getting. The alignment is out.

    Hi Basavaraj,
    When you are creating dynamic internal table(itab1) and fields of internal table, at the same time in the same way  create one more internal table(itab2) resrict this up to 10 columns.
    now
    DATA : num type i,
           FNAME(255) TYPE C
               VALUE '/data/sapdata/filename'.
    CONSTANTS : C_COMMA TYPE C VALUE ','.
    DATA : BEGIN OF I_DISPLAY OCCURS 0,
            REC(400),
           END OF I_DISPLAY.
    loop at itab1
    num = num + 1.
      if num le 100.
       move-corresponding fields to itab2
      else.
        exit.
      endif.
    endloop.
      Give column headings
            itab2-col1 =  'name1'
            itab2-col2 =  'name2'
            itab2-col3 =  'name3'
            itab2-col4 =  'name4'
            itab2-col5 =  'name5'
            itab2-col6 =  'name6'
            itab2-col7 =  'name7'
            itab2-col8 =  'name8'
            itab2-col9 =  'name9'
            itab2-col10 =  'name10'
          INSERT itab2 INDEX 1.
          CLEAR itab2.
    loop itab2.
       CONCATENATE
            itab2-col1
            itab2-col2
            itab2-col3
            itab2-col4
            itab2-col5
            itab2-col6
            itab2-col7
            itab2-col8
            itab2-col9
            itab2-col10
               into I_DISPLAY-REC SEPARATED BY C_COMMA.
         APPEND I_DISPLAY.
         CLEAR I_DISPLAY.
      ENDLOOP.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
          LOOP AT I_DISPLAY.
            TRANSFER I_DISPLAY TO  FNAME.
          ENDLOOP.
        CLOSE DATASET FNAME.
    endloop.

  • Download ALV into excel file

    Hi experts,
                   I used subtotals in ALV.first three columns I claculated based on the addition of individual column.In fourth column i calculated the value based on three calculated values ...It is  not problem.
              when i download this into excel file the original value is only coming .the calculated value i.e) calculated based on three values didnt get displayed in excel file..Help me please...
    Thank u,
    Manjula Devi.D

    Hi.
    I find that
    List > Export > Spreadsheet
    gives no subtotals, but
    List > Export > Local File and then Spreadsheet
    does give subtotals.
    I find that
    Views > Microsoft Excel
    followed by
    Save As
    does give subtotals.
    John

  • Conversion of internal table into excel file format &put it on app server

    Hi,
    My requirement is to convert the internal table into excel file format and I have to store it on application server so that administrator can send the file thr e-mail attachment.
    So, please let me know how to convert the records of internal table and store it on application server in Excel file format.
    TIA,
    Nitin

    Hi,
      Use FM GUI_DOWNLOAD to download the data from inernal table to excel sheet.
    Then Using tcode CG3Z u can transfer file to application server.
    *&      Form  sub_download
          text
    -->  p1        text
    <--  p2        text
    FORM sub_download.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
        BIN_FILESIZE                    =
          filename                        = p_path
         filetype                        = 'ASC'
        APPEND                          = ' '
         write_field_separator           = 'X'
        HEADER                          = '00'
        TRUNC_TRAILING_BLANKS           = ' '
        WRITE_LF                        = 'X'
        COL_SELECT                      = ' '
        COL_SELECT_MASK                 = ' '
        DAT_MODE                        = ' '
        CONFIRM_OVERWRITE               = ' '
        NO_AUTH_CHECK                   = ' '
        CODEPAGE                        = ' '
        IGNORE_CERR                     = ABAP_TRUE
        REPLACEMENT                     = '#'
        WRITE_BOM                       = ' '
        TRUNC_TRAILING_BLANKS_EOL       = 'X'
        WK1_N_FORMAT                    = ' '
        WK1_N_SIZE                      = ' '
        WK1_T_FORMAT                    = ' '
        WK1_T_SIZE                      = ' '
      IMPORTING
        FILELENGTH                      =
        TABLES
          data_tab                        = it_final
        FIELDNAMES                      =
      EXCEPTIONS
        FILE_WRITE_ERROR                = 1
        NO_BATCH                        = 2
        GUI_REFUSE_FILETRANSFER         = 3
        INVALID_TYPE                    = 4
        NO_AUTHORITY                    = 5
        UNKNOWN_ERROR                   = 6
        HEADER_NOT_ALLOWED              = 7
        SEPARATOR_NOT_ALLOWED           = 8
        FILESIZE_NOT_ALLOWED            = 9
        HEADER_TOO_LONG                 = 10
        DP_ERROR_CREATE                 = 11
        DP_ERROR_SEND                   = 12
        DP_ERROR_WRITE                  = 13
        UNKNOWN_DP_ERROR                = 14
        ACCESS_DENIED                   = 15
        DP_OUT_OF_MEMORY                = 16
        DISK_FULL                       = 17
        DP_TIMEOUT                      = 18
        FILE_NOT_FOUND                  = 19
        DATAPROVIDER_EXCEPTION          = 20
        CONTROL_FLUSH_ERROR             = 21
        OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " sub_download
    Otherwise use OPEN DATASET and TRANSFER statement to download data from internal table to direct application server
    Regards,
    Prashant

  • How to convert alv list into excel file?

    Hi Experts,
            i have created one report for Due Date Analysis.
    Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
         So i need the Function Module to Convert the Data into Excel File.
    Thanks,
    Neptune.M

    Hi,
      U can use function module gui_download.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
        BIN_FILESIZE       =
          filename           = 'C:\Transportaionlane.XLS'
          filetype                       = 'DAT'
        WRITE_FIELD_SEPARATOR           = ' '
        HEADER                          = '00'
        TABLES
          ata_tab                       = t_trans_lane_dis[]
           OTHERS                          = 22
    if u want with header then pass the header.
    regards
    Ahasan

  • How to download data from spool to excel file

    Hi,
    I have requirement like....i need to download data from spool to excel file.
    Please let me know the process how to download...
    <removed by moderator>
    <removed by moderator>
    Thanks,
    Khasimsa
    Moderator message: please (re)search yourself before asking, do not assign priorities, do not offer re-ward
    locked by: Thomas Zloch on Sep 8, 2010 1:18 PM

    Hi try this way..
    *FM called that returns the Spool Request Number data into and internal table
      CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
        EXPORTING
          rqident              = p_spool                     "Spool Request Number
          first_line           = 1
        TABLES
          buffer               = it_spool_xls                            "Internal table that will have the Spool Request No data
        EXCEPTIONS
          no_such_job          = 1
          not_abap_list        = 2
          job_contains_no_data = 3
          selection_empty      = 4
          no_permission        = 5
          can_not_access       = 6
          read_error           = 7
          OTHERS               = 8.
    *To convert the spool data into excel format
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = it_spool_xls               "Internal table having spool data
          objcont_new = it_xls_spool.           "Int table having Excel format data converted from Spool data
    "call GUI down Load by passing  it_xls_spool
    Prabhudas

  • How count number of item records in a File: Idoc to File scenario

    Hi All,
    I am configuring an IDOC to File scenario.
    Once all the IDOC data is dumped on a File, I need to calculate the number of Item records in this file and write this number at the end of the trailer record in the file.
    Is theer a way to calculate the item data records(or say number of lines in the file) in the message mapping area. Or any other simple way to do it.
    Appreciate your help on same.
    Thanks
    Shirin

    hi,
    Use the count function for ITEM node the assign this count value to the receiver field , keep the ITEM context to header!
    Thanks,
    Vijaya.

  • Split records into two files based on lookup table

    Hi,
    I'm new to ODI and want to know on how I could split records into two files based on a value in one of the columns in the table.
    Example:
    Table:
    my columns are
    account name country
    100 USA
    200 USA
    300 UK
    200 AUS
    So from the 4 records I maintain list of countries in a lookup file and split the records into 2 different files based on values in the file...
    Say I have records AUS and UK in my lookup file...
    So my ODI routine should send all records with country into file1 and rest to file2.
    So from above records
    File1:
    300 UK
    200 AUS
    File2:
    100 USA
    200 USA
    Can you help me how to achieve this?
    Thanks,
    Sam

    1. where and how do i create filter to restrict countries? In source or target? Should I include some kind of filter operator in interface.
    You need to have the Filter on the Source side so that we can filter records accordingly the capture the same in the File. To have a Filter . In the source data store click and drag the column outside the data store and you will have Cone shaped icon and now you can click and type the Filter.
    Please look into this link for ODI Documentation -http://www.oracle.com/technetwork/middleware/data-integrator/documentation/index.html
    Also look into this Getting started guide - http://download.oracle.com/docs/cd/E15985_01/doc.10136/getstart/GSETL.pdf . You can find information as how to create Filter in this guide.
    2. If I have include multipe countries like (USA,CANADA,UK) to go to one file and rest to another file; Can I use some kind of lookup file...? Instead of modifying filter inside interface...Can i Update entries in the file?
    there are two ways of handling your situation.
    Solution 1.
    1. Create Variable Country_Variable
    2. Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
    3. Create a new Package Country File Unload
    4. Call the Variable in Country_Variable in Set Mode and provide the Country (USA )
    5. Next call the First Interface
    6. Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
    7. Now run the package .
    Solution 2.
    If you need a solution to handle through Filer.
    1. Use this Method (http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value ) to call the File where you wish to create store the country name into the variable Country_Variable
    2. Pretty much the same Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
    3.Create a new Package Country File Unload
    4.Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
    5. Now run the package .
    Now through this way using File you can control the File.
    Please try and let us know , if you need any other help.

  • Convert report output into excel file

    hiii,
    Can we convert output of report into excel file format?
    Plz tell me the.
    Thanks in advance

    Hello,
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_paptoexcel.htm
    29 Building a Report for Spreadsheet Output
    Regards

Maybe you are looking for