VBS:How can i determine the last row of an excel-sheet

I want to replace the chn-comments of an datafile. I pick up the chn-names and want to compare them with an excel-file and so get from the excel-file the right chn-comment and store int back in the datafile. my problem is how can i determine where the excelfile-row is on the end to load the loopounter with corr values.
i know one solution via scan on ascii 13 and 9.but bether is to know immediately the length of the column.
answers also in german possible.

Peter,
Are you using DIAdem's Excel Import Wizard? By "Excel file" do you mean a tab- or comma-delimited ASCII file that Excel can read in easily, or do you mean a file with the extension "*.xls"? You certainly could not search through an *.xls file to find CR/LF characters.
If you use the ASCII or Excel Import Wizard to create an *.STP file for the "Excel" file in question, then after the *.STP file is loaded you have access to a whole range of variables, starting with Ascii... or Excel... which completely outline the structure of the ASCII or Excel file, including things like the row in which the channel comments are, etc.
Why don't you send over your Excel file and I'll be able to help you a lot better.
Regards,
Brad Turpin
NI

Similar Messages

  • How do I get the last COLUMN in an Excel Sheet using Report Generation toolkit in LV7.1?

    I am trying to get the last column in an Excel sheet using the Report Generation toolkit. The function "Excel Get Last Row" does not give last column info. Is there a function that will do this?
    Thanks

    Hello –
    I think the following example program might be helpful to get you started programming your application.
    Get Excel Data from Specified Field.
    Hope this helps!
    SVences
    Applications Engineer
    National Instruments

  • How can I delete the last row of a Matrix

    Hi All,
    Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!
    I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):
    ==
    if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))
      if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)
        if (evnt.BeforeAction)
          form = BusinessOne.Application.Forms.Item(formUID);
          mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;
         int numRow = getSelectedRow(mtx);
         if (numRow != -1)
                                            mtx.DeleteRow(numRow);
                                            form.Mode = BoFormMode.fm_UPDATE_MODE;
                                       Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);
                                       btn.Enabled = true;
    ==
    Cheers,
    Marcel Peek
    Alpha One
    Message was edited by: Marcel Peek
    Message was edited by: Marcel Peek

    Yes, there is a problem to delete the last row.
    It is fixed in version 2005.

  • How can i bring the column heading downloaded in excel sheet?

    hi all,
    I am using  FM SAP_CONVERT_TO_XLS_FORMAT to downloading populated internal table data into excel sheet by using filename type rlgrap-filename.
    Now I need the column heading(field name) for downloaded data in excel sheet.
    pls tell me how can i merge the col heading with data perfectly. Is there any FM fulfills this requirement.
    pls give me a suitable approch.
    Thanks
    PRR

    HI,
    Go thru this code.
    REPORT  ZRMM0056  NO STANDARD PAGE HEADING
                          MESSAGE-ID ZZ
                          LINE-SIZE 300
                          LINE-COUNT 65.
    Program              : ZRMM0056
    Title                : Non Inventory PO's
    Description          : Non Inventory Purchase Orders details with
                           Vendor and Invoice Receipts and Goods Receipts.
    Input  :
           Select-options  : 1. G/L Account No
           Parameters      : 1.File Paths for the Excel sheet
           Others (Specify):
    Output : Extract Files in the application server
           Report  :
    Hear Ticket #        : 113392
    Created by           : Srinivas Rao.M
    Created on           : 12/15/2005
    Version              : 1
    Request              : D10K944304
    Transaction Code     : Z420
    Change History                                                       *
    Date         Programmer  Search String   Description                 *
    12/19/2005   Srinivas    D10K944316      Removed Purchasing document
                                             Company code and Plant from
                                             Select-Options and Inculded
                                             G/L Account No and changed
                                             code accordingly.
    T A B L E S                                                          *
    TABLES: EKBE,              " History of Purchasing Document
            EKPO,              " Purchasing Document Item
            EKKO,              " Purchasing Document Header
            LFA1,              " Vendor master (general section)
            EKKN.              " Account Assignment in Purchasing Doc
                        INTERNAL TABLES
    *--Internal table to store Purchasing document header data
    DATA : BEGIN OF IT_POHEADER OCCURS 0,
            EBELN LIKE EKKO-EBELN,      "Purchasing document
            AEDAT LIKE EKKO-AEDAT,      "Created on
            ERNAM LIKE EKKO-ERNAM,      "Created by
            LIFNR LIKE EKKO-LIFNR,      "Vendor
          END OF IT_POHEADER.
    *--Internal table to store Purchasing document Item data
    DATA : BEGIN OF IT_POITEM OCCURS 0,
            EBELN LIKE EKPO-EBELN,       "Purchasing document
            EBELP LIKE EKPO-EBELP,       "Item Number
            MATNR LIKE EKPO-MATNR,       "Material number
            BUKRS LIKE EKPO-BUKRS,       "Company code
            WERKS LIKE EKPO-WERKS,       "Plant
            MATKL LIKE EKPO-MATKL,       "Material Group
            MENGE LIKE EKPO-MENGE,       "Order Quantity
            NETPR LIKE EKPO-NETPR,       "Net Price
            PEINH LIKE EKPO-PEINH,       "Price unit
            NETWR LIKE EKPO-NETWR,       "Net Value
          END OF IT_POITEM.
    *--Internal table to hold final display data.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
             EBELN LIKE EKKO-EBELN,       "Purchasing document
             EBELP LIKE EKPO-EBELP,       "Item Number
             AEDAT LIKE EKKO-AEDAT,       "Created on
             ERNAM LIKE EKKO-ERNAM,       "Created by
             MATNR LIKE EKPO-MATNR,       "Material number
             BUKRS LIKE EKPO-BUKRS,       "Company code
             WERKS LIKE EKPO-WERKS,       "Plant
             MATKL LIKE EKPO-MATKL,       "Material Group
             MENGE LIKE EKPO-MENGE,       "Order Quantity
             NETPR LIKE EKPO-NETPR,       "Net Price
             PEINH LIKE EKPO-PEINH,       "Price unit
             NETWR LIKE EKPO-NETWR,       "Net Value
             LIFNR LIKE EKKO-LIFNR,       "Vendor
             NAME1 LIKE LFA1-NAME1,       "Vendor Name
             GSBER LIKE EKKN-GSBER,      "Business area
    *--IR details
            IR_BELNR LIKE EKBE-BELNR,     "IR-Number of Material Document
            IR_BUZEI LIKE EKBE-BUZEI,     "IR-Item in material Document
            IR_BUDAT LIKE EKBE-BUDAT,     "IR-Posting date
            IR_MENGE LIKE EKBE-MENGE,     "IR-Quantity
    *--GR details
            GR_BELNR LIKE EKBE-BELNR,     "GR-Number of Material Document
            GR_BUZEI LIKE EKBE-BUZEI,     "GR-Item in material Document
            GR_BUDAT LIKE EKBE-BUDAT,     "GR-Posting date
            GR_MENGE LIKE EKBE-MENGE,     "GR-Quantity
          END OF IT_FINAL.
    *--Internal table to store History per Purchasing Document data
    DATA : BEGIN OF IT_HISTORY OCCURS 0,
            EBELN LIKE EKBE-EBELN,        "Purchasing document
            EBELP LIKE EKBE-EBELP,        "Item
            VGABE LIKE EKBE-VGABE,        "Trans/Event type
            BELNR LIKE EKBE-BELNR,        "Number of Material Document
            BUZEI LIKE EKBE-BUZEI,        "Item in material Document
            BUDAT LIKE EKBE-BUDAT,        "Posting date
            MENGE LIKE EKBE-MENGE,        "Quantity
            BEWTP LIKE EKBE-BEWTP,        "Posting history category
           END OF IT_HISTORY.
    *--Internal table to store vendor name.
    DATA : BEGIN OF IT_VENDOR OCCURS 0,
             LIFNR LIKE LFA1-LIFNR,      "Vendor Number
             NAME1 LIKE LFA1-NAME1,      "Vendor Name
           END OF IT_VENDOR.
    *--Internal table to store Business area for Purchasing document
    DATA : BEGIN OF IT_BUSINESS OCCURS 0,
             EBELN LIKE EKKN-EBELN,      "Purchasing document
             EBELP LIKE EKKN-EBELP,      "Purchasing Item
             SAKTO LIKE EKKN-SAKTO,      "G/L Account No
             GSBER LIKE EKKN-GSBER,      "Business area
           END OF IT_BUSINESS.
    DATA : BEGIN OF FIELDNAMES OCCURS 0,
           TEXT(40),
          END OF FIELDNAMES.
                    VARIABLES DECLARATION                                *
    DATA: V_FILE LIKE IBIPPARMS-PATH,         "File path
           V_FLD  LIKE DYNPREAD-FIELDNAME,     "Dynpread fieldname
           V_FLAG(1) VALUE SPACE.              "FLAG VARIABLE
                            SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK S1 WITH FRAME TITLE TEXT-001.
    *--Begin of change D10K944316
    SELECT-OPTIONS : S_SAKTO FOR EKKN-SAKTO.  "G/L Accoun no.
    *--End of change D10K944316
    SELECTION-SCREEN END OF BLOCK S1.
    SELECTION-SCREEN BEGIN OF BLOCK S2 WITH FRAME TITLE TEXT-002.
    PARAMETERS : P_EXCEL    AS CHECKBOX DEFAULT ' ' .  " download to excel
    PARAMETERS : C_FILE(128) DEFAULT : 'C:\ZRMM0056.xls'.
    SELECTION-SCREEN END OF BLOCK S2.
    A T   S E L E C T I O N - S C R E E N                                *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR C_FILE.
    *-Form to get file path for download of data
      PERFORM GET_FILE_PATH.
    AT SELECTION-SCREEN.
      PERFORM SCREEN_VALIDATIONS.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--Extract Purchasing document header data.
       PERFORM GET_PO_HEADER_DATA.
    *--Extract Purchasing document Item data.
       IF NOT IT_BUSINESS[] IS INITIAL.
         PERFORM GET_PO_ITEM_DATA.
    *--Get complete required data in final internal table
         PERFORM GET_FINAL_DATA.
       ENDIF.
    END-OF-SELECTION
    END-OF-SELECTION.
      IF V_FLAG IS INITIAL.
    *--Display Purchasing document details
        IF NOT IT_FINAL[] IS INITIAL.
           PERFORM DISPLAY_PODATA.
          IF P_EXCEL = 'X'.
    *--To down load data to excel sheet
            PERFORM DOWN_LOAD_TO_EXCEL.
          ENDIF.
        ENDIF.
      ELSE.
           MESSAGE I001(ZZ) WITH 'No data found'(003).
      ENDIF.
    TOP-OF-PAGE
    TOP-OF-PAGE.
    *--To display page header
      PERFORM PAGE_HEADER.
    *&      Form  GET_PO_HEADER_DATA
          To Get Purchasing header data
    FORM GET_PO_HEADER_DATA .
    *--To extract Business Area details
           CLEAR IT_BUSINESS.
           REFRESH IT_BUSINESS.
            SELECT EBELN    "Purchasing document
                   EBELP    "Purchasing document item
                   SAKTO    "G/L Account no
                   GSBER    "Business area
                   FROM EKKN
                   INTO TABLE IT_BUSINESS
                   WHERE SAKTO IN S_SAKTO.
      IF SY-SUBRC <> 0.
        V_FLAG = 'X'.
        MESSAGE I001(ZZ)  WITH
        'No data selected for the given selection criteria'(004).
        STOP.
      ELSE.
    *--To extract Purchasing document details with respect
    to G/L Account no
           CLEAR   IT_POHEADER.
           REFRESH IT_POHEADER.
           SELECT EBELN       "Purchasing document
                  AEDAT       "Created on
                  ERNAM       "Created by
                  LIFNR       "Vendor
                FROM EKKO
                INTO TABLE IT_POHEADER
                FOR ALL ENTRIES IN IT_BUSINESS
                WHERE EBELN = IT_BUSINESS-EBELN.
             IF NOT IT_POHEADER[] IS INITIAL.
                CLEAR   IT_VENDOR.
                REFRESH IT_VENDOR.
    *--Extracting Vendor details
                SELECT LIFNR   "Vendor #
                       NAME1   "Name
                     FROM LFA1
                     INTO TABLE IT_VENDOR
                     FOR ALL ENTRIES IN IT_POHEADER
                     WHERE LIFNR = IT_POHEADER-LIFNR.
            ENDIF.
      ENDIF.
    ENDFORM.                    " GET_PO_HEADER_DATA
    *&      Form  GET_PO_ITEM_DATA
          To extract Purchasing document item data
    FORM GET_PO_ITEM_DATA .
    CLEAR   IT_POITEM.
    REFRESH IT_POITEM.
       SELECT EBELN        "Purchasing document
              EBELP        "Item Number
              MATNR        "Material number
              BUKRS        "Company code
              WERKS        "Plant
              MATKL        "Material Group
              MENGE        "Order Quantity
              NETPR        "Net Price
              PEINH        "Price unit
              NETWR        "Net Value
           FROM EKPO
           INTO TABLE IT_POITEM
           FOR ALL ENTRIES IN IT_BUSINESS
           WHERE EBELN = IT_BUSINESS-EBELN
            AND  EBELP = IT_BUSINESS-EBELP.
    IF NOT IT_POITEM[] IS INITIAL.
       CLEAR   IT_HISTORY.
       REFRESH IT_HISTORY.
       SELECT EBELN    "Purchasing document
              EBELP    "Item
              VGABE    "Trans/Event type
              BELNR    "Number of Material Document
              BUZEI    "Item in material Document
              BUDAT    "Posting date
              MENGE    "Quantity
              BEWTP    "Posting history category
            FROM EKBE
            INTO TABLE IT_HISTORY
            FOR ALL ENTRIES IN IT_POITEM
            WHERE EBELN = IT_POITEM-EBELN
              AND EBELP = IT_POITEM-EBELP
              AND ( VGABE = '1' OR VGABE = '2' )   "1 = GR , 2 = IR
              AND ( BEWTP =  'Q' OR BEWTP = 'E' ). "Q = GR , R = IR
       IF SY-SUBRC = 0.
         SORT IT_HISTORY BY EBELN EBELP.
       ENDIF.
    ENDIF.
    ENDFORM.                    " GET_PO_ITEM_DATA
    *&      Form  GET_FILE_PATH
          Select file path
    FORM GET_FILE_PATH .
    CLEAR V_FILE.
      MOVE 'p_flname' TO V_FLD.
      MOVE C_FILE TO V_FILE.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                PROGRAM_NAME  = SYST-CPROG
                DYNPRO_NUMBER = SYST-DYNNR
                FIELD_NAME    = V_FLD
           IMPORTING
                FILE_NAME     = V_FILE
           EXCEPTIONS
                OTHERS        = 1.
      MOVE V_FILE TO C_FILE.
    ENDFORM.                    " GET_FILE_PATH
    *&      Form  PAGE_HEADER
           To Print page header and other details
    FORM PAGE_HEADER .
    *--Page Header
    ULINE AT /1(300).
      FORMAT COLOR 1.
      WRITE:/ 'Run Date:'(005), SY-DATUM, 45 'Stanley Works'(006),
             100 'Page No:'(007), SY-PAGNO LEFT-JUSTIFIED, 298 ''.
      WRITE:/ 'Run Time:'(008), SY-UZEIT, 43 SY-TITLE, 100 SY-UNAME, 298 ''.
      WRITE:/ 'Source  :'(009), SY-SYSID, 100 SY-CPROG, 298 ''.
      FORMAT COLOR OFF.
      ULINE AT /1(300).
      FORMAT COLOR 4.
      WRITE : / SY-VLINE , (10) 'Purchasing Doc'(010),
                SY-VLINE,  (5)  'Item'(011),
                SY-VLINE,  (10) 'Created On'(012),
                SY-VLINE,  (7)  'Crea By'(013),
                SY-VLINE,  (10) 'Material'(014),
                SY-VLINE,  (6)  'Com cd'(015),
                SY-VLINE,  (5)  'Plant'(016),
                SY-VLINE,  (10) 'Mat Group'(017),
                SY-VLINE,  (13) 'Order Qty'(018),
                SY-VLINE,  (11) 'Net Price'(019),
                SY-VLINE,  (10) 'Price Unit'(020),
                SY-VLINE,  (13) 'Net Value'(021),
                SY-VLINE,  (8)  'Bus Area'(022),
                SY-VLINE,  (10) 'Vendor'(023),
                SY-VLINE,  (28) 'Vendor Name'(024),
    *--IR details
                SY-VLINE,  (10) 'IR-Mat Doc'(025),
                SY-VLINE,  (5)  'IR-It'(026),
                SY-VLINE,  (9) 'IR-Post dt'(027),
                SY-VLINE,  (13) 'IR-Quantity'(028),
    *--GR details
                SY-VLINE,  (10) 'GR-Mat Doc'(029),
                SY-VLINE,  (5)  'GR-It'(030),
                SY-VLINE,  (9) 'GR-Post dt'(031),
                SY-VLINE,  (13) 'GR-Quantity'(032), SY-VLINE.
      FORMAT COLOR OFF.
      ULINE AT /1(300).
    ENDFORM.                    " PAGE_HEADER
    *&      Form  SCREEN_VALIDATIONS
          Selection screen validations
    FORM SCREEN_VALIDATIONS .
    *--Validation for G/L Account No
    IF NOT S_SAKTO IS INITIAL.
        SELECT SAKNR UP TO 1 ROWS
               INTO EKKN-SAKTO
               FROM SKA1 WHERE
               SAKNR IN S_SAKTO.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E001(ZZ) with 'Please enter a valid G/L Account no'(048).
        ENDIF.
      ENDIF.
    *--Validation for Excel file path
    IF P_EXCEL = 'X'.
        IF C_FILE = ' '.
          MESSAGE E001(ZZ) with 'Please enter a valid Excle Path'(035).
        ENDIF.
      ENDIF.
    ENDFORM.                    " SCREEN_VALIDATIONS
    *&      Form  DISPLAY_PODATA
          To Display Purchasing Document details
    FORM DISPLAY_PODATA .
    FORMAT COLOR 2.
    SORT IT_FINAL BY EBELN EBELP AEDAT BUKRS WERKS.
    LOOP AT IT_FINAL.
         WRITE : / SY-VLINE ,(10)  IT_FINAL-EBELN,     "Purchasing Doc
                   SY-VLINE,  (5)  IT_FINAL-EBELP,     "Item
                   SY-VLINE,  (10) IT_FINAL-AEDAT,     "Created On
                   SY-VLINE,  (7) IT_FINAL-ERNAM,      "Created By
                   SY-VLINE,  (10) IT_FINAL-MATNR,     "Material
                   SY-VLINE,  (6) IT_FINAL-BUKRS,      "Company code
                   SY-VLINE,  (5)  IT_FINAL-WERKS,     "Plant
                   SY-VLINE,  (10) IT_FINAL-MATKL,     "Material Group
                   SY-VLINE,  (13) IT_FINAL-MENGE, "#EC UOM_IN_MES
                                                       "Order Qty
                   SY-VLINE,  (11) IT_FINAL-NETPR, "#EC UOM_IN_MES
                                                       "Net Price
                   SY-VLINE,  (10) IT_FINAL-PEINH, "#EC UOM_IN_MES
                                                       "Price Unit
                   SY-VLINE,  (13) IT_FINAL-NETWR, "#EC UOM_IN_MES
                                                        "Net Value
                   SY-VLINE,  (8)  IT_FINAL-GSBER,     "Bus Area
                   SY-VLINE,  (10) IT_FINAL-LIFNR,     "Vendor
                   SY-VLINE,  (28) IT_FINAL-NAME1,     "Vendor name
    *--IR details
                   SY-VLINE,  (10) IT_FINAL-IR_BELNR,  "IR-Mat Doc
                   SY-VLINE,  (5)  IT_FINAL-IR_BUZEI,  "IR-It
                   SY-VLINE,  (9) IT_FINAL-IR_BUDAT,   "IR-Post dt
                   SY-VLINE,  (13) IT_FINAL-IR_MENGE,  "#EC UOM_IN_MES
                                                        "IR-Quantity
    *--GR details
                   SY-VLINE,  (10) IT_FINAL-GR_BELNR,  "GR-Mat Doc
                   SY-VLINE,  (5)  IT_FINAL-GR_BUZEI,  "GR-It
                   SY-VLINE,  (9) IT_FINAL-GR_BUDAT,   "GR-Post dt
                   SY-VLINE,  (13) IT_FINAL-GR_MENGE, SY-VLINE.
                                                       "#EC UOM_IN_MES
                                                       "GR-Quantity
      ENDLOOP.
      FORMAT COLOR OFF.
    ENDFORM.                    " DISPLAY_PODATA
    *&      Form  DOWN_LOAD_TO_EXCEL
          text
    FORM DOWN_LOAD_TO_EXCEL .
      <b>REFRESH FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-010.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-011.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-012.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Created By'(036).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-014.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Company Code'(037).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-016.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Material Group'(038).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Order Quantity'(039).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-019.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-020.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-021.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Business Area'(040).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-023.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-024.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Material Doc'(041).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Item'(042).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Posting Date'(043).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-028.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Material Doc'(044).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Item'(045).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Posting Date'(046).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-032.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
    *--FM to download data to Excel sheet
    CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
                FILENAME                = C_FILE
                FILETYPE                = 'DAT'
                TABLES
                DATA_TAB                = IT_FINAL
                FIELDNAMES              = FIELDNAMES
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_WRITE_ERROR        = 2
                INVALID_FILESIZE        = 3
                INVALID_TABLE_WIDTH     = 4
                INVALID_TYPE            = 5
                NO_BATCH                = 6
                UNKNOWN_ERROR           = 7
                GUI_REFUSE_FILETRANSFER = 8
                OTHERS                  = 9.
      IF SY-SUBRC <> 0.
         MESSAGE E001(ZZ) WITH 'Data could not downloaded'(047).
      ENDIF.</b>ENDFORM.                    " DOWN_LOAD_TO_EXCEL
    *&      Form  GET_FINAL_DATA
          To Populate required data in final internal table
    FORM GET_FINAL_DATA .
    CLEAR   IT_FINAL.
    REFRESH IT_FINAL.
    LOOP AT IT_POITEM.
       CLEAR IT_POHEADER.
       READ TABLE IT_POHEADER WITH KEY EBELN = IT_POITEM-EBELN.
       IF SY-SUBRC = 0.
        MOVE :  IT_POHEADER-EBELN TO IT_FINAL-EBELN,     "Purchasing Doc
                IT_POITEM-EBELP   TO IT_FINAL-EBELP,     "Item
                IT_POHEADER-AEDAT TO IT_FINAL-AEDAT,     "Created On
                IT_POHEADER-ERNAM TO IT_FINAL-ERNAM,     "Created By
                IT_POITEM-MATNR   TO IT_FINAL-MATNR,     "Material
                IT_POITEM-BUKRS   TO IT_FINAL-BUKRS,     "Company code
                IT_POITEM-WERKS   TO IT_FINAL-WERKS,     "Plant
                IT_POITEM-MATKL   TO IT_FINAL-MATKL,     "Material Group
                IT_POITEM-MENGE   TO IT_FINAL-MENGE,     "Order Qty
                IT_POITEM-NETPR   TO IT_FINAL-NETPR,     "Net Price
                IT_POITEM-PEINH   TO IT_FINAL-PEINH,     "Price Unit
                IT_POITEM-NETWR   TO IT_FINAL-NETWR,     "Net Value
                IT_POHEADER-LIFNR TO IT_FINAL-LIFNR.     "Vendor
    *--To Insert IR details
        CLEAR IT_HISTORY.
        READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
                                       EBELP = IT_POITEM-EBELP
                                       VGABE = '2'
                                       BEWTP = 'Q'.
          IF SY-SUBRC = 0.
            MOVE :
              IT_HISTORY-BELNR TO IT_FINAL-IR_BELNR,  "IR-Number of Mat Doc
              IT_HISTORY-BUZEI TO IT_FINAL-IR_BUZEI,  "IR-Item in mat Doc
              IT_HISTORY-BUDAT TO IT_FINAL-IR_BUDAT,  "IR-Posting date
              IT_HISTORY-BUDAT TO IT_FINAL-IR_MENGE.   "IR-Quantity
          ENDIF.
    *--To insert GR details
        CLEAR IT_HISTORY.
        READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
                                       EBELP = IT_POITEM-EBELP
                                       VGABE = '1'
                                       BEWTP = 'E'.
          IF SY-SUBRC = 0.
            MOVE :
              IT_HISTORY-BELNR TO IT_FINAL-GR_BELNR,  "IR-Number of Mat Doc
              IT_HISTORY-BUZEI TO IT_FINAL-GR_BUZEI,  "IR-Item in mat Doc
              IT_HISTORY-BUDAT TO IT_FINAL-GR_BUDAT,  "IR-Posting date
              IT_HISTORY-BUDAT TO IT_FINAL-GR_MENGE.  "IR-Quantity
          ENDIF.
    *--To insert Vendor details
         CLEAR IT_VENDOR.
         READ TABLE IT_VENDOR WITH KEY LIFNR = IT_POHEADER-LIFNR.
         IF SY-SUBRC = 0.
          MOVE : IT_VENDOR-NAME1 TO IT_FINAL-NAME1.
         ENDIF.
    *--To insert Business area
         CLEAR IT_BUSINESS.
         READ TABLE IT_BUSINESS WITH KEY EBELN = IT_POITEM-EBELN
                                         EBELP = IT_POITEM-EBELP.
         IF SY-SUBRC = 0.
           MOVE : IT_BUSINESS-GSBER TO IT_FINAL-GSBER.
         ENDIF.
          APPEND IT_FINAL.
          CLEAR  IT_FINAL.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_FINAL_DATA
    thanks
    Sunil

  • How can I reference the last value in a column?

    How can I reference the last value in a column? For example, today I want the value of A1 to appear in another cell. Tomorrow, I will add a row and want to reference A2, next day A3, and so forth.

    Now I got it:
    =OFFSET(A1,COUNT(A)-1,0)

  • How can I find the last day of the current month

    Is it possible to get the last day of the month in reports. Suppose I enter JUL in one of the text field. Now in reports I want to show that JUL contains 31 days. How can I retrieve the last day of the month.
    Any ideas?

    The first (and fast) solution I think is this:
    There is a function MONTH(CURRENT_DATE) that returns the number of the month of the current date.
    Now, you could use CASE WHEN expressions to determine the number of days returned since you now how many days does every month have.
    For instance, you could do:
    CASE
    WHEN MONTH(CURRENT_DATE)=1 THEN 31
    WHEN MONTH(CURRENT_DATE)=2 THEN 28
    WHEN MONTH(CURRENT_DATE)=3 THEN 31
    WHEN MONTH(CURRENT_DATE)=4 THEN 30
    END
    PD. This is faster that use OR expressions like 1 or 3 or 5 because you dont have to try every option.
    Hope it helps...but maybe there is another way more automatic.
    Edited by: linkln on 03/09/2010 08:21 AM

  • How can I determine the type of video out connector I need?

    Howdy,
    I have a white macbook purchased Jun/2008. I want to connect to a TV but don't know what adapter I need. How can I determine the type of video out jack my macbook has?
    System Profiler says the model identifier is "MacBook 4,1". Under Graphics/Displays the only thing it says about the "Display Connector" is that no display is connected. Too bad it doesn't tell me what type of connector it is. If I knew the name of the connector I'd probably be home free. But it seems like every macbook model has a different video connector (since the state of the art has advanced over the years) and I haven't been able to keep up with the names.
    Now, I have a 6" long adapter that will convert this connector to VGA. And searching the Apple store for VGA adapters, the existence of mine says my connector is might be one of "Mini DisplayPort", "Apple Mini DVI", "Apple DVI", or "Apple Micro-DVI". But then there is also the connector at
    http://store.apple.com/us/product/M8639G/A?mco=MTY3ODQ5OTY
    and that looks like the one I have. But unlike the other adapters, this one is just called a "VGA Display Adapter". Does the connector have a name? How can I find adapters that have that same connector?
    I know I could use the adapter I have, plus a VGA to VGA cable, to hook up to a TV. But the quality of the VGA signal is poor in the digital world. My goal is to hook up to the TV via HDMI. Is this even possible? By which I mean, will my macbook generate the signals necessary to be able to be converted to HDMI?
    Thanks for any help,
    Zebulon T

    Thanks, Ded,
    You're right, the cable that I have won't work. I't from my previous, 2004 iBook. This is pretty embarrassing... I looked at the cable but didn't bother to try plugging it in.
    Looking at the close-up picture of the Mini-DVI to VGA adapter, that does look like the right connector. So I have Mini-DVI, and the other apter you pointed to can convert this to DVI. I'll take a look to see what makes the most sense, connector wise, downstream from that.
    Thanks very much.
    Zeb T

  • How Can I Determine the Size of the 'My Documents' Folder for every user on a local machine using VBScript?

    Hello,
    I am at my wits end into this. Either I am doing it the wrong way or it is not possible.
    Let me explain. I need a vb script for the following scenario:
    1. The script is to run on multiple Windows 7 machines (32-Bit & 64-Bit alike).
    2. These are shared workstation i.e. different users login to these machines from time to time.
    3. The objective of this script is to traverse through each User Profile folder and get the size of the 'My Documents' folder within each User Profile folder. This information is to be written to a
    .CSV file located at C:\Temp directory on the machine.
    4. This script would be pushed to all workstations from SCCM. It would be configured to execute with
    System Rights
    I tried the script detailed at:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/31/how-can-i-determine-the-size-of-the-my-documents-folder.aspx 
    Const MY_DOCUMENTS = &H5&
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(MY_DOCUMENTS)
    Set objFolderItem = objFolder.Self
    strPath = objFolderItem.Path
    Set objFolder = objFSO.GetFolder(strPath)
    Wscript.Echo objFolder.Size
    The Wscript.Echo objFolder.Size command in the script at the above mentioned link returned the value as
    '0' (zero) for the current logged on user. Although the actual size was like 30 MB or so.
    I then tried the script at:
    http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_27869829.html
    This script returns the correct value but only for the current logged-on user.
    Const blnShowErrors = False
    ' Set up filesystem object for usage
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")
    ' Display desired folder sizes
    Wscript.Echo "MyDocuments : " & FormatSize(FindFiles(objFSO.GetFolder(objShell.SpecialFolders("MyDocuments"))))
    ' Recursively tally the size of all files under a folder
    ' Protect against folders or files that are not accessible
    Function FindFiles(objFolder)
    On Error Resume Next
    ' List files
    For Each objFile In objFolder.Files
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:01", objFolder.Path
    On Error Resume Next
    FindFiles = FindFiles + objFile.Size
    If Err.Number <> 0 Then ShowError "FindFiles:02", objFile.Path
    Next
    If Err.Number = 0 Then
    ' Recursively drill down into subfolder
    For Each objSubFolder In objFolder.SubFolders
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:04", objFolder.Path
    FindFiles = FindFiles + FindFiles(objSubFolder)
    If Err.Number <> 0 Then ShowError "FindFiles:05", objSubFolder.Path
    Next
    Else
    ShowError "FindFiles:03", objFolder.Path
    End If
    End Function
    ' Function to format a number into typical size scales
    Function FormatSize(iSize)
    aLabel = Array("bytes", "KB", "MB", "GB", "TB")
    For i = 0 to 4
    If iSize > 1024 Then iSize = iSize / 1024 Else Exit For End If
    Next
    FormatSize = Round(iSize, 2) & " " & aLabel(i)
    End Function
    Sub ShowError(strLocation, strMessage)
    If blnShowErrors Then
    WScript.StdErr.WriteLine "==> ERROR at [" & strLocation & "]"
    WScript.StdErr.WriteLine " Number:[" & Err.Number & "], Source:[" & Err.Source & "], Desc:[" & Err.Description & "]"
    WScript.StdErr.WriteLine " " & strMessage
    Err.Clear
    End If
    End Sub
    The only part pending, is to achieve this for the 'My Documents' folder within each User Profile folder.
    Is this possible?
    Please help.

    Here are a bunch of scripts to get folder size under all circumstances.  Take your pick.
    https://gallery.technet.microsoft.com/scriptcenter/site/search?query=get%20folder%20size&f%5B0%5D.Value=get%20folder%20size&f%5B0%5D.Type=SearchText&ac=2
    ¯\_(ツ)_/¯

  • How can we update the last synchronization date and time..on SUP in sccm 2012 R2

    Hi,
        Can you any one please guide me how can i update the last  synchronization date & time in SUP on SCCM2012 r2 , some how its updated as future date and when ever i try to synch the SUP with disconnected WSUS its shows in the wsyncmgr.log 
    "Wakeup for a polling cycle " and  " Wakeupby inbox drop" and "Wakeup by SCF change"  
    Thanks 
    Balaji K

    You'll probably have to call CSS on this one as this not normal by any means. The messages you noted above are completely normal but if that's all you are seeing then there's an issue.
    Have you reviewed wcm.log and wsusctrl.log?
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • How can I filter the LOV rows at the runtime

    I am working in oracle forms 6i.
    My lov is based on a view. If I selected one row from LOV, that row should not appear in list box.
    I would like to restrict rows before saving a form. How can i filer the LOV rows at the runtime?
    Please help me.

    Dear Mr.MH_BD,
    Thanks for your immediate response,
    My form is built based on master and detail link.  On the multi row detail section I am invoking this LOV.  The record group containing the following query:
    select fees_id,fees_name,term_fees from sk_fees_mst where fees_bal>0;
    fees_id
    fees_name
    term_fees
    12
    Tuition Fees
    2500
    13
    Smart Class
    100
    14
    Admin Fees
    300
    If I selected the fees_id 13 for the first row of detail section, then the LOV should display only the following in the next row:
    fees_id
    fees_name
    term_fees
    12
    Tuition Fees
    2500
    14
    Admin Fees
    300
    (ie.) Before commit form I need to filter the already selected fees ids from record group.
    Thanks in advance.

  • How can I get the last updated email address of the customer ??

    Dear All,
    Please let me know, How can I get the last updated email address of the customer ??
    Also, I am trying to read CDHDR table where OBJECTCLAS is ADRESSE, however what value should be passed into OBJECTID field, looks like it is ADRNR with a Suffix BP.
    Please confirm me what value should be passed into OBJECTID field.
    Thank you.
    Anitha

    Hi Anitha,
      Check if this is something that helps you:
    Change documents in BAS
    CDHDR
    address type 1
    objectclass = ADRESSE             
    objectid = addrgroup + addrnumber     (ADRC-ADDR_GROUP + ADDRNNUMBER) !!
                     'BP  000xxxxxx'
    private address (address type 2)
    objectclass = ADRESSE2
    objectid =  'BP  000xxxxxx000yyyyyyy'   
                            persnumber+adrnr private
    address type 3
    objectclass = ADRESSE3
    objectid =  'BP  000xxxxxx000zzzzzzz'
                              persnumber +comp.address
    The above details is from the link: http://wiki.sdn.sap.com/wiki/display/ERPLO/LO-MD-BP
    Regards,
    Swarna Munukoti

  • How can i check the last location of iphone when it was on?

    I left my iphone in a taxi, but i found the taxi's home, i went to his home and i told him to give me back my iphone but he told me that he never seen iphone in his taxi.
    the iphone was on when i left it in the taxi and it was still on till 4 hours after i left it, probably he found the iphone and went to his home so i just wanna check the last location of iphone, if it shows in his home area so i will be sure that he got the iphone and then i contact the police to take it back but otherwise i can not do anything cause he says i haven't found it.
    plz plz help me

    it was active when i lost it and i went to icloud website, but it shows offline. that means that it is off.
    i just need to know if the iphone keeps recording of location where you go and how can i see the last location of iphone when it was on.

  • How can I see the last location of a now dead ipod touch 4G that had find my iphone turned on?

    How can I see the last location of a now dead ipod touch 4G that had find my iphone turned on? I can see my macbook but I cant see the last location of my ipod touch. I lost it a few weeks ago and figured it would show up. But it has not and I need it again for my job. Please help.

    There is nothing you can do now. There are apps available from the app store that would give you that information if installed before it was lost/stolen.

  • I have an Ipod touch updated to last available ios 4.2.1. How can I get the last compatible versions of the apps?

    I have an Ipod touch updated to last available ios 4.2.1.
    How can I get the last compatible versions of the apps?
    In the appstore there are only the lat app versions, most of them are incompatible with my device.
    I know that previous versions of these apps were compatible with my ipod.
    Can all download them someway?
    thanks

    The problem is: I never had the compatible versions. But I want them, I'd buy them if I could.
    So I'm stuck with my Ipod, which can't be upgraded anymore to higher IOS versions, and with the appstore, that does not offer older versions; versions that have existed and still exist, perhaps in the recycle bin of some users, or somewhere in the appstore servers.
    I know, its a policy, just to sell more devices. Will not work with me. I'm not buying more Ipods

  • How can we pass the entire rows of a table to a web service in a VC model ?

    Hi,
    On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input.
    How can we pass the entire rows of a table into a service ?
    Regards,
    Nitin

    Hi Nitin,
    It seems that you have two or three different structures to pass data using your webservice. In your main question, two tables, you can join both in one table and from there call the webservice. In order to pass the entire table you need:
    1. Draw a line between your joinned table and your service,
    2. Map the fields,
    3. Create a 'SUBMIT' in your table tool bar. Right click on your table and choose 'Create Toobar', '+', name and choose 'Submit' as your event.
    4. Go to Configure Element (Table View) 'Multiple' at Selection Mode.
    Reward points if helps you to solve your question.
    Regards,
    Gilson Teixeira

