ALV - Input enabling cells based on data in other cell

Hi,
I have a requirement,
- Where in there are 4 columns to be displayed in an ALV say <Material No>, <Bin>, <Quantity> (Input enabled) and <Bin Empty> (Conditional Input enabled and it is a Checkbox).
- Now I will be fetching all the Materials available in a particular Bin and display in the ALV.
- Now the User starts entering the Quantity in the <Quantity> column and my program should enable the cells in the <Bin Empty> column for the rows where ever the user has entered Quantity as '0', so that the user can check the Checkbox in the <Bin Empty> column.
Please let me know as to how this enabling/disabling of a cell alone can be done, coz as I know we can make a whole column Input enabled/disabled. Please help.
Thanks in advance.
Saleem A. Chikodi.

Hi saleem,
1.you need to add one extra field in the internal table.
   HANDLE_STYLE TYPE LVC_T_STYL
2. before calling the metho set_table_display...
write your own conditions , in my case i am checking for flag is 'X' or not..
LOOP AT IT_FINAL INTO LS_OUTTAB WHERE FLAG = 'X'.
    V_INDEX = SY-TABIX.
    LS_EDIT-FIELDNAME = 'FIELD1'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'FIELD2'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'FIELD5'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_FINAL INDEX V_INDEX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE.
  ENDLOOP.
3. psss the style name to layout
  GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
these are the steps...
thats all..
Vijay

