Pass value to a field dynamically..

Hi Experts,
Can any one solve this issue?.
I want to pass value to different fields dynamically..
Egu2026
I have work are having fields
lwa_table-var1,
lwa_table-var2,
lwa_table-var3,
lwa_table-var4,
u2026.. up to lwa_table-var100.
My logic is I have to pass l_tot value .. based on the last letter like below.
if l_tot value is 1 we have pass to lwa_table-var1
if l_tot value is 2 we have pass to lwa_table-var2
if l_tot value is 3 we have pass to lwa_table-var3
if l_tot value is 100 we have pass to lwa_table-var100.
<removed_by_moderator>
Thanks in advance.
Regards,
Kumar.
Edited by: Julius Bussche on Aug 12, 2009 8:41 AM

Hi Friend,
U can do Following.....
data:  text(12) type c.
data : num type n.
data: int type i.
data: begin of wa_test,
      var1,
      var2,
      var3,
      var4,
      end of wa_test.
FIELD-SYMBOLS <fs_wa> TYPE ANY.
do 4 times.
  int = int + 1.
  num = int.
  CONCATENATE 'wa_test-' 'var' num into text.
  ASSIGN (text) to <fs_wa>.
<fs_wa> = num.
  UNASSIGN <fs_wa>.
enddo.
  write : wa_test-var1 , wa_test-var2 , wa_test-var3 ,wa_test-var4 .
ouput will be :     1 2 3 4.
Lets take Your Scenario----
>>>>>>>>>>>>>>>>>
Data: begin of lwa_table,
Var1,
Var2,
Var3,
u2026..
u2026u2026
Var100,
End of lwa_table.
Data: l_tot type i.
u2022     For example l_tot = 36.
u2022     Then u want to pass the same to lwa_table36.
For this do followingu2026..
Now Define-->>>
data: text(13) type c.
data : num type n.
FIELD-SYMBOLS <fs_wa> TYPE ANY.
*Now till now we done all the data definitions now u have to do following to pass it dynamically,
l_tot = 36.
Num  =  l_tot.
CONCATENATE lwa_table-' 'var' num into text.
ASSIGN (text) to <fs_wa>.
<fs_wa> = num.
UNASSIGN <fs_wa>.
Write : lwa_table-var36.
Output will be 36.
Hope this resolves ur issue,
Regards,
Akash Rana
Edited by: AKASH RANA on Aug 12, 2009 8:53 AM

