To hide a button in a column field depending on the condition in ALV

Hai,
I have a column in ALV with buttons.I need to make that button Visible or invisible based on a condition.
i have fiels with value x and blank.
if the value is x i need to make the button visible and viceversa.
Cheers,
Madhu.

Hi,
I assume when you say that you have a field with value X or blank that you have a internal table with one of the field as mentioned above and also a context node with
the same structure of the internal table so that you bind the internal table to the node
and display the same in ALV.
If my assumptions are right you must proceed as follows.
1.Create an internal table with the same structure that u had passed for ALV.Add one more column to that table with type wdui_visibility.
2.Create one more node with the structure of the internal table created above.
3.Move the coresssponding data from your old internal table to the new internal table.
4.For the new column of type wdui_visibility fill values by comparing the field with value X or blank.ie. IF value = X wdui_visibility_column-value = '02' .
                    IF value = blank wdui_visibility_column-value = '01' .
5.Save the changes in the new internal table.
6.Bind the new internal table to the new node.
7.Use the new node to display data in ALV.
8.Create an attribute "alv_table" of type "CL_SALV_WD_CONFIG_TABLE" in the view.
9.In the wd_init method add the following codes.
* create an instance of ALV component
  DATA:
    lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
* get ALV component
  DATA:
    lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
* set cell editor for input fields (~make colum Wt editable)
  DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lr_column type ref to CL_SALV_WD_COLUMN,
        lr_column_hdr type ref to CL_SALV_WD_COLUMN_HEADER,
        lr_button_1 TYPE REF TO cl_salv_wd_uie_button.
  lr_salv_wd_table_usage = wd_this->wd_cpuse_<Alv component usage name>( ).
  IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
    lr_salv_wd_table_usage->create_component( ).
  ENDIF.
  lr_salv_wd_table = wd_this->wd_cpifc_<Alv component usage name>( ).
  wd_this->alv_table = lr_salv_wd_table->get_model( ).
