I need to print logo in alv grid

I need to print logo in alv grid .As of now its getting displayed but it cannot be printed .Kindly tell me wether there is any option to print it .Eitjer using ALV or Object oriented ALV.Please reply soon

Hi Deepti,
Refer the code below.
report  sy-repid.
type-pools : slis.
*ALV Formatting tables /structures
data: gt_fieldcat type slis_t_fieldcat_alv.
data: gt_events type slis_t_event.
data: gs_layout type slis_layout_alv.
data: gt_page   type slis_t_listheader.
data: gs_page type slis_listheader.
data: v_repid like sy-repid.
*ALV Formatting work area
data: w_fieldcat type slis_fieldcat_alv.
data: w_events type slis_alv_event.
data: gt_bsid type table of bsid with header line.
initialization.
  perform build_events.
  perform build_page_header.
start-of-selection.
*perform build_comment.     "top_of_page - in initialization at present
  select * from bsid into table gt_bsid up to 10 rows.
*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading
*OR
  perform build_fieldcat.
  gs_layout-zebra = 'X'.
*top of page event does not work without I_callback_program
  v_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program                = v_repid
      i_structure_name                  = 'BSID'
   i_background_id                   = 'ALV_BACKGROUND'
      i_grid_title                      = 'This is the grid title'
  I_GRID_SETTINGS                   =
      is_layout                         = gs_layout
      it_fieldcat                       = gt_fieldcat[]
      it_events                         = gt_events[]
    tables
      t_outtab                          = gt_bsid.
Form..............:  populate_for_fm
Description.......:  Populates fields for function module used in ALV
form populate_for_fm using    p_row
                                    p_col
                                    p_fieldname
                                    p_len
                                    p_table
                                    p_desc.
  w_fieldcat-row_pos = p_row.          "Row Position
  w_fieldcat-col_pos = p_col.          "Column Position
  w_fieldcat-fieldname = p_fieldname.  "Field name
  w_fieldcat-outputlen = p_len.        "Column Lenth
  w_fieldcat-tabname = p_table.        "Table name
  w_fieldcat-reptext_ddic = p_desc.    "Field Description
  w_fieldcat-input = '1'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.
endform.                    " populate_for_fm
*&      Form  build_events
form build_events.
  data: ls_event type slis_alv_event.
  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = gt_events.
  read table gt_events with key name =  slis_ev_user_command
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_user_command to ls_event-form.
    append ls_event to gt_events.
  endif.
  read table gt_events with key name =  slis_ev_top_of_page
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_top_of_page to ls_event-form.
    append ls_event to gt_events.
  endif.
endform.                    " build_events
*&      Form  USER_COMMAND
When user command is called it uses 2 parameters. The itab
passed to the ALV is in whatever order it currently is on screen.
Therefore, you can read table itab index rs_selfield-tabindex to get
all data from the table. You can also check r_ucomm and code
accordingly.
form user_command using  r_ucomm      like sy-ucomm
                         rs_selfield type slis_selfield.
  read table gt_bsid index rs_selfield-tabindex.
error checking etc.
  set parameter id 'KUN' field gt_bsid-kunnr.
  call transaction 'XD03' and skip first screen.
endform.
*&      Form  top_of_page
Your own company logo can go here if it has been saved (OAOR)
If the logo is larger than the size of the headings in gt_page,
the window will not show full logo and will have a scroll bar. Thus,
it is a good idea to have a standard ALV header if you are going to
use logos in your top of page.
form top_of_page.
  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = gt_page
            i_logo             = 'ENJOYSAP_LOGO'.
endform.
*&      Form  build_fieldcat
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
form build_fieldcat.
  w_fieldcat-fieldname = 'BUDAT'.
  w_fieldcat-seltext_m = 'Dte pst'.
  w_fieldcat-ddictxt(1) = 'M'.
Can change the position of fields if you do not want them in order
of the DDIC or itab
w_fieldcat-row_pos = '1'.
w_fieldcat-col_pos = '10'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.
endform.                    " build_fieldcat
*&      Form  build_page_header
      gt_page is used in top of page (ALV subroutine - NOT event)
      *H = Header, S = Selection, A = Action
form build_page_header.
For Headers, Key is not printed and is irrelevant. Will not cause
a syntax error, but is not used.
  gs_page-typ = 'H'.
  gs_page-info = 'Header 1'.
  append gs_page to gt_page.
  gs_page-typ = 'H'.
  gs_page-info = 'Header 2'.
  append gs_page to gt_page.
For Selections, the Key is printed (bold). It can be anything up to 20
bytes. It gets printed in order of code here, not by key value.
  gs_page-typ = 'S'.
  gs_page-key = 'And the winner is:'.
  gs_page-info = 'Selection 1'.
  append gs_page to gt_page.
  gs_page-typ = 'S'.
  gs_page-key = 'Runner up:'.
  gs_page-info = 'Selection 2'.
  append gs_page to gt_page.
For Action, Key is also irrelevant.
  gs_page-typ = 'A'.
  gs_page-info = 'Action goes here'.
  append gs_page to gt_page.
