How to set a Caption/title in ALv

Hi frnds,
Can you tell me how to set a caption/title to a ALV grid.
Regards
Anuj

hi
try like this
DATA: i_title_kna1 TYPE lvc_title VALUE 'FIRST LIST DISPLAYED',
      i_title_vbak TYPE lvc_title VALUE 'SECOND LIST DISPLAYED'.
populate additional paramete as follows.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
     i_callback_program                = sy-repid
   i_callback_pf_status_set          = 'PF_STATUS_SET'
     i_callback_user_command           = 'USER_COMMAND'
   i_callback_top_of_page            = 'TOP-OF-PAGE'
     i_grid_title                      = i_title_kna1
     is_layout                         = wa_layout
     it_fieldcat                       = it_fieldcat
   it_events                         = it_events
    TABLES
      t_outtab                          = it_kna1.
or if you want top of page
populate the events table and use alv_commentary_write
  wa_listheader-typ = 'H'.
  wa_listheader-info = 'Customer Details'.
  APPEND wa_listheader TO it_listheader.
  CLEAR wa_listheader.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = it_listheader
      i_logo                   = 'EDSLOGO'
  I_END_OF_LIST_GRID       =
  I_ALV_FORM               =
  REFRESH it_listheader.
try the below code u will get a clear picture
report zalv no standard page heading.
TYPE-POOLS : slis.
TABLES: kna1.
TYPES : BEGIN OF ty_kna1 ,
        kunnr LIKE kna1-kunnr,
        name1 LIKE kna1-name1,
        land1 LIKE kna1-land1,
        END OF ty_kna1.
DATA: it_kna1 TYPE TABLE OF ty_kna1.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
       wa_fieldcat TYPE slis_fieldcat_alv.
DATA : wa_layout TYPE slis_layout_alv .
DATA : it_events TYPE  slis_t_event ,
       wa_events TYPE slis_alv_event.
DATA : it_listheader TYPE slis_t_listheader,
       wa_listheader TYPE slis_listheader,
       it1_listheader TYPE slis_t_listheader,
       wa1_listheader TYPE slis_listheader.
DATA: i_title_kna1 TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.
INITIALIZATION.
  PERFORM getevents using it_events.
  PERFORM desinlayout.
START-OF-SELECTION.
  PERFORM desinfieldcat.
  PERFORM datafetching.
  PERFORM display.
*&      Form  desinfieldcat
      text
-->  p1        text
<--  p2        text
FORM desinfieldcat .
wa_fieldcat-row_pos = 1.
  wa_fieldcat-col_pos = 1.
  wa_fieldcat-fieldname = 'KUNNR'.
  wa_fieldcat-seltext_l = 'Cust Num'.
  wa_fieldcat-datatype = 'CHAR'.
  wa_fieldcat-outputlen = 10.
  wa_fieldcat-tabname = 'IT_KNA1'.
  wa_fieldcat-key = 'X'.
wa_fieldcat-hotspot = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.
wa_fieldcat-row_pos = 2.
  wa_fieldcat-col_pos = 2.
  wa_fieldcat-fieldname = 'NAME1'.
  wa_fieldcat-seltext_l = 'Name'.
  wa_fieldcat-datatype = 'CHAR'.
  wa_fieldcat-outputlen = 35.
  wa_fieldcat-tabname = 'IT_KNA1'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.
wa_fieldcat-row_pos = 3.
  wa_fieldcat-col_pos = 3.
  wa_fieldcat-fieldname = 'LAND1'.
  wa_fieldcat-seltext_l = 'Country'.
  wa_fieldcat-datatype = 'CHAR'.
  wa_fieldcat-outputlen = 10.
  wa_fieldcat-tabname = 'IT_KNA1'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.
ENDFORM.                    " desinfieldcat
*&      Form  datafetching
      text
-->  p1        text
<--  p2        text
FORM datafetching .
  SELECT kunnr name1 land1
         FROM kna1
         INTO TABLE it_kna1
         UP TO 30 ROWS.
ENDFORM.                    " datafetching
*&      Form  display
      text
-->  p1        text
<--  p2        text
FORM display .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
     i_callback_program                = sy-repid
   I_GRID_TITLE                      = i_title_kna1
     is_layout                         = wa_layout
     it_fieldcat                       = it_fieldcat
   it_events                         = it_events
    TABLES
      t_outtab                          = it_kna1.
ENDFORM.                    " display
*&      Form  desinlayout
      text
-->  p1        text
<--  p2        text
FORM desinlayout .
  wa_layout-zebra = 'X'.
  wa_layout-colwidth_optimize = 'X'.
