Dynamically Changing State of a field based on condition

Hi,
I have an existing view on the SRM portal which I have enhanced. There is a field Supplier. Requirement is when Invoice is created with reference to a PO, this field Supplier should be mandatory, But when Invoice is created without reference to PO, this field Supplier should be optional. Current by default this is a Required field on the view.
Component Name is /SAPSRM/WDC_DODC_INV_O_BD
I am new to Web Dynpro ABAP. Can someone please provide me the sample code to check this condition and change the state of this field Supplier dynamically. Also where should i write this code?
Thanks and Regards,
  Vanessa

hi
In your method there would be a parameter ie ON_TOGGLE where you can write the name of your event .
Whenever your checkbox will be clicked that event wil be called.
You can write your code in that event itself.
Regards
Kuldeep

Similar Messages

  • Dynamically Adjusting the Font of Field based on length of vaule - Adobe forms

    Hello Experts,
      I have a requirement where in i need to adjust the font of the field dynamically based on the length of the value.
    There is a less space in the adobe form layout and if there is long length (Above 50 Char) value coming then it is showing in multiple lines overlapping on another field.
    I just want to dynamically pass the Font to field.
    BR,
    Nikhil Kulkarni

    Hello Sven,
      Thanks alot for your reply. My field name is AGR_NAME  , so i am writing the following logic and is not working. Please correct me where i am going wrong. Many thanks.
    agr_name   is my field name.
    data.#pageSet[0].Page1.AGR_NAME::ready:layout - (JavaScript, client)
    var len;
    len = agr_name.length;
    if (len < 3)
    this.font.size = "20"; 
    }else {
    this.font.size = "3";
    Do i need to change some thing in the above java script code which i have written in Layout:ready language : Java script Run at : Client.
    BR,
    Nikhil Kulkarni

  • Change value of another field based on the value of selectOneRadio

    Hello
    I need to display one of two city fields based on the value of a radio group. If the value of the radio group is "Yes", then display the non mandatory city field, if the value is "No", then display mandatory city field. Please can someone help me? The code is below
    <af:subform id="contactForm3" default="true">
                <af:panelForm binding="#{processScope.backing_regDetails.contactPanel3}">
                  <af:selectOneRadio binding="#{processScope.backing_regDetails.radio1}"
                                     labelAndAccessKey="#{MatrixResource['ContactDetails.inBoroughQuestion']}"
                                     layout="horizontal"
                                     valuePassThru="true"
                                     required="true"
                                     onchange="javascript.refresh;" >
                      <f:selectItems value="#{processScope.backing_regDetails.items}" />
                  </af:selectOneRadio>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.SAO']}"
                                binding="#{processScope.backing_regDetails.houseNameText}"                           
                                maximumLength="240"/>
                  <af:inputText required="true"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                maximumLength="240"
                                label="#{MatrixCommon['Label.PAO']}"
                                binding="#{processScope.backing_regDetails.numberStreetText}"/>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                maximumLength="240"
                                labelAndAccessKey="#{MatrixCommon['Label.District']}"
                                binding="#{processScope.backing_regDetails.districtText}"/>
                  <af:inputText maximumLength="60"
                                rendered="#{!backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="true"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                 <af:inputText maximumLength="60"
                                rendered="#{backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="false"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                  <af:inputText maximumLength="60"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.County']}"
                                binding="#{processScope.backing_regDetails.countyText}"/>
                  <af:inputText columns="7"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                labelAndAccessKey="#{MatrixCommon['Label.Postcode']}"
                                binding="#{processScope.backing_regDetails.postcodeText}"/>
                  <af:selectOneChoice onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                      binding="#{processScope.backing_regDetails.countrySelect}"
                                      value="#{processScope.backing_regDetails.enteredAddress.countryId}"
                                      labelAndAccessKey="#{MatrixCommon['Label.Country']}">
                      <f:selectItems value="#{backing_regComponents.countryChoiceList}"/>
                  </af:selectOneChoice>
                  <af:inputHidden value="#{processScope.backing_regDetails.enteredAddress.locationId}"
                                binding="#{processScope.backing_regDetails.locationIdHidden}"
                                id="locationId"/>
                  </af:panelForm>
                  </af:subform>Edited by: aademola on Nov 13, 2008 7:35 AM
    Edited by: aademola on Nov 13, 2008 7:42 AM

    Hi,
    you should be able to apply this example to your 10.1.3 project
    see 4.3.2 of http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_lifecycle.htm#CIAHCFJF
    Frank

  • How to count number  of records for a field based on condition?

    Hi guys,
    I want to know how to find count of records coming from the database for a particular field based on some condition.
    I need to use this count to suppress some headers. Because of this i am not able to use running totals. Is there any other way?
    Ex scenario:
    I have account number and currency fields, those are coming from database. And i need to count the number of accounts whose currency is not Euro.
    Thanks in advance,
    Vijay.

    A simple formula can do that:
    //Formula begin
    if {your account field}<>"Euro" then 1
    //Formula end
    This formula can be summarized. (by group or report)
    Bryan Tsou@Taiwan

  • Change value of a field, based on another fiekd, before insert...

    I have this situation: I have to generate a code (this happens through a database function) on the moment a new record is saved. This code is based on another field of that record (parameter passed to the function). I (have to) use Apex 3, so I can't use functionality of Apex 4.
    So to be concrete: I have a registration program of books. Eacht book has a unique library code (this is not the PK). The labrary code is based on the year of publication (e.g. B2010-00035). So once a new book is entered, before saving, the year of publication (e.g. 2010) is checked, and throug a database function (e.g. f_get_new_library_code(2010) returns "B2010-00036") the library code has to be filled out.
    How can I do this on the best way, taking into account I can't use Dynamic Actions of Apex 4 (unfortunatly).

    Hi,
    If you had specified the type of Form the answer would have been more to the point !
    If its a single row form then you can write a OnSubmit Computation where in you call your function.
    If its a Tabular Form then you have to write a OnSubmit After Comp & Val process where you will iterate through the apex_application.g_f arrays and update the required arrays.
    Regards,

  • Dynamic change in the query name based on user input

    Hi Gurus,
    In a scenario, country appears as a user input variable.When the user specifies his country, the same query displays <b>Business trends</b>' data pertaining to his own country and rest of the world(international) in two tables.The reports are developed using Web application designer.
    Can the name(description) of the query be changed  so that the user input value for country gets dynamically reflected in the query name like <b>Business trends:Selected country vs International</b>?
    Regards,
    Balaji

    Hi Bala,
      ya this can be done by text variables. create a text variable( replacement path on the country infoobject) by going to the query properties on the description.
    if the user enters country value then it will be displaed on the description of the query .
    assign points if useful .
    regards
    santosh

  • Dynamically changing attributes of a field in view container UI element

    In the layout of the web dynpro component I have added a view container UI element. I am populating the fields in the view container UI element in methods in component controller using the following code
    *--Adding a Checkbox
      lv_str = wd_assist->if_wd_component_assistance~get_text( '009' ).
      CALL METHOD wd_this->att_wd_handler->add_parameter_field
        EXPORTING
          i_id          = 'CHB_DOWNLOAD_CHECKBOX'
          i_description = lv_str
          i_value       = lv_chb_download_checkbox
          i_as_checkbox = abap_true.
    *--Adding a Parameter
        lv_str = wd_assist->if_wd_component_assistance~get_text( '010' ).
        CALL METHOD wd_this->att_wd_handler->add_parameter_field
          EXPORTING
            i_id          = 'CHB_DOWNLOAD_PATH'
            i_description = lv_str
            i_value       = lv_chb_download_path
            i_as_checkbox = abap_false.
    Now based on the checkbox selection I want to make the field CHB_DOWNLOAD_PATH mandatory and also on F4 for CHB_DOWNLOAD_PATH  I want a method to be called. Where must i write the coding for the above conditions and how? Please help.

    hi
    In your method there would be a parameter ie ON_TOGGLE where you can write the name of your event .
    Whenever your checkbox will be clicked that event wil be called.
    You can write your code in that event itself.
    Regards
    Kuldeep

  • Dynamically changing state of JToggleButton

    Hey people,
    Im total newb to Java and i need some help.
    i have 4 JToggleButton's next to each other inside a JToolBar.
    When one is selected, other 3 must be unselected, im setting
    action listener on each of those like this:
    button1.addActionListener(this);
    button1.setActionCommand("button1");
    button2.addActionListener(this);
    button2.setActionCommand("button2");
    button3.addActionListener(this);
    button3.setActionCommand("button3");
    button4.addActionListener(this);
    button5.setActionCommand("button4");
    toolbar.add(button1);
    toolbar.add(button2);
    toolbar.add(button3);
    toolbar.add(button4);then I have actionlistener there:
    public void actionPerformed(ActionEvent evt)
              if (evt.getActionCommand() == "button1")
                            toolbar.button2.setSelected(false);
                            toolbar.button3.setSelected(false);
                            toolbar.button4.setSelected(false);
                         return;
                 else if (evt.getActionCommand() == "button2")
                            toolbar.button1.setSelected(false);
                            toolbar.button3.setSelected(false);
                            toolbar.button4.setSelected(false);
                         return;
                   else if (evt.getActionCommand() == "button3")
                            toolbar.button1.setSelected(false);
                            toolbar.button2.setSelected(false);
                            toolbar.button4.setSelected(false);
                         return;
                   else if (evt.getActionCommand() == "button4")
                            toolbar.button1.setSelected(false);
                            toolbar.button2.setSelected(false);
                            toolbar.button3.setSelected(false);
                         return;
         }And this is not working. Can you suggest the right way of doing this?
    Thanx a lot.

    public void actionPerformed(ActionEvent evt)
              if (evt.getActionCommand() == "button1") // index 0
                   Component tmp1 = object_toolbar.getComponentAtIndex(1);
                   JToggleButton tmp2 = (JToggleButton)tmp1;
                   tmp1.setSelected(false);
                         return;
         }is this correct way of doing this? doesnt seem to be working. please help :)

  • Mapping Issue. Parsing problem to target Fields based on condition.

    Hi All,
    File to Idoc scenario.
    My file looks like below.
    HD 89650 28/01/11 "Presciber tan"
    AF "disc-rsn"
    RK "007287001" A
    KE disc-code "007287"
    KE addr-num "001"
    DF fax-num ""
    DF in-out "I"
    DF phone-2 "23221"
    AF "drs"
    RK "007287" A
    KE dr-num "00221"
    KE addr-num "001"
    DF affil "OPSM"
    DF rec-stat "A"
    DF phone-2 "12444"
    AF "disc-rsn"
    RK "dr-addraddress-1 17287|1EN" A
    KE disc-code "008287"
    KE field-name "address-1"
    KE element " 1"
    DF in-out "I"
    DF phone-2 "1232"
    DF post-code "3109"
    DF provider-num "5349201J"
    DF rec-stat "A"
    T         24
    I need to capture and create target segments only for the values "AF "disc-rsn"".And pass all the relavant rows (RK,KE,DF...) which are under "AF "disc-rsn"" to the target fields.
    I'm struggling to parse the value to the output structure as RK,KE,DF will be present under anywhere like "AF drs", "AF disc-rsn" etc.
    I'm able to create the target segments (2 Zdisc segments as 2 "AF disc-rsn" present in the file), but unable to parse the field values to the target fields.
    Ex: DF phone-2 is present in 8th, 15th,22nd row. I need to pass only 8th and 22nd rows to the target fields.
    After content conversion, My Source XML looks like below.
    <?xml version="1.0" encoding="utf-8" ?>
    - <MT_DiscountDetails>
    - <HD>
      <KeyField>HD</KeyField>
      <HDRow>89650 28/01/11 "Presciber tan"</HDRow>
      </HD>
    - <AF>
      <KeyField>AF</KeyField>
      <AFRow>"disc-rsn"</AFRow>
      </AF>
    - <RK>
      <KeyField>RK</KeyField>
      <RKRow>"007287001" A</RKRow>
      </RK>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>disc-code "007287"</KERow>
      </KE>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>addr-num "001"</KERow>
      </KE>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>fax-num ""</DFRow>
      </DF>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>in-out "I"</DFRow>
      </DF>
    - <DF>
    Is there any way I can acheive my  mapping based on the above condition?? Kindly suggest me.
    Thank you for your time.
    Regards
    Deepthi

    Not required. Using Java function. Solved the issue.

  • Highlight few fields based of condition

    Hi Experts,
    I have to highlight few fields which are changed.
    Scenario is, i am reading materials from SAP & displaying it in a view in edit mode for change. On send it has an aproval process befor updating SAP database. The approver should be able to see what are the fields changes by highlighting them.
    Along with that it should display the old value in tooltip.
    Regards,
    Nik.

    Hi,
    First try to implement the change log for these attirbutes...and create the context attirbute as STRING and also for
    highlighitng you need to use the cell design property.
    when you get the change log for these get the old value from that structure and set the value to this context attribute.
    Bind this attirbute to the TOOLTIP property of the field and cell deisign respectively.
    You might have got some button for APPROVAL right....
    In this button handler,
    get the change log,
    set the attributes.
    Regards,
    Lekha.

  • Reporting: Change Color on Prompt fields

    I need to know if we can change color options for prompt fields?
    Thanks,
    Rick

    Regarding prompt feild no idea.
    We can change the colour of that data which comes after prompting parameter.
    I mean  you have created a parameter Country then you can change the colour of field based on parameter by writing formula.
    Right click on field-> Format field->Font tab->on color clik on X-2
    write formula if {?My parameter}="USA" then red
    Have a look to Sample reports:
    [Crystal Reportsample |https://boc.sdn.sap.com/crsamples]
    Hope that helps!!
    Regards,
    Shweta

  • Dynamically change the pattern of numeric field in adobe

    I am using a adobe form to display Sales order ouput.
    I have a requirement that for some kind of sales order the quantity field should be displayed with 2 decimal places and for some with 4 decimal places.
    So i have made the field in the form with display pattern = z,zzz,zzz,zz9.99
    and writing a FromCalc script as below.
    if ( z_mix eq "X" ) then
    Format ("z,zzz,zzz,zz9.9999", data.MainSubform.ItemTable.ItemGroup.Items.KWMENG.value)
    endif
    i also tried
    if ( z_mix eq "X" ) then
    data.MainSubform.ItemTable.ItemGroup.Items.KWMENG.format = "z,zzz,zzz,zz9.99"
    endif
    The problem is i am not able to understand what statement to be used to change the format of a numeric field.
    When i replace the second code with
    data.MainSubform.ItemTable.ItemGroup.Items.KWMENG.presence = "hidden"
    this functionality works. Which means i need to correct statement for pattern change of a numeric field.

    Or if somebody can provide me with alternative solution is also welcom.
    My requirement is a quanity field in the adobe form would be displaying either with 2 decimal place or 4 decimal place based on some condition.

  • Dynamically change the contents of one combo box based on the other

    Hi Forum,
    I have a question which might have a possibly simple answer. Well anyway help me out since i could not find the simple answer.
    I am building an application using Swing and binding with BC4J using JClient. My GUI has combo boxes, grids, editboxes. My requirement is that i should be able to dynamically change the contents of one combo box based on the selected item in trhe previous combo box. For example, when i choose a country in the "country combo box", the "states combo box" should show the list of the states of the selected country.
    Now how do i do this using binding. If not, how do i write custom querirs in BC4J layer and return a resultset to the remote application so theat i can populate the dependent combo boxes.
    I will appreciate if anyone can help me out in this regard.
    Thank You
    Sumit

    there could be quite a few number of ways of solving this problem.
    One way is through event handlers.
    taking your example as a model when user selects a country you could fire an action with a flag set to ture. A method will return the states from the DB or your temporary files or what ever and then the true flag will be used in the states combo box rendering.
    other way: javascript
    this might be a bit clumsy as you will need the states information in a property file and you can get the info as the user selects a country.
    regards,
    raj

  • Dynamically change the binding of a field

    Hi,
    I've been looking all over the internet for 2 days to find the answer to my question, but I couldn't get any information on my problem. Here's what i'm trying to do :
    Based on a checkbox in my form, I want to export or I don't want to export a field to a XML document.
    My checkbox is working properly and I got the Send button with the XML working too. I only need to find a way to dynamically change the binding property of my field. I've read some informations with the ".bind.match", but I can't seem to make it work.
    I'm using Windows XP, LiveCycle Designer ES2 v.9.0 and I have to run the form in Reader 8.0.
    Thanks alot for your help, it's greatly appreciated.
    Jonathan

    Hi,
    the binding cannot be changed at runtime.
    You can use the checkbox to delete the value of the field so the exported xml contains an empty tag.
    Or you try to delete the data node of the desired field in the data DOM (xfa.datasets).

  • Dynamically enable a field based on a selected table row

    Hi everyone.
    I'm getting really confused right now, please show me the right way. My approach may be, and probably is, wrong since I am self learning this and all I have is an ASP.NET background.
    I have a page with a table in it. I've created a DataControl for a collection I've made and mapped it to the table. I added a column that shows an "edit" button. On it's click, I open a popup that shows the selected row's data. Naviguation controls are also present on the popup.
    This is working fine.
    My problem comes in the popup. Each row has multiples fields. These fields, shown on the popup, need to dynamically be enable/disable. To toggle those field, the only way I can see right now is to have a function that takes into parameter the rowId and the fieldName. Based on those two fields, I can get the necessary information to know if I need to enable or disable the control.
    What I was aiming for, but then again I totally failed, was to have that function called on the "enabled" EL Expression, returning a Boolean.
    Now that this has been said, can someone guide my on how to dynamically enable/disable each field based on the selected row.
    Thanks !

    Above +
    why don't you create a bean method that returns a Boolean ans through EL Expression Builder select the method to this property.
    btw .. on which components are you setting this?
    Also,
    If there is business logic that prohibits to update this object unless that is met.. you can also do it as..
    In EOImpl .. override isAttributeUpdateable(int i) method eg:
    @Override
    public boolean isAttributeUpdateable(int i) {
    if(i == this.ENAME && "KING".equalsIgnoreCase(this.getEname())){
    return true;
    }else
    return super.isAttributeUpdateable(i);
    and then in UI for the component say
    ReadOnly = #{bindings.Ename.updateable}
    Or, In UI
    disable = #{ bindings.Ename.attributeValue == 'KING' & bindings.Mrg.attributeValue == null ? true : false}
    adf does provides many ways to do it ..
    Cheers, Amit

Maybe you are looking for

  • OIM 11g - How to get modified data on a reconciliation event

    Hi, We're running OIM 11.1.1.5.2 with Ad (9.1.1) , exchange ( 9.1.1.7), dbum (9.1.0.4) and dbat (9.1.0.5) connectors. When we run reconciliation we can get the recon data on the event management tab of the advanced administration console, but, update

  • Desktop in Trash involuntarily and I can't seem to get it back out.

    Erm ok... am not rightly sure what has just happened. I was unraring some files... I went to empty my trash... and then before I knew it... the files I was unraring were in my trash and I was getting the error message that some of my files were in us

  • Workflow task on UWL does not open in new window

    Hi, Some of the workflow tasks in my UWL do not open up in a new window when i click on them. I notice that these tasks are not even hyperlinked (underlined). Instead, when i click on the line, a small pop up shows to options: Forward and Resubmit. T

  • Import Error Message continually

    I recently updated with the Apple automatic updates. My Iphoto worked just fine until this update and this may simply be a coincidence but now when I try to import photos from my camera, I get an error message. Its the same camera, same hard drive sa

  • Need CD for Live! Wireless Cam

    Lost CD. New PC and new router, wireless Cam no longer connects, neither through wireless nor wired connection. Thank you for your help!