Execute subroutine only when selection parameter changes

Hi ABAP workers,
I have a block of selection parameters, and I created the event AT SELECTION SCREEN ON BLOCK bl1 with a subroutine. I want that subroutine to be executed only when a parameter in the selection block is changed by the user. But the behaviour right now is that it executes every time I press Enter, even if no parameter changes.
Is there any way to chieve this (like in the module pool case, with the extension "ON REQUEST")?
Thank you very much
Ivson
Code involved:
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE csks-bukrs MEMORY ID buk OBLIGATORY,
                         p_ryear LIKE glpct-ryear OBLIGATORY.
SELECT-OPTIONS: s_poper  FOR glpct-rpmax,
                              s_racct  FOR glpct-racct,
                              s_kunnr  FOR glpca-kunnr,
                              s_lifnr  FOR glpca-lifnr,
                s_sprctr FOR glpct-sprctr.
SELECTION-SCREEN END OF BLOCK bl1.
AT SELECTION-SCREEN ON BLOCK bl1.
  PERFORM preselect.

Hi,
You could try this.
Use the FM "DYNP_VALUES_READ" to get the contents of that screen parameter and then check for the parameter value inside the subroutine using a IF statement.
PNAME is a paramter name here.
a  dynpfields-fieldname  = 'PNAME'.
  append dynpfields.
  repid = sy-repid.
  call function 'DYNP_VALUES_READ'
       exporting
            dyname     = repid
            dynumb     = sy-dynnr
       tables
            dynpfields = dynpfields
       exceptions
            others.
  read table dynpfields index 1.
  pname = dynpfields-fieldvalue.
Process the subroutine if needed based on the check condition.
Hope this helps you.
Regards,
Subbu