Maybe you are looking for

  • HOW DO I GET NUMBERS TO DO WHAT I WANT?

    HELP PLEASE: I  FIND NUMBERS  CONFUSING.  THE OLD WORKS SPREADSHEETS WERE SO MUCH EASIER/SIMPLER. I CAN’T SEEM TO GET THE FORMULAS & FUNCTIONS ENTERED CORRECTLY. I DON’T KNOW WHAT THEY MEAN “PRESERVE ROW” OR “PRESERVE COLUMN”.. SO DON’T KNOW IF I NEE

  • Music on one mac and apps on windows pc

    Hi we have our music on an I Mac, my wife has her phone synced with her PC laptop for apps am Nd photos, is there a way to connect her I phone 4 to the Mac so I can transfer music to it.  Right now she uses an old iPod nano and would like it all in o

  • Compile of forms on Oracle 11g database Rel1 very slow

    I think the following statement is causing the issue : SELECT COUNT (*) FROM ALL_OBJECTS WHERE ( OWNER = 'SYS' AND OBJECT_NAME = 'DBMS_JAVA' AND OBJECT_TYPE = 'PACKAGE' AND ALL_OBJECTS.STATUS = 'VALID' ) OR ( OWNER = 'SYSTEM' AND OBJECT_NAME = 'ORA_D

  • SD Condition Record Control data.

    Hi All, In a sales order pricing procedure, if we go in the condition Type JMOD, and double click in it, to view the control data, and its tax code coming into it.  In control Data screen there is 2 fields Cond. Control and Condit. Origin. From where

  • Dreamweaver with Flash

    I've been designing a website and want the first thing someone sees on my site is a flash movie I've made. The flash movie starts with the company name and moves objects across the screen right to left to reveal the website. I've made it so it remove