Similar Messages

  • Passing value to a field of SAP Program which do not have "Parameter ID"

    Dear Experts,
    My requirement is that i need to pass a value from my dialog program to a field of SAP Program which do not have "Parameter ID" attached to it.
    For example: If you run SAP Transaction CS14, it has two sections viz., Primary BOM and Secondary BOM. I need to copy and create own screen using Dialog program. The screen appears in custom screen would be similar to that of the SAP Transaction CS14. If you check the fields, all the fields have "Parameter ID" attached to it, except for the following fields which do not have Parameter IDs are "Alternative", "Valid From" and "Required Qty".
    Hence how do i pass value to those fields? Kindly help me
    To those fields where "Parameter IDs" are attached, i can use below two statements:
    Set parameter id <par> field <field>.
    call transaction 'CS14' and skip first screen.
    Regards,
    Ramesh Manoharan

    Hi Harald Boeing,
    Thanks you very much. My problem is solved.
    Rewarded Points.
    Regards,
    Ramesh Manoharan

  • Passing values to hidden fields in screens

    Hi ,
    I have designed a screen which has i field which is output only, and two fields which are hidden.. the output only field gets populated when i select value from an alv tht pops up on the screen based on certain conditions.. the hidden fields should also be populated than.. but the hidden fields are not getting populated i think..
    i have assigned a t-code to this screen,
    and i need to call this transaction from another program passing values to all the fields.. i used parameter id for all teh fields, but values are not getting populated in the hidden and display fields. i gets in when i make it input enabled.. but i cannot let users enter values in 1 field, and i do not want users to see the other field.. What do i do???? please give your valuable suggestions. .a ny idea how to correct the issue?
    Regards,
    Suzie

    Hi,
    If you want one of the fields to be grey mode you can do that statically in the screen painter or dynamically in the progarm
    in PBO
    loop at screen
    if screen-name = 'TO_BE_GREY_MODE'.
    SCREEN-INPUT = 0
    ENDIF
    endloop
    for hidden fields if the screen name and the variable name in the program are same the data transfer takes place but the users cannot see this.
    Regards
    Ramchander Rao.K

  • Passing values to another field in APEX form

    Hi,
    How do I pass a value in 1 field to another field in APEX form ?
    I have a hidden field and I need to populate this field by another field.
    thanks

    I found the solution to my problem.
    [1] Create a "After Submit" under Computations.
    [2] Select 'Item Value' under Type in Item Name
    [3] Select "After Submit" under Computation Point
    [3] Enterer Item Name, which value needs to be passed in 'Source'
    thanks

  • Regarding how to pass values to the fields of a screen.

    Hi  all :
         there is a field called approver on screen. I'd like to pass value to it ,
         may I use the statement  like      approver-text = 'xxx'. ?
         is this ok?
         Thanks for any of your reply.

    Hi,
    Parameters: p_name type char20 default 'XXX'.
    you can give like this.
    or
    parameters: p_name type char20.
    Initialization.
    p_name = 'XXX'.
    both these will work
    regards
    Sarves

  • Popup2 in SQL report not passing values of table fields

    Hello All,
    Can some one help me with this popup 2 case statement.
    Instead of the values behind the fields being passed the literal text of "A.Metric" & "A.Month" is beaing passed into the new page instead.
    A.Metric has a value of 10 and A.Month has a value of '01/May/2008'
    CASE WHEN ANALYSIS IS NOT NULL THEN
    '<a href="javascript:popUp2('''
               || 'f?p=&APP_ID.:305:&SESSION.::&DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:A.METRIC_TYPE,A.MONTH'
               || ''', 890, 460);style="text-decoration:underline;color:black; font-size: 90%">'
    || '<img src="#APP_IMAGES#notes.jpg">'
    || '</a>' END "Analysis"
    Frank

    Species 5618 wrote:
    Hello All,
    Can some one help me with this popup 2 case statement.
    Instead of the values behind the fields being passed the literal text of "A.Metric" & "A.Month" is beaing passed into the new page instead.
    A.Metric has a value of 10 and A.Month has a value of '01/May/2008'
    ----------------------------------------------------------------------------------------------------------------------<font face="Arial">CASE WHEN ANALYSIS IS NOT NULL THEN
    '&lt;a href=&quot;javascript:popUp2('''
               || 'f?p=&amp;APP_ID.:305:&amp;SESSION.::&amp;DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:'
               ||  A.METRIC_TYPE,A.MONTH
               || ''', 890, 460);&quot;style=&quot;text-decoration:underline;color:black; font-size: 90%&quot;&gt;'
               || '&lt;img src=&quot;#APP_IMAGES#notes.jpg&quot;&gt;'
               || '&lt;/a&gt;' END &quot;Analysis&quot;</font>
    Franksorry did not realise that my text was being changed by this forum's application edit tool
    Here is the SQL statement again
    Frank
    Edited by: Species 5618 on Apr 15, 2009 10:03 AM
    I also Tried this with no success (&
    <font face="Arial">CASE WHEN ANALYSIS IS NOT NULL THEN
    '&lt;a href=&quot;javascript:popUp2('''
               || 'f?p=&amp;APP_ID.:305:&amp;SESSION.::&amp;DEBUG.::'
               || 'P305_METRIC_TYPE,P305_METRIC_MONTH:'
               ||  &A.METRIC_TYPE.,&A.MONTH.
               || ''', 890, 460);&quot;style=&quot;text-decoration:underline;color:black; font-size: 90%&quot;&gt;'
               || '&lt;img src=&quot;#APP_IMAGES#notes.jpg&quot;&gt;'
               || '&lt;/a&gt;' END &quot;Analysis&quot;</font>
    Edited by: Species 5618 on Apr 15, 2009 10:10 AM

  • How to set default value to input field dynamically

    Hello Experts,
    I am using adobe forms inside Webdynpro Java.
    Adobe form is having few input fields where at run time i want to assign default value to those fields.
    How can i do it ?
    Thanks in advance,
    Vinay
    Edited by: VINAY on Feb 24, 2011 6:39 AM

    Hi Mate,
    Just set the value to the webdynpro context fields on view init.
    if its like that will override the values entered by use on the form.
    just check if the default value is equall to the field value if yes leave it, if not dont touch that field.
    does this make sense...?
    Cheers,
    Sai

  • Passing values to custom OVS dynamically

    Hi,
    I am trying to select the Address from a list of addresses available for an Account while creating Visit for that account.
    In Visit QC, I populate the Account field using the standard Account OVS. After this, I want to show the list of Addresses available for this selected account in my custom Address OVS.
    Currently I have configured my OVS to Customer XBO. In this, I am passing Account ID as the parameter to the query and I am displaying the Account ID and the Addresses for that account.
    But this OVS displays all the Account IDs and only 1 address for all the available Accounts.
    As can be seen from the below screenshot, I have selected Account= ‘Lowes’ in Visit QC. But when I click on Addresses OVS, it displays me entire list of Accounts.
    Is there a way in which I can dynamically pass the Account ID of the account selected in the Visit QC to my custom OVS? I also need to display all the Addresses available for this AccountID.
    Please suggest how this can be achieved.
    Thanks,
    Ambuja

    Hi,
    By Custom OVS what I mean is, I have created an OVS based on standard Customer object. I am not using the public OVS. I have not defined any Custom BO. Do I need to define a custom BO for this?
    I am using Customer XBO to show the list of Addresses as shown in below screenshot.
    ValueHelpQuery is bound to InternalID of Customer.
    I have not configured any Inport or Outport. Actually I am implementing the OVS for the first time. Could you please guide me on what needs to be configured in the Inport. I referred the PDF documentation for configuring OVS but did not find much info on configuring Inport and other event hanldlers.
    Thanks,
    Ambuja

  • Passing value to paramater field in the crystal report

    Hai,
    I have done the following thing.
    1. Created SBO screen using screen painter.
    2. Added one text box, button in the screen painter.
    3. Created one Windows screen and attached Crystal report viewer.
    4. As soon as the button clicked in the SBO screen i am able to open the crystal report.
    But now i need values which i have typed in the text box should be passed to the crystal report. how this can be done . I have attached the code please let me know where is the error. I have also created paramater filed in the crystal report name "From_dt".
    As soon as the screen opened from SBO. It is asking for discreate value. But i have already passed the value from the SBO. I need to pass the value dyanamical from SBO screen.
              Dim oRpt As New Myreport
                            Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
                            Dim oLI As New CrystalDecisions.Shared.TableLogOnInfo
                            For Each myTable In oRpt.Database.Tables
                                oLI = myTable.LogOnInfo
                                oLI.ConnectionInfo.Password = "sapb1@sql"
                                oLI.ConnectionInfo.UserID = "sa"
                                myTable.ApplyLogOnInfo(oLI)
                            Next
                            Dim Crviewer As New Frm_rptwaste
                            Crviewer.CrystalReportViewer1.ReportSource = oRpt
                            Dim ParameterField1 As New CrystalDecisions.Shared.ParameterField
                            Dim ParamterFields As New CrystalDecisions.Shared.ParameterFields
                            Dim ParamterDescreteValue1 As New CrystalDecisions.Shared.ParameterDiscreteValue
                            ParameterField1.ParameterFieldName = "From_dt"
                            ParamterDescreteValue1.Value = txtcode.Value
                            ParameterField1.CurrentValues.Add(ParamterDescreteValue1)
                            ParamterFields.Add(ParameterField1)
                            Crviewer.CrystalReportViewer1.ParameterFieldInfo = ParamterFields
                            Crviewer.CrystalReportViewer1.RefreshReport()
                            Crviewer.ShowDialog()

    Hi Suresh,
        Instead of Parameter, you try Formula field and assign desired value to formula.
    HTH
    B Ravi Shankar

  • Passing value to formula field in CR XI from vb6

    currently using vb6 and testing CR XI.  Attempting to pass a value to a formula field in a CR XI report and getting the an "invalid use of property"  How do you pass a value from code in vb6 to the formula in the report?
    current code is as follows:
    Set app = New craxdrt.Application
    Set cr = app.OpenReport("test.rpt")
    Dim crystalFormFieldDefns As craxdrt.FormulaFieldDefinitions
    Dim crystalFormFieldDefn As craxdrt.FormulaFieldDefinition
    Set crystalFormFieldDefns = cr.FormulaFields
    Set crystalFormFieldDefns.Item(0).FormulaFieldName = ("{@InvList}")
    crystalFormFieldDefn.Text = Chr$(34) & selFormula & Chr$(34)
    crvInvoice.ReportSource = cr
    crvInvoice.ViewReport

    Hi, Gerry;
    I think the logic is off a bit.
    Instead of:
    Set crystalFormFieldDefns.Item(0).FormulaFieldName = ("{@InvList}")
    Try:
    For Each crystalFormFieldDefn In crystalFormFieldDefns
    If crystalFormFieldDefns.Name = "{@InvList}" Then
    crystalFormFieldDefn.Text = Chr$(34) & selFormula & Chr$(34)
    Regards,
    Jonathan

  • Mapping JDBC lookup: Passing values to multiple fields at target

    Hi all
    i my scenario  i am using mapping JDBC lookup ,and it is working sucessfully.
    but i need to select 4 fields from lookups select query and passing it to 3 different target field at target MT.
    if i use Global container object methods,than only 1 field i can store inglobal container variable..
    and return it 1 the target fields...
    BUT how do i pass 4 fields ,result of the select query to 4 different fields at target MT..
    query :"
    Select BPNO,emp,BENR,bacepack from Ztable where BPNO='"+BPNO[0]+"'";
    Regards
    AjayP

    Hi,
    I have to fetch 3 values and populate it to the 3 fields in the target. The UDF am using is as attached. This UDF is for fetching one value. Kindly tell me about the changes I will have to make to fetch 3 values instead of 1 value.
    String Query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;               
    DataBaseResult resultSet = null;                
    // Query to retrieve the PROP value for the particular source value passed.
    Query ="Select PROP from TANKS where ID='" + ID[0] + "' ";
    try{
    //Determine a channel, as created in the Configuration
    channel = LookupService.getChannel("<Business Service>","<Communication Channel>");
    //Get a system accessor for the channel. As the call is being made to an DB, an DatabaseAccessor is obtained.
    accessor = LookupService.getDataBaseAccessor(channel);
    //Execute Query and get the values in resultset
    resultSet = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();                      
    result.addValue((String)rowMap.get("PROP"));       
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!=null) accessor.close();
    catch(Exception e){
    result.addValue(e.getMessage());

  • Passing values according to fields in a table

    Hi
    I am using Tomcat 6, JDK 6, Win XP.
    I have first.jsp , which collects information from a file and and displays it in the table, plus some common operations , for example :
    A1 A2 select update delete
    B1 B2 select update delete
    C1 C2 select update delete
    So my first row of information consists of A1 and A2 and three operations which are hyper links to the next page, second.jsp:
    Data fields : A1, A2 and
    Select Update Delete
    This is my Question:
    first.jsp should send the correct parameters to second.jsp. Meaning, if user clicks the update in 2nd row, second.jsp should get B1,B2 and operation update and build a update.jsp page accordingly.
    Could you tell me how first.jsp can pass these values to second.jsp ?
    Thank you

    hope u build the table using for() loop .
    <a href = "select.jsp?id=<%=primarykeyvalue%>">select</a>
    <a href = "update.jsp?id=<%=primarykeyvalue%>">Update</a>
    <a href = "delete.jsp?id=<%=primarykeyvalue%>">Delete</a>
    Try this

  • Discoverer - passing value into Parameter Field.

    I would like to pass sysdate into a parameter I have created called "Start Date" and sysdate+30 into another one called "End Date" but have been unsuccessful.
    Any ideas folks?
    I have tried by putting in different combinations in the defaul value - including SQL etc but to no avail.
    I am relatively new to Discoverer so apologies if its a stupid question and the functionality isnt there.
    Thanks!
    Sam

    Hi,
    The functionality isn't really there to do this, but there are a number of workarounds. The most frequently used workarounds are:
    1. Create a list of values containing CURRENT_DATE as a text value using for example a custom folder containing:
    SELECT 'CURRENT_DATE' date_field FROM DUAL
    UNION ALL
    SELECT TO_CHAR(other_dates) FROM another_table
    Then in a condition decode CURRENT_DATE back to sysdate, e.g.
    select_date = DECODE(:date_param, 'CURRENT_DATE', TRUNC(sysdate), TO_DATE(:date_param))
    2. Use a NULL parameter to mean current date. The user will be prompted to enter NULL for the current date then you can decode this out in the condition:
    select_date = DECODE(:date_param, NULL, TRUNC(sysdate), :date_param)
    3. Use a date offset as the parameter, so that 0 is the current date, -1 is yesterday etc. You then use a condition like:
    select_date = TRUNC(SYSDATE) + :date_param
    Hope that helps,
    Rod West

  • How to pass values in dynamic fields in LX03

    HI ,
    i  want to pass values for dyanmic fields in lx03 program by calling this in my own program through  call transction or submit report .

    LX03 is the report program so you have to use Submit report.
    See the simple example :
    REPORT ZTEST_98 .
    DATA: t_param LIKE rsparams OCCURS 10 WITH HEADER LINE.
    parameters p_LGNUM like lagp-lgnum obligatory.
    start-of-selection.
          t_param-selname = 'S1_LGNUM'.
          t_param-kind = 'P'.
          t_param-low  = p_lgnum.
          APPEND t_param.
    *-- Period
    SUBMIT RLS10030 VIA SELECTION-SCREEN
                              WITH SELECTION-TABLE t_param
                              AND RETURN.
    Just press F1 on submit and you get good documentation.
    Thanks
    Seshu

  • Pass values dynamically to the WHERE clause in SFAPI

    Hi there
    We have a requirement to pass values dynamically (in the run-time of the interface) to the WHERE condition to our SFAPI query.
    Eg -
    SELECT person, personal_information, address_information, phone_information, email_information, employment_information, job_information, compensation_information, paycompensation_recurring, paycompensation_non_recurring, job_relation, accompanying_dependent,         global_assignment_information, direct_deposit, national_id_card, person_relation
              FROM CompoundEmployee
              WHERE last_modified_on &gt;= to_date('LAST_RUN_DATE')  AND
                           last_modified_on &lt;= to_date('CURRENT_RUN_TIME') 
    LAST_RUN_DATE is stored in a custom entity for which we execute another OData query. The custom entity is updated with the CURRENT_RUN_TIME once the interface has been executed successfully. So the next time the interface is run it picks up the LAST_RUN_DATE from the custom OData entity.
    SAP PO has the functionality to run a dynamic query for OData adapters. Refer to Note 2051137 - PI Successfactors adapter : Dynamic odata query and single synchronous sfapi query
    Eg - select fields from position (this is what you state in OData query path in the comms channel; this is static); and you have an advanced tab in comms channel where you mention dynamicquery and set it to true (this points to a XSD which has the keyword TOP, SKIP & FILTER in it).
    This gets the filter values passed from the BPM from another query (from a OData cust_table).
    So the whole query is - select fields from position filter field a = x field b = y etc. Field a field b are fields in position that are you passing values x and y in run time of the interface.
    SAP PO also has the advanced tab feature for SFAPI for dynamic query.
    Question is -
    how to use it?
    has anyone implemented this before?
    What does XSD will look like?
    How do we pass values to the fields to the Where clause for SFAPI.
    Any ideas are welcome!
    Regards
    Arijit Das

    After you have added a new where clause on the detail VO, try re-executing VO's query by DetailVO.executeQuery()
    If it doesn't work try re-executing the MasterVO's query after you have added the where clause on the detail

Maybe you are looking for

  • Using Flex Fields in BPM worklist

    Hi, Am trying to use flexfileds in BPM worklist so that I can have additional attributes from the payload associated from the humantask type , in the task header that appears in home page. Am able to create new label and then tried following steps :-

  • Using the eyedropper tool to take a color from another file or website...

    Hi, I'm new to Kuler, but recall being able to use the eyedropper tool in InDesign and click on an area of color from a file from another application or a website and have use it in the InDesign file. Am I incorrect? If there is a way to do what I am

  • Default value at Account Object Field setup

    Hi, How to give default value as 'On Demand' for the Source field at the time of Account creation and also we need to bypass this default value if the channel is web service and data import. This default should only effect if it is being done from OD

  • Replacement FM...

    Hai Friends , Good Evening ......... Can Any one give the Alternate FM(Replacement) For These FM, LOG_SYSTEM_GET_RFC_DESTINATION, HELPSCREEN_NA_CREATE CONVERT_DATE_INPUT, DISPLAY_BASIC_LIST TRANSFER_NAMES_TO_FIELDS, HELP_VALUES_GET_NO_DD_NAME ISO_TO_

  • Jdbc parameters in weblogic

    I want to know about the different parameters in weblogic which can improve performance.Is there any doc which help us understand this.I know few parameters like datacache, implicitcaching ,statement cache etc.But i would like to exact purpose of the