Changing field lable (header) in Table control.

Hi all,
        I am currently working on a table control. The requirement is to change the label in the column heading dynamically based on few conditions. Could any one please help me in finding out a way for changing the heading labels dynamically.
Example stated below.
Totally 4 columns in table control.
|  Value      |  Description      |  Tag 1 (should be dynamic)  |  Tag2 (should be dynamic)*                        -
|   1            |   Hai                | 2121212                             | 212122222
|   2            |   welcome        | 43424234                           | 234234444324
Many Thanks in Advance.
Shiv

Hi Neha,
            Many thanks for your reply. The document you have sent is really a good one, but it do not throw much light on changing the column header text (label). If you could provide me some more info on changing the label that should be of great help to me.
Thank you.
Hi Tharani,
            Many thanks for your reply. The link you have attached is a good one, but it has no information on changing the label on a module pool screen. It details only about SAP forms.
Thank you.
Hi Ramchander,
            Many thanks for your reply. I have already tried it that way and it dint work out. The screen looping is possible for only for changing the contents of an output fields on a module pool screen, but not for table control column header.
Thank you.
Could you all please throw me some more light on this issue.
Regards,
Shiv

Similar Messages

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.

    Hi all
      In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.
    Thanks & Regards,
    Rajib.

    Isn't that just exactly what transaction CO02 does? CO01 is for creating production orders so what sense does it make to have it display mode only?
    Maybe your goal is to stop then end user changing the component assignment that is automatically  detected by the system. If so, personally I think a better starting point would be PP configuration or user authorizations rather than looking to change the screen by whatever method. As we don't know what you are trying to achieve it's hard to offer much more advice maybe all you need is to change transaction to CO02

  • Changing field lable of KVGR1 data element.

    Hi Guys,
                  I am changing field lable of KVGR1 data element. No. of depedent objects are also changed but some of the objects were end up with warning "Enahancement category for table missing". Since all this objects SAP Standard do I have to genarate key for every single one with warning to adjust the enhancement type.
    Cheers
    S Kumar

    Hi Amit,
                I have already changed the Field labels and Description of KVGR1 data element using SSCR key.
    Is it a good idea to revert it back. The dependent tables and structures are activated with warnings. Which is Enhancement category.
    Cheers
    S Kumar

  • Column Header In Table Control

    Hi all,
    how to mentain the column header in table control,
    in case of manually table control( not with wizard).
    Thanks.

    Hi,
    First just drag and drop all the fields that are to be a part of the table control. Then drag the label on the column header. Give name and text to the label.
    Regards,
    Nikhil

  • Problem in changing(updating) the data in table control

    Dear ABAP Experts,
    I have a screen with 2 tables fields. 1st table(ZESTHEADER) fields are normal fields in the screen.
    2 nd table fileds(ZESTDETAILS) are table control fields in the same screen .
    Now i can update the 1st table fields(ZESTHEADER) succesfully But 2 nd table fields(ZESTDETAILS) are not at all updating. please review the below code and let me knwo where iam wrong.
    FLOW LOGIC:
    PROCESS BEFORE OUTPUT.
    loop at itab1 with control VCONTROL CURSOR VCONTROL-CURRENT_LINE.
    MODULE STATUS_0100.
    endloop.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    loop at itab1.
    endloop.
    module mod1.
    module user_exit.
    CODE:
    PROGRAM  ZEST_HEADER2 message-id ymsg.
    tables: zestheader,zestdetails.
    data: itab like zestheader occurs 0 with header line.
    data: itab1 like zestdetails occurs 0 with header line.
    controls: vcontrol type tableview using screen '100'.
    MODULE USER_COMMAND_0100 INPUT.
    case sy-ucomm.
        when 'ENTR'.
        refresh itab.
          select * from ZESTHEADER INTO ITAB where ESTMATE_NBR = ZESTHEADER-ESTMATE_NBR.
            append itab.
          endselect.
          if itab is not initial.
          refresh itab1.
          SELECT * FROM ZESTDETAILS INTO table ITAB1 for all entries in itab wHERE ESTMATE_NBR = itab-ESTMATE_NBR.
    select * from zestdetails INTO ITAB1 where ESTMATE_NBR = itab-ESTMATE_NBR.
            append itab1.
         endselect.
          endif.
        when 'UPDA'.
          move zestheader to itab.
          append itab.
         update zestheader from table itab.
          move-corresponding zestdetails to itab1.
         update zestdetails from table itab1.
    append itab1.
          if sy-subrc eq 0.
            message s002(ymsg).
          else.
            message e003(ymsg).
          endif.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'ZESTCHNG'.
      SET TITLEBAR 'ZESTCHNG2'.
      MOVE-CORRESPONDING ITAB TO ZESTHEADER.
      MOVE-CORRESPONDING ITAB1 TO ZESTDETAILS.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE User_exit INPUT.
      case sy-ucomm.
        when 'EXIT'.
          leave program.
      endcase.
    ENDMODULE.                 " User_exit  INPUT
    *&      Module  mod1  INPUT
          text
    MODULE mod1 INPUT.
    ENDMODULE.                 " mod1  INPUT

    Hi Ramesh,
      For performance : Change  the code.
    1.   select * from ZESTHEADER INTO table ITAB
          where ESTMATE_NBR = ZESTHEADER-ESTMATE_NBR.
    2. if itab is not initial.
          refresh itab1.
             SELECT * FROM ZESTDETAILS INTO table ITAB1
              for all entries in itab wHERE ESTMATE_NBR = itab-ESTMATE_NBR.
          append itab1.  No need of append itab1 here.
    3.This part i am not able to under stand.
        when 'UPDA'.
            move zestheader to itab.
              append itab.
    Above code by writing move zestheader to itab" how data will move  from database table"
    ***In below code without loop how you are moving data to internal table itab1.
                update zestheader from table itab.
                 move-corresponding zestdetails to itab1.
              update zestdetails from table itab1.
               append itab1.
    if sy-subrc eq 0.
    message s002(ymsg).
    else.
    message e003(ymsg).
    endif.
    I think you have not pasted full code

  • How to define Column Header text table control

    Hi All,
    I have to create a function in which user will pass Field Name, Field Description.
    I have to show that field description in Table Control Columns as Text for columns.
    Like if a user pass Material , PLant etc, then first column header text will be Material and so on and in rows it will show the data.
    One more thing, is it possible to define the technical attributes like length based on field passed through function.
    Please help me to find out the solution.
    Thanks
    Piyush Mathur

    Hi Piyush,
    here are the some components of the screen . you can change tehm at run time in your code.
    components: name,input,output,required,length,active,invisible,intensified,group1,group2...etc.
    at ruin time you modify these attributes..
    your requirement is to change the name attribute.
    regards,
    sateesh

  • Transfering multiple fields from help in table control

    Hi everyone.
    I have a table control in a dynpro.
    The table control has many fields: x, y, z ...
    I have a module in PROCESS ON VALUE REQUEST for a field "x".
    The module calls a function to search values for field "x" and for field "y".
    How can I transfer the value of field "y" to the screen?
    I know that I can use the function DYNP_VALUES_UPDATE but it updates the field "y" in the wrong position of the table.
    Thanks so much for your help.

    Hi Sara
    It seems you are a new member; welcome to SDN forums. According to SDN customs, you can assign points to posts to thank people. You can do this by clicking the yellow star icon at header of each post. You can assign;
    - one 10 points (solved)
    - two 6 points (very helpful answer)
    - many 2 points (helpful answer)
    Kind regards...
    *--Serdar

  • Variable column header in table control

    Hi all, I need a variable column header text in table control. I am doing the following but is not working,
    I have deleted the header field that the wizard created me thorugh a internal table, and put a I/O field instead.
    I have assigned a variable in the name of this field.
    In the PBO I am writing the following:
      LOOP AT   i_details
           WITH CONTROL tc_detail
           CURSOR tc_detail-current_line.
        MODULE m_modify.
      ENDLOOP.
    MODULE m_modify OUTPUT.
      IF tc_detail-current_line EQ '1'.
        var1(header column text) = 'text1'.
        var2(header column text) = 'text2'.
      ENDIF.
    ENDMODULE.
    But with this is not working, the rare thing is that the first time that the screen is shown, this value is not appearing. After press Enter or some action, the value appears.
    I am not doing anything in PAI. The only code that is in PAI is:
    Loop at i_details.
    endloop.
    Nothing more.

    Hi,
    First just drag and drop all the fields that are to be a part of the table control. Then drag the label on the column header. Give name and text to the label.
    Regards,
    Nikhil

  • Dynamic Column Heading in Table Control

    Hi
    I have a table Control which needs dynamic heading for the first column. So i dragged a label and placed it on the Column 1 header. I gave the corresponding declaration and assignment in TOP include for that screen field. I also tried assigning values in the PBO of the screen also. I even tried replacing the Label with an I/O field. It is not allowing.
    Nothing is working. Any suggestions.

    Instead of the text field for your column heading, put an input/output field there, and specify the field for output only. Then assign the field with the header that you want on your PBO.

  • Error while trying to change the Column description in Table Control

    Hi,
    I have created a table control using the wizard in Module Pool.
    When i try to change the column description of the table control or adjust any other element which is already available on the screen and not in table control. It gives me an error
    Unable to transfer data. End Program?
    Any help would be appreciated.
    Thanks
    Sarves S V K

    Hi.,
    Check these  [Table Control Change Column Description|Add new columns in table control in custom screen program;
    and  [Add Columns in Table Control|Re: Table control columns]
    else  delete and create Table control Again..!!
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Error when displaying a field on Screen with Table Control

    Hi,
    It is going to 'Dump' when I am trying to display data on the screen with the help of Table Control. From the dump, What I have observed is , there is a field 'ZTSV_FSRDATA-ANZFEHLER'. If this field has negative value, then it is going to 'Dump' saying that the length is not enough. If it has a positive value then it is working fine. But the type of the field in the Internal table & on the screen are same.
    Please help me to resolve this error.
    I am posting here the Dump message also:
    A conversion error occurred while the program was trying todisplay data on the screen.
    The ABAP output field and the screen field may not have the same format.
    Some field types require more characters on the screen thanin the ABAP program. For example, a date field on a screen needstwo characters more than it would in the program. When attempting to display the date on the screen, an error will occur that triggers the error message.
    Thanks,
    Sreenivas Reddy Maddi.

    Hi Sreenivas,
       Refer this thread:
    how to display negative values in a screen field of a screen
    Re: negative values not allowed
    Regards,
    Sampath

  • Read and display the field values in the table control

    Hi Experts,
    I am new to the Table Control. I have created table control using the wizard where i have mentioned the ztable while creating which consist of the following fields.
    Item Number
    Material number
    Material Description
    Net Price.
    I would like to retrieve the material description, Order quantity and Netprice based on the selection of the material number from the table control field.
    Thanks in advance.
    Sunil Kumar.

    Hi,
    Try to implicate the following code to your requirement..
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
      LOOP AT itab INTO wa_itab.
       CHAIN.
        FIELD wa_itab-item.
        FIELD wa_itab-material MODULE fetch_desc_price ON CHAIN-REQUEST.
        FIELD wa_itab-mat_desc.
        FIELD wa_itab-price.
       ENDCHAIN
        MODULE modify_itab.
      ENDLOOP.
    Inside the module.
    MODULE fetch_desc_price INPUT.
    SELECT maktx FROM makt INTO itab-mat_desc
    WHERE matnr = itab-material.
    SELECT STPRS or resp fld from MBEW
    INTO itab-price WHERE matnr = itab-material.
    ENDMODULE.
    MODULE modify_itab INPUT.
    MODIFY itab from wa_itab INDEX <table control name>-CURRENT_LINE.
    ENDMODULE.

  • Change field value in standard table

    Hello Experts,
    Could you please guide me to change i.e update field CESS value in standard table j_1irg23d.
    Thanks and regards,
    Sirisha

    Hi sirisha,
    if you want to change the value in the CESS field of j_1irg23d table. ( sales tax )
    since it is a standard table dont try to do it using update ot modify statsments.. standard tables are updated using standard transaction and it is not advicable to change using abap statments..
    just try to find a bapi or field module to update that field in the j_1irg23d table.
    1) To find a bapi or function module just do a whereused list on the table name you may get some fms or bapi
    2) check the forum you may get some links on it..
    Regards
    Satish Boguda

  • How to change the colums of a table control scrollable?

    Hi Guys,
    I have one table control in my webdynpro component. Datais are filling to the table dynamically . Fields also may vary depending on the requirement.if some 20 or 30 fields are filling into my table in the run time, then i need to scroll the fields. Each field should be scrollable. Using which property of the table i can achieve this.??
    Can u people help me in this.
    Thanks
    Subin

    Hi
    Thanks for ur reply. Actually i am using this table control for search help. the same table control is using for the all search helps. if some 20 fields are there in th search result all the fields it is showing in my table control. eg. one costcentre field is there in my resultin table control. But it s showing only 'costcen' instead of 'costcentre.' It is not showin the resulting costcentre value also fully. for this i need to scroll the particular field alone for seeing the full value. This is my requirement.
    If i am  giving scrllable col count as 1 it is showing only one field. this is not wt i ws expecting.
    Please try to give me a solution.
    Thanks
    Subin

Maybe you are looking for