Save data on state change

I’m using Labview 2010 p1 and trying to figure out have to save data on a specific change in the data.  I have a VI that I can;
Watch the data change real time
Save single shot or continuous data
Save if data goes over “x”
But what I now need is to save once when the data goes over, then watch till the data goes under “x”, and repeat.  So instead of continuously saving data (a waste), only want to save data when the motor first starts and when the motor stops.  So I will have just two segments of data instead of 100’s.
Does this make sense?
SKIP

If your program already saves data when a threshold is passed on the increase, then you have accomplished much of what you need. Have the state change set a boolean to indicate to the data save to save the data, then have the data save reset it, then have the state change below the threshold set it again to allow saving, ... The state change boolean can be in a Functional Global, a single element queue, or depending on the structure, held in a shift register around the threshold determining code.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • 2 Vertical Axis Chart & State Change Bug

    When a column or line chart has 2 vertical axis (one on the left and one  on the right), the additional vertical axis must be defined at the series level  as the definition at the chart level only allows for one vertical axis.
    When you define the additional vertical axis at the series level, it will populate on the chart when the chart is first rendered.  But, it fails to populate after a state change.
    This problem does not occur if the data provider uses static data defined in Action Script as an array collection.  But, the problem always occurs if the data provider uses a web service.
    This is a Flex 4 problem.  Flex 3 does not have this problem.
    Below is an example that will demonstrate the problem.  It uses the Flex Grocer web service that comes on the CD with Jeff Tapper’s book “Adobe FLEX 3 Training from the Source” (an Adobe Press book).  However, this example can be easily modified to use any web service.
    The example is currently pointing to static data defined in Action Script.
    You can switch from static data to web service data by commenting the instruction on line 32 ( dp = dpStatic; ) and un-commenting the instruction on line 33 ( dp = (event.result as ArrayCollection); ).
    The example first presents a chart with Gross Sales plotted as columns using the left axis and Net Sales plotted as a line using the right axis.  Note, the vertical axis for Net Sales is defined at the series level.
    When you click the “Data” button a state change occurs and a data grid is presented showing Gross Sales and Net Sales.  When you click the “Chart” button another state change occurs and the chart is presented again.  If you are pointing to static data, both Gross Sales and Net Sales will populate on the chart.  If you are pointing to web service data, Gross Sales will still populate, but Net Sales fails to populate.  This is the problem.
    Does anyone have a solution or work around for this problem?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   creationComplete="init()">
      <fx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.rpc.events.FaultEvent;
          import mx.collections.ArrayCollection;
          [Bindable]
          public var selectedType:String = "All";
          [Bindable]
          public var startDate:Date = new Date(2006, 4, 1);
          [Bindable]
          public var endDate:Date = new Date(2006, 4, 5);
          [Bindable]
          public var dp:ArrayCollection;
          public var dpStatic:ArrayCollection = new ArrayCollection([
            {DTSALE:"11-Nov-07", NET:41.87, GROSS:63.34},
            {DTSALE:"12-Nov-07", NET:45.74, GROSS:58.56},
            {DTSALE:"13-Nov-07", NET:42.77, GROSS:62.34},
            {DTSALE:"14-Nov-07", NET:48.06, GROSS:75.65},
          private function init():void {
            getData();
          private function getData():void {
            dashboardWS.getSalesData.send();
          private function salesRPCResult(event:ResultEvent):void {
            dp = dpStatic;                                        // Line on chart always populates with static data
            // dp = (event.result as ArrayCollection);   // Line on chart does not populate with WebService data after state change
          private function showFault(event:FaultEvent):void {
            trace(event.fault.faultCode + ":" + event.fault.faultString);
        ]]>
      </fx:Script>
      <fx:Declarations>
        <mx:WebService id="dashboardWS" fault="showFault(event)"
                       wsdl="http://localhost:8300/flexGrocer/cfcs/aggregate.cfc?wsdl">
          <mx:operation name="getSalesData" result="salesRPCResult(event)">
            <mx:request>
              <startDate>{startDate}</startDate>
              <endDate>{endDate}</endDate>
              <category>{selectedType}</category>
            </mx:request>
          </mx:operation>
        </mx:WebService>
      </fx:Declarations>
      <s:states>
        <s:State name="chart"/>
        <s:State name="data"/>
      </s:states>
      <s:controlBarContent>
        <s:Button label="Chart" click="this.currentState='chart'"/>
        <s:Button label="Data" click="this.currentState='data'"/>
      </s:controlBarContent>
      <s:HGroup width="100%" height="100%">
        <mx:ColumnChart includeIn="chart"
                        width="100%" height="100%" dataProvider="{dp}">
          <mx:horizontalAxis>
            <mx:CategoryAxis categoryField="DTSALE"/>
          </mx:horizontalAxis>
          <mx:verticalAxis>
            <mx:LinearAxis id="vLeft" title="Gross Sales Columns"/>
          </mx:verticalAxis>
          <mx:series>
            <mx:ColumnSeries yField="GROSS" verticalAxis="{vLeft}"/>
            <mx:LineSeries yField="NET">
              <mx:verticalAxis>
                <mx:LinearAxis id="vRight" title="Net Sales Line"/>
              </mx:verticalAxis>
            </mx:LineSeries>
          </mx:series>
          <mx:verticalAxisRenderers>
            <mx:AxisRenderer axis="{vLeft}" placement="left"/>
            <mx:AxisRenderer axis="{vRight}" placement="right"/>
          </mx:verticalAxisRenderers>
        </mx:ColumnChart>
        <mx:DataGrid dataProvider="{dp}" width="100%" height="100%" includeIn="data">
          <mx:columns>
            <mx:DataGridColumn dataField="DTSALE"/>
            <mx:DataGridColumn dataField="NET"/>
            <mx:DataGridColumn dataField="GROSS"/>       
          </mx:columns>
        </mx:DataGrid>
      </s:HGroup>
    </s:Application>

    I found a workaround.
    When the chart goes through a state change, the “maximum” property on the additional vertical axis defined at the series level defaults to 100 causing the line not to render as the data values are greater than 100.  Setting this to a higher value (maximum="10000" ) forces the line to appear consistently after a state change.
    I still believe this is a bug.
    The downside is that I will have to dynamically determine the maximum vale to use at runtime, but at least I can still use state changes on two vertical axis charts.

  • Last State Received / Last State Change Date is Incorrect

    Checking a report today I noticed the Last State Received and Last State Change dates are off for many of our clients. The report I'm looking at is the
    Compliance 8 - Computers in a specific compliance state for an update (secondary)
    The StateMessage.log on our clients show successful submissions to the MP. Statesys.log on SCCM looks healthy as does MPControl.log. Has anyone run into this before?
    Orange County District Attorney

    Hi,
    If you initiate Actions on clients, could this data get updated after a while?
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Error when save date in SQL database

    Hi all,
    I try to save a date in to a sql database, but when I run my program I get following error:
    Invalid object 11/21/05 9:32 AM of type java.sql.Date assigned to host variable 3.
    In my database table I have a fields date (type Data)en time type(Time).
    this is the source:
         public void createTitle(int title_id, String description, String user)
              throws SQLException {
              // TODO Auto-generated method stub
              Date date = new Date();
              String dateFormat = "YYYY-MM-DD";
              String timeFormat = "HH:mm:ss";
              SimpleDateFormat ddf = new SimpleDateFormat(dateFormat);
              SimpleDateFormat tdf = new SimpleDateFormat(timeFormat);
              String det = ddf.format(date);
              String creationTime = tdf.format(date);
              PreparedStatement newTitle = conn.prepareStatement("INSERT INTO BE_TITLE (TITLE_ID, DESCRIPTION, DATE_CREATE, TIME_CREATE, USER_CREATE) VALUES (?,?,?,?,?)");     
              try{
                   newTitle.setInt(1,title_id);
                   newTitle.setString(2,description);
                   newTitle.setDate(3, new java.sql.Date(date.getTime()));
                   newTitle.setTime(4, new java.sql.Time(date.getTime()));
                   newTitle.setString(5, user);
                   newTitle.executeUpdate();
              }finally{
                   newTitle.close();
    Can someone give me a solution for this error
    Richard

    Hi Richard,
    in your application, you atempt to insert a java.sql.Date value into a DATE column, which has non-zero time-components. Open SQL rejects such an atempt.
    Please allow me to quote from the OSS message (452727 2004), which Detlev refers to in his quote:
    <i>
    about one year ago, we had a very lengthy discussion on this issue - not only internally at SAP but also with Jonathan Bruce, the specification lead for JBDC at Sun.                                                                               
    We have the following dillema:                                                                               
    The javadoc of the constructor java.sql.Date(long) states:                                                                               
    "If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT."                                                                               
    With Jonathan Bruce, we tried to clarify when this normalization should take place.                                                               
    1) Source code inspection shows that it is not the class java.sql.Date the performs the normalization.                                                                               
    2) The Javadoc states that the JDBC driver should perform the             
    normalization. If it is the driver, more open questions arrise:                                                                               
    a) When shall the normalization be performed?                             
       - if a setDate method is invoked?                                      
       - only for INSERT and update statements or also for all other parameters?                                                               
       - shall the getDate method perform the normalization?                  
       - what about set/getObject?                                            
       - the java Docs of set/getDate don't tell anything about normalization.                                                            
       - according to which time zone shall the value be normalized?          
         - UTC                                                                
         - vm time zone?                                                      
         - database time zone?                                                                               
    3) If an automatic normalization is performed, data will be modified upon insertion (or extraction) from the database. This means that we cannot quarantee if we insert and Date object retrieve it again that the two objects will be equal.
    In the discussion with Jonathan, we couldn't clarify the issue. However, Jonathan promised that the JDK should be modified in such a way that the JDK is responsible for the normalization. (So far such a change has not been done).                                                                               
    In order to be on the safe side, SAP chose that Open SQL should reject any Date values that are not normalized. This is what we have          
    implemented and documented. I agree, that in this repect, Open SQL is stricter than the JDBC standard demands.                                                                               
    To help the application with the task to normalize a Date (and Time) object, we offer the helper class                                      
    com.sap.sql.DateTimeNormalizer which you find in opensql.jar.                                                                               
    To come to a conclusion, the bevavoir you observed is from our side not a bug of Open SQL but a feature. Please use DateTimeNormalizer to normalize Date objects appropriately.                                  
    </i>
    I hope, you can follow our reasoning.
    Best regards,
    Adrian

  • I have created a form in InDesign, exported to a pdf, created an editable form and saved.  When I open the form and make changes and save, the reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is alway

    I have created a form in InDesign, exported to a pdf, then created an editable form and saved.  When I open the form and make changes and save, then reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is always minus the edits.   ????

    Hi chuck,
    If you ave created the form and then filling it yourself and saving the form, the filled data should be there when you reopen the same form.
    Can you please send the form to me at [email protected]  so that I can have a look.
    Regards,
    Rave

  • 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

  • How can I initialize all TabNavigator Tabs upon a state change?

    Here's the basic goal. I want to provide two views to the
    user that display the same panels. I configured each view as a
    separate state but I am having trouble initializing each of the tab
    views since they are only created by Flex when the user first
    selects it. I need them all created when the user changes to that
    state so that I can insert my view objects. Does that make sense?
    Ok, how about an example program. I define three view objects
    in ActionScript which will be used in two different states. I use
    AddChild to put them in the proper layout location. The problem is
    with the Tab state. The AddChild operation only works for the first
    tab because it is visible. The other two tabs don't get setup
    properly. Can anyone help me resolve this?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="onCreationComplete()">
    <mx:Script>
    <![CDATA[
    import mx.containers.VBox;
    import mx.controls.Label;
    [Bindable] public var view1:VBox;
    [Bindable] public var view2:VBox;
    [Bindable] public var view3:VBox;
    private function onCreationComplete():void
    var label1:Label = new Label();
    var label2:Label = new Label();
    var label3:Label = new Label();
    label1.text = "This is view 1.";
    label2.text = "This is view 2.";
    label3.text = "This is view 3.";
    view1 = new VBox();
    view1.label = "View 1";
    view1.addChild(label1);
    view2 = new VBox();
    view2.label = "View 2";
    view2.addChild(label2);
    view3 = new VBox();
    view3.label = "View 3";
    view3.addChild(label3);
    currentState = "wizardState";
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = 'wizardState'; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320"/>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="wizardState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:HBox width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"/>
    </mx:HBox>
    </mx:AddChild>
    <mx:AddChild target="{view1}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view2}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view3}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    </mx:State>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabViewStack" width="100%"
    height="100%">
    <mx:VBox label="Tab 1" id="tab1"/>
    <mx:VBox label="Tab 2" id="tab2"/>
    <mx:VBox label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"
    position="lastChild"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"
    position="lastChild"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"
    position="lastChild"/>
    </mx:State>
    </mx:states>
    </mx:Application>

    Ok, here is an even simpler scenario. I take each view from
    the default state and put them in the new tab view when the state
    changes. If you compile and run this example, the only view that
    makes it into the tabview is the one that was active when the state
    changed. Why is that?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = ''; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320">
    <mx:HBox id="wizardView" width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"
    creationPolicy="all">
    <mx:Canvas id="view1" label="Part 1" >
    <mx:TextInput text="This is view 1"/>
    </mx:Canvas>
    <mx:Canvas id="view2" label="Part 2">
    <mx:TextInput text="This is view 2"/>
    </mx:Canvas>
    <mx:Canvas id="view3" label="Part 3">
    <mx:TextInput text="This is view 3"/>
    </mx:Canvas>
    </mx:ViewStack>
    </mx:HBox>
    </mx:Panel>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabView" width="100%" height="100%"
    creationPolicy="all">
    <mx:Canvas label="Tab 1" id="tab1"/>
    <mx:Canvas label="Tab 2" id="tab2"/>
    <mx:Canvas label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:RemoveChild target="{view1}"/>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"/>
    <mx:RemoveChild target="{view2}"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"/>
    <mx:RemoveChild target="{view3}"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"/>
    <mx:RemoveChild target="{wizardView}"/>
    </mx:State>
    </mx:states>
    </mx:Application>

  • How to fetch data for the Change Request in PROCESS_EVENT

    Hi All,
    I need to write some custom logic on Save/Submit button. For this I am planning to enhance the PROCESS_EVENT method of class CL_USMD_CR_MASTER. Within this method I need to access runtime data of the change request currently being processed.
    I am going to create a post-method exit for this PROCESS_EVENT method. Is this correct?
    I have heard we have APIs in MDG which can be used to fetch data, however I do not know how to use the same.
    Can someone please help me with sample code how to fetch the runtime data of the Change Request
    Thanks in advance.
    Regards,
    Vanessa

    What MDG domain are you working on? What you are trying to do is called "reuse mode" enhancement and you do NOT want to tinker with the FPM feeder classes in this case. SCN document Configuration and Enhancement of SAP Master Data Governance contains many examples on how to achieve this.
    This is a how-to document for MDG-M reuse mode enhancement: Extend MDG-M Data Model by a New Entity Type (Reuse Option)
    This is a how-to document for MDG-C/S reuse mode enhancement: SAP How-To Guide: Extend the MDG Business Partner - Node Extension (Reuse Option)
    Keep in mind, these examples are mainly for additional "master data" fields. If you need additional fields that are not master data but are more related to the Change Request itself, you should use this how-to document: Enhancement of the User Interface Building Block for Change Requests
    Again, all of these documents can be found on the first document I referenced above. I suggest that you bookmark it.

  • How to save data after clicking checkbox stored in databasetable

    TYPE-pools: slis.
    tables:mkpf,mseg,mard.
    TYPES: BEGIN OF tp_data,
          mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
      __mark,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    ========================== Selection Screen ==========================
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    =========================== Event Blocks =============================
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    =========================== Subroutines ==============================
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
      SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
      INTO CORRESPONDING FIELDS OF TABLE t_data
      FROM mseg
      JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
          t_heading  TYPE slis_t_listheader.
    ALV required data objects.
      DATA: w_title   TYPE lvc_title,
            w_comm    TYPE slis_formname,
            w_status  TYPE slis_formname,
            x_layout  TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
            t_fieldcat TYPE slis_t_fieldcat_alv,
            t_sort     TYPE slis_t_sortinfo_alv.
      REFRESH t_fieldcat.
      REFRESH t_event.
      REFRESH t_sort.
      CLEAR x_layout.
      CLEAR w_title.
    Field Catalog
      PERFORM set_fieldcat2 USING:
            1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space  t_fieldcat ,
            3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space  t_fieldcat,
            4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            7 'BWART' 'BWART' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space space space space space space space t_fieldcat,
            9 'MENGE' 'MENGE' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            10 'MEINS' 'MEINS' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            14 '__MARK' 'XFELD' space space space 'Select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
      x_layout-zebra = 'X'.
    Top of page heading
      PERFORM set_top_page_heading USING t_heading t_event.
    Events
      PERFORM set_events USING t_event.
    GUI Status
      w_status = ''.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    PERFORM set_order USING 'LIFNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        it_fieldcat              = t_fieldcat
        is_layout                = x_layout
        it_sort                  = t_sort
        i_callback_pf_status_set = w_status
        i_callback_user_command  = w_comm
        i_save                   = 'X'
        it_events                = t_event
        i_grid_title             = w_title
      TABLES
        t_outtab                 = t_data
      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.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
          t_events  TYPE slis_t_event.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Reporte Prueba'(001).
      APPEND x_heading TO t_heading.
    Program name
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Program: '.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-FORM = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
      DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
          t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-UP = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-HOTSPOT = p_hotspot.
      wa_fieldcat-CHECKBOX = p_checkbox.
      wa_fieldcat-ICON = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF p_edit IS NOT INITIAL.
        wa_fieldcat-INPUT     = 'X'.
        wa_fieldcat-EDIT     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    =========================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        i_logo             = 'XXXXX'
        it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
          rs_selfield TYPE slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_s lfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    ENDFORM.                    "user_command
    this is mycode,mblnr, matnr and checkbox both field had created in database table
    then save data after clicking checkbox data stored in database table,and next clickin checkboxes are no change. this my requirment.
    plz send me code .

    Try this
    In user_command form...
    LOOP AT IT_DATA.
    IF  CHECKBOX __MARK EQ 'X'.
    write logic wht u want....
    ENDIF.
    ENDLOOP.

  • Ability to save data on fillable pdf within a broswer

    I am not sure if this is the right place to post, please let me know if it is not.
    I make forms for internal use at my company, and most people tend to fill in forms via browser.  Ever since my department has upgraded to CS5 from CS3, nobody could save data anymore if it is open from web browser. So in order to save the data and send forms back to my department, the end users have to Save Target as to download to their desktop then fill it in then send it to us.
    The only solution I can think of is to zip all pdfs and that forces the end users to download to the desktop for them to fill in.
    Was this changed since CS5 or updates to Adobe Reader plug-ins? Also I've come across LiveCycle extension, and I am not clear on that. I would have to install this extension on our webs erver to let the end users to save?
    Thanks
    Mac OS 10.6.7, 2x2.8 ghz quad core intel, 10 GB ram, CS5, Acrobat Pro 9 and Acrobat Professional 8

    You can assign setting from you user id to other planner user ID by tcode :
    /SAPAPO/SDPUSET - User Settings for Interactive Planning
    I am not sure wheather it is applicable for graphical setting also.
    If it is not applicable than i don't think it is available with std SAP functionality .
    Manish
    Edited by: Manish Kumar Rathi on Oct 5, 2008 9:16 PM

  • Acrobat 9 pro. Letting people save data typed in Reader

    I am evaluated Acrobat 9 pro for purchase. One of the key features I am looking for is create a form and letting people save data typed in in Aobe Reader.
    I looked and tried all the different security features and can't seem to be able to do it.

    The whole concept of forms with Acrobat is that you have the ability to save, as does anyone else with Acrobat. Those with Reader have the ability to fill out the form, print it, and submit data, but the saving is an additional feature that Adobe charges for. Starting with AA8 (I think that was the first), Adobe started allowing up to 500 copies to be saved with User Rights, an option in Acrobat. However, if you exceed the 500, then the idea is that you need to be paying for that additional feature. I am not arguing for or against this model, but this is the current deal.
    With AA9, I think that some of the options might have changes and the license restrictions might be different. The information should be in either the HELP file or the EULA.

  • How to save the session states for a tabular form WITHOUT using check boxs?

    Greeting guys,
    As you know that we can use collections to save the session states of a tabular forms, described in the how-to doc of manual tabular forms. However, what I am trying to do ( or have to do) is to provide a manual tabular form, and save the session states for validation, without using the check boxes. Because a user can put contents into some columns in a row without checking the corresponding checkbox, according to the requirements. So basically what I tried is to loop over all the rows and save Every entry into a collection. However, sometimes I got "no data found" error with unknown reasons.
    My current solution is to use the "dirty" Retry button that gets back the history, which IMO is not a good workabout. So, I'd appreciate if somebody can shed some light on a better solution, especially if it is close to the one in that how-to doc.
    Thanks in advance.
    Luc

    The following is the first collection solutin I've tried:
    htmldb_collection.create_or_truncate_collection('TEMP_TABLE');
    for i in 1..p_row_num loop -- Loop on the whole form rows
    if (htmldb_application.g_f01(i) is not null) or (htmldb_application.g_f05(i) <> 0)
    --If either of them has some input values, the row should be saved into the colleciton.
    then
    htmldb_collection.add_member(
    p_collection_name => 'TEMP_TABLE',
    p_c001 => htmldb_application.g_f01(i),
    p_c002 => htmldb_application.g_f03(i),
    p_c003 => htmldb_application.g_f04(i),
    p_c004 => htmldb_application.g_f05(i),
    p_c005 => htmldb_application.g_f06(i),
    p_c006 => htmldb_application.g_f08(i)
    end if;
    end loop;
    Some of columns have null values, but I don't think that's the reason. Because once I clicked all the check boxes, there would be no error no matter what values were in other columns.
    Another issue would be extract the values FROM the collection, which has been tried because I had problem to store the data into the collection. I used "decode" functions inside the SQL to build the tabular form. I am not sure whether it will be the same as a regular SQL for a tabular form, like the example in the How-to doc.
    Also I didn't use the checksum, for it is not an issue at the current stage. I am not sure whether that's the reason which caused the NO DATA FOUND error.

  • Change the background color for HToggleButton as State changed

    Hi , I want to change the background color of HToggleButton or HGraphicButton as its state changed as normal to focus and then focus to normal and same with actioned state .It is possible to change the image with different states but how can I do the same thing to change background color .I'll appreciate any help regarding this with thanks in adv.

    Satya,
    i_x denotes first column and not characctersitic 1.
    Also I am not sure if the check is to be for IS_SUM.
    Use Get_Cell_info class instance and then use the data returned by the same for checking IS_SUM and then change the cellstyle.
    Another thing to look out for is , the required change might be needed on DATA_CELL and notcharacteristic_cell.
    Arun
    Assigning points is a way of saying thank you on SDN

  • Problem with Save data with report

    Post Author: ramprosoft
    CA Forum: General
    Hi,
    I am new to CR and using Crystal Reports XI with SQL Server 2000.
    I'm not able to remove the saved data in a report. I have played around different options, but unfortunately I'm not able to remove the data. I have checked variouse places in web above this issue not able to find a solution, so decided to open a new post. The problem is :
    I have created a simple report and saved with-out data (1st version) the file size was 16KB. After few changes I have saved the same report with Data, the file size become 1065 KB. Its perfect and I can view the report in Report Viewer. Great Stuff!. Now the Testing completed, I would like to move this report to production environment, I notice that I'm unable to remove the data. I have played around various tricks like below, but it didnt work well.
    Trick 1:
    Uncheck: File->Options->Reporting (tab)->Save Data With Report.
    Check: File -> Options -> Reporting (tab)->Discard Saved data on Open,
    Uncheck: file-> Report Options -> Save Data With Report.
    File -> Save Data with Report (Not selected)
    Opened the report and try "save" and also tried "save as", still the size is 1065.
    Trick 2:
    I enabled all "Save Data with report" feature. Deleted all the rows in the table related to the query, previewed the report and Saved the report with "Save Data with report" featuer. But now, the funny part happen, the file size increased to 1070kb, instead of reducing. Worst Stuff!!!
    Trick 3:
    Updated the latest version of Patch and tried above tricks, still i'm not able to remove the data.
    Appreciate, if you could help me to fix the problem.
    thanks in advance

    Post Author: salmanq
    CA Forum: General
    Hi, This
    post is very informative, however I would like some specific information. If
    someone can help me then please send me a private message. Best Regards,
    Wholesale Pages UK Dropshippers
    | Wholesale Suppliers
    Australia Wholesalers and
    Dropshippers | Dubai Property and Real Estate

  • Any way to save data in loop without using shift register or feedback loop

    Hello all
    I was thinking, is it possible to save data in a loop to next iteration without the use of a shift register or a feedback loop?
    I need the possibility to reload data within a loop from a lvm file, but I want to use the same data until i load some new ones.
    The reason why I don't want to use the shift register or feedback node is due to speed, even though I am not sure if the shift register
    actually moves all the data from one register to another, or if it is stationary until a change in the data occur.
    The data I want to reuse is medium-large (6 force measurements, 2 pressure, 1 flow channels)of about 10sec data in each file with samplingsrate of 2kHz..
    In my analysis program I have many CPU demanding calculations and 3D graphs, so I just want to minimize the CPU load as much as I can for each part of the
    software..
    I have attached a small VI to explain what I am talking about.
    I now I shouldn't use the express VI, and I am going to change that as well - this is just a proof of concept! 
    Hope you guys can help me understand this shift register better...
    Thanks!
    - Tommy 
    Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
    Solved!
    Go to Solution.
    Attachments:
    visual.vi ‏34 KB

    tombech wrote:
    [...]The reason why I don't want to use the shift register or feedback node is due to speed[...]
     Tommy,
    shift register are the fastest you can ever get...........
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for

  • Change from one account to another

    I've searched and read several posts on accounts but I want to make sure I go about things the right way. I have two accounts (bad idea I know, but it was accidental). One, we'll say is [email protected] The other is [email protected] Both are active

  • Conditional User Defined Variable in TOC in RH10

    Hi I have a single project created with conditional build tags for a product in multiple countries. The company name has been the same in all three countries, but now the company name in one country is about to change. I have created UDVs with condit

  • List of tcode in BW/BI

    Hi please let me know list of tcodes in bw/bi

  • Help with QT 360 Mov files.. (active X)

    I make 360 tours for realestate sites and now im getting this message that says "click to run an Acitive X control on this webpage" This pop up message is new. Is it a new security download from Microsoft? Please help on getting rid of this pop up me

  • *** URGENT *** Hierarchical Tree *** URGENT ***

    Hi, following situation: I have a tree item (ht) in a block TB_FRM_NAME within a help form. This tree is filled with the Module Names within the entire application. I fill this in the WNFI: Fpr_Fill_Tree_Item ( 'TB_FRM_NAME.HT' -- pi_tree_item_name ,