Update TVARV variables...

Hello all,
I would greatly appreciate it if someone could send me a sample program to update table TVARV with a variable for 'From' and 'To' date and time. I have already declared 4 parameters in TVARV. 
i.e. User will enter 'From' and 'To' dates and time in parameters and TVARV table will be updated, and when report is run next time, the 'To' date/time will become 'From' date/time. In other words, it will take the latest value of the variables.
Regards,
Eddie.

We actually use a BDC do update the table using SM31.  I have it encapsulated in a subroutine(form) .
Send the variable name, the variable type(P or S) and the low and high.  The BDC code will take care of the rest.  It will handle Parameters and Select-options.
*      Form REUSE_BDC_SESSION
form reuse_bdc_session using var_name
                             var_type
                             variable
                             variable_low
                             variable_high.
  perform bdc_dynpro      using 'SAPMSVMA' '0100'.
  perform bdc_field       using 'BDC_CURSOR'
                                'VIEWNAME'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=UPD'.
  perform bdc_field       using 'VIEWNAME'
                            'TVARV'.
  perform bdc_field       using 'VIMDYNFLDS-LTD_DTA_NO'
                                'X'.
  perform bdc_dynpro      using 'SAPMS38V' '1100'.
  perform bdc_field       using 'BDC_CURSOR'
                                '%#AUTOTEXT001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=TOGGLE'.
  perform bdc_dynpro      using 'SAPMS38V' '1100'.
  perform bdc_field       using 'BDC_CURSOR'
                                '%#AUTOTEXT001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=SINGLE'.
  perform bdc_dynpro      using 'SAPMS38V' '1001'.
  perform bdc_field       using 'BDC_CURSOR'
                                'TVARV-NAME'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=CHNG'.
  perform bdc_field       using 'TVARV-NAME'
                            var_name.
  if var_type = 'P'.
    perform bdc_field       using 'RB_TYPE_P'
                                  'X '.
    perform bdc_field       using 'RB_TYPE_S'
    perform bdc_dynpro      using 'SAPMS38V' '0600'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'PAR_VAL'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=USAV'.
    perform bdc_field       using 'PAR_VAL'
                                variable.
  endif.
  if var_type = 'S'.
    perform bdc_field       using 'RB_TYPE_P'
    perform bdc_field       using 'RB_TYPE_S'
                                  'X'.
    perform bdc_dynpro      using 'SAPMS38V' '0600'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SEL_VAL-LOW'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%015'.
    perform bdc_dynpro      using 'SAPLALDB' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=INTL'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSCSEL-SLOW_I(01)'.
    perform bdc_dynpro      using 'SAPLALDB' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ACPT'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RSCSEL-IHIGH_I(01)'.
    perform bdc_field       using 'RSCSEL-ILOW_I(01)'
                              variable_low.
    perform bdc_field       using 'RSCSEL-IHIGH_I(01)'
                             variable_high.
    perform bdc_dynpro      using 'SAPMS38V' '0600'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SEL_VAL-LOW'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=USAV'.
  endif.
  perform bdc_dynpro      using 'SAPMS38V' '1001'.
  perform bdc_field       using 'BDC_CURSOR'
                                'TVARV-NAME'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=RETN'.
  perform bdc_dynpro      using 'SAPMS38V' '1100'.
  perform bdc_field       using 'BDC_CURSOR'
                                '%#AUTOTEXT001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=SAVE'.
  perform bdc_dynpro      using 'SAPMS38V' '1100'.
  perform bdc_field       using 'BDC_CURSOR'
                                '%#AUTOTEXT001'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=RETN'.
  perform bdc_dynpro      using 'SAPMSVMA' '0100'.
  perform bdc_field       using 'BDC_OKCODE'
                                '/EBACK'.
  perform bdc_field       using 'BDC_CURSOR'
                                'VIEWNAME'.
  call transaction 'SM31' using  bdcdata
                          mode   mode
                          update 'S'.
  if sy-subrc = 0.
    write:/ i_tvarv-name, at 40 'Variable updated successfully'.
    case var_type.
      when 'P'.
        write:80 variable.
      when 'S'.
        write:80 variable_low, at 100 variable_high.
    endcase.
  else.
    write:/ i_tvarv-name, at 40 'Error occured during update process'.
  endif.
  commit work and wait.
  clear bdcdata. refresh bdcdata.