*wa_layout-edit = 'X'.
ENDFORM.                    " desinlayout
*&      Form  getevents
      text
-->  p1        text
<--  p2        text
FORM getevents using p_it_events type slis_t_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
  IMPORTING
     et_events             = p_it_events
   EXCEPTIONS
     list_type_wrong       = 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.
READ TABLE p_it_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.
  wa_events-form = 'TOP_OF_PAGE'.
  MODIFY it_events FROM wa_events TRANSPORTING form WHERE name = wa_events-name.
ENDFORM.                    " getevents
*&      Form  populatevents
      text
-->  p1        text
<--  p2        text
FORM populatevents .
  READ TABLE it_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.
  wa_events-form = 'TOP_OF_PAGE'.
  MODIFY it_events FROM wa_events TRANSPORTING form WHERE name = wa_events-name.
ENDFORM.                    " populatevents
*&      Form  top-of-page
      text
FORM TOP_OF_PAGE.
  wa_listheader-typ = 'H'.
  wa_listheader-info = 'Customer Details'.
  APPEND wa_listheader TO it_listheader.
  CLEAR wa_listheader.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = it_listheader
      i_logo                   = 'EDSLOGO'
  REFRESH it_listheader.
ENDFORM.                    "top-of-page
REWARD IF HELPFUL
PRASANTH