Similar Messages

  • Drop down in alv based on data in other calumn of same row

    Hi Guys,
    I need to provide drop down in an ALV based on data in other calumn in same row.
    if i have two calumns country and region in my alv then drop down values for region should come depending upon country value.
    i went through lot of blogs and forum threads but none seems to solve my problem.
    I'm able to achieve this in Table but not in ALV. I'm using DropdownbyIndex Ui element.

    Hi Guys finally i am able to get my dropdown data visible.
    I am posting the code here so that others can make use of it.
    In your context node add an attribute type WDR_CONTEXT_ATTR_VALUE_LIST
    after getting data into your context node table fill the above attribute as shown in the below code
    LOOP AT lt_mara INTO ls_mara.
    clear: lv_indx.
    lv_indx = sy-tabix.
    clear ls_valueset.
    *refresh: lt_valueset.
    ls_valueset-value = ls_mara-mtart.
    ls_valueset-text = ls_mara-mtart.
    APPEND ls_valueset to ls_mara-valueset.
    clear ls_valueset.
    *ls_valueset-text = ls_mara-matnr.
    APPEND ls_valueset to ls_mara-valueset.
    *lr_element = lo_nd_mara->get_element( lv_indx ).
    *lr_child_node = lr_element->get_child_node( 'DDVALUE' ).
    *lr_child_node->bind_table( lt_valueset ).
    MODIFY lt_mara FROM ls_mara INDEX lv_indx.
    CLEAR ls_mara.
    ENDLOOP. lo_nd_mara->bind_table( lt_mara ).
    DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
    *---set data
    lo_interfacecontroller->set_data( r_node_data = lo_nd_mara ).
    DATA lv_value TYPE REF TO   cl_salv_wd_config_table.
      lv_value = lo_interfacecontroller->get_model(
    *----dropdown logic
    data: lr_col type ref to CL_SALV_WD_COLUMN,
          lr_ddn type ref to cl_salv_wd_uie_dropdown_by_idx.
    CALL METHOD lv_value->if_salv_wd_column_settings~get_column
      EXPORTING
        id     = 'MTART'
      receiving
        value  = lr_col
    *lr_ddn ?= lr_col->get_cell_editor( ).
    CREATE OBJECT lr_ddn
      EXPORTING
        selected_key_fieldname = 'MTART'
    CALL METHOD lr_ddn->set_valueset_fieldname
      EXPORTING
        value  = 'VALUESET'
    lr_ddn->set_selected_key_fieldname( value = 'MTART' ).
    CALL METHOD lr_ddn->set_type
      EXPORTING
        value  = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>type_key_value
    CALL METHOD lr_col->set_cell_editor
      EXPORTING
        value  = lr_ddn
    lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).
    Just follow the above code you will be able to achieve dropdown by index in your alv.

  • Changing Date in one cell based on text in another cell

    Is there a formula to change the date in a cell in one column to the date in another column on the same row based on the text in a third cell on the same row? For example, I want the date in G3 to change to the date in J3 when the text in H3 says Completed.

    Hi,
    My understanding is that if the value of H3 is "Completed", the G3 is changed the value of J3, is it correct? If yes, we can use If formula (=IF(H2="completed",J2)), please see the image below:
    If no, please share us a sample, we'd like to re-try it.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Run a formula if a cell contains particular data from various cells

    I have a formula which checks a list of domains to see what the TLD is and then returns a renewal price based on the TLD e.g. .co.uk may return with $5.99 and .com $10.00. The formula I am using is below:
    =VLOOKUP(RIGHT(A2,LEN(A2)−SEARCH(".",A2)+1),$A:$B,2,FALSE)
    I am now wanting to expand this formula to check additional criteria before running the above formula.
    I don't know what functions to use, but I know what I'm trying to achieve, so please, humour me when it comes to make believe syntax below:
    if a cell contains the data from a number of cells e.g. C$2:C$5 then run the above formula, if not return "N/A"

    Hi Ian,
    Thanks for your reply.
    I see exactly where you're going with this, but it's not exactly what I'm after.
    Perhaps I need to be a bit more clear in my explanation - my bad.
    Cell A2 has a domain name e.g. example.com, example.co.uk, example.org, example.net
    Cell B2 has a number of options to choose from e.g. Expire, Hosting, Backorder, Mapping
    Column D2:D5 have a number of TLDs e.g. co.uk, .com, .org, .net
    Column E2:E5 have the corresponding annual renewal prices for the TLDs listed in cells F2:F5
    Column F2:F5 have the options than can be chosen in column B2
    I only want to get the renewal price for the TLD where the option in Cell B2 is one of the options listed in cells F2:F5 and if it's not, I want it to return "N/A"

  • Conditional format of one cell based on contents of another cell

    Preparing list of appointments for visitors with time for each. There are four possible status categories for visitors based on projected activity and whether they have shown up or not. (A Group Scheduled, A Group Showed, B Group Scheduled, B Group Showed). I've created the calendar in iCal with different calendars, then accessed that through Bento iCal Events. Bento adds the column with name of calendar from iCal. Info is now in Numbers. (iWorks 09)
    It shows Title, Start Date, Location, Calendar. I'm adding more fields using Lookup in Numbers drawing on entire data base brought over from Bento. I'm trying to get what info I need, but none that I don't, so the form isn't too crowded and busy.
    I would like to be able to conditionally format the Time column based on the contents of the Calendar column. If successful, the color of the Time column would tell me all I need to know about visitor status, and I could hide the Calendar column and clean up the form.
    I hope I've described it adequately. Can this be done, and if so, how?
    Thanks! Have a great Thanksgiving!

    jpcranch wrote:
    Does it work to format two cells based on contents of one of them?
    Conditional formatting of a cell depends on the contents of that individual cell, compared with another value, so no.
    But you could use a two-table approach.
    In general terms, the technique is to:
    • make the original table's cell fill transparent,
    • Add a second table to the sheet,
    • Set the second table to copy the control values into a column of cells,
    • Select the cells in that column of Table 2,
    • Apply conditional formatting rules for each possible control value (see below)
    • Set the text opacity for these cells to 0 (full transparency),
    • Click on Table 2 in the sidebar, then use (shift and) the arrow keys to slide Table 2 behind Table 1 to align the highlighted cells with the cells to appear highlighted in Table 1.
    • Set the colour of the cell borders on table 2 to none.
    Using the information you gave regarding the calendar column, you'll need four rules for conditional formatting of this column. All are of the same format:
    Text contains: A Group Scheduled
    With the text changed to match each possible entry.
    Regards,
    Barry
    BTW: by changing the width of the formatted column on table 2, you can appear to highlight as many columns as you wish on Table 1.

  • Assigning a Numeric Value in a Cell Based on Text in Another Cell

    In advance, thanks for your assistance. I'm trying, in vain, to assign a numeric value in a cell based on text (from a dropdown menu) in another cell. For example, in cell A5 I have a dropdown list that includes the options "blue", "red", "white", and "gold." I want cell C15 to be 2 if A5="blue"; I want C15 to be 0 if A5="red"; I want C15 to be 2 if A5="white"; and, I want C15 to be 1 if A5="gold."

    Tippet,
    This is a job for LOOKUP.
    The expression for the Result cell is: =LOOKUP(A2, Lookup :: A1:A4, Lookup :: B1:B4)
    The aux. table contains the matches that you assign for the colors.
    Regards,
    Jerry

  • Does SSRS dynamically set the alignment of table cells based on the majority of cell types in the column???

    This is the first time I've run into this, but it appears that SSRS is setting the text-align based on the other cells in the column.  I have cells being set with either a dataset item of type System.Double or to "--" when Is Nothing evaluates
    to true.  I never noticed before that if the majority of the cells in the column are Nothing, then the few that aren't Nothing get aligned to the left along with all of the "--" text items.  And now I also see columns where the opposite
    is also happening, where if the majority of the cells in the column are numeric values, then everything is aligned right, even the few "--" items there.  I'm only using Default TextAlign and VerticalAlign, and no Indent, SpaceAfter or SpaceBefore,
    nor any concatenated text or embedded preserved spaces.
    Has anyone else in the SSRS universe seen this, and does anyone know why or have a good workaround for it?
    Thanks in advance : )

    Are you viewing the report in html format or are you looking in some other format like Excel,CSV etc?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to make a cell populate the same as other cells mac numbers

    does anyone know if theres a command where I can make a cell be the same value as another cell? so i change one cell and it populates the same in others. Thanks!

    Hi appleryan,
    =A1
    in any cell will bring the value of A1 into that cell.
    quinn

  • Conditional Formatting in one cell with a dates in another cell

    I have a simple spreadsheet that will gauge a project's progress.  I wish to have individual cells change color based on another cell.  I can't get the right syntax in order - groan
    E2 has today's date, =NOW()
    G2 (not started) would change from a color to no color when the start date, F27,  has arrived then
    H2 (started) would change to a color when the date is met, F27, (may be change color as the completed date arrives) then no color when the completed date arrives, F28.
    I2 (completed) would change to a color when the date is met, F28
    When the spread sheet is opened or if I need to change the dates in either of the cells the cells with color gauges will update.
    I am using conditional formating through the ribbon.
    Please help!

    Hi,
    Thank you for posting in the MSDN Forum.
    Since the issue is more relate to the end-user, I'd like to move it to Excel IT pro forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Seeking Pdf form help - javascript formula to auto-populate fields based on data from other fields.

    Hi there, I am new to PDF form work, and am wondering if someone could help me with a javascript formula.
    I want to auto-populate the EXPIRYDATE field, as the same date as the entered AUTHORIZATIONDATE field, but 4 years later.
    So, I want to be able to enter 11/14/2014 in the AUTHORIZATIONDATE date, and have 11/14/2018 auto populate in the EXPIRYDATE field.
    Seems simple I know, but I've messed around quite a bit and can't seem to make it work. Is this possible??
    Any help would be very much appreciated!!

    And what have you done?
    This can only be done with custom JavaScript programing.
    The value of date type fields are text field and not numeric data. The first task is to convert the dates to a number on some type of number sequence that is a mapping to dates.
    Have you looked at the Acrobat JavaScript API Reference, the MDN JavaScript reference?
    I would use the Acrobat JavaScript util.scand to covert the date string to the number of milliseconds from January 1, 1970 midnight. and then use the getFullYear method of the date object for the year value and add 4 years to that value and then use the setFullYear method to set the year for the date object. Now you can use the util.printd method to format the date object as a date string with a specific format.
    // get the date value, format of date string and years to add;
    var cDate = "11/14/2014"; // date value;
    var cFormat = "mm/dd/yyyy"; // date format;
    var nYears = 4; // years to add;
    // convert date string to date object;
    var oDate = util.scand(cFormat, cDate);
    if(oDate == null) {
    app.alert("Error converting " + cDate + " using format " + cFormat, 0, 1);
    // add years to date object;
    oDate.setFullYear(oDate.getFullYear() + nYears);
    // display result;
    var cExpireyDate = util.printd(cFormat, oDate);
    app.alert("Authorization Date: " + cDate + "." +
    "\nExpire Date: " + cExpireyDate, 3, 0);

  • Use check cells to enter data in another cell

    I'm creating a table that list my sales. I what the total to reflect money received not money invoiced. I thought i could just check a box and then the amount would be displayed.
    this is what am thinking in my head but it is not right:
    =SUM(R2,IF,U2="true")
    "true" meaning the check box is ticked
    Is this possible? if so how, or can you see another way.

    Reading *_iWork Formulas and Function User Guide_* is often useful when we want to write a formula.
    (1) why use SUM when a formula is designed to return the content of a single cell as the one which you wrote ?
    G2 contains :
    =IF(C2=TRUE,D2,"")
    is the correct syntax.
    (2) if you want to get a conditional sum of a range, the formula must apply to ranges, not to single cell.
    H2 contains :
    =SUMIF(C,TRUE,D)
    Yvan KOENIG (VALLAURIS, France) dimanche 5 décembre 2010 14:21:46

  • How do i count the number of times a cell has been referenced by other cells' formulae?

    Hello,
    I have a spreadsheet of recipes and ingredients that use checkboxes to let me know which recipes I can make based on the ingredients I have on-hand, using a formula like this one: =IF(AND('Spirits' :: A42,Mixers :: A18,Mixers :: A41,'Spirits' :: A25 ),Table 3 :: $A$2,Table 3 :: $A$3). If I've checked all of the boxes for ingredients that are required for any one of my recipes, the cell that the formula is in returns something like "YES"; otherwise, it returns a blank. It works well enough, but I'd like to include a cell next to each ingredient with a formula that will look through the hundreds of recipes, which all use a formula like the one above, and return a count of the number of times the ingredient's cell is referenced in those formulas. That way, I'll know which ingredients are the most commonly used in my eclectic collection of recipes. I thought something like =COUNTIF('Recipes' :: A2:A343, "=A2") would work, but it doesn't look at the cell references in the formulas, so no, it doesn't work. Any ideas? I'm using Numbers 2.3

    Hello
    There's no formula to inspect other formula in Numbers. So what you asked cannot be achived in such a way you described.
    A simple alternative method would be to build recipe-ingredient matrix as follows.
    E.g.
    Table definitions:
    Recipes
    A1    Recipe \ Ingredient
    A2    A
    A3    B
    A4    C
    A5    D
    A6    E
    A7    F
    A8    # recipes / ingredient
    B1    X1
    B2    TRUE
    B3    FALSE
    B4    TRUE
    B5    FALSE
    B6    TRUE
    B7    FALSE
    B8    =COUNTIF(B,TRUE)
    C1    X2
    C2    TRUE
    C3    TRUE
    C4    FALSE
    C5    TRUE
    C6    TRUE
    C7    TRUE
    C8    =COUNTIF(C,TRUE)
    D1    X3
    D2    FALSE
    D3    TRUE
    D4    FALSE
    D5    TRUE
    D6    FALSE
    D7    TRUE
    D8    =COUNTIF(D,TRUE)
    E1    X4
    E2    FALSE
    E3    FALSE
    E4    FALSE
    E5    FALSE
    E6    FALSE
    E7    TRUE
    E8    =COUNTIF(E,TRUE)
    F1    Y1
    F2    TRUE
    F3    FALSE
    F4    TRUE
    F5    TRUE
    F6    TRUE
    F7    FALSE
    F8    =COUNTIF(F,TRUE)
    G1    Y2
    G2    FALSE
    G3    TRUE
    G4    TRUE
    G5    FALSE
    G6    FALSE
    G7    TRUE
    G8    =COUNTIF(G,TRUE)
    H1    Y3
    H2    TRUE
    H3    TRUE
    H4    FALSE
    H5    TRUE
    H6    TRUE
    H7    FALSE
    H8    =COUNTIF(H,TRUE)
    I1    Y4
    I2    FALSE
    I3    FALSE
    I4    FALSE
    I5    FALSE
    I6    FALSE
    I7    TRUE
    I8    =COUNTIF(I,TRUE)
    J1    in-stock?
    J2    =SUMIF(B2:E2,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F2:I2,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B2:I2,TRUE)
    J3    =SUMIF(B3:E3,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F3:I3,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B3:I3,TRUE)
    J4    =SUMIF(B4:E4,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F4:I4,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B4:I4,TRUE)
    J5    =SUMIF(B5:E5,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F5:I5,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B5:I5,TRUE)
    J6    =SUMIF(B6:E6,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F6:I6,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B6:I6,TRUE)
    J7    =SUMIF(B7:E7,TRUE,TRANSPOSE(X::$C$2:$C$5))+SUMIF(F7:I7,TRUE,TRANSPOSE(Y::$C$2:$C$5))=COUNTIF(B7:I7,TRUE)
    J8   
    X
    A1    Ingredient
    A2    X1
    A3    X2
    A4    X3
    A5    X4
    B1    in-stock?
    B2    TRUE
    B3    TRUE
    B4    TRUE
    B5    FALSE
    C1    code
    C2    =IF(B2,1,0)
    C3    =IF(B3,1,0)
    C4    =IF(B4,1,0)
    C5    =IF(B5,1,0)
    Y
    A1    Ingredient
    A2    Y1
    A3    Y2
    A4    Y3
    A5    Y4
    B1    in-stock?
    B2    TRUE
    B3    FALSE
    B4    TRUE
    B5    FALSE
    C1    code
    C2    =IF(B2,1,0)
    C3    =IF(B3,1,0)
    C4    =IF(B4,1,0)
    C5    =IF(B5,1,0)
    In "Recipe" table, the first row is header row and the last row is footer row.
    Hope this may help,
    H

  • Table Control - Input Enabling/Diabling of Rows based on Condition.

    Hi,
    In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can you please provide me a suitable solution for this?
    Appreciate Your Help.
    Thanks,
    Kannan

    Hi Kannan...
    If we are talking about "Rows"...
    then identify based on some conditions the row numbers and in PBO...loop at screen with screen name..set thier input properties and modify screen (make them input only)
    If we are taking into consideration "columns"
    There is an internal structure COLS where we can identify column number of screen name ...or we can take except for one particular column..
    if some condition satisfied....
    loop at screen where screen-name <> "Column which is input'.
    Loop at screen...and make other columns display only.
    modify screen
    endif.
    Regards
    Byju

  • How to create an input enabled query with Integrated Planning

    Hello experts. I have created an aggregation level in IP and I am trying to create an input enabled query based on this aggregation level.  My problem is in the properties.  On the query properties planning tab the Start query in change mode is grayed out and I am unable to select it.  Also on all the chararteristic properties on the planning tab, the planning settings are all grayed out as well and the No budgeting is selected.  There is a red exclamation here that says 'function not supported by server'  Any ideas?  Points will be awarded.
    Peter

    hi,
    go through this help for the procedure...
    [http://help.sap.com/saphelp_nw04s/helpdata/en/43/1d023a41130bd5e10000000a422035/frameset.htm]
    hope it helps...

  • Transport  Ztable data to other server

    Hi,
    Could anyone let me know how to transport the ztable entries from one server to the other.

    Instead of Transporting the whole ztable you can access the ztable from other server.. you can do this below way...
    U need to use Client Specified option,....
    then u can use mandt field in where clause..
    When u use it , in select staement u can use mandt field in where clause..
    DELETE [FROM] (<name>) [CLIENT SPECIFIED] <lines>.
    where the field <name> contains the name of a database table defined in the ABAP Dictionary.
    You can use the CLIENT SPECIFIED addition to disable automatic client handling.
    It enables us to process data form other than the current client also ..
    Normally in database for spfli table the data will be stored for all the clients..
    But when u want to select data from database for spfli generally onli the data under the current client will be retrieved... But table in database contains data for all the cllients.
    Try executing these codes u will come to know & compare the results..
    800 is my current client...
    data t_spfli type standard table of spfli with header line.
    select *
    from spfli client specified
    into table t_spfli
    where mandt = '100'.
    loop at t_spfli.
    write : / t_spfli-carrid, t_spfli-connid.
    endloop.
    data t_spfli type standard table of spfli with header line.
    select *
    from spfli client specified
    into table t_spfli
    where mandt ne '800'.
    loop at t_spfli.
    write : / t_spfli-carrid, t_spfli-connid.
    endloop.
    reward if it helps u,,,
    Regards,
    Jayant

Maybe you are looking for