Save data to array

帖子被trinight在02-19-2006 07:14 AM时编辑过了
Attachments:
save data to array.vi ‏11 KB

Hi, K C.  In another post I got some examples. In my case , I have a data source which outputs two numbers at a time(like 8.2 9.6), then after a fixed time interval, it outputs another two numbers...... I want to keep these numbers in a two demention array. I attach a example(add to array.JPG) from someone(in another post you can find the details) which has a fault , that is if two same number come along, it can only save one to the array. I attach another image of vi which I made myself(add to array[1].JPG), which has a fault too, I didn't know why, wish you can help me. Tomorrow I will go out for several days. So I cann't reply in the following days.
Attachments:
add to array.JPG ‏34 KB
add to array[1].JPG ‏62 KB

Similar Messages

  • Save data to array(dele​te two previous wrong threads, please )

    Sorry ,I have put two same threads in this board by wrong operation, please delete for me.Thanks.
    Hi, I want to save a series of data to an array in the
    following prosedure: The first data come (index of array
    = 0), save the data to a(0), then the second data come,
    array index +1,  save the data to a(1),...... I have write a
    vi, but it doesn't work
    Attachments:
    save data to array.vi ‏11 KB

    trinigh,
    I'm not sure I get your point and only have LabVIEW 7.1, so could you just post an image of your diagram.
    If what you want is to build (not save) an array, you should use the "build array" function in a loop, like this...
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    Untitled12.vi ‏37 KB

  • How to save data (DBL array) in a excel file

    Ok, I am new into Labview.  This question may seem easy for you guys, but for me, it is quite a challenge.  I have current coming out of a loop.  When the program stop, I would like to be able to save it as well as the time when it has been taking and the average current in a excel file.  When my labview code stops, how do I do to get a  pop up window which ask me where and what name to save it to? How do I get so that on the top of each column, it says : current (Amp)    Time (ms)   Average Current (amp)?
    thank you very much,

    Hello,
    We love to see people catch the LabVIEW spirit and anything we can do to help
    you through the initial learning process is our pleasure.
    As KC suggested saving the file as a .csv is a good idea,
    you can also save it as a txt file and open it with Excel specifying a delimiter
    for the columns.
    There is a really good example you can find in the LabVIEW
    example finder if you search for the keyword ‘file’, the example is called “Write
    to Text File.vi”. They use a Get date/time String to record the time when data
    is acquired.
    I have attached a simple Write to File picture of a VI that
    takes a random number and writes it to a file. When I run the VI, a popup asks
    me what I want to call the file. The first part writes the heathers on the
    columns and inside of the for loop I save the data. Underneath the block diagram
    is a picture of the output file when I specify the number of samples to be five.
    If you want your file to be on a very specific format, you
    can create a template file, read it in LabVIEW, and then add your data to it
    and save it to a new file.
    Hope this can get you started with your program.
    There are a lot of good tutorials online on how to
    get started using LabVIEW. Here is the link to a three hour
    introduction course:
    http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/60c2782788a811c986256cd50001a0a6?OpenDocument&node=200067_us
    We are also comming out with LabVIEW 8 in November and we have a program called LabVIEW Standard Service Program
    (SSP) that allows you to get automatic upgrades and updates. Please let
    me know if you are interested in knowing more about it.
    Good luck,
    Tica Taveras
    Applications Engineer
    National Instruments
    Attachments:
    SaveData.bmp ‏1475 KB

  • How to save a 4D Array in a File and load it later on?

    Hello,
    I am trying to save a 4D Array (Array[4000] [3] [20] [5]) of UINT in a File. I can do it through "write in binary File". But then I can´t load it. I know I can transform my Array down to 1D Array of 1.200.000 Elements (4000*3*20*5) of UINT. When I load it, I have to transform it back (with a lot of "for-looping") back to 4D. But is there an easier way of doing that?
    I was not able to find a solution in this forum - I am sorry if I made a new thread if there is already a solution in this forum.
    Best regards
    LabVIEW 2011
    Solved!
    Go to Solution.

    As Lynn said, there should be no extra code required.
    When writing, make sure that "prepend size" is true (true is default) and when reading, wire an empty 4D array of the correct representation to the "data type" input.
    (I also assume that your LabVIEW version is not extremely ancient)
    LabVIEW Champion . Do more with less code and in less time .

  • How concatenate date and array to write in excel?

    Hello
    I have a problem to concatenate a date array and numeric array. can you help me?
    I want save Measurement of a sensor with save time in an excel (row 1 column1 save date and row 1 coulmn : save sensor data). but I cant save these two value seperatly(my clocks cant do it). now, I want concatenate them at first and then save them. is it possible?
    Best Regards
    Solved!
    Go to Solution.
    Attachments:
    concatenate.jpg ‏82 KB

    Try the attached.  You'll understand it as soon as you see it.  If not, shout.
    Attachments:
    write_to_file.vi ‏8 KB

  • How to recive game save data form ipad

    i loss my game save data in my ipad mini 2 , and how to recive games save data
                please help

    Sure you can save arrays also
    var mySo:SharedObject;
    mySo = SharedObject.getLocal("application-name");
    trace("loaded value: " + mySo.data.savedValue + "\n\n");
    var testArray:Array = new Array(1,2,3,4,5,6,7,8);
    saveValue(testArray);
    function saveValue(testArray):void {
        mySo.data.savedValue = testArray;
        var flushStatus:String = null;
        try {
            flushStatus = mySo.flush(10000);
        } catch (error:Error) {
            trace("Error...Could not write SharedObject to disk\n");
        if (flushStatus != null) {
            switch (flushStatus) {
                case SharedObjectFlushStatus.PENDING :
                    trace("Requesting permission to save object...\n");
                    mySo.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
                    break;
                case SharedObjectFlushStatus.FLUSHED :
                    trace("Value flushed to disk.\n");
                    break;
    //to clear the cookie call this function
    //clearValue();
    function clearValue():void {
        trace("Cleared saved value...Reload SWF and the value should be \"undefined\".\n\n");
        delete mySo.data.savedValue;
    function onFlushStatus(event:NetStatusEvent):void {
        trace("User closed permission dialog...\n");
        switch (event.info.code) {
            case "SharedObject.Flush.Success" :
                trace("User granted permission -- value saved.\n");
                break;
            case "SharedObject.Flush.Failed" :
                trace("User denied permission -- value not saved.\n");
                break;
        mySo.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);

  • Having problem with storing data in array

    Hi,
    I'm having problem on storing data in array. My problem is that each time it loops, the array just keep overwrite instead save to the next index. Like at 0 the value is 123, and 1 is 234. But i having that all data capture all overwrite at 0 till the last data it still show at 0. How do i correct this problem?
    Solved!
    Go to Solution.

    How to use array to do comparison? Like Array 1 go thru array 2 to get data Loss out and build an array. Like Array 1 ,1000,1024,1048,etc before 1520 fall in between Array 2 range 1000-1500. So Freq 1000,1024,1048 etc will get Loss value as 1 and 1520 fall in between 1500-2000 will output Loss 2. and so on till the end of the list. How should do this? Need help on this.
    Array 1                                                Array 2
    Freq                                              ​     Freq   Loss
    1000                                              ​    1000      1
    1024                                              ​    1500      2
    1048                                              ​    2000      3
    1100                                              ​     :
    1200                                              ​     :
    :                                                 ​        18000
    1520
    18000

  • How to save data in 4-bit mode instead of U8

    Hi
    I use LabVIEW to acquire and save data through the counter timer PCI6602.
    My signals are really low so the data can be expressed in 4-bits (0-15).
    I have used the conversion to U8 and write them using "Write Binary Files"
    So this uses 1 byte for each data point but I would like to reduce it to 4bit (half byte) for each data point.
    Can anyone help me with this?
    I am attaching my program for reference 
    Solved!
    Go to Solution.
    Attachments:
    DAQ-longvector1.vi ‏64 KB

    Here's some easy code how to do it.
    Note that this code assumes that the data is 4bit (0..15). If any of the upper 4 bit are set, you've got problems, of course
    See if this makes sense. Good luck.
    This example uses a single 1D array. You would eliminate the decimate/interleave and just use the two arrays.
    A small comment to your code. There are a few weird constructs, but the use of two "split array" operations to take a simple derivative seems overkill. This made a honorary mention in the Rube Goldberg Hall of Fame.
    Message Edited by altenbach on 12-04-2008 05:18 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    8bitTo4bit.png ‏18 KB

  • How can i save the output array of the invoke node "commands values" into a specific file

    I must save the setup of vi commands'. I use an invoke node called "command value" wich give me an array with the name of the specific command and his value. How can i save this array into a specific file to load it later if o need. Must i change the array format?
    Thank you

    Hi,
    I have attached two VIs.
    The first one "Ecriture fichier tableau" (writer) permits to collect all control's values in an array (dbl) and to save it as .bin file. You had to convert variant type into dbl type. (You can do the same with string type if you wish. You will save datas as .txt file for example)
    The second VI "Lecture tableau fichier" (reader) permits to retrieve all the datas you saved in the file.
    I think this responds to your question.
    Regards,
    Attachments:
    Control values.zip ‏26 KB

  • Can I save data in a snapshot from signal express 2013 LE?

    Can I save data (in txt or excel format) from a snapshot from signal express 2013 LE?  My data buffer is too larege to export to excel.  When I try to take a snapshot, I do not see any data.  Are snapshots supported in the LE mode?  This is the free version that comes with the USB 6009 ADC.

    Yes, the snapshot function is available for SignalExpress 2013 LE. Does the snapshot function as intended when you try other projects?
    Daniel P.

  • Not able to save data in pa30 action infotype in production

    Hi,
    In my organization users are not able to save data in SAP HR  pa30 action info type in production.
    It is gets hanged and throws run time error after run long time .
    in ST22 it will give below error:
    Runtime Errors   TSV_TNEW_PAGE_ALLOC_FAILED
    Information on where terminated
        Termination occurred in the ABAP program  "SAPLRHAS"   in "FILL_STRU_TURBO"
        The main program was "MP000000 ".
        In the source code you have the terminated point in line 759
        of the (Include) program "LRHASF00".
    Thanks and regards,
    Tarun

    Hi,
         Pls check your relationship of reporting postions and set up relationship A002 and also check organization relationship
        otherwise take help form ABPERs and debug and partiuclar prorgram and where and witch object its throwing
        error found out.
    Regrads,
    Tarun

  • Unable to save data in record working time

    Hi All,
    I am working on ESS portal , when I try to record & save working time in portal , it throw an error message as 'Unable to save data'.
    Can you plz assist me on this.
    Usefull answers will be awarded.
    Thanks,
    Nilima

    Hi ALL,
    I'm too facing the same problem....usefull answers will be awarded.

  • How to save data in ztable after editing in alv report

    how to save data in ztable after editing in alv report?

    Hi,
        Please find the attachment below.This may be usefull to you.
         [http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database%28OOPS%29]
    Regards,
    Ramakrishna Yella.

  • Save Data in ALV Report .

    Hello,
    Given below is my code
    *& Report  ZALV_TEST_SA                                                *
    REPORT  ZALV_TEST_SA NO STANDARD PAGE HEADING.
    *----------------------TYPE POOL OF ALV--------------------------------*
    TYPE-POOLS: SLIS.
    *----------------------DATABASE TABLES---------------------------------*
    TABLES: ZFLIGHTM_SA, ZFLIGHT_AVAIL_SA.
    *-------------DATA DECLARATION-----------------------------------------*
    DATA: BEGIN OF ITAB OCCURS 0,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZCITY_FROM TYPE ZCITY_FROM,
             ZCITY_TO TYPE ZCITY_TO,
             ZDEP_DATE TYPE DATS,
             ZTIME TYPE TIMS,
             ZPRICE TYPE ZPRICE,
             ZNUM_OF_PSNGRS(3) TYPE N,
             ZAVAIL_SEATS(3) TYPE N,
          END OF ITAB.
    DATA: BEGIN OF ITABM OCCURS 0,
             MANDT TYPE MANDT,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZCITY_FROM TYPE ZCITY_FROM,
             ZCITY_TO TYPE ZCITY_TO,
             ZTIME TYPE TIMS,
             ZPRICE TYPE ZPRICE,
          END OF ITABM.
    DATA: BEGIN OF ITAB_AVAIL OCCURS 0,
             MANDT TYPE MANDT,
             ZFLIGHT_ID TYPE ZFLIGHT_ID,
             ZDEP_DATE TYPE DATS,
             ZNUM_OF_PSNGRS(3) TYPE N,
             ZAVAIL_SEATS(3) TYPE N,
          END OF ITAB_AVAIL.
    DATA: WA_ITAB LIKE LINE OF ITAB,
          WA_ITABM LIKE LINE OF ITABM,
          WA_ITAB_AVAIL LIKE LINE OF ITAB_AVAIL.
    DATA: L_REPID LIKE SY-REPID,
          L_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV,
          L_EVENTS TYPE SLIS_T_EVENT.
    DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    *----------------SELECTION SCREEN SELECT-OPTIONS-----------------------*
    SELECT-OPTIONS S_CITY FOR ZFLIGHTM_SA-ZCITY_FROM NO INTERVALS.
    SELECT-OPTIONS D_CITY FOR ZFLIGHTM_SA-ZCITY_TO NO INTERVALS.
    SELECT-OPTIONS D_DATE FOR ZFLIGHT_AVAIL_SA-ZDEP_DATE NO INTERVALS.
    *----------------------SELECTION OF DATA-------------------------------*
    PERFORM SELECT_DATA.
    *----------------SETTING DATA IN TABLE FOR FIELD CATALOG---------------*
    PERFORM CALL_FIELDCAT_MERGE.
    *----------CALLING FUNCTION FOR DISPLAYING REPORT----------------------*
    PERFORM DISPLAY_TABLE.
    *----------------------AT SELECTION SCREEN EVENT-----------------------*
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'STORE'.
           PERFORM SAVE_DATA.
        WHEN 'PREVIOUS'.
           LEAVE TO SCREEN 0.
        WHEN OTHERS.
      ENDCASE.
    *------------------------------FORMS-----------------------------------*
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SELECT_DATA .
      SELECT A~ZFLIGHT_ID    ZCITY_FROM
             ZCITY_TO        ZDEP_DATE
             ZTIME           ZPRICE
             ZNUM_OF_PSNGRS  ZAVAIL_SEATS
         FROM ZFLIGHTM_SA AS A INNER JOIN ZFLIGHT_AVAIL_SA AS B
            ON A~ZFLIGHT_ID = B~ZFLIGHT_ID
             INTO CORRESPONDING FIELDS OF TABLE ITAB
                WHERE A~ZCITY_FROM IN S_CITY
                  AND A~ZCITY_TO IN D_CITY
                  AND B~ZDEP_DATE IN D_DATE.
      L_REPID = SY-REPID.
    ENDFORM.                    " SELECT_DATA
    *&      Form  CALL_FIELDCAT_MERGE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM CALL_FIELDCAT_MERGE .
    *  CLEAR WA_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZFLIGHT_ID'.
    *  WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZPRICE'.
    * WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *  WA_FIELDCAT-TABNAME       = ITAB.
    *  WA_FIELDCAT-FIELDNAME     = 'ZAVAIL_SEATS'.
    *  WA_FIELDCAT-KEY           = 'X'.     "sets key field
    *  APPEND WA_FIELDCAT TO  L_FIELDCAT.
    *--------------CALLING FUNCTION FOR FIELD CATALOG----------------------*
      CLEAR L_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
         I_PROGRAM_NAME               = L_REPID
         I_INTERNAL_TABNAME           = 'ITAB'
    *       I_STRUCTURE_NAME             = 'WA_ITAB'
    *       I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = 'ZALV_TEST_SA'
         I_BYPASSING_BUFFER           = 'X'
    *       I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = L_FIELDCAT
    *     EXCEPTIONS
    *       INCONSISTENT_INTERFACE       = 1
    *       PROGRAM_ERROR                = 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.
    *--------------EDITING FIELDS IN FIELD CATALOG ------------------------*
      LOOP AT L_FIELDCAT INTO WA_FIELDCAT.
        CASE WA_FIELDCAT-FIELDNAME.
             WHEN 'ZFLIGHT_ID'.
               WA_FIELDCAT-COL_POS = '1'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '3'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
               WA_FIELDCAT-EMPHASIZE = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Flight ID'. "40 char long field name
               WA_FIELDCAT-SELTEXT_M = 'Flight ID'. "20 char long field name
               WA_FIELDCAT-SELTEXT_S = 'Flight ID'. "10 char long field name
             WHEN 'ZCITY_FROM' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZCITY_TO' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZDEP_DATE' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZTIME' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZPRICE' .
               WA_FIELDCAT-COL_POS = '2'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '4'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
    *          WA_FIELDCAT-EMPHASIze = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Price'. "40 char long field name
               WA_FIELDCAT-SELTEXT_M = 'Price'. "20 char long field name
               WA_FIELDCAT-SELTEXT_S = 'Price'. "10 char long field name
               WA_FIELDCAT-EDIT = 'X'.
             WHEN 'ZNUM_OF_PSNGRS' .
               WA_FIELDCAT-NO_OUT = 'X'.
             WHEN 'ZAVAIL_SEATS' .
               WA_FIELDCAT-COL_POS = '3'.
    *          WA_FIELDCAT-text_fieldname = 'Flight ID'.
               WA_FIELDCAT-KEY = '4'.
               WA_FIELDCAT-JUST = 'L'.
               WA_FIELDCAT-NO_ZERO = 'X'.
    *          WA_FIELDCAT-EMPHASIze = 'X'.
               WA_FIELDCAT-SELTEXT_L = 'Available Seats'.
               "40 char long field
               WA_FIELDCAT-SELTEXT_M = 'Available Seats'.
               "20 char long field
               WA_FIELDCAT-SELTEXT_S = 'Seats'. "10 char long field name
               WA_FIELDCAT-EDIT = 'X'.
             WHEN OTHERS.
               WA_FIELDCAT-NO_OUT = 'X'.
        ENDCASE.
    MODIFY L_FIELDCAT FROM WA_FIELDCAT.
      ENDLOOP.
    ENDFORM.                    " CALL_FIELDCAT_MERGE
    *&      Form  USER_COMMAND_ALV_SA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM USER_COMMAND_ALV_SA USING I_UCOMM LIKE SY-UCOMM
                            IS_SELFIELD TYPE SLIS_SELFIELD.
    *****form frm_usercommand using r_ucomm like sy-ucomm
    *****rs_selfield type slis_selfield.
    ****CASE I_UCOMM.
    CASE sy-ucomm.
        WHEN 'STORE'.
           PERFORM SAVE_DATA ON COMMIT.
        WHEN 'PREVIOUS'.
           LEAVE TO SCREEN 0.
        WHEN OTHERS.
    ENDCASE.
    ENDFORM.                    "USER_COMMAND_ALV_SA
    *&      Form  DISPLAY_TABLE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY_TABLE .
    *  L_FIELDCAT-input = 'X'.
    *  L_FIELDCAT-edit = 'X'.
    *  L_LAYOUT-Edit = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
    I_CALLBACK_PROGRAM                = L_REPID " report id
    I_CALLBACK_PF_STATUS_SET          = 'ZALV_TEST_SA' " to set pf-status
    I_CALLBACK_USER_COMMAND           = 'USER_COMMAND_ALV_SA' " to handle
                                                              " user command
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  = ''
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         = L_LAYOUT
    IT_FIELDCAT                       = L_FIELDCAT " for field catalog
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    IT_EVENTS                         = L_EVENTS "internal table with
                                                               " user events
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    *  IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
       TABLES
        T_OUTTAB                          = ITAB "internal table with
                                                                   " records
       EXCEPTIONS
        PROGRAM_ERROR                     = 1
       OTHERS                             = 2
    *********  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.                    " DISPLAY_TABLE
    *-------------------------SET PF-STATUS--------------------------------*
    *&      Form  ZALV_TEST_SA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM  ZALV_TEST_SA USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'ZALV_TEST_SA' .
    ENDFORM.                    "ZALV_TEST_SA
    *&      Form  SAVE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SAVE_DATA.
      LOOP AT ITAB INTO WA_ITAB.
    ****HIDE:WA_ITAB-ZFLIGHT_ID,      WA_ITAB-ZCITY_FROM,
    ****WA_ITAB-ZCITY_TO,        WA_ITAB-ZTIME,
    ****WA_ITAB-ZDEP_DATE,       WA_ITAB-ZNUM_OF_PSNGRS,
    ****WA_ITAB-ZAVAIL_SEATS.
        CLEAR: WA_ITABM,WA_ITAB_AVAIL.
        WA_ITABM-ZFLIGHT_ID          = WA_ITAB-ZFLIGHT_ID.
        WA_ITABM-ZCITY_FROM          = WA_ITAB-ZCITY_FROM.
        WA_ITABM-ZCITY_TO            = WA_ITAB-ZCITY_TO.
        WA_ITABM-ZTIME               = WA_ITAB-ZTIME.
        WA_ITABM-ZPRICE              = WA_ITAB-ZPRICE.
        WA_ITAB_AVAIL-ZDEP_DATE      = WA_ITAB-ZDEP_DATE.
        WA_ITAB_AVAIL-ZNUM_OF_PSNGRS = WA_ITAB-ZNUM_OF_PSNGRS.
        WA_ITAB_AVAIL-ZAVAIL_SEATS   = WA_ITAB-ZAVAIL_SEATS.
        APPEND WA_ITABM TO ITABM.
        APPEND WA_ITAB_AVAIL TO ITAB_AVAIL.
      ENDLOOP.
      MODIFY ZFLIGHTM_SA FROM TABLE ITABM.
      MODIFY ZFLIGHT_AVAIL_SA FROM TABLE ITAB_AVAIL.
      COMMIT WORK.
    ENDFORM.                    " SAVE_DATA
    I want to edit a field--the price and save the changes. I have assigned a button STORE for this. But my data is not getting saved.
    I searched the forum and wrote the code accordingly. I even referred the stored programs. Still I am not getting the output. Please help.
    Regards,
    Smruthi.
    Edited by: Smruthi Acharya on Feb 10, 2009 3:31 PM
    Edited by: Julius Bussche on Feb 10, 2009 12:16 PM
    Please use code tags

    Hi,
    You must have taken some function code for that STORE button (say you have taken it as   MODIFY )
    Use this code, it will modify the code in internal table from alv.
    I have tried it, n its working:-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sort        " sort info
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     i_save                            = 'A'
    *     is_variant                        = wa_variant     " variant name
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is MODIFY (STORE button) then save data
        WHEN 'MODIFY'.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    " at this point your data in internal table is changed
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • Hi am trying to save Data into a write to measurement file vi using a NI PXI 1042Q with a real time mode but it is not working but when i run it with uploading it into the PXI it save in to the file

    Hi am trying to save Data into a write to measurement file vi using a NI PXI 1042Q and DAQ NI PXI-6229 with a real time mode but it is not working but when i run it without uploading it into the PXI it save in to the file please find attached my vi
    Attachments:
    PWMs.vi ‏130 KB

     other problem is that the channel DAQmx only works at real time mode not on stand alone vi using Labview 8.2 and Real time 8.2

Maybe you are looking for