How to use the value of a variable to set another variable

Hello Experts,
Is it possible to access the value of variable set by the user and set the default value of another variable using the user entered value for the first variable? Example:
Date variable
Week variable
Month variable
User enters one of those and the other two are automatically prefilled with the correct values?
Thanks
Rado

Hi Rado,
Gothrough following code
Which reads year from user input and converts it to factory calendar week , following which you should able to convert user inputs to required parameters.
DATA:  v_year1 TYPE i,
        v_int   TYPE i,
        v_week1 TYPE kweek,
        v_qurt  TYPE i,
        v_perd  TYPE /bi0/oifiscper,
        v_iweek TYPE i,
        v_periv TYPE periv VALUE 'Z4'.
DATA : v_vweeks  TYPE /bi0/oicalweek,
        v_vperd   TYPE /bi0/oifiscper,
        v_vperiv  TYPE /bi0/oifiscvarnt VALUE 'Z4'.
DATA : vit_weeks LIKE /bi0/scalweek OCCURS 0 WITH HEADER LINE.
DATA : v_perd1   TYPE umc_y_fiscper,
        v_weeks   TYPE umc_ys_dimvals,
        v_pweeks  TYPE i.
CASE i_vnam.
   WHEN 'WPIYWEEK'.                "Variable name of char. in Bex
*Check for Step 2 (After user gives inputs on selection screen)
     CHECK i_step = c_after.                                "Step:2
     CLEAR :  v_year1,
              v_week1,
              v_iweek.
*Read the value of variable which used has entered on sel. screen
     READ TABLE i_t_var_range INTO wa_var_range
                                 WITH KEY vnam = 'WPIFYEAR'.
     v_year1 = wa_var_range-low.
     CALL FUNCTION 'TIME_GET_LAST_WEEK'
       EXPORTING
         if_year     = v_year1
       IMPORTING
         ef_week     = v_week1
       EXCEPTIONS
         fatal_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.
*Get the no. of week from YYYYWW format
     v_iweek = v_week1+4(2).
     l_s_range-low  = v_iweek.
     l_s_range-sign = c_include.
     l_s_range-opt  = c_equal.
     APPEND l_s_range TO e_t_range.  "This is the output structure in which u have to add the result
Endcase.
Hope that helps.
Regards
Mr Kapadia
Assigning points is the way to say thanks in SDN.

