Add hidden fields in ALV

Hi all,
   I wanna add a new field in ALV field catalog, so that when user choose function Change Layout to decide which fields are showed, they can choose the new field.
In orginal source, the ALV uses field catalog from structure<b> LIPOV.</b> And the field I wanna add is just a normal text field (char15, for example) and its data will be extracted from a select statement.
So, Here is the logic of report:
data: ls_fieldcat type slis_fieldcat_alv.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_internal_tabname     = 'itab_data1'
          i_structure_name       = 'LIPOV'
          i_client_never_display = 'X'
        changing
          ct_fieldcat            = ct_fieldcat[]
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
After this call, i add new field
    ls_fieldcat-col_pos = 110. " above function will retrieve a field catalog with 109 records
    ls_fieldcat-fieldname = 'new_text_field'.
    ls_fieldcat-tabname = 'itab_data1'.
    ls_fieldcat-seltext_l = 'NEW'.
    ls_fieldcat-no_out = 'X'.
    APPEND ls_fieldcat to ct_fieldcat .
    clear ls_fieldcat.
Here, I copy all data from<b> itab_data</b> to <b>itab_data1</b>
Display:
   call function 'REUSE_ALV_LIST_DISPLAY'
      exporting
        i_buffer_active          = 'X'
        i_callback_pf_status_set = gf_status
        i_callback_user_command  = gf_user_command
        i_structure_name         = 'LIPOV'
        is_layout                = gs_layout
        it_fieldcat              = ct_fieldcat
        it_events                = lt_events             
        it_sort                  = gt_sort
        is_variant               = gs_variant
      tables
        t_outtab                 = <b>itab_data1</b>
      exceptions
        program_error            = 1
        others                   = 2.
Please note that there are something special here:
Originally, ALV displayed with internal table itab_data.
The new filed is a part of internal table itab_data1.
<b>And the problem is:</b>
  When I choose Change Layour (Ctrl F8) to select the new field to display, It does not appear in HIDDEN FIELD.
Any suggestion, plz.
Thank you very much.

Clemens Li,
Thanks for your advice.
I have a new problem. Now, the new field appears in Selection. However, displaying the new  field is impossible. My problem is:
- In default, 8 fields will display. Then, I use CHANGE LAYOUT to choose the new field which will be at 9th position. -> <b>I got a dump</b>... It informs that a Field Symbol is not assigned.
- Now, with the 8 fields above, I replace 8th position by the new field => It does not give me a dump but New field shows value of 8th field. I mean, if at first, 8th field is Quantity with value 10. Then I replace 8th field by my new field. When displaying again, it also gets 10 as its value.
- It is so strange. Because in function 'REUSE_ALV_LIST_DISPLAY', I used itab_data1, which consists of all field of itab_data and an addition field (NEW). I dont know why it does not show value of the new field while all old fields have right values. (before using that function, I copied all contents of itab_data to itab_data1)
So, everybody can help me this? Thanks