Similar Messages

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • How can I execute a vi when a switch changes

    I have a switch which controls the input to a VI (it is slightly more complicated than that, but that's the basic idea).
    The VI is a "set" function.  So it really should only execute when the value changes. 
    Is there some way to set the switch so that there is only data available on the output when the switch is switched, thus executing the VI once?
    If not, what is the best way to do this?
    Thank you.
    B.

    BPerlman wrote:
    Thank you.
    An event structure sounds like just what I need.  I am not going to get into the design patterns you mentioned here .... this is a demo program and there is a switch on the front panel that demos a feature in our library, turning it on and off.  I just want to call a library function to turn the feature on or off at user request....the rest of the demo works (right now, I call the VI to turn on/off the feature every time through my main loop -- this is ugly and causes us timing problems... but everything else is finished)
    I tried to add an event structure but don't seem to have it in my edition of LabVIEW....
    What I just added now is a shift register to save the value of the switch between loop iterations, and I compare it to the current value, then feed it into a true/false case structure, only calling my "set" VI when the two values are different...
    Is there a better way, or is that all I can do unless my company buys a fancier LabVIEW version?
    Thanks.
    B.
    Shameless plug for an idea in the idea exchange. Since this would have helped you resolve your issue you might want to consider giving a kudo to this idea.
    The way you are doing it now with the shift register is pretty much the only way you can do this without using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Buttons that play motion track only when selected

    I'd like to create a chapter menu such that as the chapter buttons are selected, a short loop of motion video (or audio+video) track plays somewhere on the screen, When focus moves away from the button, the track either goes away entirely or freezes at its start frame.
    A good example of what I'm talking about would be the chapter menus of any of the Lord Of The Rings Extended Editions.
    Is this possible with DSP?

    The other way to achieve the effect is to use overlay shapes as masks which you make transparent when selected. You composite the motion areas as part of the background and then make an overlay to cover them. Set the overlay shape to be large enough and make it fully opaque when not selected/activated. You can then reveal the video underneath as you move from button to button.
    This will work much faster than moving from menu to menu but there are some issues to consider...
    Firstly, when you click on a button, your player may remove ALL overlay masks momentarily which will reveal all background videos. Similarly, when returning to the menu you may have a slight delay when the menu first appears, so that all video is again visible for a fraction of a second. This effect is not seen on every player, but some are worse for it than others.
    Secondly, there is no way of controlling where abouts you start the video clip as the mask is removed - it will simply loop in the background and each time the mask is removed the clip will show from where it currently is.
    However, if these are not major issues for you, then this technique will give you faster responses to your button selection and activation than moving between menus. If you want to have finer control over things then the multi-menu approach is the only one to consider!

  • Syndicate only when few fields change

    Hi Gurus,
    There are 10 fields in the Main table. And the requirement is such that the auto syndication should happen only when Field 1 or Field 4 value changes (like change pointer triggering).
    I know there is an option while creating a syndication map to "Supress unchanged records" but this work for all the fields.
    I need to trigger the syndication only when Field 1 or Field 4 changes.
    Please help me achieve that.

    hi,
    There is one work around.
    We can achieve this requiremnt  through workflow.
    If feasible for you then try these steps :
    1.create one more field  that contain  information of field1 and field4 .
    2. Create one  validation that check whther the concatenation of field1 and field4 equals to the value of new field
    3.create an assignment that assign these two fields value to new field
    4.create onw workflow that run on record update.
       4.1 this workflow runs on each update of record
        4.2 second step do that validation that we created in step 2
        4.3 if  validation ok then end of workflow
         4.4 otherwise,run the assignemnt that created in step 3 and syndication step that syndicate  the records  whose either field1 and field4 value change.
    just check your feasibility with this approach and revert back if u need any other help.
    Thanks,
    sudhanshu

  • Writing to Multiple Data Files Only When selected?

    I am building a system that is measuring the CO2 content of 12 vessels but only 1 CO2 gas analyzer. So, my system has a series of valves that only lets one valve open at time so that only one vessel is being measured at a time.  What I would like to is have a measurement file for each vessel so I don't have to worry about determining which data came from each vessel. Also, I only want to write measurements to each file whenever its corresponding valve is turned on. The third thing I would like to do is to be able to read the data file and plot the trend data as the test is running.  These test will run for 14 days.  So what would you recommend to do this? Would you recommend using a Write to Measurement File Express VI, Write to Spreadsheet, Write to Text File, Write to XML? 
    Requirment Summary
    1) File for each vessel
    2) Only write data to file when corresponding valve is selected
    3) Ability to read the data files and plot the trend data over time for the 14-day test.
    I am using a Consumer/Producer design with two consumer loops one for processing and writing the data and the other to control a pump for a waterbath that was made inhouse.
    Thanks!
    Attachments:
    Producer-Consumer From Scratch2.vi ‏153 KB

    This is such an open ended question...but I will give some advice.
    If you plan on reading and writing to a file, dont use the write to measurement, you want to use the open/create/replace and close file functions.  The particular file you write to can be either of those listed, but the text file will require all numeric values to be changed to strings, which is just more overhead to take care of.  If I could recommend a type, it would be datalog files.  They are great to organize your data.  I don't see any reason to use XML.  Do you want to be able to open and review this data later? Do Post-Analysis in Excel? Maybe write to spreadsheet is what you are looking for then.
    Also, how fast are you gathering data?  At high speed, maybe you want to use binary files.  Downside is that you wouldn't be able to easily open the file for viewing outside of LabVIEW.  For a 14 day test, make sure you have enough resources for your sampling rate, as any ASCII files, such as .txt, can grow large very fast depending on how you sample and how many digits you store.
    For example, if we only store a 5 digit sample from one channel at 10 hz for 14 days:
    5bytes/sample*10Samples/s*60s/min*60min/hour*24hour/day*14days =  60,480,000 bytes, or 60MB.
    Are you wanting to show all of this data on a chart at once, and update live? This will use a lot of resources(RAM), but should be doable.  I would obviously have to know more about your engineering requirements to make any more suggestions, just wanted to give you a feel for the ups and downs of some of your options.  If you have the LabVIEW DSC module, then Citadel would be great for logging this data for you.
    Rob K
    Measurements Mechanical Engineer (C-Series, USB X-Series)
    National Instruments
    CompactRIO Developers Guide
    CompactRIO Out of the Box Video

  • SubVI not executable error only when opening another VI in same instance of LabView

    I have a VI (ill refer to as "A")that I have written for some of my components of my system, one of them being a loop that polls a pump controller to pick up the data (pressure, volume, etc.) coming from the pump.  Now I have been able to get a VI (Ill refer to as "B")from that manufacturer that allows me to not only get the data, but write a command to my pump controller to control my pumps from labview.  So, my goal was to just open both VI's (A and B), "copy and paste" (from B to A)so to speak, so that I could have controls incorporated into my existing VI (A) that has the controls for the rest of my components.  However, when i open both VIs in the same instance of labview, i always get errors from the second VI that i open.  Keep in mind that when running just one VI in an instance of labview, it gives me no errors.  The furthest ive gotten was to open my "B" VI first, then open my "A" VI, in which the "A" VI only gives me "not an executable error"  After investigating the source of the error, it says that it's coming from the loop inside my "A" VI of which polls my pump controller to get the data.  So basically what im thinking is that the programming thinks that one VI is coming up with the data, and one is controlling it, so it gets confused as to whats actually going on. 
    Any help or suggestions would be greatly appreciated.  I can attach some of the VIs if need, figured Id try to get some ideas first as to maybe what is going on...
    Thanks in advance!
    Matt

    What errors?  Do they have an error number?  Do they have a description?
    Since you said communication, I'm going to assume that it is serial communication and is using VISA drivers.
    It is very likely the two VI's are stepping on each other's communication while they are trying to communicate with the pump.
    Why don't you post the two VI's so we can see what you are doing?

  • How to execute query only when user submits request in af:query

    Hi,
    I'm using an <af:query> based on a named view criteria. The view criteria contains a bind variable. When the web page is initially rendered the query is executed and the result is displayed in an <af:table>.
    Instead, I want the user to trigger the query by pressing the Search button in the <af:query> form.
    Is there a way to configure such a behavior without coding?
    Sorry, if this is a faq, but I didn't find a suitable answer for my problem.
    Any hints are welcome,
    Markus

    Hi Frank,
    it is not that easy, I'm afraid. In 10g apps, I used a combination of two iterators. One Find-iteratior and one iterator for the resultset. The resultset iterator had the refresh condition set to ${adfContext.postback}. But with 11g, it does not work. The result is rendered when the page comes up.
    What has changed from 10g to 11g? I have discovered the fact, the table does a second (asynch) request to get the resultset from the server when attribute contentDelivery="lazy". Changing the attribute to contentDelivery="immediate" the page comes up with an empty table and the user can enter the query criteria. The solution works fine as long as you stay on the search page. If you navigate to an 'Edit result' page and then back to the search page, the table is empty again (thanks to the postback condition). To solve the problem you have to work with a second flag in the refresh condition which indicates that the user has triggered a query. This is the background for my last posting (' Can I set an <af:setActionListener> on the search button of a <af:query>?', Re: Can I set an <af:setActionListener> on the search button of a <af:query
    Any other recommendations?
    Thanks,
    Markus

  • Syndication only when records are updated, but ONLY for selected fields

    again with one of my : it's that even possible at all ?
    the case, we have a customer repository where, among other things we add some extra info (classification ABC and similar mainly) to a small percentage of them (around 5 - 10 %)
    and we would like to distribute only those changes, changes in few fields
    of course we load plenty of fields from R3 and other systems, and also we modify records to assign the customers to different business organization that have to look after, this assignments change also very often (it can affect to 30 to 40 % of the customers). All this data does not need to be distributed.
    so in figures (as example to easier understand), weekly base :
    _ 250.000 _ aprox records in MDM
    _ __ 1.000 _ new records every week from source systems
    _ __ 8.000 _ updated records every week from source systems
    _ ______________(yes, big number, some marketing attributes and soft stuff they like to see in MDM)
    _ ____ 100 _ aprox are "enhanced" with data we need to distribute
    _ __ 50.000 _ aprox records are re-assigned or reclassify with data we do NOT need to distribute
    _ ______________(mostly done with assignments and so on that keep changing every week)
    so, even selecting "suppress unchanged records", MDM keeps distributing like 60.000 records, when we only need those 100.
    is any direct way to make this ??
    as a work-around, I have think into a workflow that in a way flags a new field (to_be_distributed) always and only when a user change one of this specific fields. And then filter the distribution for only this field = True. And another workflow that set the mention field to False, just after the distribution is done.
    Crazy idea ??, anything better ??
    (we are in MDM 5.5, if the solution require 7.0, migration plans are in the horizon)
    thanks in advance, everybody

    Hi,
           We had the same scenario where in we have to Syndicate only certain Fields to Legacy...As per your scenario add classification data to your Existing Customer repository. Next steps is to create a map for the classifications data...You write your own conditions in FreeForm search of MDM Syndication. Whenever certain conditions are satisfied, MDM system will syndicate. 
    Next - Option - If you are implementing work flow then create a extra field called Syndicate_Legacy. Syndicate_Legacy should be Flat LookUps .Values should be Syndicate,No Syndicate.  Before end of the WF, you should have  a assignment step. By using assignment change the value to Syndicate or Not syndicate. For this , along with map you should also write a condition in Free form search in syndicator stating that only if Field(Syndicate_Legacy) = Value(Syndicate). I believe these should solve your issue...If not please let me know...
    Thanks
    Ganesh Kotti

  • Radio buttons and Checkboxes to change appearance when selected

    Hi guys!
    Help needed.
    I want my check boxes and radio buttons when selected to change color from black to "0,64,128", size from 12 to 14 and to become bold.
    Also the default appearance for checkboxes is cross, but I need it to be a check mark.
    I would be so much thankful if you could give me some advice.
    THANK YOU!
    Maria

    Hi Bibhu,
    Thanks for quick response!
    For check mark -- thanks! How could I not see that option!
    For radio button -- it's not working.
    I found this helpful tips on changing appearance of the radio buttons and check boxes. http://www.assuredynamics.com/wp-content/uploads/2010/11/Assure-Dynamics-Checkboxes-and-Ra dio-Buttons-Rev-1.pdf
    I used the first script, but I got an error message. I can't understand what I am doing wrong. It says: "Syntax error near token "{" on line 2, column 1.
    I am confused.
    Help appreciated.

  • Error when selecting a user

    Hi everyone:
    We have implemented SAP NetWeaver 7.0, and we defined "ABAP System" as Data Source.
    We've come across a strange error while selecting some particular users (clicking on user) in Netweaver under User Management -> Identity Management > Selecting a User (clicking on user)
    "java.lang.NoSuchMethodError: com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator.isSecureURL(Ljava/lang/String;)Z"
    So far, this error has happened only when selecting a user that has the E-Mail field defined in the ABAP side. If we delete the E-Mail address from de ABAP account and then select the user in the Java Identity Management, the error disappears and the user account is perfectly shown.
    Any suggestions guys??
    Regards,
    Pablo Vaquero

    Hi Ravi,
    Thank for your reply.
    That indeed is the issue!... Since we have defined "ABAP System" as the Data Source, the E-Mail field can only be mantained on the ABAP side. But, as I've said on my previous post, when we fill this field in the ABAP side for any particular user and then want to see this change in user details on the UME side, when clicking on that particular user we get the error mentioned above.
    Regards,
    Pablo

  • Lightroom trial doesn't show complete menu selections or import button.  Also get error message on launch:  An error occurred when attempting to change modules.  I am unable to find/see the following file to try renaming the SLCache and SLStore files:  Sy

    Lightroom trial doesn't show complete menu selections or import button.  Also get error message on launch:  An error occurred when attempting to change modules.  I am unable to find/see the following file to try renaming the SLCache and SLStore files:  System Library/Application Support/Adobe.  Any ideas?  I only have 16 days left on the trial and have been unable to get it to work on my Macbook Pro.  This is all I am seeing after Lightroom opens.  Thanks!

    Thanks to both of you for attempting to help.  I finally figured out what was wrong . . . it was a Permissions problem.  Very frustrating, but after scouring the troubleshooting tips I finally found the one that solved my problem.  I had to add a User and give it Read/Write privileges to Lightroom.  The file I had to add the User to was Hidden on my Mac, so that added an even bigger challenge to the mystery.  Only a few days left on my trial version!  I hope I have time to try it out!

  • How to trigger a refresh of a dropdown list when the selection is changed

    Hi,
    This is a general ExtendScript question, but since I'm working with FM, I'll ask here first. I have a bit of a paradox here and I'm not sure of the best way to handle it.
    I have a dialog box with a dropdown list, where I want to refresh certain controls when the user changes the selection in the list (dropdownList.onChange). This includes refreshing the contents of the list itself. However, the problem is, as soon as I try to refresh the list contents, it triggers onChange again. So, if I put the call to refresh the box within the onChange handler, it results in an endless loop, because my refresher function triggers onChange when it refreshes the list.
    Does anyone know a better methodology, where I can safely trigger a refresh of a dropdown list within the list's own onChange event handler? I really wish that onChange was reserved for a user action only, or there was at least some property to that effect.
    Russ

    Hi Russ,
    you can stop that with "stopPropagation()"
    You can find this in "Javascript Tools Guide" on page 150.
    I'm not able at the moment to send you an example 'cause I'm in a hospital for a while.
    Happy New Year!

  • How to run TCP/IP Tx in cRIO vi only when value changes?

    My design uses NI's TPC-2006 as the user interface for a cRIO-based product.  I use TCP/IP to exchange data between the TPC-2006 and cRIO.  My code causes the TPC to lock up after a variable number of minutes, typically about 10.  The OS is completely locked and requires a power cycle to recover.
    Based on the theory that the TPC-2006 is not keeping up with the TCP/IP packets sent by cRIO, I want to try configuring cRIO to transmit only when it has something new to say.  The event structure that I use for the TPC-2006 won't work on cRIO.  Can anyone out there suggest another approach?
    Jeff
    Climbing the Labview learning curve!
    Sanarus Medical
    Pleasanton, CA

    Hi Jeff,
    The simplest way to reduce transmission overhead in this scenario would be to encase your existing TCP/IP routine in a case structure that only executes if the data element you're interested in is not equal to its last value (stored in a shift register).  This shouldn't add much in the way of computational overhead on the RT side, but should reduce the flood of data if the value doesn't change very often.  Keep in mind also that if you have LabVIEW 8, you can use Shared Variables to send the data over your tcp/ip connection only when a new value is written to the variable - this may meet your needs just as well.
    Cheers,
    Matt Pollock
    National Instruments

  • When I visit a site the color of the link seldom changes to the color I have selected. also even when it does change, it reverts to the unvisited color in a day or so.

    When I visit a site the color of the link seldom changes to the color I have selected. Also even when it does change, it reverts to the unvisited color in a day or so. The history is set to over 300 days and everything is there as far as I can tell.

    Does this problem affect all sites, or only some? Try going to a Google search results page and click a few links. Then, come back a day later and see if they are still visited.
    It may be that the links that get reset are coming from a frameset. Firefox only remembers history from framesets temporarily, which affects sites that use them. (An example would be the craigslist forums)

Maybe you are looking for

  • SNAP table

    Hi All, We are facing large number no of dumps in our ECC6.0. So I want to know some information for SNAP table which stores dump data. 1 )  How to check how many entries can be store in SNAP table or what is the size of this table to proactive take

  • Retrieving triggers messages

    Hi! I came across this problem the other day. I have created triggers in my SQL. The triggers are stating appropriate message for any worng data entry. But I cannot catch this message from front end either by servlet or swing. Can any of you please h

  • My microphone no longer works although my audio still works.

    Could someone please help me resolve this problem?  Thanks.

  • [SOLVED]Cannot compile Wine on Arch64

    I am trying to compile the 32 bit version of Wine on Arch 64. I know I could use PKGBUILDS and all that but I want to compile it from scratch. I am not very experienced (at all) so please  post in retard language for me. bash-3.2# ./configure checkin

  • HT201210 Why iphone 3g has no support for ios 5 + ..please allow us to download..

    Why iphone 3g has no support for ios 5 + ..please allow us to download.. Please do anyhow. .anything ...you are the creater of apple.. I know you can do it. .please do anything that iphone 3g will support ios 5 ro greater than that..