Assigning Value to Variable in Sapscript

Hi,
To initialized value of the variable when I tried to assign 0 to variable (like in the following statement) it comes up with error 'Command Expected'.
&RF140-ZALBT&= '0'.
Please let me know where and what I am doing wrong in assigning value to a variable?
Regards,
Shabbar

Hi,
Still its not working. The statement I am writing is
/: &NET& = &RF140-WRSHB& - &RF140-MSATZ&
but the system gives error on that.
NET is the local variable declared with Define statement and both the others are defined in print program.
Even I tried
/: &RF140-ZALBT& = &RF140-WRSHB& - &RF140-MSATZ&
but still the same error.
Any comments?
Regards,
Shabbar

Similar Messages

  • Assigning value to variable in ODI

    Hi
    TotalCount(datatype is numeric)--->Action is (Latest value)
    And i want to assign value it by using following query
    select count(*) from Investment_ato
    i am writing this in a refresh tab
    And i am using this variable in another variable(var_account)
    but value of TotalCount variable is not coming in var_account
    so plz suggest regards the same
    thanks

    You can set the refreshing mode in the variable var_account and in the refreshing tab put the query as: select #TotalCount from dual.
    Hope it helps!

  • Assigning value to variable of type time

    Hi,
    I want to assign value '8:00:00' to a time variable (w_time like sy-uzeit).
    How do i do this? Do i need to do any casting?
    w_time = '8:00:00' didnt work.
    I am trying to use this in a customer exit.
    Thanks,
    Arun KK

    Gotcha!
    Thanks!!

  • Read XML in BPEL and assign values to variables

    Hello,
    I need to read an xml message in BPEL and assign variables created in BPEL the values of elements in XML message. Whats the best possible way to do this.

    When you say"*read an xml message*", is the xml coming as input message or you need to read from file ?
    If you want to read from file, you can make use of the below function.
    Returns the string value of an element defined by lookupXPath in a XML file (docURL) given its parent XPath (parentXPath), the key XPath (keyXPath) and the value of the key (key). Usage: oraext:lookup-xml(docURL as string, parentXPath as string, keyXPath as string, lookupXPath as string, key as string)
    Example: oraext:lookup-xml('file:/d:/country_data.xml', '/Countries/Country', 'Abbreviation', 'FullName', 'UK') returns the value of the element FullName child of /Countries/Country where Abbreviation = 'UK' in the file d:\country_data.xml
    Thanks,
    Vijay

  • Define and assign values to variables in calc manager

    Hi all,
    I have created a smartlist in data form for user to select the start month and end month.In BR,based on the smartlist ID,i need to assign the months to a variable,which i will later use it in the same BR.
    For Eg:In data form,from the smartlists,user has choosen "Jul" for start month and "Nov" for end month,hence the smartlist ID is 7 for start month and 11 for end month.Now in calc manager,i have created 2 variables as "DateFrom" and "DateTo" of type "member" for dimension "Period"
    Note: "Jan" to "Dec" are period dim level 0 members
    IF(start month==1)
    DateFrom="Jan";
    ELSEIF(startmonth==2)
    DateFrom="Feb";
    ELSEIF(start month==7)
    DateFrom="Jul";
    ELSE
    DateFrom="Dec";
    ENDIF;
    Similarly for end month as below:
    IF(end month==1)
    DateTo="Jan";
    ELSEIF(end month==11)
    DateTo="Nov";
    ELSE
    DateTo="Dec";
    ENDIF;
    Above method of assigning a value to a variable is not working and no values assigned to the 2 variables "DateFrom" and "DateTo"
    Kindly help me on any additional steps required to use variables in calc manager.
    Thanks!

    Cant you use the values from RTP directly? What is the logic you are trying to build?
    One of the ways to achieve this is to use Calc TP Index member, if you are not sure of this, create a workforce application and you will get the formula for calc TP index member in Essbase.
    Edited: I just checked other question from you, will revert on that in some time.
    Cheers..!!
    Rahul S.

  • Any way to assign value for  variable of type Class List String ?

    I'm puzzled why I can declare a variable:
    Class<List<String>> clazz;but I cannot assign a value to it as
    clazz = List<String>.class;The compiler also complains about
    Class<List<?>> clazz0 = List<?>.class;yet it has the nerve to warn about raw types when I give up and use
    Class<List> clazz0 = List.class;Even using a dummy instance does not work.
            List<String> dummy = new ArrayList<String>();
            Class<List<String>> clazz1 = dummy.getClass();I only care because I've declared a method like
    public String useless( Class<List<String>> unSetable){
      return  unSetable.getName();
    }And now there seems to be no way to call it.

    Hello chymes,
    there is no way to get an instance of Class<List<String>> without at least one unchecked warning. Otherwise you could get away with the following:
    List<Integer> ints = new ArrayList<Integer>();
    Class<List<String>> clazz = List<String>.class;
    List<String> strings = clazz.cast(ints);
    strings.add("No Good");
    int i = ints.get(0); // CCETherefore the only way to get it is via unchecked cast:
    Class<List<String>> clazz = (Class<List<String>>) (Object) List.class;With kind regards
    Ben

  • Assigning value to variable within Range

    The Problem:
    Range of values permitted is 10 < x < 30. x starts at 20. Variable x increments by 5, on a button click, until it reaches 30, at which point it should decrement by 5, until it reaches 10, before moving up the range again... and so on.
    I'm sure this is quite simple, but it's been bugging me for hours... the following simple increments by 5.
    How would I include range constraint. please some help.
    void jButton_mouseClicked(MouseEvent e) {
    int r = aBall.radius();
    aBall.rad = r + 5;
    repaint();
    }

    You're right, perhaps, nasch_.
    When I was starting out, I learned a lot from looking at code and then figuring out how to adapt it. Perhaps I have denied the OP this opportunity.
    To learn more from the code I posted, OP, don't just copy and paste it. As nasch_ was pointing out, you absolutely must learn how to translate requirements in English (or language of your choice) into code. If-statements ar crucial elements. Look at the code and figure out how it matches your requirements. Think about what you have to do logically - When the size would be less than 10, you need to grow instead of shrink... etc. Write out (or at least think out) every scenario that your code has to react to. Size would be in range, size would be too large, size would be too small, ball is growing, ball is shrinking, etc. Make every possible combination and figure out how you must react.
    When your logic is hammered out like that, in natural language, start converting to logic. You see that your code has to remember whether your Ball is growing or shrinking. Your Ball should know it's minimum and maximum size (which my code ignores, making it less flexible). Turn your scenarios into If-statements. Your first code could have way too many If-elses, but get it to work, and then refine it by combining and nesting statements.
    Don't ever just copy and paste code. You won't learn how to do anything yourself. Learn from code you see. Take this opportunity to not just solve the immediate problem, but to realize that this is an area of your skills that needs improvement and follow through on improving it.
    -- end soapbox

  • Assigning value to variable defined as LOCAL in standard program

    Hello Gurus,
    We have a Z function module which gets called via standrad SAP program. Now inside this Z FM we have to code such that it updates an internal table defined via LOCAL in program LQEEMF72 (Main program SAPLQEEM). Is this possible ?
    I tried following :
      DATA gt_qasptab TYPE qaspr OCCURS 0.
      FIELD-SYMBOLS: <qasptab>.
      ASSIGN ('(SAPLQEEM)QASPTAB[]') TO <qasptab>.
      gt_qasptab[] = <qasptab>.
    and at the end
    ASSIGN gt_qasptab[] TO <qasptab>.
    This does not work. How to update the table QASPTAB ?
    Please provide your suggestions ....
    Thanks in advance <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Dec 28, 2007 8:26 AM

    Hi tushar,
    I'm very sorry I can't reallly help you if you don't describe your process at all.
    The include you mentioned is not part of an SAP program but a FORMS include of a SAP function group.
    In this function group QEEM SAP provides lots of userexits:
    EXIT_SAPLQEEM_001 Customer Function for Calculating Formulas in Results Recording          
    EXIT_SAPLQEEM_002 Customer Function: Add. Fns for Importing Insp. Chars in Results Recording
    EXIT_SAPLQEEM_003 Customer Function: Add. Functions After Valuating Insp. Characteristics  
    EXIT_SAPLQEEM_004 Customer Function: Add. Functions After Valuating Partial Samples        
    EXIT_SAPLQEEM_006 Customer Function: Add. Functions After Closing Insp. Characteristics    
    EXIT_SAPLQEEM_007 Customer Exit: Additional Functions After Closing Partial Samples        
    EXIT_SAPLQEEM_011 Customer Function: Add. Functions Before Valuating Insp. Characteristics 
    EXIT_SAPLQEEM_012 Customer Function: Additional Functions Before Valuating Partial Samples 
    EXIT_SAPLQEEM_015 Customer Function: Add. Functions After Entering Individual Results      
    EXIT_SAPLQEEM_020 Customer Function: Additional Functions After Entering Inspector         
    EXIT_SAPLQEEM_021 Customer Function: Add. Functions for User Key +US1 (Char. Single Screen)
    EXIT_SAPLQEEM_022 Customer Function: Add. Functions for User Key +US2 (Char. Single Screen)
    EXIT_SAPLQEEM_023 Customer Function: Add. Functions for User Key +US3 (Char. Single Screen)
    EXIT_SAPLQEEM_024 Customer Function: Add. Functions for User Key +US4 (Char. Single Screen)
    EXIT_SAPLQEEM_025 Customer Function: Add. Functions for User Key +US1 as Pushbutton        
    EXIT_SAPLQEEM_026 Customer Function: Add. Functions for User Key +US2 as Pushbutton        
    EXIT_SAPLQEEM_027 Customer Function: Add. Functions for User Key +US3 as Pushbutton        
    EXIT_SAPLQEEM_028 Customer Function: Add. Functions for User Key +US4 as Pushbutton        
    EXIT_SAPLQEEM_029 Customer-Function for Subscreen Characteristic Overview                  
    EXIT_SAPLQEEM_030 Customer Function for Subscreen Characteristic Single Screen             
    EXIT_SAPLQEEM_031 Customer Function Creating Table with External Numbers                   
    EXIT_SAPLQEEM_032 Customer Function Characteristic Text in Logon Language                  
    Try one of them.
    Regards,
    Clemens

  • Assigning value to an item

    Is there a way to assign value to variable
    of data type ITEM? In other words, I need to
    assign value to an item, where I just know the
    it_id.
    In the following procedure p_item is unknown until runtime;
    and if it_id is not null then assign some value to the item.
    procedure update_item(p_item)
    is
    it_id item := find_item('block1.'||p_item);
    if not id_null(it_id) then
       it_id := 'some_value';  --doesn't work.
    end if;
    end;

    Do you mean you know the name of the item and you want to then assign a value?
    If so then use the COPY command which allows you to assign a value to a named variable
    e.g.
    COPY (12345, 'blocka.number_item1');
    To read the value in the same way use the NAME_IN function.
    There is plenty in the forms helps about this.
    Mark

  • # value in Variable Selection screen

    Hello,
              Can you please help with the below:
    How do we remove # (Not Assigned) value from Variable selection screen. When I select PLANT in one of the  report, I see # value. But there are no empty values in the cube. So, I am not sure as why I am getting this # value in Selection Screen.  The seeting in Web designer for READ MODE is "Posted Values" and  not  "Master data or Dimension Table".
    Thanks.

    have you checked what Bex properties are set in the Info Object for "Query Def. Filter Value S"
    Select Values from Info provider.
    that might solve your problem. But ensure you're not disturbing anything else by changing this property.
    Regards, Siva
    Message was edited by:
            Siva Bonam

  • Assigning value to array type variable in a loop

    Hi
    I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
    My copy operation in assign activity looks like this-
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters"/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    </copy>
    It is inside a while loop activity.
    PS *()* are square brackets
    But it is erroring out at run time.
    Does anybody has an alternate idea to assign value to an array type?.
    i have seen that while extracting value from an array type variable it works fine
    A similar kind of operation is shown below.
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters"/>
    </copy>
    Thanks
    Ayush
    Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AM

    Hi Ayush
    I suppose you are getting some error like "source node returns multiple elements".
    In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
    Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
    Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
    *<copy>*
    *<from variable="Var" part="InputParameters"*
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
    part="InputParameters"
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *</copy>*
    And the easiest way to do this is by the transform activity as said above.
    Regards
    Suryaveer
    Edited by: Suryaveer on Aug 15, 2009 11:19 PM

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • Execute SQL Task: Cannot assign value to the variable

    DECLARE
    @PartitionDate varchar(8),
    @Date int
    SELECT
    @PartitionDate = MAX(PartitionDate)
    FROM PartitionLog (NOLOCK)
    SELECT
    @Date = MIN(DateKey)
    FROM DimDate WHERE CAST(DateKey as varchar(8)) > @PartitionDate
    IF NOT CONVERT(varchar(8),GETDATE(),112) = @PartitionDate
    SELECT @PartitionDate = CAST(DateKey as varchar(8))
    FROM DimDate (NOLOCK)
    WHERE DateKey = @Date
    SELECT @PartitionDate AS PartitionDate ,
    'IISDW_' + @PartitionDate AS PartitionName
    GO
    I have the above SQL stmt in the excute SQL task and declared 2 variable "PartitionDate" and "PartitionName" in the Package, the RESULT SET I hav given as "Single Row" and when I run the ETL I get the error as 
    [Execute SQL Task] Error: An error occurred while assigning a value to variable "PartitionDate": "Exception from HRESULT: 0xC0015005".

    Does your package variable datatype match the datatype of your parameter?
    Is your Package variable assigned to the parameter in the task editor?
    And does the parameter name in the task editor match the parameter names in your stored procedure?

  • Is an assigned value to an variable in the domain of the data element

    Hi
    how can I check if the value, which I want to assign to an variable is in the domain of the data element of that variable.
    Example:
    I defined a data element myDataElement. The Elementary Type of myDataElement is the Domain myDomain.
    myDomain has the Format: Char with Length 1 and the fixed values 'A' and 'B'.
    The following code works, but IMHO should not:
    DATA testVar TYPE myDomain.
    testVar = 'Foo'.
    The value of testVar is now: 'F' .
    As 'F' is not in the fixed values, this is a behaviour which I don't want. How can I prevent this from not happening (without using a bunch of IFs)?
    In such a case, it were nice if an exception were raised.
    Regards
    Gilles

    Thanks Gungor.
    I tried it with DDUT_DOMVALUES_GET. Works so far. I think I will write some FMs on my own, like this one:
    FUNCTION z_valueisindomain.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IV_DOMAINNAME) TYPE  DDOBJNAME
    *"     REFERENCE(IV_EVALUATING_VALUE) TYPE  ANY
    *"  EXPORTING
    *"     REFERENCE(EV_DESTINATION) TYPE  ANY
    *"  EXCEPTIONS
    *"      ILLEGAL_INPUT
    *"      NOT_IN_DOMAIN
      DATA domainvalues TYPE TABLE OF dd07v.
      CALL FUNCTION 'DDUT_DOMVALUES_GET'
        EXPORTING
          name          = iv_domainname
        TABLES
          dd07v_tab     = domainvalues
        EXCEPTIONS
          illegal_input = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        RAISE illegal_input.
      ENDIF.
      DATA oneline TYPE dd07v.
      LOOP AT domainvalues INTO oneline.
        IF oneline-domvalue_l EQ iv_evaluating_value.
          ev_destination = iv_evaluating_value.
          EXIT.
        ENDIF.
      ENDLOOP.
      IF ev_destination IS INITIAL.
        RAISE not_in_domain.
      ENDIF.
    ENDFUNCTION.
    I'm pretty new to ABAP, so this FM might not be very elegant.
    Regards
    Gilles

Maybe you are looking for