Change the List Headings in the ALV output

Hi,
I am trying to bind  dynamic attributes to a dynamically created Node.
The code is as follows
build a structure description from the list of single fields
  comp-name = 'CARRID'.
  comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
  APPEND comp TO comp_tab.
  comp-name = 'CONNID'.
  comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
  APPEND comp TO comp_tab.
* not this structure contains the fields "CONNID" and "CARRID"
  struct_type = cl_abap_structdescr=>create( comp_tab ).
* now the nodeinfo is created
  node_info = wd_context->get_node_info( ).
  node_info = node_info->add_new_child_node(
    name                         = 'MY_NODE'
    IS_MANDATORY                 = ABAP_true
    IS_MULTIPLE                  = ABAP_true
    STATIC_ELEMENT_RTTI          = struct_type
    IS_STATIC                    = ABAP_false
But in the output I want my custom List Headings for each of the column.
How to achieve the same.
Edited by: SAP LEARNER on Jan 4, 2010 8:11 AM

Hi,
You can set the column titles when you initialize your ALV as follows,
* Data declarations for instantiation
  DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table   ,
        l_ref_cmp_usage           TYPE REF TO if_wd_component_usage.
* Instantiate the ALV
  l_ref_cmp_usage =   wd_this->wd_cpuse_usg_alv_feclm( ) ." alv_feclm is your usage name
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL .
    l_ref_cmp_usage->create_component( )                 .
  ENDIF                                                  .
* Get model
  l_ref_interfacecontroller = wd_this->wd_cpifc_usg_alv_feclm( ).
  l_value = l_ref_interfacecontroller->get_model( )             .
  wd_this->l_value_feclm = l_value                              .
*to make ALV table editable
  lr_table_settings ?= l_value                  .
  lr_table_settings->set_read_only( abap_false ).
* Column Settings
  lr_column_settings ?= l_value                  .
  lt_columns = lr_column_settings->get_columns( ).
  LOOP AT lt_columns INTO ls_column.
    CASE ls_column-id.
      WHEN 'CA_TEXT'.
        lr_column_header = ls_column-r_column->get_header( )  .
        lr_column_header->set_ddic_binding_field(
           if_salv_wd_c_column_settings=>ddic_bind_none )     .
        lr_column_header->set_text( 'Column Header' )      . " this is your coulmn header
    WHEN OTHERS.
   ENDCASE.
ENDLOOP.

Similar Messages

  • Is it possible to create the ALV output with dropdown list for the columns

    Hi forum experts,
                              Could the ALV output contain the dropdown list for the column names? if yes, then how we can acheive this to happen.
    Thanks in advance,
    Regards,
    Samad.
    Edited by: Samad arif on Aug 21, 2009 4:40 PM

    Hi Arif,
    Yes we can .FOr the codding check the article,
    [dropdowns in ALV|https://wiki.sdn.sap.com/wiki/display/Snippets/DropdownsinALV]
    regards,
    Archana
    Edited by: Archana Kumari on Aug 21, 2009 1:22 PM

  • How to put the alv output into the spool request?

    Hi guys,
    How to put the alv output into the spool request?
    Thanks!

    Hi
    Sending an ALV List screen output to SPOOL
    Convert ALV list to PDF and send mails to respective persons
    Regards
    Pavan

  • Want to save the alv output in local file

    Hi,
    i want to save the alv output to local file throuh menu.
    in out put
    system>LIst>save
    using oops alv
    Regards
    Jagadeeshwar.B

    Hi,
    I get the following dump when i try to download alv output to local file.Please suggest what is to be done:-
    Runtime Errors         PERFORM_NOT_FOUND            
    Except.                CX_SY_DYN_CALL_ILLEGAL_FORM  
    Date and Time          09/23/2008 22:09:28          
    Error analysis                                                                     
        An exception occurred that is explained in detail below.                       
        The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_FORM', was   
         not caught in                                                                 
        procedure "METHOD_PRINT_TOP_OF_PAGE" "(FORM)", nor was it propagated by a      
         RAISING clause.                                                               
        Since the caller of the procedure could not have anticipated that the          
        exception would occur, the current program is terminated.                      
        The reason for the exception is:                                               
        The program "SAPLSLVC_FULLSCREEN" is meant to execute an external PERFORM,     
        namely the routine "TOP_OF_PAGE_BATCH " of the program "ZRTCLT06_ALV ", but    
        this routine does not exist.                                                   
    Line  SourceCde                                                                               
    133   endif.                                                                               
    134                                                                               
    135   export alv_form_html from abap_false                                                       
      136          to memory id 'ALV_FORM_HTML'.                                                       
      137                                                                               
    138 endform.                               " METHOD_END_OF_LIST                                  
      139 &----                     
      140 *&      Form  METHOD_PRINT_TOP_OF_PAGE                                                       
      141 &----                     
      142 *       text                                                                               
    143 ----                     
      144 *  -->  p1        text                                                                       
      145 *  <--  p2        text                                                                       
      146 ----                     
      147 form method_print_top_of_page using value(i_table_index) type syindex.                       
      148                                                                               
    149   if gt_grid-r_salv_fullscreen_adapter is bound.                                             
      150     if not gt_grid-i_callback_top_of_page is initial and                                     
      151        not i_callback_program is initial.                                                    
      152       perform (gt_grid-i_callback_top_of_page)                                               
      153         in program (i_callback_program) using i_table_index.                                 
      154     endif.                                                                               
    155   else.                                                                               
    156     if not gt_grid-i_callback_top_of_page is initial and                                     
      157        not i_callback_program is initial.                                                    
      158       perform (gt_grid-i_callback_top_of_page)                                               
      159         in program (i_callback_program).                                                     
      160     endif.                                                                               
    161   endif.                                                                               
    162                                                                           
    >>>> endform.                               " METHOD_PRINT_TOP_OF_PAGE         
    164 ----   
    165 *       FORM METHOD_PRINT_END_OF_LIST                                 *   
    166 ----   
    167 *       ........                                                      *   
    168 ----   
    169 form method_print_end_of_list.                                            
    170   if not gt_grid-i_callback_end_of_list is initial and                    
    171      not i_callback_program is initial.                                   
    172     perform (gt_grid-i_callback_end_of_list)                              
    173       in program (i_callback_program).                                    
    174   endif.                                                                  
    175                                                                           
    176 endform.                               " METHOD_PRINT_END_OF_LIST         
    177 &----  
    178 *&      Form  METHOD_DOUBLE_CLICK                                         
    179 &----  
    180 *       text                                                              
    181 ----  
    182 *  -->  p1        text

  • Function Module to edit the ALV Output

    Hi,
      I have an ALV report output.I need the edit values based on some conditions in the ALV output and 
      save the changes. Is there any function module to edit the output and proceed further.
      Thanks in advance.
    Regards,
    Navas

    First create the field catalog of the field that you want to edit in this way
    WA_fieldcat-fieldname  = 'MENGE'.
      WA_fieldcat-qfieldname = 'MEINS'.
      WA_fieldcat-seltext_m  = 'PO Quan.'
      WA_fieldcat-edit = 'X' .
    Secondly you keep a custom button like 'SAVE' in the toolbar and  also try to keep a checkbox in your ALV.
    for checkbox you have to keep a following code snippet in your finallly displayed interanal table:
    chk(1)    TYPE c, and in the fieldcatalog you have to write following piece of code
      WA_fieldcat-fieldname = 'CHK'.
      WA_fieldcat-seltext_m = 'CheckBox'.
      WA_fieldcat-checkbox = 'X'.
      WA_fieldcat-edit = 'X' .
      WA_fieldcat-input = 'X'.
      WA_fieldcat-tabname = 'IT_FINAL'.
      WA_fieldcat-col_pos = 1.
    then you have to set the parameter i_callback_user_command           = 'USER_COMMAND'
    of FM REUSE_ALV_GRID_DISPLAY.
    Then write a subroutine like the following one to handle the SAVE operation
    FORM user_command USING I_r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    DATA:l_cntr TYPE i.
    CASE I_r_ucomm.
    WHEN '&ZXZ'.
          CLEAR l_cntr.
          CLEAR WA_final.
          LOOP AT IT_final INTO WA_final.
            IF WA_final-chk = 'X'.
              l_cntr = l_cntr + 1.
            ENDIF.
          ENDLOOP.
          IF l_cntr GT 1.
            MESSAGE i011.
          ELSEIF l_cntr = 1.
               READ TABLE IT_final INTO WA_final WITH KEY chk = 'X'.
               MODIFY IT_final FROM WA_final TRANSPORTING menge
              WHERE chk = 'X'.
              CLEAR WA_final.
              PERFORM disp_alv. <<<This is to display the refreshed alv after saving your data
         endif.
    ENDCASE.
    ENDFORM.

  • Total is not getting displayed in the ALV output.

    Hi,
    Total is not getting displayed in the ALV output.
    I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
    Are  there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
    source code:
    DATA: layout TYPE slis_layout_alv,
          IT_eventS  TYPE slis_t_event,
          fcat   TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    TYPES: BEGIN OF ty_tab,
          belnr TYPE dberchz-belnr,
          belzart TYPE dberchz-belzart,
          net TYPE dberchz-nettobtr,
          END OF ty_tab.
    DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
    SELECT belnr belzart nettobtr
      FROM dberchz
      INTO TABLE lt_tab[]
    WHERE belnr eq '000000000001'.
      if sy-subrc ne 0.
      ENDIF.
    *  defining layout
    layout-colwidth_optimize = 'X'.
    layout-def_status = 'X'.
    *defning event
    *event
    *defining field catalog
    fcat-col_pos = 1.
    fcat-fieldname = 'BELNR'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 2.
    fcat-fieldname = 'BELZART'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 3.
    fcat-fieldname = 'NET'.
    fcat-tabname  = 'LT_TAB'.
    fcat-do_sum = 'X'.
    APPEND fcat.
    *calling alv
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'YZ_PLR'
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   IT_EXCLUDING                   =
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = layout
        it_fieldcat                      = fcat[]
        i_tabname                        = 'LT_TAB'
        it_events                        = IT_EVENTS[]
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      tables
        t_outtab                         = lt_tab[]
    * EXCEPTIONS
    *   PROGRAM_ERROR                    = 1
    *   MAXIMUM_OF_APPENDS_REACHED       = 2
    *   OTHERS                           = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks,
    Gaurav

    Hi
    No I don't think, this is my code (based on your code) and it works fine:
    TYPE-POOLS SLIS.
    DATA: BEGIN OF LT_TAB OCCURS 0,
           BELNR LIKE BSEG-BELNR,
           GJAHR LIKE BSEG-GJAHR,
           WRBTR LIKE BSEG-WRBTR,
           WAERS LIKE BKPF-WAERS,
          END OF LT_TAB.
    DATA: LAYOUT     TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS  TYPE SLIS_T_EVENT,
          FCAT       TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          REC_FCAT   TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    START-OF-SELECTION.
      FCAT-COL_POS       = 1.
      FCAT-FIELDNAME     = 'BELNR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'BELNR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 2.
      FCAT-FIELDNAME     = 'GJAHR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'GJAHR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 3.
      FCAT-FIELDNAME     = 'WRBTR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-CFIELDNAME    = 'WAERS'.
      FCAT-REF_FIELDNAME = 'WRBTR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      FCAT-DO_SUM        = 'X'.
      APPEND FCAT.
      FCAT-COL_POS       = 4.
      FCAT-FIELDNAME     = 'WAERS'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'WAERS'.
      FCAT-REF_TABNAME   = 'BKPF'.
      FCAT-DO_SUM        = SPACE.
      APPEND FCAT.
      SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
        WHERE BUKRS = 'MAAB'
          AND BELNR = '0000000001'.
      LT_TAB-WAERS = 'EUR'.
      MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
    *CALLING ALV
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT   = LAYOUT
          IT_FIELDCAT = FCAT[]
          I_TABNAME   = 'LT_TAB'
          IT_EVENTS   = IT_EVENTS[]
        TABLES
          T_OUTTAB    = LT_TAB[].
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    I've also inserted a currency field
    Max

  • Is it possible to change the ALV report layout settings in spool request

    Hi All,
    Please let me know is it possible to change the ALV layout settings in background as we can change the layout settings in foreground to get correct format when download to excel.
    Regards,
    Jyothi CH.

    Hello,
    Add a parameter for layout on selection-screen (p_varmm LIKE disvariant-variant).
    As you are in backgroud mode, ALV will be printed with this layout (assuming you call correctly the MF ALV_LIST or REUSE_ALV_GRID)
    Regards,
    Christophe

  • Some fields are missing in the ALV output

    Hi ,
    I have created a normal ALV report using REUSE_ALV_GRID_DISPLAY . It shows the output correctly. But when I take the prin out or download to an excel sheet some fields are not there. Can I know how to solve this issue ?
    Regards,
    Beena

    hi Beena,
    If you are downloading the ALV output to excel, please make sure that the DDIC structure is passed as a parameter to the REUSE_ALV. I doubt you are creating field catalog from the program and that DDIC structure is not used.
    Hope this helps,
    Sajan Joseph.

  • HT4437 How do I change the display output orientation to my TV from my iPhone?

    The ABC app on my iPhone5 displays sideways (portrait) when outputting to my TV while using Air Play. How do I change the orientation output to my tv when using apps such as ABC?

    Unless you are mirroring you can't

  • Problem while downloading the alv output to excel file.

    Hii,
    While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
    Cant put in txt file  as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
    So what are the other ways to do so.
    Edited by: mansi_v27 on Mar 24, 2010 12:35 PM

    Hi,
    Welcome to SCN!!!.
    Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
    Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
    Thanks,
    Vinod.

  • How to extract in the ALV output the old data using EXTRACT

    Dear Friends,
                I have requiremnt where the user executes the report -
    using REUSE_ALV_GRID_DISPLAY  FM.  On the output
    i have given an option to user to edit values on the output. So user will edit the values and updating  to the data base this
    the functionality which we have given to the custom report till now . Now the user came back and asking to provide a SAVE
    option on the ALv output so that before updating the total records to the database he can re edit the values which he
    has entered previous day . To do this functionality i have read  in ALV documentation using the EXTRACT- INCLUDE vex01top.       
    I have added this but iam not getting exactly how to do this option when the user saves on the ALV output how can he retrive back the  saved data on to the output again( i.e on the ouput screen) using the Extract functionality . If any body has done this
    do help me . I would like to know should we maintain any custom table for this,for saving the records when user press
    save button? .
    Thanks & Regards
    Madhuri.

    > i have read  in ALV documentation using the EXTRACT- INCLUDE vex01top.       
    I don't know where you got that. You have to define your own GUI status (first, copy it from standard status STANDARD_FULLSCREEN of function group SLVC_FULLSCREEN) with your button, and define as follows:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'USER_STATUS' EXCLUDING rt_extab.
    ENDFORM.                    "set_pf_status
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.
    IF r_ucomm = 'SAVE'.
    ENDIF.
    ENDFORM.
    > I would like to know should we maintain any custom table
    Of course. Create your own custom table. Where else do you want to store data?

  • Query on display the Alv output,...................its urgent pls help

    hi friends,
        Here is my query on a Alv Report output display
      I have two internal tables i_vbak and i_vbap
    i_vbak contains the fields and value as
    vbeln     kunnr    auart  audat                   bstnk   vkorg
    1000066         1000071  ze0r   20070918       Itest1     PA11
    1000067         1000072  ze0r   20070919       SLA-Test1  PA11
    i_vbap contains the field and value as
    VBELN             MATNR             ARKTX
    1000066    SAMPLE MATERIAL1   Sample Material for reports
    1000066    SAMPLE MATERIAL    Sample Material for reports
    1000066    TEST   MATERIAL       Test Material for reports
    1000067    SAMPLE MATERIAL    Sample Material for reports
    1000067    TEST MATERIAL         Test Material for reports
    1000067    SAMPLE MATERIAL1   Sample Material for reports
    I have a another internal table called inv_final which contain all these fields and respective values to display in the alv output.Here i am giving only two field how it whould come in alv output.
    Sold to Patry(kunnr)  Sales Doc No(vbap-vbeln)    Material Name(matnr)
    1000071                  1000066                  Sample Material1
    1000071                  1000066                  Sample Material
    1000071                  1000066                  Test Material
    1000072                  1000067                  Sample Material 
    1000072                  1000067                  Test Material
    1000072                  1000067                  Sample Material1
    If anybody have done similay kind of repore than help me with the code,or else if anybody having any idea to solve this out than help me.I have only prob with the logic bofore the final table display in the alv output.
    Helpful answer will be rewardad generously.
    Thanks a lot
    mrutyun^

    Hi
    Put all the fields in to an internal table and disply only your required fields.
    Kuntal

  • New column in the ALV output of transaction phap_admin_pa

    Hello All,
    I want to display a new column in the ALV output of transaction phap_admin_pa. Is this possible? If so, could anyone please give some guidance how to proceed. The new column willl contain the elements from appraisal catalog. Do u think there will be any BADi's to achieve this or I am not sure if a custom program need to be created?
    Thank you very much,
    Rush

    Hi
    I had same problem of adding felds from additional data into the ALV and when I asked SAP they told me to implement BADI HRHAP00_REPORTING.
    I am still trying to get some info on how to implement it if you find any documentation of someone who has implemented appreciate you tell me.
    regards
    Pravin

  • How to insert blank lines in the ALV output.

    Hi Friends,
    Could any body help me out How to insert blank lines in the ALV output.?? Any Code pls...
    Thank you,
    Vikram.C

    hi vikram
    do like this
    In the fieldcatalog table all the fields should be in editable mode
    ie lw_fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    is_layout = lv_layout
    it_fieldcat = lt_fcat[]
    i_save = 'A'
    is_variant = lv_variant
    TABLES
    t_outtab = lt_license[]
    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.
    ENDFORM. " display_data
    *& Form user_command
    FORM user_command USING r_ucomm TYPE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE r_ucomm.
    WHEN 'ADD'. "
    data: lv_ind type i.
    data: lv_line type i.
    describe table lt_license lines lv_line.
    loop at lt_license into lw_license.
    lv_ind = sy-tabix.
    if lv_ind = lv_line.
    append initial line to lt_license.
    endif.
    endloop.
    ENDCASE.
    ENDFORM. "user_command
    reward points if useful
    Rohan

  • Dump while downloding the ALV output

    Hi,
    My requirement is to Develop an ALV report with new Function Keys in the Application Toolbar of the ALV. 
    For that I have copied the Status of the program 'SAPLSLVC_FULLSCREEN' Status - 'STANDARD_FULLSCREEN' and added few more Function Key's on the Application Toolbar. The new Key's added are working fine but when I try to download the ALV Output using the Download file option on the application toolbar its giving and dump saying 'Field symbol has not yet been assigned'
    Runtime Errors         GETWA_NOT_ASSIGNED.
    Regards,
    Ramu N.

    Hi, Add this code to the alv report. the report will get downlaoded as an excel sheet to ur hard drive.
    FORM DOWNLOAD .
      DFILENAME =  'D:\log.xls'.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                  =
          FILENAME                      = DFILENAME
          FILETYPE                      = 'ASC'
      APPEND                        = ' '
         WRITE_FIELD_SEPARATOR         = ','
        TABLES
          DATA_TAB                      = IT_MDKP
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " DOWNLOAD
    REWARD POINTS IF USEFUL

  • Change the remittance output  where tofind the form layout name

    I am trying to change the remittance output ,
    Can anyone let me know how to find the script that is attached to this remittance program whcih is given out in the Payment run transaciton F110,
    Thanx in advance

    Goto <b>FBZP transaction</b> and in the payment methods for company code push button u can see the attached form there for the respective company code.
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

Maybe you are looking for