endform.                    " build_page_header
Settings for the Logo :
01) GOTO - OAOR (Business Document Navigator)
02) Give Class Name - PICTURES
Class Type - OT
Object type - whatever you want to call your area EG: OURCOMP.... then Execute
03) Top left will say PICTURES. Bottom left will have multi tab. Select Create and double-click on Screen.
04) Select your image from the appropriate directory.
05) Give the image an appropriate name (not Screen)
06) It will tell you document stored successfully.
07) You can now find your logo under the heading OURCOMP in top left window.
08) You can reference the logo in things like FM REUSE_ALV_COMMENTARY_WRITE or any other area which may reference these things. EG: I_LOGO = 'OURCOMP'. You can preview image by double-clicking it.
<b>Please reward points if it helps.</b>
Regards,
Amit Mishra
Message was edited by: Amit Mishra

Similar Messages

  • Not able to display logo on alv grid output

    hi
    can anybody guide me.
    i have written code for displaying logo on alv grid report.
    i uploaded bmp image using OAER
    but even then i am not able to display logo on the report please help me
    i am using 4.7 version..
    code...
    REPORT  ZALVLOGO                                .
    type-pools: slis.
    data: i_sflight type table of sflight.
    *data: begin of i_sflight occurs 10.
    *include structure sflight.
    *data: end of i_sflight.
    data: it_events type slis_t_event,
           wa_events type slis_alv_event.
    select * from sflight into table i_sflight.
    perform form_fill_table.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_TOP_OF_PAGE            = 'top-of-page'
       I_STRUCTURE_NAME                  = 'sflight'
      TABLES
        T_OUTTAB                          = i_sflight
    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.
    *&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM top-of-page .
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader.
    wa_header-typ = 'h'.
    wa_header-info = 'FLIGHT DETAILS'.
    APPEND wa_header to t_header.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = t_header
        I_LOGO                   = 'ENJOY'.
      I_END_OF_LIST_GRID       =.
    ENDFORM.                    " top_of_page
    *&      Form  form_fill_table
          text
    -->  p1        text
    <--  p2        text
    FORM form_fill_table .
    clear wa_events.
    wa_events-name = 'top-op-page1'.
    wa_events-form = 'top-of-page'.
    append wa_events to it_events.
    ENDFORM.                    " form_fill_table

    hi ,
    First upload images  in SAP using transaction se78
    http://www.howforge.com/step-by-step-upload-bitmap-images-to-sap
    Then use that Image name to call using function module 
    in top of -page 
    call function 'REUSE_ALV_COMMENTARY_WRITE'
          exporting
            i_logo             = 'KAL1_LOGO'
            it_list_commentary = lt_top_of_page_no_sel.
    Regards
    Deepak.

  • INSERTING LOGO IN ALV GRID

    hi experts,
    how can i insert logo in alv grid..can u send me some examples of alv that includes all the functionalities like user-command,commentary write n also logo insertion etc..
    regards,
    raman

    hi ,
        chk out this .....and  try this ..
    for getting the events ....
    FORM ZVRPSALV_EVENT_CAT  CHANGING RT_EVENT TYPE slis_t_event .
        DATA : s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = RT_EVENT
       EXCEPTIONS
         list_type_wrong = 1
         OTHERS          = 2.
    CASE sy-subrc.
       WHEN 1.
         MESSAGE s000 WITH 'List type does not exist'(058).
         LEAVE LIST-PROCESSING.
       WHEN 2.
         MESSAGE s000 WITH 'Error with List Type'(059).
         LEAVE LIST-PROCESSING.
    ENDCASE.
      READ TABLE RT_EVENT WITH KEY NAME = slis_ev_top_of_page INTO s_event .
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE'(056) TO s_event-form.
        APPEND s_event TO rt_event.
        CLEAR s_event.
      ENDIF.
    ENDFORM.                    " EVENT_CAT
    *&      Form  ZVRPSALV_GRIDDISPLAY1
          text
    -->  p1        text
    <--  p2        text
    FORM ZVRPSALV_GRIDDISPLAY1 .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'DISPLAY_DOCUMENT '
       I_CALLBACK_TOP_OF_PAGE            = ' TOP-OF-PAGE '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'BASIC LIST'
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = T_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         = RT_EVENT
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = T_ITAB
    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.                    " ZVRPSALV_GRIDDISPLAY1
    SUBROTINE FOR DISPLAYING THE SECONDRY ALV GRID.
    FORM DISPLAY_DOCUMENT USING R_UCOMM  LIKE SY-UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
    IF RS_SELFIELD-FIELDNAME = 'VBELN'.
      READ TABLE T_ITAB INDEX  RS_SELFIELD-TABINDEX .
    V_VBELN = T_ITAB-VBELN.
    LOOP AT T_ITAB WHERE VBELN = V_VBELN.
       Move: T_ITAB-POSNR to T_ITAB1-POSNR  ,
             T_ITAB-MATNR to T_ITAB1-MATNR ,
             T_ITAB-MATKL to T_ITAB1-MATKL,
             T_ITAB-ARKTX to T_ITAB1-ARKTX  ,
             T_ITAB-PSTYV to T_ITAB1-PSTYV  ,
             T_ITAB-SPART to T_ITAB1-SPART ,
             T_ITAB-GSBER to T_ITAB1-GSBER ,
             T_ITAB-KWMENG to T_ITAB1-KWMENG .
       Append T_ITAB1.
    ENDLOOP.
       ENDIF.
    *&      Form  ZVRPSALV_COMMENT
          text
         -->P_T_HEADER  text
    FORM ZVRPSALV_COMMENT  USING  P_T_HEADER type slis_t_listheader .
    DATA : LS_LINE TYPE SLIS_LISTHEADER.
    CLEAR LS_LINE .
    LS_LINE-TYP = 'H'.
    LS_LINE-INFO =  'HEADING LIST'.
    APPEND LS_LINE TO P_T_HEADER.
      CLEAR LS_LINE.
      LS_LINE-typ = 'S'.
      write sy-datum to LS_LINE-info MM/DD/YYYY.
      CONCATENATE text-041 LS_LINE-info INTO LS_LINE-info separated by space .
      APPEND LS_LINE TO P_T_HEADER.
    ENDFORM.                    " ZVRPSALV_COMMENT
    SUBROUINE FOR TOP OF PAGE.
    FORM TOP_OF_PAGE.
    clear t_header.
    DATA: LV_HEADER TYPE SLIS_LISTHEADER.
      LV_HEADER-TYP = 'S'.
      WRITE SY-DATUM TO LV_HEADER-INFO MM/DD/YYYY.
      CONCATENATE TEXT-041 LV_HEADER-INFO INTO LV_HEADER-INFO SEPARATED BY SPACE.
      APPEND LV_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         IT_LIST_COMMENTARY       = T_HEADER
        I_LOGO                   = ' ENJOYSAP_LOGO '
       I_END_OF_LIST_GRID       =
       I_ALV_FORM               =
    ENDFORM.
    *&      Form  ZVRPSALV_EVENTTAB
          text
         <--P_T_EVENT  text
    FORM ZVRPSALV_EVENTTAB  CHANGING P_T_EVENT TYPE SLIS_T_EVENT.
      DATA : LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = P_T_EVENT.
    SEARCH THE TOP OF PAGE EVENT.
      READ TABLE P_T_EVENT WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT .
      IF SY-SUBRC = 0 .
      MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
      APPEND LS_EVENT TO P_T_EVENT.
      ENDIF.
    ENDFORM.                    " ZVRPSALV_EVENTTAB
    thanks and regards
    Priyank Dixit

  • Printing logo with ALV report output?

    Hi all,
    I have written a sinple program to display a report output in ALV grid format and inserted a logo in it usingh standrad FM. Though the logo is inserted successfully displaying with list ,  but  when i am clicking on print preview the logo is missing.
    Please help me on how to print the logo with the list?
    Thanks,
    Vamshi.

    Hi Krishna,
    -->Firstly go to T-Code OAER.
    -->Give Class Name as PICTURES
    -->Give Class Type as OT
    -->Give Object Key as(watever the name you wish to give)
    -->Example key 1000
    -->Click on Execute.
    Here you will get Standard Document Types.
    Select which ever you want i.e., Attachment,Screen,Template ,etc.
    Double click on Attchment it will ask you the File on the Desktop.
    Upload the image.
    Now you can see the Image in the Folder PICTURES.
    Now go to the Report.
    Function Module 'REUSE_ALV_COMMENTARY_WRITE'.
                             i_logo = '1000'.
    Hope this will Help you.
    With Regards,
    Sharmishta.

  • Printing logo in ALV report

    Hi,
    I've created an ALV report with a logo in the header.
    But, when i'm taking the printout ,the logo is not printed.
    How to solve this problem,..please help me .
    Thanks and regards.
    Rajesh

    It is not possible to Print the logo, which you are showing in ALV Grid.
    But you have to work with Cl_DD_DOCUMENT class
    Check this program DD_ADD_PICTURE, Here you can print the logo.the same you can try to implement if you want.

  • Need to choose fields from alv grid output and send mail

    Hi,
    I need to choose few orders from alv grid output and send mail as PDF for chosen orders.
    Suggest if possible and how.

    Moderator message - Please do not post your requirements and ask the forum to do your work for you - post locked
    Rob

  • Missing columns in print preview of ALV Grid

    In a report using ALV grid the output is ok in ALV grid when press print preview the 1st column is always missing and the 1st row shift by 1 character. Why is it happening. The same is happening in print out or when list saved in excel also.
    the coding is like
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_interface_check        = ' '
          i_buffer_active          = ' '
          i_callback_program       = i_repname
          i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          i_callback_pf_status_set = ' '
          i_callback_user_command = 'FRM_ALV_USER_COMMAND'
          i_structure_name         = 'IT_REPORT'
          i_background_id          = ' '
          is_layout                = i_layout
          it_fieldcat              = i_fieldtab[]
          it_sort                  = i_sort[]
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = i_variant
          it_events                = i_events[]
          is_print                 = i_print
        tables
          t_outtab                 = it_report.
    Kindly resolve.
    thanks
    anya

    Sample code:
    REPORT ZALV_DISPLAY_CHANGE.
    TABLES :T247.
    TYPE-POOLS SLIS. "Type definitions for alv report
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
    WA_FIELDCAT TYPE LVC_S_FCAT.
    DATA: WA_LAYOUT TYPE LVC_S_LAYO.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
    CHECK(1),
    CELLTAB TYPE LVC_T_STYL, " Switch between display/change
    MNR LIKE T247-MNR,
    LTX LIKE T247-LTX,
    END OF IT_FINAL.
    DATA : WA_FINAL LIKE IT_FINAL.
    DATA : W_REPID LIKE SY-REPID.
    W_REPID = SY-REPID.
    REFRESH IT_FINAL.
    SELECT MNR LTX
    FROM T247
    INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
    WHERE SPRAS EQ 'E'.
    WA_FIELDCAT-FIELDNAME = 'CHECK'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-CHECKBOX = 'X'.
    WA_FIELDCAT-EDIT = 'X'..
    WA_FIELDCAT-OUTPUTLEN = '3'.
    WA_FIELDCAT-COL_POS = '1'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MNR'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-OUTPUTLEN = '8'.
    WA_FIELDCAT-COL_POS = '2'.
    WA_FIELDCAT-REPTEXT = 'Month'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'LTX'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-OUTPUTLEN = '20'.
    WA_FIELDCAT-COL_POS = '3'.
    WA_FIELDCAT-REPTEXT = 'Month Desc'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    DATA: WA_CELLTAB TYPE LVC_S_STYL,
    IT_CELLTAB TYPE LVC_T_STYL,
    L_INDEX TYPE I.
    CLEAR : WA_CELLTAB,WA_FINAL,IT_CELLTAB.
    REFRESH IT_CELLTAB.
    *Initialize the celltab table
    LOOP AT IT_FINAL INTO WA_FINAL.
    L_INDEX = SY-TABIX.
    WA_CELLTAB-FIELDNAME = 'CHECK'.
    WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
    INSERT WA_CELLTAB INTO TABLE IT_CELLTAB.
    INSERT LINES OF IT_CELLTAB INTO TABLE WA_FINAL-CELLTAB.
    MODIFY IT_FINAL FROM WA_FINAL INDEX L_INDEX.
    ENDLOOP.
    *Make the first five 5 rows as disabled
    CLEAR L_INDEX.
    LOOP AT IT_FINAL INTO WA_FINAL.
    L_INDEX = SY-TABIX.
    IF SY-TABIX LE 5.
    LOOP AT WA_FINAL-CELLTAB INTO WA_CELLTAB.
    IF WA_CELLTAB-FIELDNAME EQ 'CHECK' .
    WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    MODIFY WA_FINAL-CELLTAB FROM WA_CELLTAB.
    MODIFY IT_FINAL INDEX L_INDEX FROM WA_FINAL TRANSPORTING CELLTAB.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDLOOP.
    WA_LAYOUT-BOX_FNAME = 'CHECK'.
    WA_LAYOUT-NO_ROWMARK = 'X'.
    WA_LAYOUT-STYLEFNAME = 'CELLTAB'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    I_CALLBACK_PROGRAM = W_REPID
    I_GRID_TITLE = 'GRID DISPLAY'
    IS_LAYOUT_LVC = WA_LAYOUT
    IT_FIELDCAT_LVC = IT_FIELDCAT
    TABLES
    T_OUTTAB = IT_FINAL
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    Please give me reward point If it is useful
    Thanks
    Murali Poli

  • Problem with print preview in alv grid

    Hello all,
    I have to display base unit of measure(meins) in alv grid output. i am using a conversion routine to convert it from ST TO PC before display.After executing the report i am getting the correct data. the problem is when i select the print preview
    alv list is displayed. in that the unit of measure pc is not displayed, it is comming as '*******. what i came to know is the same conversion routine is triggered in the standard program for the display. so it canot convert that.
    so please help me out in solving this.
    Thanks in advance,
    Sarat

    hi sarath,
        this is an example code try using the statement before displaying, i think it works.
    *example cdoe.
    LOOP AT i_grp1 INTO wa_grp1.
    AT NEW tknum.
    READ TABLE i_grp1 intto wa_grp1 index sy-tabix.
    SUM.
    MOVE-CORRESPONDING wa_grp1 TO wa_grp2.
    APPEND wa_grp2 TO i_grp2.
    ENDAT.
    ENDLOOP.

  • How to realize page numbers when printing from an ALV-Grid

    Dear ABAPers,
    with resprect to SAP note 402627 ALV-Grids in 4.6-Systems
    do not produce a header with Actual date, report title
    and page number as it does from release 610 on.
    I've spent almost the entire day on searching the SDN
    for an answer on how I could produce a page numbering.
    I've also tried quite a lot, for example by using the
    END_OF_PAGE event, but nothing worked.
    I'm using the FM REUSE_ALV_GRID_DISPLAY, but even an SAP
    sample report BCALV_GRID_01, which is supposed to
    demonstrate the object-oriented use of the several
    PRINT-events does not process PRINT_END_OF_PAGE in our
    4.6C-System.
    Is my search in vain or does anybody have experience
    with those kinds of problems under 4.6x ?
    Thanks in advance
    Andreas Flügel

    I think you should be able to use PRINT_END_OF_PAGE event for the same. That should work. Use SY-PAGNO variable to print the page no in this event.
    You will have to register this event and set the handler for the same.
    Did you try this?
    Regards,
    Ravi

  • How to upload logo for alv grid when we are using classes

    Hi am using cl_gui_alv_tree  for displaying alv grid. i want to upload logo in the heade section. as we do in simple alvs using resuse_alv_commentary_write.
    plz update me in this regard.
    regards
    venkat

    Welcome to SDN.
    Check the following threads -
    How To use TOP OF PAGE event in OOPS ALV?
    Logo & TOP_OF_PAGE in OO ALV
    Regards,
    Amit
    Reward all helpful replies.

  • Need new button's on ALV grid

    Hi All,
    I  have to select all / deselect all records from alv out put, how to add those buttonds to alv grid..
    Regards,
    DSK

    Hi Suresh,
    Try this program. It works.
    REPORT ztest_notepad.
    DATA: BEGIN OF it_t100 OCCURS 0,
            checkbox LIKE abgr-kzart,
            arbgb    LIKE t100-arbgb,
            msgnr    LIKE t100-msgnr,
            text     LIKE t100-text,
          END OF it_t100.
    DATA:program TYPE sy-repid VALUE sy-repid.
    TYPE-POOLS slis.
    DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
         wa_fieldcat LIKE LINE OF it_fieldcat.
    DEFINE fieldcatalog. "Macro defining.
      wa_fieldcat-fieldname = &1.
      wa_fieldcat-tabname   = 'IT_T100'.
      wa_fieldcat-checkbox  = &2.
      wa_fieldcat-edit      = &3.
      wa_fieldcat-seltext_m = &4.
      append wa_fieldcat to it_fieldcat.
      clear  wa_fieldcat.
    END-OF-DEFINITION.
    START-OF-SELECTION.
      SELECT * FROM t100 INTO TABLE it_t100 UP TO 100 ROWS.
      fieldcatalog: 'CHECKBOX' 'X' 'X' 'CHECKBOX',
                    'ARBGB'    ''  ''  'ARBGB'   ,
                    'MSGNR'    ''  ''  'MSGNR'   ,
                    'TEXT'     ''  ''  'TEXT'    .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = program
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = it_fieldcat
        TABLES
          t_outtab                 = it_t100.
    *&      Form  PF_STATUS_SET
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'STATUS' EXCLUDING rt_extab.
    ENDFORM.                    "PF_STATUS_SET
    *&      Form  user_command
    FORM user_command USING ucomm TYPE sy-ucomm selfield TYPE slis_selfield.
      IF ucomm = 'SEL_ALL'.
        LOOP AT it_t100.
          it_t100-checkbox = 'X'.
          MODIFY it_t100 INDEX sy-tabix.
        ENDLOOP.
        selfield-refresh = 'X'.
      ELSEIF ucomm = 'DESEL_ALL'.
        LOOP AT it_t100.
          it_t100-checkbox = space.
          MODIFY it_t100 INDEX sy-tabix.
        ENDLOOP.
        selfield-refresh = 'X'.
      ENDIF.
    ENDFORM.                    "user_command
    Thanks
    Venkat.O

  • Need to be displayed in ALV grid

    Dear All,
    Below is my Program's code which is working accordingly. But in this code I am generating output as Basic list display.  But  I want my output to be displayed in ALV only. So from where I will start. Where to add code for Alv in my existing code. Can anybody help me out on the same.
    Regards,
    Abhay.
    REPORT  zfi_temp_rfkopr00
            MESSAGE-ID FR
           LINE-SIZE  132
           NO STANDARD PAGE HEADING.
    Report Name : Vendor Open Items Ageing Report
    Purpose : This report displays the Vendor Open Items based on
    different Ageing days (Calculated by taking the Base
    Line date and the days mentioned in Payment Terms)
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: lfa1, " Vendor Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Vendor Open Items Data
    DATA: BEGIN OF int_bsik OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
    belnr LIKE bsik-belnr, " Document Number
    xblnr LIKE bsik-xblnr, " Ref Doc No
    blart LIKE bsik-blart, " Document Type
    zfbdt LIKE bsik-zfbdt, " Base Line Date
    zbd1t LIKE bsik-zbd1t,                                      " Due date1
    zbd2t LIKE bsik-zbd2t,                                      " Due Date2
    zbd3t LIKE bsik-zbd3t,                                      " Due Date3
    waers LIKE bsik-waers, " Currency
    dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_bsik.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    total1 LIKE bsik-dmbtr, " Amount in Local Curr
    total2 LIKE bsik-dmbtr, " Amount in Local Curr
    total3 LIKE bsik-dmbtr, " Amount in Local Curr
    total4 LIKE bsik-dmbtr, " Amount in Local Curr
    total5 LIKE bsik-dmbtr, " Amount in Local Curr
    total6 LIKE bsik-dmbtr, " Amount in Local Curr
    total LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal LIKE bsik-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal LIKE bsik-dmbtr, " Amount Totals
    v_date LIKE bsik-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE sy-lisel, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
    r_date2 FOR bsik-zfbdt, " Date Range 2
    r_date3 FOR bsik-zfbdt, " Date Range 3
    r_date4 FOR bsik-zfbdt. " Date Range 4
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
      PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
      PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
      ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
      PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
      PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Vendor Code
      CLEAR lfa1-lifnr.
      SELECT lifnr UP TO 1 ROWS
      INTO lfa1-lifnr
      FROM lfa1
      WHERE lifnr IN s_lifnr AND
      spras = sy-langu.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
      ENDIF.
    Validate Company Code
      CLEAR t001-bukrs.
      SELECT bukrs UP TO 1 ROWS
      INTO t001-bukrs
      FROM t001
      WHERE bukrs = p_bukrs AND
      spras = sy-langu.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e021. " Invalid Company Code range
      ENDIF.
      IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
      ( p_tage1 > p_tage4 ).
        MESSAGE e999 WITH 'Column 1 greater'(004)
        'than Column# 2 or 3 or 4'(005).
      ENDIF.
    *column 2
      IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
        MESSAGE e999 WITH 'Column 2 greater'(006)
        'than Column# 3 or 4'(007).
      ENDIF.
    *column3
      IF ( p_tage3 > p_tage4 ).
        MESSAGE e999 WITH 'Column 3 greater'(008)
        'than Column#4'(009).
      ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
      r_date1-sign = 'I'.
      r_date1-option = 'BT'.
      r_date1-low = p_allgst.
      r_date1-high = r_date1-low + p_tage1.
      APPEND r_date1.
      r_date2-sign = 'I'.
      r_date2-option = 'BT'.
      r_date2-low = r_date1-high + 1.
      r_date2-high = r_date1-low + p_tage2.
      APPEND r_date2.
      r_date3-sign = 'I'.
      r_date3-option = 'BT'.
      r_date3-low = r_date2-high + 1.
      r_date3-high = r_date1-low + p_tage3.
      APPEND r_date3.
      r_date4-sign = 'I'.
      r_date4-option = 'BT'.
      r_date4-low = r_date3-high + 1.
      r_date4-high = r_date1-low + p_tage4.
      APPEND r_date4.
    Select the Vendor Open Items data from BSIK
      SELECT l~lifnr
      l1~name1
      b~waers
      b~dmbtr
      b~zfbdt
      b~zbd1t
      b~zbd2t
      b~zbd3t
      b~belnr
      b~xblnr
      b~shkzg
      b~blart
      INTO CORRESPONDING FIELDS OF TABLE int_bsik
      FROM lfb1 AS l INNER JOIN lfa1 AS l1
      ON llifnr = l1lifnr
      INNER JOIN bsik AS b
      ON llifnr = blifnr AND
      lbukrs = bbukrs
      WHERE l~lifnr IN s_lifnr AND
      l~bukrs = p_bukrs AND
      b~zfbdt LE p_allgst.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH 'No Data found'(027).
      ENDIF.
    Removing the date limit to get the due items in the past
      DELETE int_bsik WHERE
      ( blart NE 'RE' AND blart NE 'KR' ) OR
      shkzg NE 'H'.
      SORT int_bsik BY lifnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
      v_tage1 = p_tage1 + 1.
      v_tage2 = p_tage2 + 1.
      v_tage3 = p_tage3 + 1.
      v_fidd = p_tage1.
      v_sedd = p_tage2.
      v_thdd = p_tage3.
      v_fodd = p_tage4.
      MOVE v_fodd0(4) TO v_fodd1(3).
      v_fodd+0(1) = space.
      CONCATENATE '1 to'(010) v_fidd INTO v_fir.
      CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
      CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
      CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
      CLEAR: v_date1, v_str, v_str1, v_tage.
      WRITE p_allgst TO v_date1.
      MOVE p_tage4 TO v_tage.
      CONCATENATE '>' v_tage text-025 INTO v_str1.
      CONCATENATE
      'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
      v_date1 INTO v_str SEPARATED BY space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
       EXPORTING
         title1 = 'Saudi International Petrochemical Company'(012)
         title2 = v_str.
      FORMAT COLOR OFF.
      WRITE : /1(168) sy-uline.
      FORMAT COLOR 1 INTENSIFIED.
      WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
      50(101) 'Invoices Due For(In Days)'(014) CENTERED,
      151 sy-vline, 168 sy-vline .
      WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
      13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
      49 sy-vline,
      50(101) sy-uline,151 sy-vline,
      152(16) 'Total'(017) CENTERED,
      168 sy-vline.
      WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
      50(16) v_fir CENTERED, 66 sy-vline,
      67(16) v_sec CENTERED, 83 sy-vline,
      84(16) v_thir CENTERED, 100 sy-vline,
      101(16) v_four CENTERED, 117 sy-vline,
      118(16) v_str1 CENTERED, 134 sy-vline,
      135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
      168 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
      NEW-PAGE LINE-SIZE 168.
      LOOP AT int_bsik.
        CLEAR v_date.
        IF int_bsik-zbd3t <> ' '.
          v_date = int_bsik-zfbdt + int_bsik-zbd3t.
        ELSE.
          IF int_bsik-zbd2t <> ' '.
            v_date = int_bsik-zfbdt + int_bsik-zbd2t.
          ELSE.
            v_date = int_bsik-zfbdt + int_bsik-zbd1t.
          ENDIF.
        ENDIF.
        IF int_bsik-zbd1t = ' '.
          v_date = int_bsik-zfbdt.
        ENDIF.
        IF v_date IN r_date1.
          int_final-total1 = int_final-total1 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date2.
          int_final-total2 = int_final-total2 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date3.
          int_final-total3 = int_final-total3 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date4.
          int_final-total4 = int_final-total4 + int_bsik-dmbtr.
        ELSEIF v_date > r_date4-high.
          int_final-total5 = int_final-total5 + int_bsik-dmbtr.
        ELSEIF v_date < p_allgst.
          int_final-total6 = int_final-total6 + int_bsik-dmbtr.
        ENDIF.
        AT END OF lifnr.
          v_flag = 1.
        ENDAT.
        IF v_flag = 1.
          int_final-lifnr = int_bsik-lifnr.
          int_final-name1 = int_bsik-name1.
          int_final-total = int_final-total1 + int_final-total2 +
          int_final-total3 + int_final-total4 + int_final-total5 +
          int_final-total6.
          APPEND int_final.
          v_gtotal1 = v_gtotal1 + int_final-total1.
          v_gtotal2 = v_gtotal2 + int_final-total2.
          v_gtotal3 = v_gtotal3 + int_final-total3.
          v_gtotal4 = v_gtotal4 + int_final-total4.
          v_gtotal5 = v_gtotal5 + int_final-total5.
          v_gtotal6 = v_gtotal6 + int_final-total6.
          v_gtotal = v_gtotal + int_final-total.
          WRITE: /1 sy-vline,
          2 int_final-lifnr COLOR 4 INTENSIFIED ON,
          13 sy-vline,
          14 int_final-name1 COLOR 4 INTENSIFIED ON,
          49 sy-vline.
          DATA : v_rem.
          v_rem = sy-tabix MOD 2.
          IF v_rem NE 0.
            FORMAT COLOR 2 INTENSIFIED.
            WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
            66 sy-vline,
            67 int_final-total2 CURRENCY int_bsik-waers,
            83 sy-vline,
            84 int_final-total3 CURRENCY int_bsik-waers,
            100 sy-vline,
            101 int_final-total4 CURRENCY int_bsik-waers,
            117 sy-vline,
            118 int_final-total5 CURRENCY int_bsik-waers,
            134 sy-vline,
            135 int_final-total6 CURRENCY int_bsik-waers,
            151 sy-vline,
            152 int_final-total CURRENCY int_bsik-waers,
            168 sy-vline.
          ELSE.
            WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
            66 sy-vline,
            67 int_final-total2 CURRENCY int_bsik-waers,
            83 sy-vline,
            84 int_final-total3 CURRENCY int_bsik-waers,
            100 sy-vline,
            101 int_final-total4 CURRENCY int_bsik-waers,
            117 sy-vline,
            118 int_final-total5 CURRENCY int_bsik-waers,
            134 sy-vline,
            135 int_final-total6 CURRENCY int_bsik-waers,
            151 sy-vline,
            152 int_final-total CURRENCY int_bsik-waers,
            168 sy-vline.
          ENDIF.
          FORMAT COLOR OFF.
          HIDE int_final.
          CLEAR int_final.
          v_flag = 0.
        ENDIF.
        AT LAST.
          WRITE : /1(168) sy-uline.
          FORMAT COLOR 3 INTENSIFIED.
          WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
          49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
          66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
          83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
          100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
          117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
          134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
          151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
          168 sy-vline.
          HIDE : v_gtotal1,
          v_gtotal2,
          v_gtotal3,
          v_gtotal4,
          v_gtotal5,
          v_gtotal6,
          v_gtotal.
        ENDAT.
        FORMAT COLOR OFF.
      ENDLOOP.
      WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
      NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
      DATA : v_rem,v_cnt LIKE sy-tabix.
      v_cnt = 0.
      SORT int_bsik BY belnr zfbdt.
      LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
        v_rem = v_cnt MOD 2.
        CLEAR v_date.
        IF int_bsik-zbd3t <> ' '.
          v_date = int_bsik-zfbdt + int_bsik-zbd3t.
        ELSE.
          IF int_bsik-zbd2t <> ' '.
            v_date = int_bsik-zfbdt + int_bsik-zbd2t.
          ELSE.
            v_date = int_bsik-zfbdt + int_bsik-zbd1t.
          ENDIF.
        ENDIF.
        IF int_bsik-zbd1t = ' '.
          v_date = int_bsik-zfbdt.
        ENDIF.
        IF v_rem NE 0.
          FORMAT COLOR 2 INTENSIFIED.
          WRITE :/1 sy-vline, 2 int_bsik-belnr,
          12 sy-vline,13 int_bsik-lifnr,
          23 sy-vline,24 int_bsik-name1,
          59 sy-vline,60 int_bsik-xblnr,
          76 sy-vline,77 int_bsik-zfbdt,
          87 sy-vline.
          WRITE : 104 sy-vline,121 sy-vline,
          138 sy-vline,155 sy-vline,
          172 sy-vline, 189 sy-vline,
          190 int_bsik-dmbtr CURRENCY int_bsik-waers,
          206 sy-vline.
          IF v_date IN r_date1.
            v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
            WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date2.
            v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
            WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date3.
            v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
            WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date4.
            v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
            WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date > r_date4-high.
            v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
            WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date < p_allgst.
            v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
            WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ENDIF.
          FORMAT COLOR OFF.
        ELSE.
          WRITE :/1 sy-vline, 2 int_bsik-belnr,
          12 sy-vline,13 int_bsik-lifnr,
          23 sy-vline,24 int_bsik-name1,
          59 sy-vline,60 int_bsik-xblnr,
          76 sy-vline,77 int_bsik-zfbdt,
          87 sy-vline.
          WRITE : 104 sy-vline,121 sy-vline,
          138 sy-vline,155 sy-vline,
          172 sy-vline,189 sy-vline,
          190 int_bsik-dmbtr CURRENCY int_bsik-waers,
          206 sy-vline.
          IF v_date IN r_date1.
            v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
            WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date2.
            v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
            WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date3.
            v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
            WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date4.
            v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
            WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date > r_date4-high.
            v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
            WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date < p_allgst.
            v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
            WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ENDIF.
        ENDIF.
        FORMAT COLOR OFF.
        v_cnt = v_cnt + 1.
      ENDLOOP.
      WRITE : /1(206) sy-uline.
      v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
      + v_subtotal4 + v_subtotal5 + v_subtotal6.
      FORMAT COLOR 3 INTENSIFIED.
      WRITE : /1 sy-vline,
      2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
      87 sy-vline,
      88 v_subtotal1 CURRENCY int_bsik-waers,
      104 sy-vline,
      105 v_subtotal2 CURRENCY int_bsik-waers,
      121 sy-vline,
      122 v_subtotal3 CURRENCY int_bsik-waers,
      138 sy-vline,
      139 v_subtotal4 CURRENCY int_bsik-waers,
      155 sy-vline,
      156 v_subtotal5 CURRENCY int_bsik-waers,
      172 sy-vline,
      173 v_subtotal6 CURRENCY int_bsik-waers,
      189 sy-vline,
      190 v_subtotal CURRENCY int_bsik-waers,
      206 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(206) sy-uline.
      CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
      v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
      v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
      CLEAR: v_date1, v_str, v_str1, v_tage.
      WRITE p_allgst TO v_date1.
      MOVE p_tage4 TO v_tage.
      CONCATENATE '>' v_tage text-025 INTO v_str1.
      CONCATENATE
      'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
      v_date1 INTO v_str SEPARATED BY space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
       EXPORTING
         title1 = 'Saudi International Petrochemical Company'(012)
         title2 = v_str.
      FORMAT COLOR 1 INTENSIFIED.
      WRITE :/1(206) sy-uline.
      WRITE :/1 sy-vline,12 sy-vline ,
      23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
      88(101) 'Invoices Due For(In Days)'(014) CENTERED,
      189 sy-vline,206 sy-vline.
      WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
      12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
      23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
      59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
      76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
      87 sy-vline, 88(101) sy-uline,
      189 sy-vline,190(16) 'Total'(017) CENTERED,
      206 sy-vline.
      WRITE : /1 sy-vline, 12 sy-vline,
      23 sy-vline,59 sy-vline,
      76 sy-vline,87 sy-vline,
      88(16) v_fir CENTERED, 104 sy-vline,
      105(16) v_sec CENTERED, 121 sy-vline,
      122(16) v_thir CENTERED, 138 sy-vline,
      139(16) v_four CENTERED, 155 sy-vline,
      156(16) v_str1 CENTERED,
      172 sy-vline,
      173(16) 'Already Overdue'(018) CENTERED,
      189 sy-vline,
      206 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(206) sy-uline.
    ENDFORM.                                                    " header1

    Hi Abhay,
    After moving the whole data into final internal table, pass that internal table to function module REUSE_ALV_GRID_DISPLAY.
    before that you need to build field catalog and have to build layout with all the required columns.
    Go through the below links for your reference.
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    http://www.sap-img.com/abap/what-is-alv-programming.htm
    http://www.sap-img.com/abap-function.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
    http://www.sap-img.com/abap-function.htm
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    <b>Reward points for helpful answers,</b>
    Satish

  • How to display LOGO in ALV grid when using class CL_GUI_ALV_GRID

    Hello everyone,
    please let me know how to display Company logo as the header part in the report program with the class cl_gui_alv_grid.
    Thanks and regards,
    Padma.

    Hi,
    Got this info from a site.
    http://sap.ittoolbox.com/documents/document.asp?i=3213
    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    Try this one.
    Also have a look at this link
    http://www.sap-img.com/fu002.htm
    Message was edited by: Judith Jessie Selvi

  • How to display logo in alv grid display

    Hi, i am using 'REUSE_ALV_COMMENTARY_WRITE' to display logo. but i couldn't get in the output.
    plain explain how use this functoin module.
    DATA  :  it_listheader   TYPE slis_t_listheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheader
          i_logo             = 'LOGO'.

    hi
    i am doing month wise customer sale report.
    the output should like that
    month   customer1    customer2   customer3  customer 4  total
    jan       100                200           200              -                500
    feb                                            300                               300
    mar
    apr
    total   100                200              500                            800
    i want to do this dynamicaly.
    let me know how can i display customer as a header.

  • Skipping ALV Grid and moving into Print Preview

    Hi Friends,
    I am using ALV Grid Display, and created an ALV Layout which gives multiple lines output in Print Preview.
    Now I do not want ALV Grid Output. I need to directly see the print preview, by skipping the grid output.
    Any ideas?
    Thanks
    Krishna

    Print preview of ALV grid display data in ALV list format. So if u r using REUSE_ALV_GRID_DISPLAY Fm instead of it use REUSE_ALV_LIST_DISPLAY fm. It will display data like print preview of ALV grid.

Maybe you are looking for

  • Remote system JSP project not working in eclipse

    Hi I am developing a JSP project. My files are on a remote server and I want to configure it in Eclipse 3.3 with Lomboz. The problem is After adding the project it gives a warning that xml files can't be validated.The exact warning is The file cannot

  • How to create a customer program for "PPMOD"feature(pe03)?

    Hi, I want to create customer program for "PPMOD"feature(tcode:pe03),who can tell me the steps? (ECC6.0) thanks a lot? Olivia Yang

  • Self assinged IP address when going thru a Workgroup HUB

    Hello Thank your for reading this post. This is my set up: (Please keep in mind I have only modest networking exp. but I was told this hub would be fine. We used to use it (previously we had 2 discrete IP addresses however, but I thought a HUB could

  • Which camcorder to purchase

    Hi, I have recently purchased CS4 Premiere and looking to buy an HD camera with built in hard drive. I have around £600 to spend. There is so much choice I was hoping somebody could recomend one which has good picture quaility and is supported by Pre

  • Thread safety

    Quick question about thread safe servlets. I understand that class variables are not thread safe, but what about method variables which are passed around to other methods within the servlet? Are those also completely thread safe? thanks