Similar Messages

  • How to print the Grid title in ALV Report?

    Hi All,
    I write ALV Report.When i am going to print this report it is not printing the Grid Header(ie.Title ).even in Print Preview Also i m not getting the title.It shows the Gird with Values.How Can i print the title Also...
    Regards,Ravi

    Hi,
      u will declare the data as below like this
    DATA: LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
            TOP_OF_PAGE  TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
      DATA : ST_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
             IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
             ST_EVENT TYPE SLIS_ALV_EVENT,
             IT_EVENT TYPE SLIS_T_EVENT.
      DATA : ST_LIST  TYPE SLIS_LISTHEADER,
             IT_LIST  TYPE SLIS_T_LISTHEADER,
             IT_LIST1 TYPE SLIS_T_LISTHEADER,
             IT_LIST2 TYPE SLIS_T_LISTHEADER.
    START-OF-SELECTION.
      IF G_FLAG = SPACE.
      W_REPID = SY-REPID.
      G_TOP_PAGE = 'TOP-PAGE'.
          ST_LIST-INFO = '  Title Name '.
          APPEND ST_LIST TO IT_LIST.
          ST_LIST-INFO = '  second Name'.
          APPEND ST_LIST TO IT_LIST.
        ELSE.
      ENDIF.
    FORM TOP-PAGE .
      DATA: V_LOGO(15).
        V_LOGO = 'LOGO'.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LIST
          I_LOGO             = V_LOGO.
        I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP-PAGE

  • How to set image in title of Panel in flex 4

    Hai Friends,
    I don't how to set title have image in  Panel(spark panel) of flex 4 , so please any one help to me  ...and send code...
    { normally title =" something text" but my case title="some image come here"  }
    Thanks & regards,
    Magesh R.

    You need to set the icon property to a Class variable that is the image (embedded image).

  • How to set Terminal window title?

    No matter what I try the Terminal title stays the same.
    Here is the terminal settings window :
    Any suggestion?
    TIA

    Does anyone know how to set Terminal title from shell? It seems there is something that resets the title when the command (printf/echo) finishes and the next prompt appears.
    Thanks.

  • How to set closed captioning to turn 'on' as default setting?

    Does anyone know how to set the closed captioning so that
    this feature is turned "on" as the default when people view the
    finished product? As it stands right now, users must select the
    "cc" button on the "control pad" to turn on closed captioning, but
    I want it to automatically appear.

    Hi again
    All you should have to do is to edit the first slide in
    Captivate. Click Insert > Animation and point at the .SWF file.
    Once you have done this, publish your project again and your Closed
    Captions should display automagickally.
    Cheers... Rick

  • How to set browser window title from FPM ?

    How do I set brwoser window title at runtime in FPM ?
    Using IDR area objetc I can set only apllication are(ident area) title, not the browser window title. Browser window title is set statically from iView name of in portal, and PFCG contect if in NWBC client.
    But in my case, I want to set it at runtime, for eg. in case of Purchase Order window, I want to set it as 'Purchase Order:<PO number>
    Is there any API to set this?
    Thanks again,
    Hari
    Edited by: Hari Krishnan P on Jun 9, 2010 10:22 AM

    When you call it as external window you may pass the title. other than that i am afraid you are left with no choice.

  • How to set a variant View of ALV at runtime

    Hi,
    For each user, I have saved in a specific table the Configuration Key of The variant he has created.
    At runtime I want to set this one in my ALV component.
    I think to use the method if_salv_wd_comp_table_pers~set_standard_view of class CL_SALV_WD_C_TABLE but this class isn't implemented elsewhere SALV_WD_TABLE.
    As anybody worked on this need, or something like ?
    Thanks

    I want to access attribute of  context node A in another context node B of the same view .
    for that In my View impel class I have created a public static attribute which can be accessed from any where in the view .
    I want to set the value of this public static attribute from the set method of the attribute of the context node  A .
    which I can access in my other node B's attribute
    cl.._impl=>attr_tmp = lv_varibleA  . for setting the value .
    lv_variableB = Cl..._impl=>attr_tmp  for accessing the value .
    will this work ???

  • How to Set Report Region Title Dynamically

    I have code working to periodically refresh a Interactive Report on a page. I have the following code in the page header:
    <script type="text/javascript">
    //automatic reload IRR
    function fnc_reloadIRR () {
    gReport.search('SEARCH');
    window.setTimeout(fnc_reloadIRR, 10000);
    // this means the code execution starts after 10 seconds
    window.setTimeout(fnc_reloadIRR, 10000);
    </script>
    This is working great. The title of the report region is "Intraday Color Code Test - &P1_LAST_REFRESH_TIME."
    I have a hidden page item named P1_LAST_REFRESH_TIME on the page that contains the last time the report was refreshed. I am struggling with resetting this value when the report region is refreshed. ( May not even need this item!)
    To address this, I created an On Demand application process that gets the Last Refreshed string. I then altered the above code like this:
    <script type="text/javascript">
    //automatic reload IRR
    function fnc_reloadIRR () {
    var ajaxRequest = new htmldb_Get( null, &APP_ID., 'APPLICATION_PROCESS=SET_LAST_REFRESH_TIME',0);
    gReport.search('SEARCH');
    window.setTimeout(fnc_reloadIRR, 10000);
    ajaxResult = ajaxRequest.get();
    // this means the code execution starts after 10 seconds
    window.setTimeout(fnc_reloadIRR, 10000);
    </script>
    Note the addition of the ajaxRequest stuff. This, too, is working. That is, if I check the value in ajaxResult, it does contain the correct, current time. So far so good.
    What I can't figure out is how, now, to get a reference to the title attribute of the Interactive Report Region so that I can reset it.
    I AM SOOOOO CLOSE. Can anyone fill in this last part of the puzzle for me?

    To clarify, I really just need to know how to get a reference to the Report Region's title so that I can set it to the value currently stored in "ajaxResult"

  • How to set the output list in alv

    hai all,
    i have copied the standard alv program into customized and the out put of customized have changed . but the output listy of this customized program is to be changed like standard program . please tell me how to do this i have setting the current layout of it . it will display only for time been whemni come out of that program it will change .

    Hi,
    After changing the layout to desired output. Save the layout and set it as default. Then it will work for every time.
    Thanks
    Chandra

  • How to set a colored Border in ALV OO aroung a row

    Hi there,
    i would like to know if it is possible to set a colored border around an entier row.
    I tried to debug er_data_change_protokol to figuere out how they do their cell bordering but i wasn't successful. Inet an FoSe didn't neither reveal anything, so befor i waste more time i ask the pro's.
    thanks in advance
    mathias

    Also refer:
    [http://abaplovers.blogspot.com/2008/05/changing-color-of-alv-grid-in-sap-abap.html]

  • How to set PF status title in module pool.If we are executing it in VA01

    Hi all!
    I a executing my screen in module pool.I set the title for my screen.While i a executing i am getting title in the screen like pf status title only. But if i am executing that screen through VA01.I am not getting title and at the same time it is capturing the VA01 title.But i want the title as the se51 pf status screen title.Plz give me the solution

    Hi,
    I think you should assign your program at the
    'Output types' using tcode: NACE.
    thanks|
    Mahesh

  • How to set a window title...

    Let me start with the basics:
    If you create an extension, the Stage Manager will create the container for you and load the swf into the container. This container can be one of three types: Panel, Model Dialog, or Modeless Dialog. Any one of these containers have titles. The StageManager will create a title with the menu name you provide.
    So far so good.
    If you do not provide a menu name (so it shold not appear in the menu, the StageManager will create a title which appears to be either the exention id or the package id (depending on the app).
    Not so good, but let's continue:
    If you have an extension load a Window, you can set the title of the Window using the Window's title property.
    Good.
    This all basically amounts to: if you want to open a window and set its title, you are really better off using Windows rather than separate extensions.
    Not ideal, but mostly workable.
    Now for the problem:
    Fireworks opens new windows INSIDE THE MAIN PANEL!!! When you close this window, it closes the panel as well, and the panel is inaccessible until the next launch of the app. This is obviously a bug... Fireworks appears to only support panels and not model or modelless dialogs.
    I am trying to work around this issue by making my dialog its own extension. This solves the problem of Fireworks opening it within the main panel. However, I do not want my sub-extension to appear in the menus, so I do not want to give it a menu name. I do however, want to set the title of the window.
    What to do???
    Harbs

    I worked out a hack to (sort of) get around this issue:
                private function preinit():void{
                    Object(this.parent.parent.parent.parent).title = "I really should not need to make the title like this!!!";
    Is there a better workaround?
    Harbs

  • How to set Menu and Title functionality for a remote control in a menu?

    I have a main menu (countries) and under each country there is a submenu (regions). When I play my DVD on my Mac it seems to function alright:
    If I go to country C and hit the "menu" button, nothing happens (I see the "action prohibited" line popping up). And nothing should happen of you hit menu in a submenu. Only if you hit Title/Top menu you should be able to go to the main menu.
    However... When I play my DVD on a DVD player (and I tested it on 2 different ones) and I go to a the Country C and hit the "menu" button, I am suddenly transfered to Country A. And if I go from the main menu to Country D and I hit the "menu" button, I go to... Country A. The menu button seems to be linked to the first submenu. Which is very odd!
    So there is definately something going very wrong when using the menu/title buttons during playback when I am in a submenu (not while playing a track).
    Can someone help me? Is there a way to define what happens with the remote control buttons menu or title when you are in a submenu and NOT playing a track? I can not find any controls for that.
    Thanks!

    Does this mean I should select "not set" in the general tab at the dropdown menu's for Title, Menu and Return in the Remote Control section? I can't find any other place where I can select menu or title.
    But if I set these to "not set",the menu and title buttons still work in simulation mode... So I guess I should do something else in order to disable menu and title? Sorry for the amount of questions from my side!

  • How to set the caption text of a node with user object.

    This is my problem for two days below is my sample code. I need to associate object with the tree node but the node is displaying the toString() value of the object. It should display the text I wanna see.
    Please help. I was from the JSP world so Swing is quiet new to me, only this year I got again a project in swing.
    TreeMap treemap = new TreeMap();
    treemap.put("3","3");
    treemap.put("5","4");
    treemap.put("4","4");
    treemap.put("1","1");
    treemap.put("2","2");
    DefaultMutableTreeNode nodetable = new DefaultMutableTreeNode(treemap,true);
    DefaultTreeModel model = (DefaultTreeModel)jtree.getModel();
    model.insertNodeInto(nodetable, nodetop,nodetop.getChildCount());

    I have created a subclass of DefaultMutableTreeNode, I just have one question with my Default Constructor, is it correct? Suppose to be it should be super(Object userObject ,boolean allowChildren)?
    But when I do that it does not compile.
    Please correct me if I am wrong. I suspect my contructor inside code super() is not enough the parameters got lost. (btw) i will give you the dukes, please just verify my code.
    Thanks.
    class MyDefaultMutableTreeNode extends DefaultMutableTreeNode{
    public String caption="";
    public MyDefaultMutableTreeNode(Object userObject ,boolean allowChildren){
    super();
    public void setCaptionString(String str){
    caption = str;
    public String toString(){
    return caption;
    }

  • How to set font for title and message in JOptionPane?

    Hi,
    I have following test code.
    JOptionPane.showMessageDialog(null, "Some Alert Message", "Alert", JOptionPane.ERROR_MESSAGE);In this code can we set font for "Some Alert Message", "Alert"?
    Regards,
    Kalyani......

    roll-your-own?
    import javax.swing.*;
    class Testing
      public static void main(String[] args)
        JDialog.setDefaultLookAndFeelDecorated(true);
        JOptionPane optionPane = new JOptionPane("<html><font size='5'>Your message here</font></html>");
        optionPane.setOptionType(JOptionPane.DEFAULT_OPTION);
        optionPane.setMessageType(JOptionPane.ERROR_MESSAGE);
        JDialog dialog = optionPane.createDialog(null, "Alert");
        dialog.getLayeredPane().getComponent(1).setFont(dialog.getFont().deriveFont(18f));//size = 18/whatever
        dialog.setModal(true);
        dialog.setVisible(true);
    }

Maybe you are looking for