Similar Messages

  • Add extra field in alv

    Hi experts,
    i want to add extra field in alv that is totalprice
    the total price = qunatity * price
    already quantity and price from data base tables
    but the field total price is not from any table..
    thanks advans

    Hi,
    Quantity and Price both are ddic fields.
    Define the TOTAL PRICE of the type Price in the final internal table(table to b displayed).
    before passing the data / in looping define the logic...
    LOOP AT T_SOURCE.
    T_FINAL-PRICE = T_SOURCE-PRICE.
    T_FINAL-TOL_PRICE = T_FINAL-QTY x T_FINAL-PRICE
    ENDLOOP.
    Now all the required values are in the final table.
    Reward if helpful.
    Thanks.

  • Hidden field in ALV

    Hi ,
    I need to know which all fields are hidden in the ALV in background (as the user will enter the layout) ...i have used REUSE_ALV_LIST_LAYOUT_INFO_SET but this doesn't work in the background..
    Regards
    Gunjan

    hi
    good
    i dont think there is any such function module to solve your problem..
    thanks
    mrutyun^

  • Hiding fields in ALV report

    Hi all
    In ALV Report .The user must be able to adapt the result list (add hidden fields, remove columns) and save the layout as layout. The user must be able to select this layout when executing the selection.
      the user must hide the fields and can diplay when ever he needs in ALV report

    U have to use no_out = 'X'.
    fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-no_out   = 'X'.
      fieldcatalog-key         = 'X'.
    gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
                it_events               = gt_events 
                is_print                = gd_prntparams
    <b>            i_save                  = 'X'</b>
                is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

  • Adding custom fields to ALV of Delivery View of ME2M Report

    Dear all,
    I want to copy ME2M and create a new report and add 2 fields to ALV fetching it from Z-Table.
    I am not able to make out how the Field Catlog is built and How values are passed to ALV from IT. The complete code is complex OO ABAP and we have imported EHP4 now.
    Could you please help me in identifying the place to change as per my requirement ?
    I have Identified the below.
    Main Progarm SAPLMEREP
    ALV is called in LMEREPI04
    But i dont know hot field catlog is built and values are passed.
    Please help
    Thanks,
    Kausthub
    Edited by: Kausthub Krish on Oct 22, 2011 8:38 PM

    Really?.. Could you help me? pleaseee. I'm looking for a user exit o some enhancement to add one field
    of EKKO table.

  • Very Strange Problem... Missing hidden field when deployed on JBOSS

    This problem is driving me nuts. Here it is... When I deploy my app to TomCat it works fine. When I deploy to JBoss everything works except the links . When I select a link rendered via JBoss the directory containing the JSP is displayed. I can also see that my filters are not being called in this case. I compared the HTML produced by TomCat to the HTML produced by JBoss and there was one minor difference. This hidden field was not rendered in JBoss:
    <input type="hidden" name="contentView:contentForm:_idcl" />When I manually include this in the JSP and run JBoss.. It works.
    I have spent a full day trying to figure out when the hidden field is not being rendered when deployed to JBoss... I would very much appreciate any suggestions.. Thanks in advance. Paul
    Here is a bigger snippit:
    <tags:layout
        heading = "/banner.jsp" 
        menu    = "/mainmenu.jsp">
         <f:subview id="contentView">
              <f:loadBundle basename="com.dygtig.bundles.labels" var="labels" />
         <h:messages layout="table" tooltip="Please review errors and resubmit."
                     fatalClass = "msgFatalText"
                     errorClass = "msgErrorText"
                     warnClass  = "msgWarnText"
                     infoClass  = "msgInfoText"/>
              <h:form id="contentForm" style="display:inline">
                   <f:verbatim><CENTER></f:verbatim>
                   <h:outputText value="Aircraft Types" styleClass="pageTitle"/>
                   <f:verbatim><br><br></f:verbatim>
                   <h:dataTable value       = "#{aCTypeListView.acTypes}"
                                var          = "ac"
                                first        = "0"
                                rows         = "15"
                                columnClasses= ""
                                styleClass   = "normaltable"
                                width        = "500px" title="Aircraft List"
                                rowClasses   = "normaltabletext1,normaltabletext2"
                                id           = "AircraftTable">
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Action"/>
                        </f:facet>
                        <h:commandLink action="#{aCTypeListView.updateActype}">
                             <f:param name="acId" value="#{ac.id}"></f:param>
                             <h:outputText value="Upd" styleClass="commandLink"/>
                        </h:commandLink>
                        <h:outputText value=" "></h:outputText>
                        <h:commandLink action="#{aCTypeListView.deleteActype}" >
                             <f:param name="acId" value="#{ac.id}"></f:param>
                             <h:outputText value="Del" styleClass="commandLink"/>
                        </h:commandLink>
                     </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Type-Suffix"/>
                        </f:facet>
                        <h:outputText value="#{ac.typeSuffixText}"/>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Model"/>
                        </f:facet>
                        <h:outputText value="#{ac.model}"/>
                   </h:column>
                   </h:dataTable>
                   <dygtig:tablescroller tables="AircraftTable" />
                   <br>
                   <h:commandLink action="#{aCTypeListView.createActype}">
                        <h:outputText value="Create New Aircraft Type" styleClass="link"/>
                   </h:commandLink>
                   <br>
                   </CENTER>
                   <br>
                   <! manually add hidden field here>          </h:form>
         </f:subview>
    </tags:layout>

    Hi Paul,
    I have the same problem under deployment to WAS, all <h:commandLink>s are out of order. The hidden form field '...:_idcl' is missing in the generated JSP, but will be generated under Tomcat.
    Have you found a solution?
    Cheers, Ralf.

  • How to add a search help for a field in alv?

    HI!Everyone ,
    i want to add a search help created by myself for one field in alv,
    and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
    can anyone help me ?
    thanks!

    HI,Vijay.
    My code like this :
          PERFORM build_fcat.
          PERFORM build_objects.
          PERFORM layo_build.
          PERFORM set_drdn_table .
          CALL METHOD alv_grid->set_table_for_first_display
            EXPORTING
             i_structure_name = 'STU_S'
              is_layout        = s_layo
            CHANGING
              it_outtab        = itab_out
            it_fieldcatalog  = i_fcat
            ."Period
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    for example, there is a field 'UNAME' IN Structure 'STU_S',
    i want to add a search help for 'UNAME'.
    the 'UNAME'  is not users in SAP R/3 , i want to add some data by myself or from a table .

  • Add List box for one field in ALV GRID

    Hi All,
      I need to add drop down list box for one field in ALV Grid.
      If any body knows, please help.
    Thanks in advance.
    Regards
    Manglesh

    Hi,
    Here is the ex where i have used for date parameter in the sel screen
    type-pools: vrm.
    data: name type vrm_id,
          list type vrm_values,
          value like line of list.
    parameters :    p_date like p_date2
                                  as listbox visible length 15.
    at selection-screen output.
      name = 'P_DATE'.
      value-key = '1'.
      value-text = 'Today'.
      append value to list.
      value-key = '2'.
      value-text = 'Last 7 days'.
      append value to list.
      value-key = '3'.
      value-text = 'Last 30 days'.
      append value to list.
      value-key = '4'.
      value-text = 'Last 90 days'.
      append value to list.
      value-key = '5'.
      value-text = 'Last year'.
      append value to list.
    Call the ''VRM_SET_VALUES' to display the values in Listbox
      call function 'VRM_SET_VALUES'
        exporting
          id     = name
          values = list.
    at selection-screen.
      if sy-ucomm = 'CLI1'.
        sscrfields-ucomm = 'ONLI'(001).
      endif.
      if p_date = '1'.
        p_date11 =  sy-datum .
      elseif p_date = '2'.
        p_date11 = ( sy-datum - 7 ).
      elseif p_date = '3'.
        p_date11 = ( sy-datum - 30 ).
      elseif p_date = '4'.
        p_date11 = ( sy-datum - 90 ).
      elseif p_date = '5'.
        p_date11 = ( sy-datum - 365 ).
      endif.
    Hope this helps u..
    Please reward points if useful.
    Regards,
    Sreenivas

  • Co41 enhancement for add field in ALV output

    I must add a custom filed to ALV output of transaction CO41 and i trying to use all the 25 enhancements provided (that i find in other post CO41- Enhancement ), but i haven't found any way to get the desired results.
    Can any body help me?
    Thanks in advance.

    Hi,
    I had the same requirement to add a custom field to ALV output of transaction CO41.
    1. I first added the custom field to an new append-structure to the structure SFC_POCO.
    2. Then i added this field to the Dynpro-Screen 200 in the function-group COUP (by choosing the table control, pressing F6 and then adding the custom field of SFC_POCO).
    3. At last i added an Enhancement to the function CO_UP_PLANNED_ORDERS_SELECT and filled my custom field with data there.
    Please reward if useful.
    Regards,
    Henry

  • How to add a field in a standard alv report and to display in result list

    hi gurus,
    i need to add field in selectio-screen.
    i need to validate the field with existing fields.
    i need to add this in alv grid output list dynamically.
    thanks & regards,
    kgn9.

    hi swaret,
    i tried ur problem.....
    nothing special as to be done to add a new field in elementary search........
    just press F4 at parameters.
    there are already 4 fields...
    BUKRS
    HBKID
    BANKS
    BANKL
    you just add ur field.....
    TEXT1
    and specify Lpos and Spos as 5.
    and activate...... thats all......
    i tried and it worked for me........
    i hope it was helpful for u.

  • How to add F1 help for a field on ALV grid

    Hi All,
    When we execute a program, the output is displayed using ALV grid.
    on the ALV grid, if we press F1 on a field, it should popup the help document.
    How to add F1 help for a field on ALV grid.
    Thank you all in advance.

    fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
    A.

  • Sum hidden fields in web dynpro ALV reports

    Hi everyone
    Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
    I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
    Thanks!
    Fede

    Hi everyone
    Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
    I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
    Thanks!
    Fede

  • ALV , How to add a Field after it has been deleted

    Hi,
    I am formating a ABAP Webdynpro ALV: I remove a field by using :
        l_value->if_salv_wd_column_settings~delete_column( lv_field_name).
    How will I be able to add the field again ?
    I tried the following :
        l_value->if_salv_wd_column_settings~CREATE_COLUMN( lv_field_name).
    but getting a 'null' object reference in the following standard code :
    if ls_column-r_column->r_cell_editor->visible_fieldname is initial.
    Regards

    Hi.
    After create_column method you have to create cl_salv_wd_uie_text_view object:
      data:
        " Variables para configurar los ALVs.
        lr_alv_config_table  type ref to cl_salv_wd_config_table,
        lr_lr_wd_table_usage TYPE REF TO if_wd_component_usage,
        lr_wd_table          TYPE REF TO iwci_salv_wd_table,
        lr_table_settings    TYPE REF TO if_salv_wd_table_settings,
        lr_column_settings   TYPE REF TO if_salv_wd_column_settings,
        lr_column            TYPE REF TO cl_salv_wd_column,
        lr_text              type ref to cl_salv_wd_uie_text_view,
        lr_header type ref to cl_salv_wd_column_header.
      " Initialize variables
      lr_lr_wd_table_usage = wd_this->wd_cpuse_alv_1001( ).
      if lr_lr_wd_table_usage->has_active_component( ) is initial.
        lr_lr_wd_table_usage->create_component( ).
      endif.
      lr_wd_table = wd_this->wd_cpifc_alv_1001( ).
      lr_alv_config_table = lr_wd_table->get_model( ).
      lr_column_settings ?= lr_alv_config_table.
      lr_table_settings ?= lr_alv_config_table.
      " Delete Column.
      lr_column_settings->delete_column( 'OBJID' ).
      " Create column.
      lr_column = lr_column_settings->create_column( 'OBJID' ).
      create object lr_text.
      lr_text->set_text_fieldname( 'OBJID' ).
      lr_column->set_cell_editor( lr_text ).
      " Change the header of the column.
      lr_column->GET_HEADER( receiving value = lr_header ).
      if lr_header is bound.
        lr_column->delete_HEADER( receiving value = lr_header ).
      endif.
      lr_column->create_HEADER( receiving value = lr_header ).
      lr_header->SET_TEXT( exporting value = 'Objid Field' ).

  • How to add a field in FV60 transaction ALV

    Hi,
    I want to add a new field in FV60 transaction, I know that it can be done adding a new screen variant is this right? and how do i do this? What I exactly want is to add a field in the Table Control Named "Distance" and it should be type character with 12 positions, how can I do this?
    Thanks!!

    u have to search for a screen exit to implement the field in the screen of LT31. then u have to write ur code to upload to the zcode in the same exit..

  • ALV - add new fields

    Hi All,
    i am using REUSE_ALV_FIELDCATALOG_MERGE to populate fieldcat. the Internal table used is TB_FINAL with 20 fields.
    in additon ,i have to add new fields to the Fieldcat based on a custom table . if the custom table is having 3 entries , i need to add 3 new fields to the Fieldcat.
    and i need to Populate those new fields with data from CABN ( Characteristics table)
    how to do this?
    waiting for your replies.
    Thanks in advance.
    Suki.

    FORM ZI004_FIELDCAT_MOULD .
        wa_fieldcat-fieldname = 'ZMLDCDID' .      "Mould Code ID
        wa_fieldcat-tabname   = 'IT_MLDETAILS' .
        wa_fieldcat-outputlen = 40 .
        wa_fieldcat-seltext_l = text-010 .
        APPEND wa_fieldcat TO it_fieldcat.
        CLEAR wa_fieldcat.
        wa_fieldcat-fieldname = 'ZMLDID' .        "Mould ID
        wa_fieldcat-tabname   = 'IT_MLDETAILS' .
        wa_fieldcat-outputlen = 20 .
        wa_fieldcat-seltext_l = text-011 .
        APPEND wa_fieldcat TO it_fieldcat.
        CLEAR wa_fieldcat.
        wa_fieldcat-fieldname = 'ZMLDCODE' .      "Mould Code
        wa_fieldcat-tabname   = 'IT_MLDETAILS' .
        wa_fieldcat-outputlen = 40 .
        wa_fieldcat-seltext_l = text-012 .
        APPEND wa_fieldcat TO it_fieldcat.
        CLEAR wa_fieldcat.
    endform.