Similar Messages

  • How to change the value from one input control to another input control?

    Hi Experts,
    I want to change the value from  one input control to another input control. For Example if i change month in first tab. it should reflect in second tab also. How should we acheive through input control or some other option.
    Here I attached screen shot.Please help me for this

    Hi,
    It is not possible to have Input controll in all tabs that will be set from another .
    But There is one workaround .
    Follow the link below .
    http://davidlai101.com/blog/2013/08/13/web-intelligence-input-control-that-affects-all-tabs/

  • How to hold the value of a prompted password in a variable while file is open?

    I have this little VBA macro that uses ADODB to execute a SQL Server Agent job remotely.  It is in an Excel file, and there will be several other similar macros in the same Excel file.  They will be used at least 10 times, each time the user opens
    the Excel file.  If I leave it like this, the user will be prompted for the password every single time they run one of the macros.  How can I change it to instead prompt the user for the password value initially when they open the file, store it
    in a variable, and then utilize that variable value for the database connection every time they run one of the macros (to avoid repeated prompting)?  Also, are there any security concerns with my proposed approach?
    Sub Test_SSIS()
    Dim conn As Object
    Set conn = CreateObject("ADODB.Connection")
    conn.Provider = "sqloledb"
    conn.Properties("Prompt") = adPromptComplete
    conn.Open = "Data Source=MYSERVER;USER ID=JOHNDOE;"
    conn.Execute "exec msdb.dbo.sp_start_job 'Test_remote_job_execution'"
    End Sub

    One possibility is to use the workbook_open event to prompt for and store the password temporarily in the registry. Add the following code to the thisworkbook module of the workbook
    Option Explicit
    Private Sub Workbook_Open()
    Dim strPassword As String
    strPassword = GetSetting("myApp", "Config", "Password", "")
    If strPassword = "" Then
    strPassword = InputBox("Enter password")
    SaveSetting "myApp", "Config", "Password", strPassword
    End If
    lbl_Exit:
    Exit Sub
    End Sub
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    RegKeyDelete "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\myApp\Config\"
    If RegKeyDelete("HKEY_CURRENT_USER\Software\VB and VBA Program Settings\myApp\") = True Then
    MsgBox "Password cleared"
    Else
    MsgBox "Password not stored"
    End If
    lbl_Exit:
    Exit Sub
    End Sub
    Function RegKeyDelete(i_RegKey As String) As Boolean
    Dim myWS As Object
    On Error GoTo ErrorHandler
    Set myWS = CreateObject("WScript.Shell")
    myWS.RegDelete i_RegKey
    RegKeyDelete = True
    Exit Function
    lbl_Exit:
    Exit Function
    ErrorHandler:
    RegKeyDelete = False
    GoTo lbl_Exit
    End Function
    Then modify your macro code as follows:
    Sub Test_SSIS()
    Dim strPassword As String
    Dim conn As Object
    strPassword = GetSetting("myApp", "Config", "Password", "")
    If strPassword = "" Then
    strPassword = InputBox("Enter password")
    SaveSetting "myApp", "Config", "Password", strPassword
    End If
    Set conn = CreateObject("ADODB.Connection")
    conn.Provider = "sqloledb"
    conn.Open "DATA SOURCE=MYSERVER;USER ID=JOHNDOE;Password=" & strPassword & ";"
    conn.Execute "exec msdb.dbo.sp_start_job 'Test_remote_job_execution'"
    End Sub
    The workbook must obviously be saved as macro enabled
    This will then prompt once when the workbook is opened. When the macro is run it will read the password from the registry thus not requiring a prompt, unless for some reason the password is missing or nothing has been entered as a value in the first box.
    When the workbook is closed, the workbook before close event deletes the registry entries completely.
    The only snag to this is if the workbook is crashed, the registry entry is not removed and there will be no prompt next time, until the workbook is closed correc tly. This might not be an issue, if the users don't know about it, so hide your code from them.
    Graham Mayor - Word MVP
    www.gmayor.com

  • How to capt  the Value of Session Id [jsessionid] in a variable in e-tester

    Hi,
    We are facing a problem in the following scenario in e-testeer.
    1. We had recorded two individual scripts in e-tester
    a. Login Script of our application [ only login ] and
    b. An Action Script which is DEPENDENT on the first script
    We need to merge these two scipts in such a way, user would login through 1st script and then perform the action in 2nd script.
    But there exists a dependency over session id on these actions.
    Session ID generated in the first script needs to be used in the second script.
    So the crux is we would like to know how to capture the session id generated in the LOGIN script and use it in the ACTION script in e-tester
    Please provide a solution for our problem.
    Thanks.
    Edited by: user11144652 on May 8, 2009 2:10 AM

    Hi All,
    I found the solution for the above problem!!!
    I used the 'GetCookies' and 'SetCookies' method of VBA for getting and setting the 'SessionID' across the scripts.
    Examples for 'GetCookies' and 'SetCookies' methods are available in etester help itself.
    We need to get the value of cookie from login script and need to store the value in a variable defined in a 'Shared Module'. Variable value stored in 'SharedModule' can be accessed across the scripts.
    Thanks a lot for your time.

  • After hiding an item, its value cannot be used in a query. How to use the value of a hidden item.

    Hi,
    I have a shuttle. I am using its value in a query by using sql collection array. My requirement is that I need to hide that shuttle. But when I hide the shuttle, its value is not retrived by the query.
    Please give some idea how to get this functionality.
    Thanks,
    chandru

    ChandraBhanu wrote:
    Its a shuttle. so how to create an application item of shuttle type?
    pls give some idea.
    You don't create an application item of shuttle type.  Application items only hold one value, and I thought since you were using a value in a query that you were only using one.  In the case of multiple values my idea to use a page/application item will not work

  • How to use the value in a text cell?

    Hi everyone i am new to this forum. My family and i have been macusers for more than 10 years and for our business we own many macs. I am trying to build a stock list calculator and want to ask something.
    My B3 cell contains the text "50*70cm" and i want to see the value of 50*70 which is "3500" in the D3 cell. And when i change the B3 cell for example to "70*100cm" i want to see "7000" in the D3. Is there any function for this? Thank you.

    merthlm wrote:
    My B3 cell contains the text "50*70cm" and i want to see the value of 50*70 which is "3500" in the D3 cell. And when i change the B3 cell for example to "70*100cm" i want to see "7000" in the D3. Is there any function for this?
    IF: the operator used is ALWAYS x
    AND the unit used in ALWAYS cm
    AND there are NO spaces in the entry,
    THEN the following expression will work:
    =LEFT(B3,FIND("x",B3,)-1)*MID(B3,FIND("x",B3)+1,FIND("c",B3)-FIND("x",B3)-1)
    </PRE>
    If the unit is separated from the rest of the expression, change the single "c" to " " and the formula becomes independent of the unit.
    =LEFT(B3,FIND("x",B3,)-1)*MID(B3,FIND("x",B3)+1,FIND(" ",B3)-FIND("x",B3)-1)
    If you wish to use an asterisk as the multiplication sign, rather than an x, that seems to also work. Replace the three x characters with asterisks.
    While this formula works, my own preference would be to use separate columns for width and length, indicate the units only at the top of the columns, express all lengths in the same units, and enter only the numbers into the two columns. Your formula in D3 (or E3, when a new column was added before or after B) then would be
    =B*C
    and would be somewhat more forgiving of finger errors.
    Regards,
    Barry

  • How to get the value in one JSP page to another?

    Hi,
    I have problems in passing the value around in JSP. I have two JSP pages as below:
    test1.jsp
    I try to get the vaule from my textbox by using:
    String strUser = request.getParameter ("strUserName");
    Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).
    test2.jsp
    Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using
    String strUser1 = request.getParameter ("strUser");
    Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.
    Could you please give me some guidance?
    Thanks you very much for any advise you may give me.
    Kimsan

    Hi,
    Thank you very much for your help. It's working fine if i just get a one value to another page, however, i have problem while i pass the value in my loop to another page because i always get the last record. I try with the following code:
    logged_page.jsp
    <html>
    <head>
    <title>Welcome to the online Auction...</title></head>
    <body>
    <%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
    <% try
         String strUsername = request.getParameter("username");
         session.setAttribute("myUserName", strUsername);     
         String strPassword = request.getParameter("password");
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         String strSQL = "SELECT [UserName], [Password] FROM tblUserDetails where [UserName] = ? and [Password] = ?";
         PreparedStatement statement = myConn.prepareStatement(strSQL);
         statement.setString(1, strUsername);
         statement.setString(2, strPassword);
         ResultSet myResult = statement.executeQuery();
         if(myResult.next())
         //out.println("Login Succesful! A record with the given user name and password exists");
         out.print("<center><h1>");
         out.print("Welcome  ");
         out.print(strUsername);
         out.print("</h1></center>");
         out.print("<center>");
         out.print("<BR><BR>");
         out.print("<font font face = Viner Hand ITC size= 5>Products on sales</font>");
         out.print("<BR><BR>");
         Statement myStatement = myConn.createStatement ();
         ResultSet myResult1 = myStatement.executeQuery("SELECT * FROM tblProduct");
         ResultSetMetaData myResultSet = myResult1.getMetaData();
         out.println("<font face=Tahoma>");
         out.print("<table border=1 CELLSPACING=0>");
         out.print("<TR>");
         out.print("<TD width = 200> Item Title");out.print("</TD>");
         out.print("<TD width = 200> Description");out.print("</TD>");
         out.print("<TD width = 200> Current bid");out.print("</TD>");
         out.print("<TD width = 200> Available Time");out.print("</TD>");
         out.print("<TD width = 200> Place Bid");out.print("</TD>");
         out.print("</TR>");
         out.print("</table>");
         while(myResult1.next())
              String strProName = myResult1.getString(1);
              session.setAttribute("myProName", strProName);          
              out.print("<table border=1 CELLSPACING=0>");
              out.print("<TR>");
              out.print("<TD width = 200>");
              out.println(strProName);
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(3));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(2));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(4));
         out.print("</TD>");
         out.print("<TD>");
              out.print("<form action=bid_page.jsp method=post>");
              out.print("<input type=text name=place_bid>");
              out.print("<input type=submit name=okfunc value=Bid>");
              out.print("</TD>");
              out.print("</form>");
              out.print("</TR>");
              out.print("</table>");
              out.println("</font>");
              out.print("</center>");          
         else
              out.print("<center>");
              out.print("Sorry ");
              out.print("<font color = RED size = 5>");
              out.print(strUsername);
              out.print("</font>");
              out.print(" could not be found.");
              out.print("</center>");
         myResult.close();
         statement.close();
         myConn.close();
         catch(SQLException e)
         out.println(e);
    %>
    </body>
    </html>
    bid_page.jsp
    <HTML>
    <HEAD>
    <TITLE>Welcome to the online Auction...</TITLE>
    </HEAD>
    <BODY>
    <%@ page language ="java" import = "java.io.*" import = "java.lang.*" import = "java.sql.*" %>
    <% try
         String thisUserName = (String) session.getAttribute("myUserName");
         String thisProName = (String) session.getAttribute("myProName");
              Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         PreparedStatement myStatement = myConn.prepareStatement("INSERT INTO tblHistory VALUES ('"+thisUserName+"', '"+thisProName+"', '"+request.getParameter("place_bid")+"')");
              myStatement.executeUpdate();
              myConn.commit();
              myStatement.close();
              myConn.close();
              catch(Exception e){}
    %>
    </BODY>
    </HTML>
    When i click on the BID button in the logged_page.jsp then i always get the last record and save into my table and that is not what i want to. i want to get the result on the same row as the BID button that just click and save to my table.
    Could you please advise?
    Thanks you very much for your time and any consideration you may give me.
    Best Regard,
    Kimsan

  • How to copy the value of default view textbox into another view textbox

    I create one form library and customizing in infopath 2010. on this default view one textbox is placed. in which user will enter his name.
    I create another view. in which i also place second textbox. I want when user put his name in default view textbox and save the form . then his name also copy into another view textbox .
    Kindly let me know how to do this ?

    Hi John,
    You can achieve in infopath. Steps are below:
    Default Text Box (Infopath Field A)
    Mirror Text Box (Infopath Field B)
    In Mirror Text Box, the default value would be the Field A. The default value you specified by right click on Mirror Text Box --> Properties...
    Thanks,

  • How to use hashtable values

    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).

    I'm not clear what exactly are you looking for? Is it just the printing/reading of values in hashtable or some interaction of those values with beans?
    --Shiv                                                                                                                                                                                                                                                                                                                               

  • Reposting:urgent....how to use hashtable values

    Hi
    if i get all lovsession results in to a hash table
    how to use them
    i mean how to use the value of particular field in hash table(lov ).
    is it <hashtable>.get(object name);
    if it is what should be my object name...is it VO attribute of LOV???or the Id in that lov page??
    please help me out..
    Regards
    Sandeep.G

    if(pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    if (lovResults != null)
    value = (String) lovResults.get("<Lov Item Name>");
    }

  • Can someone help me in easy steps on how to use the home sharing for music on itunes.

    Hi can someone give me easy to follow instructions on how to use the home sharing for itunes.

    iTunes- Setting up Home Sharing on your computer
    Setting up Home Sharing for Apple TV (2nd generation)
    Troubleshooting Home Sharing

  • How to use the variable value "ALL"

    Hello all,
    I'm trying to use the value "all" for a selection variable in a Web Interface so that to have no restrictions for that specific variable and that all the rows are shown on the interface.
    Unfortunately it does not seem to be working because when I select the value "all" the system seems to go back to the latest rows saved under a specific value for that variable and does not show all the rows saved under any variable's value.
    Anyone knows how to make this work? One option is to remove the variable from the web interface altogether, but that's my last option.
    Thanks in advance.
    Best regards,
    Francesco

    Hi Francesco,
    why is leaving out the variable your last option? If you want to select "all" then you don´t need a variable.
    Cornelia

  • How to update and use the values of variables of another class

    I can we update or use the values of the variables of another class. For example, if we have class A
    public class A //(situated in package view)
    public s0,s1;
    public void runFunction()
    ...some coding and proceedings
    s0="Hi";s1"Hello";
    ......some coding
    RequestDispatcher dispatcher = request.getRequestDispatcher("/MainUser.jsp?alert=F");
    dispatcher.forward(request, response);
    ARunner.jsp
    <jsp:useBean id="a" class="view.A" scope="session"/>
    <%
    a.runFunction();
    %>
    MainUser.jsp
    <jsp:useBean id="a" class="view.A" scope="session"/>
    <%
    System.out.println("S0:"+a.s0+" S1:"+a.s1); //should print S0:Hi S1:Hello, but printing S0:null S1:null
    %>
    A.class has some procedures and String variables which can be updated and later can be used in JSP pages. The project starts with ARunner.jsp which uses the A.class and updates the values of string variables s0 and s1of A to hi and hello respectively.And then redirects the page to MainUser.jsp.
    Now what I want is ,when I call those string variables(s0 & s1 of A.class) in any another jsp likeMainUser.jsp it should give me the value of hi and hello respectively not null as it is giving right now. Could you refine the coding for this one?

    public class A //(situated in package view)
    public String s0,s1;
    public void runFunction()
    ...some coding and proceedings
    s0="Hi";s1"Hello";
    ......some coding
    RequestDispatcher dispatcher = request.getRequestDispatcher("/MainUser.jsp");
    dispatcher.forward(request, response);
    ARunner.jsp
    <jsp:useBean id="a" class="view.A" scope="session"/>
    <%
    a.runFunction();
    %>
    MainUser.jsp
    <jsp:useBean id="a" class="view.A" scope="session"/>
    <%
    System.out.println("S0:"+a.s0+" S1:"+a.s1); //should print S0:Hi S1:Hello, but printing S0:null S1:null
    %>
    giving code again to remove the typing errors. Please guide.

  • Can we use the value of a variable in an alert message

    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is this possible?

    Gul wrote:
    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is this possible?Try
    DECLARE err_txt VARCHAR2(200) t;
    al_id ALERT;
    al_button Number;
    BEGIN
    al_id := FIND_ALERT('My_Error_Alert');
    SET_ALERT_PROPERTY(al_id, alert_message_text, 'Hello how are you mr. variable '||:variable_name );
    al_button := SHOW_ALERT( al_id );
    END; Hope it works..
    Hamid

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

Maybe you are looking for