lr_column_settings ?= wd_this->alv_table.
lr_column = lr_column_settings->get_column( '<column name which you want to show
                  as button>' ).
CREATE OBJECT lr_button_1.
  lr_button_1->set_text( '<some releavnt text>' ).
  lr_button_1->SET_VISIBLE_FIELDNAME('<new column name of type
                     wdui_visibility>').
  lr_column->set_cell_editor( lr_button_1). 
Hope this helps.
Thanks,
G.Jayaprakash

Similar Messages

  • Autopopulating PER_ALL_ASSIGNMENTS_F column fields depending on Job Id.

    Hi,
    Currently the following fields are getting populated in assignment form depending on the Position name.
    1) Payroll
    2) Salary Basis
    3) Working Hours
    4) Frequency
    Now our client want to disable the position field. They want to store these information in Job DFF field. So going forward the above mentioned field need to be populated depending on the Job name in Core HR forms and Self Service pages. I have tried dynamic trigger and API hook. But none of them are working.
    Regards,
    Rakesh.

    Hi Sanjay,
    Thank you for the reply. But we are not looking for any trigger option. Because if we make such trigger on oracle seeded table then later on support from ORACLE would not be possible. Rather if we can do via form personalization then it would be better.
    So I tried it in the following way(form personalization). But it is not working. Please correct me if I am wrong at any steps. Right now I am trying to fetch a constant value after changing the job.
    Condition
    Trigger Event : WHEN-NEW-ITEM-INSTANCE
    Trigger Object : ASSGT.JOB_NAME
    Condition : :SYSTEM.RECORD_STATUS IN ('CHANGED')
    Actions
    Seq - 1
    Type - Property
    Object Type - Item
    Target object - ASSGT.NORMAL_HOURS
    Property Name - VALUE
    Value - 32.12
    But after this when I am changing job name it is not changing the normal hours.
    Regards,
    Rakesh.

  • Validation of column fields while entering values in editable ALV

    Hi,
    I am currently working on a ALV,I have to validate the editable field of ALV,while entering values.SO if there is a field Item number,the range should be between M01-M99,and user should not take any value other than the F4 help assigned to the field.Can all this calculation be done using a FM & Not OOPs process for making ALV.
    Please advice.
    Thanks.

    >
    p317980 wrote:
    > REF_TABNAME    LIKE DD03P-TABNAME,
    > Will the field just pick values from the F4 & not any random value entered by user?
    >>yes.
    > if these values entered at runtime need to be saved into a Ztable,will I have to use Classes for defining my ALV?
    >>write some code to check if the entry exists.. if not then update the Ztable..
    >>select single field from table. if sy-subrc eq 0. fine else. update ztable.if.

  • How to mask a particular field depending on the user for a protected pdf?

    Hi,
    I have a requirement of showing a particular fiels data to only one user and to hide that critical data to others. For example, suppose I have two users viz, Primary user and Secondary user. I have a field named UID in my protected pdf form which has some critical data. I want only my Primary user enter and view the information entered in the UID field. When the Secondary user opens the document using his credentials, he should not be able to view the data in the UID field. It should be displayed in astrix as in a password field. Can anyone help me how to acheive this for a protected document?
    Thanks and Regards,
    Maria Johni

    It is possible. You should be having a field in your XSD schema for the username. Bind the username to a hidden field in your form.
    In the designer, in form initialize event,
    write the code: if hiddenfield.rawValue == "person A"
                                 subform1.presence = "hidden";
                           if hiddenfield.rawValue == "person B"
                                 subform2.presence = "hidden";
                                 subform1.presence = "visible"   }
    In your process, when your moving from one step to other step, update the uname accordingly and the form will respond according to the username.
    Regards,
    Chaitany

  • Hide or show ratios in a query depend of the entry variable

    HI gurus,
    I wish hide or show rates depending if the user choose a entry variable. For example for 2008 dates take three ratios and for 2009 others.
    Thanks

    OK. WAD problem !
    Basically you need to use some HTML expertise to resolve this issue.
    Creat a new template with Radio button or a dropdown button which will contain the available values what user can select.
    something like as follows:
    o 2008
    o 2009
    Now this can be done using java script.
    You will have two different templates. One for 2008 query and second for 2009 query. Run them and get the URL of the reports.
    Then in the HTML on the "onSelect" event, put the URL.
    So if user selects the 2008, on the next page, you will see 2008 query and if they select 2009, then you will see 2009 query.
    - Danny
    Edited by: Danny Matt on Jul 10, 2009 3:08 PM

  • How to show the subtotal value of a field without showing the rows in ALV?

    Dear All,
    In my ALV I am showing the sub total value of a calculated field. But the requirement is, only the category and sub total value will be shown in the ALV not the all rows, i,e
    CATEGORY     VALUE
      Z01       186,000 (the subtotal value)
    Here, the rows whose values are calculated to 186,000 will not appear. Plz give some idea.
    With regards,
    Rosaline.

    Hi
    Using the fieldcatalog, you can achieve this.
             no_out(1)      type c,        " (O)blig.(X)no out
    use this in fieldcatelog. u can achieve this.
    All the best
    Edited by: Sudeesh Ravindran on Mar 23, 2011 9:22 AM

  • How do I populate form fields depending on the value of a list box?

    Hi,
    Can anybody help me out here?
    I'm creating a form where I'm needing to populate a number of fields (first name & last name) based on the value of a list box (values are 1,2,3,4,5,6) ie: if 3 is selected 3 sets of the first name and last name fields populate on the page for the user to fill out.
    At this stage it is just a prototype site and there is no database running behind it.
    Thanks
    Hayden

    This can only be solved if you have javascript coding skills.  Without knowing more about what you want to do and why, I can only show you a skeleton of how your code should look, but consider this form select field -
    <select onchange="populateForm()">
    When a value is selected from that list, the "onchange" event will fire, and will call the javascript function called populateForm().  You need to define a function by that name somewhere on the page -
    <script type="text/javascript">
    //<![CDATA[
    function populateForm(value) {
         if value >0 { document.getElementById("fieldID").style.display='block' }
         if value >1 { .... }
         etc.
    //]]>
    </script>
    The page itself would need to have ALL the fields already in the form, but with those that are to be revealed set to a style of display:none.
    Obviously, this is a skinny skeleton.  Each test in the function would reveal a new field on the page by changing its display style from "none" (which is how they should be set in the code) to "block".  You would need a separate function for each type of field that might need to be chosen.
    If this is well over your head, then I'm afraid you will be out of luck for this particular approach....

  • Populating a Field depending on the selection of a dropdownlist in adobe fo

    Hi,
    I am not able to populate a Text Field based on the selection of a dropdownlist in Adobe forms in WebDynPro.
    Pls let me know how to do it????
    Thanks in Advance,
    Sameer

    Hi Sameer,
    There is one way to achieve this.
    You can write some javascript on event of selecting value in dropdown.
    Open your PDF form.Then goto menu "palettes" and then choose "script editor".
    Now, select your dropdwon element.
    It will show some line of scripting in Javascript of Formcalc.
    Here, you can write your JAVA script for displaying values in textview.
    If it helps then don't forget to award points
    Regards,
    Bhavik

  • How to do readyonly field depending on some condition.

    Dear All,
    One seeded page in iProc having Table Region. That Table region having Item, Item Description, Quantity, Price, Amount etc....
    I need to do Quantity field as readonly for some Items only..
    Is it possible to do, if it is possible pls suggest how to do it..
    Thanks in Advance,
    Hanimi.

    1. Extend the underlying VO
    2. Create a transient attribute in the VO and set the value to true/false depending on yoru condition
    3. Use spel on the item(using personalization) to enable/disable the item based on the VO Attribute created.
    Refer to: http://oracle.anilpassi.com/spel-in-oa-framework-with-audio-visual-demo.html

  • How to have a button to reset a field and not the whole form?

    Hi,
    Can anyone help me with this dilemma please? All tutorials online demonstrates how to have a button to reset the whole form, but i only want the user to clear 1 field in the form.
    I have a form which has a field representing a persons name who has booked out a piece of equipment. I would like the administrator to be able to clear the field quickly without having to select the whole name and then delete it, ready to insert the name of another booker.
    Any help would be very much appreciated. (If it is using dreamweaver features than that is better.)
    Thank you!

    There's nothing in DW that will do this for you.
    This script from the internet seems to do the trick. Add this to the <head> section of your page...
    <script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
    <script type='text/javascript'>//<![CDATA[
    $(window).load(function(){
    function resetForm() {
      $(this.previousSibling).val(function() {
      return this.defaultValue;
    $( "input[type='button']" ).bind( "click", resetForm );
    });//]]> 
    </script>
    Then add your form in the <body>...
    <form>
      <label for="textfield1">Text Field:</label>
      <input type="text" name="textfield1" id="textfield1"><input type="button" value="reset" /><br />
      <label for="textfield2">Text Field:</label>
      <input type="text" name="textfield2" id="textfield2"><input type="button" value="reset" /><br />
      <label for="textfield3">Text Field:</label>
      <input type="text" name="textfield3" id="textfield3"><input type="button" value="reset" /><br />
      <label for="textfield4">Text Field:</label>
      <input type="text" name="textfield4" id="textfield4"><input type="button" value="reset" /><br />
    </form>
    EDIT: Ha! Same script as you found Nancy, posted originally at the exact same time too (I threw a couple modifications in)...
    Good times, good times.

  • How to make checkbox field inactive in the output of ALV report.

    Dear All,
    I am having one ALV report in whose output there are checkboxes against each record. Example: the output columns of my ALV report are:
    Checkbox, Sales Document No, Billing Document No.
    Now, my requirement is that if for the Sales Document No there exists any Billing Document No in the output then the Checkbox should be inactive but if the Billing document coloumn is empty for a particular Sales Document No then only the Checkbox field should become active.
    Kindly guide me on how to make this checkbox field inactive.
    Waiting for your reply.
    Warm Regards,
    N.Jain

    Hello,
    Follow the below steps:
    1.Define as--> GS_STATUS TYPE SLIS_STATUS,
    2.check layout check box fieldname is not initial.
          then set the status according to your logical conditions
          GS_STATUS-FLG_CHECKBOXES_ACTIVE = 'X'
    Hope this would help you.
    Let me know your feedback.
    Regards,
    Raju

  • Automatically update text field depending on the in select list value

    I have got 2 tables. Table A (Employee Personal Detail), Table B (Employee Academic detail). Employee no is common field between two tables).
    I have created interactive report with form on table b using in-built templates. I have added text box on form to display employee name which is stored in table A. I want to automatically display employee name depending upon value in employee no field on form. I know I can write query to get value in employee name field. It gives me error when employee no is blank. How to handle error?

    Sagar,
    For the employee name value to change according to the emp_no, your page needs to get submitted. can you use a select list with submit for emp_no? And then use the PL/SQL mentioned above to run on page submit?
    I'm not sure but I guess you can also achieve this in Ajax. May be someone expert in that could help.

  • Activate input for a field depending on the input in another field

    Hy gurus,
    A have a report with select option.
    In the select option I'd like to have the following:
    I have a checkbox ,if it is flagged the input for another field should be made possible.
    The problem is,to activate it right after I flag the checkbox (without having to press ENTER)
    Do you have suggestions?
    Thanks,Christian

    Hi Christian
    It's the same, check my sample in the last my answer.
    If you want to protect a SELECT-OPTION or more than one parameter it should use the group.
    SELECT-OPTIONS: S1 FOR SY-DATUM MODIF ID AAA,
                    S2 FOR SY-UNAME MODIF ID BBB
    PARAMETERS: p1  MODIF ID AAA,
                p2  MODIF ID BBB.
    PARAMETERS: p_ck AS CHECKBOX USER-COMMAND aaa.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_ck = 'X'.
          IF screen-group1 = 'AAA'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSE.
          IF screen-group1 = 'BBB'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Max

  • Help to extract the Column Name depending on the row values

    Hello All,
    I have a table with below format
    Table Name: Employees
    Emp Name Monday Tuesday Wednesday Thursday Friday Saturday
    John yes NULL yes yes NULL NULL
    Michael NULL yes NULL yes yes NULL
    Smith NULL yes yes NULL yes yes
    In the above I have explicitly mentioned NULL just for better understanding.
    I am trying to send an email using HTMLDB_MAIL.SEND which will have the body as following
    "John is absent on Tuesday, Friday and Saturday
    Michael is absent on Monday, Wednesday and Saturday
    Smith is absent on Monday and Thursday"
    I am trying to do this using cursor, fetching each row and matching the value with NULL. But I am not able to display the column name.
    Can somebody please help me?
    Regards,
    RS.
    Edited by: user8966924 on Jan 24, 2013 4:35 AM

    Hi,
    just use Peter's query, collect into a nested table the output and create one CLOB variable from collection to use it as a body:
    create or replace function getbodyemp
    return clob
    is
       p_body_out      clob;
       type tp_tbemp   is table of varchar2 (100);
       v_tbemp         tp_tbemp;
    begin
       -- collect the output into a nested table
       with employees as
       select 'John' Emp_Name    , 'yes' Monday, null  Tuesday, 'yes' Wednesday, 'yes' Thursday, null  Friday, null  Saturday from dual union all
       select 'Michael' Emp_Name , null  Monday, 'yes' Tuesday, null  Wednesday, 'yes' Thursday, 'yes' Friday, null  Saturday from dual union all
       select 'Smith' Emp_Name   , null  Monday, 'yes' Tuesday, 'yes' Wednesday, null  Thursday, 'yes' Friday, 'yes' Saturday from dual
       select
         e.emp_name || ' is absent on ' ||
         replace (trim( ',' from nvl2(monday,null, 'Monday')
         || nvl2(Tuesday,null, ',Tuesday')
         || nvl2(Wednesday,null, ',Wednesday')
         || nvl2(Thursday,null, ',Thursday')
         || nvl2(Friday,null, ',Friday')
         || nvl2(Saturday,null, ',Saturday')), ',', ', ') txt
       bulk collect into v_tbemp
       from
         employees e
       where
         monday          is null
         or tuesday      is null
         or wednesday    is null
         or thursday     is null
         or friday       is null
         or saturday     is null
       for i IN 1 .. v_tbemp.count
       loop
          p_body_out := p_body_out || v_tbemp(i) || chr(10);
       end loop;
       return p_body_out;
    end getbodyemp;
    select getbodyemp() from dual;
    GETBODYEMP()                                                                   
    John is absent on Tuesday, Friday, Saturday                                    
    Michael is absent on Monday, Wednesday, Saturday                               
    Smith is absent on Monday, Thursday                                            
    1 row selected.Regards.
    Al

  • How to create popup window with radio buttons and a input field

    Hi Guys,
    Can somebody give some directions to create a stand alone program to create a window popup with 2 radio button and an input field for getting text value. I need to update the text value in a custom table.
    I will call this stand alone program from an user exit. 
    Please give me the guidance how go about it or please give any tutorial you have.
    Thanks,
    Mini

    Hi,
    There are multiple aspects of your requirements. So let's take them one at a time.
    You can achieve it in the report program or you can use a combination of the both along.
    You can create a standalone report program using the ABAP Editor (SE38). In the report program you can call the SAP Module pool program by CALL Screen <screen number>. And then in the module pool program you an create a subscreen and can handle the window popup with 2 radio button and an input field for getting the text.
    For help - Module Pool programs you can search in ABAP Editor with DEMODYNPRO* and you will ge the entire demo code for all dialog related code.
    For Report and other Module pool help you can have a look at the following:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/a1ff9b8d0c0986e10000000a42189c/frameset.htm
    Hope this helps. Let me know if you need any more details.
    Thanks,
    Samantak.

Maybe you are looking for