Maybe you are looking for

  • How to resolve data request error in cube load

    I apologize in advance if this is too much detail, but here goes... We are on BW 3.5 and have only one cube active (0SD_C03).  This cube contains five data targets.  One of these targets had an update request fail due to an error in the transfer rule

  • SSAS data source calculating from two data source

    Hi There, I have SSAS cube and use SSRS 2008R2. Basically I have cube A for current month income statement, cube B from previous month, they have shared the same dimensions. I want to create  report to show                   current month  previous M

  • Regarding Exit/IDOC Related TD

    Hi, Can anybody tell me what is the code required to be written folowing TD points. Before below TD i have populated one internal table in userexit_save_document exit and submitted following new program need to be written as below: SUBMIT gv_prog WIT

  • HP Pavilion TouchSmart Sleekbook

    Ever since about the second month of owning my sleekbook my monitor has been freezing while the software continues to function properly. Since then the problem has continued to worsen to the point now where I can hardly use my computer because I cann

  • Is Oracle Client software must in Sql Server 2005 Box to connect ORACLE

    We need to connect ORACLE from SqlServer 2005 1. We would like to know is Oracle Client Software MUST needed to be installed in SqlServer 2005 to connect ORACLE. 2. Do we have any other means? 3. Will Oracle OLE DB Provider for Oracle help us in esta