endform.
Regards,
Rich Heilman
Message was edited by: Rich Heilman

Similar Messages

  • Profit Center Hierarchy is not updating in Variable

    HI Guru's,
    Profit Center Hierarchy is not updating in Variable .
    We have 3 new profit center added of which i have updated the master data ie, attr, txt, and hierarchy and Txn data. Where after updating i can find the thing updated but when i execute the report in the variable i dont find the updated profit center.
    Please guide
    Prasad

    But just to update you that we don't have data for the new profit centerin R3. Is it because of this i don't find the new profit centers in
    Variable screen ( though i can see in Query Designer)
    Please guide

  • Hyperion Reports 2.6 updating substituion variables in a prompt

    I'm running into a problem where I update a substitution variable on my Essbase server and then go to pull a report in Hyperion Reports v2.6.The report is set up to prompt the user to choose a member from the Time dimension, I have the default set to use the substitution variable 'cur_week'.The problem is when I update the variable on Essbase and pull the report, the report defaults to the old variable value. The only way I can get it to display the new value is to restart the Report Server.Has anyone experienced this? Do you know of a way to work around this?Thanks in advance

    Decided to go with a batch script to restart the service on Report Server. Combined with a MaxL script to update the subvariables. Run both back to back and it seems to work.Not the ideal solution, but as long as I don't kick off while a report is running, it seems like it will work.

  • Timeline. How does (or does not) update global variables?

    Hello All,
    I am having problems to understand how a timeline updates values. In my case the timeline is supposed to change an index within a second always by incrementing it by one or decrementing by one. Basically I am trying to create a mosaic of images that when I press left key all the columns move to left and when I press right key all the columns move to right.
    To do this I have a deltaX constant that defines the translation.
    Then I have a global tracker initialized to 0 and then udated +1 if move to right, -1 if move to left.
    The Timeline is:
    public var tracker: Number = 0;
    var thumbnails: ImageView[] = bind for (column in [0..appModel.CATALOG_COLUMNS + 1]) {
                    for (row in [1..appModel.CATALOG_ROWS]) {
                        def imageView: ImageView =  ImageView {
                                    image: bind catalogData.dataAt(row, column)
                                    x:  bind (column - 1)*catalogData.maxThumbnailWidth + column*xSpacing
                                    y:  bind ySpacing + (row - 1) * (catalogData.maxThumbnailHeight + ySpacing)
                                    translateX: bind tracker*deltaX
                                    transforms:  bind [
                                        Rotate {
                                            angle: bind direction * rotation
                                            pivotX: bind imageView.x + imageView.boundsInLocal.width / 2
                                            pivotY: bind imageView.y + imageView.boundsInLocal.height / 2
        override public function create(): Node {
            return Group {
                        content: bind thumbnails
    public function rotateAndTranslateToRight(): Void {
            direction = 1;
            translateAndRotateTimeline.stop();
            translateAndRotateTimeline.play();
        public function rotateAndTranslateToLeft(): Void {
            direction = -1;
            translateAndRotateTimeline.stop();
            translateAndRotateTimeline.play();
        var translateAndRotateTimeline = Timeline {
            def initialValueTracker = tracker;
                    keyFrames: [
                        KeyFrame {
                            time: 0s
                            values: [
                                 rotation => 0,
                                 tracker => initialValueTracker
                        KeyFrame {
                            time: 1s
                            values: [
                                rotation => 360 tween Interpolator.LINEAR,
                                tracker => initialValueTracker + direction tween Interpolator.LINEAR
                }The problem is that if I first move to right the Timeline works correctly and tracker goes from 0 to 1 in one second, therefore I see a translation to right of tracker*deltaX pixels. So far so good.
    Then if I move to left, I am expecting the Timeline to change tracker from 1 to 0 in one second, but really it is changing tracker from 0 to -1... which of course messes up my translation to left.
    I thought Timeline updates global variables (define outside the Timeline in the context of the class the Timeline is defined) during the transition, but apparently from my observation it doesn't.
    Or maybe I am not defining correctly the Timeline itself and/or the tracker variables?
    Thanks.
    Edited by: sacchett88 on Jun 4, 2010 1:03 PM

    Thanks for the reply... but it didn't help me that much in finding the workaround. I wrote a simpler example to prove the point that can be easily copied and pasted and run. The example draw a circle and for every right key it should move the circle to right of a deltaX number of pixel. If left key is pressed then the circle should move to left of a deltaX number of pixels. The code is:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.shape.Circle;
    import javafx.scene.paint.Color;
    import javafx.scene.input.KeyEvent;
    import javafx.scene.input.KeyCode;
    import javafx.animation.Timeline;
    import javafx.animation.KeyFrame;
    import javafx.animation.Interpolator;
    var deltaX: Number = 70;
    var direction: Number = 1;
    var tracker: Number = 0;
    var circle: Circle;
    var translate = Timeline {
        def initialValueTracker = tracker;
                keyFrames: [
                    KeyFrame {
                        time: 0s
                        values: [
                            tracker => initialValueTracker
                    KeyFrame {
                        time: 1s
                        values: [
                            tracker => initialValueTracker + direction tween Interpolator.LINEAR
    Stage {
        title: "Application title"
        scene: Scene {
            width: 900
            height:500
            content: [
                circle = Circle {
                    centerX: 100,
                    centerY: 100,
                    translateX: bind tracker*deltaX
                    radius: 40
                    fill: Color.BLACK
                    onKeyPressed: function (e: KeyEvent): Void {
                        if (e.code == KeyCode.VK_RIGHT) {
                            direction = 1;
                            translate.stop();
                            translate.play();
                        } else if (e.code == KeyCode.VK_LEFT) {
                            direction = -1;
                            translate.stop();
                            translate.play();
    circle.requestFocus();I understand how KeyFrame works. However the final value I'd like to be the initial value for next key press. I also tried to assign explicitely the final value to the tracker variable at the end of the timeline, but next time timeline still picks up the initial value 0 of tracker.
    Thanks.

  • Update Instance Variables using PAPI

    I have a need to update Instance Variables for a bunch of instances. Can this be done using PAPI? I am writing a global function that can search the instances and update. How can I update these variables...thank you

    Hi,
    I think that the best way of changing instance variables using papi is by adding a global activity (with instance access) and pass the new variable values as arguments. Pay attention that you have to define those arguments in the activity.
    Then, you can assign those values to the instance using PBL.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/papi_javadocs/fuego/papi/ProcessServiceSession.html#activityExecute(fuego.papi.Activity,%20fuego.papi.InstanceInfo,%20fuego.papi.Arguments)
    I do suggest avoiding sending interruptions to instances, because once the notification is sent (and the papi method returns successfully), the notifications will be processed in another transaction.
    Hope this helps,
    Ariel A.

  • 11g Updating instance variable

    How do update instance variable at runtime. e.g say my workflow instance wating at 'InProcess' HumanTask with instance variable wrkStatus='IP'..now with out executing the HT how can we update the 'wrkStatus' variable to 'IR'....?
    NOTE : in 10g we can do that using global interactive with instance access....but i have no idea abt 11g :(
    Rgds,
    Biltu

    Thanks for your reply Mariano.
    But that will be before the Token reaches to my Human task....we can do that..using association.....
    But my doubt is different..lets assume i have moved to my human task ..now I need to update my instace data.
    e,g I enter to HumanTask1 with a req msg
    <UserReq>
    <Name>nam1</name>
    <address>addr1</address>
    </UserReq>
    now I want to update address by 'addr2'.

  • Change TVARV variable...

    Hi,
    I have a variable maintained in TVARV whose value needs to be changed every month. In production, I cannot give access to SM30/SM31 to a user as he might then have access to change values in all other tables too.
    What can I do ?
    Should I write an ABAP program to get the new value as input and update the TVARV table for this variable  and provide access to this program to an user ? Is this the only way ?
    Pl suggest.
    thnks

    Hi,
    Use transaction  STVARV OR STVARVC  for maintaining values in TVARVC table This should solve your purpose.
    This is the standard way of doing it.
    Hope this helps.
    Thanks
    Edited by: Sumit Naik on Feb 24, 2011 7:01 PM

  • Update TVARV table entries using a Function Module or Program

    Hi Gurus,
    My requirement is that I have a entry in TVARV table which has a 'low'. We would like to change this value whenever we desire. We are unable to do it via sm30 and se16 as table maintenance access is not permitted in Production environment.
    Can you please provide any Function module or program code to do it?
    Requirement - User can enter a value into TVARV table by executing a function module or program
    Thank you all, will award points,
    Priyansh

    Hi Priyansh,
    Please refer to SAP Help for more information on variant maintenance and more specifically variable values in variants. You can use t/code STVARV for maintaining the variant variables in table TVARVC (Client-Specific Variant Variables).
    Note: I suggest to use the TVARVC table instead of TVARV.
    If you are looking for Function Modules in the area of Variant Maintenance, then please have a look at Function Group SVAR (t/code SE80).
    If you are looking for Function Modules in the area of User Variables in Variants, then please have a look at Function Group SVUV (t/code SE80).
    Furthermore, if you are looking for a program to update table TVARVC, please have a look at ABAP: Dynamic Variant Processing with STVARV.
    Best eregards,
    Sander

  • How to update bind variable and restrict values in a Model Driven LOV?

    Hi Guys,
    Using JDev 11.1.1.2.0
    I've recreated an excellent Frank Nimphius article about restricting values derived from a model driven LOV (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf)
    But my bind variable isn't updating. Deleting the bind variable gets me the entire LOV. Activate the code below and insert a bind variable into the where clause like Frank says and I get nothing back. Bind variable is blank. Any ideas? Code wasn't supplied with the article. It seems simple enough but the bind variable isn't updating in the SQL, even though the updated value shows up here...
      public void onLovLaunch(LaunchPopupEvent launchPopupEvent)
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DepartmentId");
        lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("deptId","60");
        System.out.println("lov name: " + lov.getName().toString());
        System.out.println("lov Param Attrs: " + lov.getListIterBinding().getViewObject().getNamedWhereClauseParams().getAttribute("deptId").toString());
        System.out.println("lov View Object: " + lov.getListIterBinding().getViewObject().getName().toString());
        System.out.println("lov IterBinding: " + lov.getListIterBinding().getName().toString());
       }Gets me ...
    lov name: DepartmentId
    lov Param Attrs: 60
    lov View Object: _LOCAL_VIEW_USAGE_lov_model_queries_EmployeesView_DepartmentsView
    lov IterBinding: DepartmentIdList_2

    That's a good idea, but it's still not working. Here is how I implemented it. It might be different from your suggestion as I'm still pretty new to this.
    I have a recursive tree table. You select a node. You then click a button which calls the listener below. "findParents" is a method call to the AppModuleImpl class and it finds all parent nodes of your selection. "restrictPartBomLOV", also of the AppModuleImpl class, then modifies the model driven lists' View Object (partBomLOV) to exclude those parent node values.
    The resulting model driven LOV on the popup should be updated, yeah? But it still isn't udpating. If I manually type in the updated Where clause in PartBomLOV.xml query tab, it works, but it doesn't programmatically.
      public void insertPopupFetchListener(PopupFetchEvent popupFetchEvent)
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("findParents");
        parents = (List)operationBinding.execute();
        operationBinding = bindings.getOperationBinding("restrictPartBomLOV");
        operationBinding.execute();
       public void restrictPartBomLOV(List parents)
          ViewObjectImpl vo = getPartBomLOV();
          String wcl = "";
          Object[]   p = parents.toArray();
          for(int i = 0; i < p.length; i++)
             if (i == 0)
                wcl = wcl + "PNUM <> '" + p.toString() + "'";
    else
    wcl = wcl + "AND PNUM <> '" + p[i].toString() + "'";
    vo.setWhereClause(wcl);
    System.out.println(vo.getWhereClause().toString());
    vo.executeQuery();
    Edited by: LovettWB on Nov 11, 2010 11:23 PM

  • How to update the variables in sub-vi on main front panel?

    hi~
    The problem is to display variables in Sub vi on main front panel.
    What should I do?메시지가 04-07-2005 03:14 AM에 julitan에 의해 편집되었음
    Attachments:
    main_.vi ‏14 KB

    You probably want the slide to update while the while loop in the subVI is running, so you can't simply wire an output from the subVI to the main VI. So you are going to have to use some form of communication between the two VI's other than a hard wire. For this simple case I think I would recommend using a global variable. You could also use DataSocket or even write the value to disk, but using a global is probably the easiest method for this case. I've attached your modified VI's. Let me know if this works for you.
    Robert Mortensen
    Software Engineer
    National Instruments
    Attachments:
    global.zip ‏45 KB

  • Update workflow variable in a form associated to manual action

    I have a view called userfind in my workflow,
    I pass this view to a search form, in this form I would like to update
    this view.
    I am passing this view object as variable to the manual form.
    In my form I am trying to update this object as follows
    <Field name='variables.userfind.query'>
    <ref>query</ref>
    </Field>
    User find object is correctly updated when this block of code is executed, but when the control goes out of the form (back to the 'action' that calls this form) I dont see the updated value. The value of userfind.query is same as before (i.e. before it was updated in the form).
    Why isn't the updation visible outside the form?
    Thanks in advance!

    very good question !
    I'm working on something similar and wondering about form field variables in general.
    Generally it looks like form fieldnames correspond with userview attribute and editing the field, edits the view directly so it is ready for CheckIn.
    I'd also like to know if this methodology applies to other views and WorkItem views which may contain general workflow variables. If so, I assume they can be editable by the form if the fieldname is the same as the var name.

  • Updating a variable from a new window

    I have a frame which displays various labels and lists. I want to open a new frame, put in some input, then update the original frame. So far I have done this my making the original variable "static" and modifying it from the new frame but this is a pain. Is there an easier way?

    Can I do that if I am instantiating the second frame
    from the first? How do I pass myself to the new
    frame's constructor?
    // called from inside FirstFrame
    SecondFrame secondFrame = new SecondFrame(this);

  • Updating a variable based on checking expiration date against now() in each row of a table

    I’m using Coldfusion 9,0,0,251028 on Windows 7 64-bit, with a Microsoft Access 97 database.
    I’m trying to create a query which loops through all the rows in a table and checks if the current date is later or earlier than the expiration date. 
    If the expiration date column is earlier than now(), it sets the column “is_current” to 0, which is a variable that controls whether or not a message displays on a different page(breakingnews.cfm). 
    The column that has the expiration date is “exp_dat” in the table “news”. The query I have so far is:
    <cfquery name="expire" datasource="#db#">
    update news
    set is_current = 0
    where exp_dat < now()
    </cfquery>
    What this ends up doing is filtering out the expired items correctly, but once a new row is inserted, the previous items(which haven’t expired yet)
    are still having the “is_current” column set to 0.
    The query is cfincluded on the page the messages are supposed to display on (breakingnews.cfm). 
    How can I get the query to loop over each row every time to check if the now() is earlier or later than “exp_dat” without setting all the other row’s “is_current” to 0?

    Two things:
    1 - A query will never affect rows you haven't told it to. Therefore if new rows have the is_current set to 0, then it's because you're either setting it so in your insert statement or you've set a default value on the column. Just make sure you set the column to 1 when you insert the new row.
    2 - Why are you doing this at all? Say you run your update query (which is relatively intensive) a millisecond before one expires, it'll still be shown on your page. Why are you not just doing "SELECT * FROM mytable WHERE expiration_date > now()"?
    Obviously use cfqueryparams, but that's just an example. It seems at the moment all you're doing is storing out-of-date data in a database and causing yourself a lot more work and overhead.

  • Safari 6.0.5 update == no variable speed feature on html5 video player.

    Today I installed the Safari 6.0.5 update and now I don't have the html5 video player variable speed feature -- this allows one to play videos at speeds from 0.5x to 2.0x.  My previous Safari was 6.0.4 and the html5 video var speed feature worked well.
    The other things SW Update installed with the Safari 6.0.5 were:
    Security Update 2013-002
    Java for OS C 2013-004
    iTunes 11.0.4
    Any ideas?

    Today I installed the Safari 6.0.5 update and now I don't have the html5 video player variable speed feature -- this allows one to play videos at speeds from 0.5x to 2.0x.  My previous Safari was 6.0.4 and the html5 video var speed feature worked well.
    The other things SW Update installed with the Safari 6.0.5 were:
    Security Update 2013-002
    Java for OS C 2013-004
    iTunes 11.0.4
    Any ideas?

  • How to update shared variables

    Hi, I have a VI that opens an text file and reads some information from that page. That information should be copied to shared variables. The problem is that I have 160 shared variables and I don't want to drag them all from project explorer to Block diagram and wire them all. Is there any other way to update that data to shared variables? I can easily open and read data with couple of while loops. I'd really be thankful if someone could help me.
    Mika

    I do need all 160 variables. I have to make a sequencer.With cFP modules and laptop is ment to specify sequences needed for testing some equipment. I have 16 digital inputs and 16 digital outputs and 8 analog inputs. Those shared variables specify which channel is ON and for how long, and the delay of the channel. There is also variable that tells if channel is in use or not. One variable is channel factor, which tells how many cycles there will be in that cycle time. So if one channel needs only 5 variables, those 40 channels need 160-200 variables.  Shared variables are specified in the user interface and then cFP module can easily read them. In user interface there is also the possibility to open a file that have variables specified earlier. In that point I need to open a text file and update the data to shared variables.
    Mika

Maybe you are looking for

  • PE8 Problem -

    "The file archive part of Adobe Premiere Elements 8 Content is missing.  You need all parts in the same folder in order to extract Adobe Premiere Elements 9 Content.  Please download all parts." Any suggestions.  The following 2 files were downloaded

  • Can LR show custom camera profiles

    Can LR represent the user defined picture styles? Canon 7D user def 1 user def 2 user def 3

  • Downward and Upward integration scenarios

    Hi, Can anybody explain some upward and downward scenarios from scratch how to approach. Like i am looking at these Downward ( ERP to SFA systems ) :planned Orders,Bills of Material Upward (from SFA Systems to SAP ERP ) - Upload Inspection results re

  • No audio from line output or headphone output.

    My MacPro suddenly has no audio coming out the line and headphone outputs. Nothing has changed on the configuration, and I've checked the settings in the Sound preferences. I'm hoping there's something easy to fix, but I fear this may require a trip

  • How can I get my slide show to run continuously?

    I believe I have set my slide show to run continuously but it stops after one run. What do I need to do to get it into a continual loop?