How to get header in the ALV report

Hi
I want to print header in the ALV report.But i am not getting that.Plz see my program it is getting error and also not printing header.If there is any error means plz give me the solution.In this program there is an error.
REPORT  ZREPORT_ALV .
TYPE-POOLS : slis.
tables:vbak,vbap.
DATA:  report_id LIKE sy-repid.
DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV.
data: heading        TYPE slis_t_listheader,
      wa_header      TYPE slis_listheader,
     events         TYPE slis_t_event.
data: l_string type c.
data: ivariant(1) type c,
      itvariant like disvariant,
      w_variant like disvariant.
initialization.
REPORT_ID = SY-REPID.
PERFORM pgm. "F1000_LAYOUT_INIT. "using I_LAYOUT.
ivariant = 'A'.
*PERFORM init.
itvariant = w_variant.
select-options:so_vbeln for vbap-vbeln.
data:itab like vbak occurs 0 with header line.
data:itab1 like vbap occurs 0 with header line.
start-of-selection.
select * from vbak into table itab where vbeln in so_vbeln.
if not itab[] is initial.
select * from vbap into table itab1
for all entries in itab
where vbeln = itab-vbeln.
endif.
data:ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat1  TYPE slis_t_fieldcat_alv.
****For alv display
IF NOT itab1[] IS INITIAL.
   DEFINE ls_fieldcat.
   add 1 to ls_fieldcat-col_pos.
    ls_fieldcat-fieldname    = &1.
    ls_fieldcat-outputlen    = &2.
    ls_fieldcat-seltext_l    = &3.
     ls_fieldcat-emphasize  = &4.
    append ls_fieldcat to lt_fieldcat1.
    clear ls_fieldcat.
  END-OF-DEFINITION.
    ls_fieldcat 'VBELN'           '10'     'Sales Order Number'.
   ls_fieldcat 'POSNR'           '6'        'SO Item'.
    ls_fieldcat 'MATNR'           '13'      'Material No'.
m_fieldcat1 'NETWR'           '13'        'Amount'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
  I_CALLBACK_PROGRAM                = sy-repid
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
   IS_LAYOUT                         =  I_LAYOUT
   IT_FIELDCAT                       =  lt_fieldcat1
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =   ITVARIANT
  IT_EVENTS                         =
  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                          =  itab1
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.
endif.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
   I_SAVE              = ivariant
  CHANGING
   CS_VARIANT          = itvariant
EXCEPTIONS
  WRONG_INPUT         = 1
  NOT_FOUND           = 2
  PROGRAM_ERROR       = 3
  OTHERS              = 4
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  pgm. "F1000_LAYOUT_INIT. "USING I_LAYOUT TYPE SLIS_LAYOUT_ALV.
CLEAR I_LAYOUT.
i_layout-colwidth_optimize = 'X'.
I_LAYOUT-key_hotspot = u2018Xu2019.
I_LAYOUT-hotspot_fieldname =  MATNR.
ENDFORM.
*regarding logo and header,,,,
*first store the logo in T-code OAOR, then call that in your report.....
*data: heading        TYPE slis_t_listheader,
     wa_header      TYPE slis_listheader,
    events         TYPE slis_t_event.
To display TOP_OF_PAGE.
FORM top_of_page.
  DATA : text(40),txtdt(40).
  CLEAR l_string.
  l_string = 'JCB India Limited'(hd2).
  wa_header-typ  = 'H'.
  wa_header-info = l_string.
  APPEND wa_header TO heading.                              " index 1.
  CLEAR l_string.
  WRITE :'Number of records:' TO text,'dbcnt' TO text+20 LEFT-JUSTIFIED.
  wa_header-typ  = 'S'.
  wa_header-info = text.
  APPEND wa_header TO heading.
CLEAR l_string.
wa_header-typ  = 'S'.
WRITE : 'Report Run Date  :' TO txtdt,sy-datum TO txtdt+20 DD/MM/YY.
WRITE sy-datum TO dat DD/MM/YY.
wa_header-info = txtdt.
APPEND wa_header TO heading.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
     i_logo             = 'ENJOYSAP_LOGO'
      it_list_commentary = heading.
  CLEAR heading.
ENDFORM.                    "top_of_page
*to execute top-of-page you have to create events.
*for ex......
FORM create_event USING p_events 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_events.
  READ TABLE p_events WITH KEY name = slis_ev_top_of_page
                         INTO ls_event.
  IF sy-subrc = 0.
    MOVE formname_top_of_page TO ls_event-form.
    APPEND ls_event TO p_events.
  ENDIF.
ENDFORM.                    " create_event

Hi,
   Find below code for your question, you may get some idea,,
*& Report  ZACTIONGRIDPRACTICE
REPORT  ZACTIONGRIDPRACTICE.
*data declarations.....
TYPE-POOLS SLIS.
TABLES : T529T ,PA0000.
data : gd_repid type  sy-repid.
DATA : LD_COLOR(10) TYPE N.
DATA : GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV.
Data:  is_fieldcat TYPE slis_fieldcat_alv.
DATA : GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : GD_DATUM TYPE DATUM.
DATA : BEGIN OF WA_TABLE,
                MASSN TYPE T529T-MASSN,
                MNTXT TYPE T529T-MNTXT,
                userg type userg,
                TOTAL TYPE I ,
                begda type begda,
                endda type endda,
                april type i,
                SLNO TYPE I,
                  LINE_COLOR(4) TYPE C,
                END OF WA_TABLE,
                IT_TABLE LIKE TABLE OF WA_TABLE.
data : april type i.
DATA : TEMP TYPE C.
data :    LT_PA0000 TYPE TABLE OF PA0000,
          LT_PA0000_T typE TABLE OF PA0000 with header line.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
        WA_FCAT LIKE LINE OF IT_FCAT.
DATA : IT_EVENTS TYPE SLIS_T_EVENT,
        WA_EVENTS LIKE LINE OF IT_EVENTS.
        wa_events-form = 'HEADER'.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
APPEND WA_EVENTS TO IT_EVENTS.
PERFORM HEADER.
DATA : SLNO TYPE I.
DATA : lv_output      TYPE  dats.
CALL FUNCTION 'ZHR_RE_BE_CALC_START_DATE'
  EXPORTING
    id_daberi   = sy-datum
  IMPORTING
    ed_date_cor = lv_output.
select-options...
selection-screen BEGIN OF BLOCK B WITH FRAME TITLE TEXT-003.
select-options : s_date for sy-datum OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B.
lv_output = sy-datum - 27.
INITIALIZATION.
S_DATE-LOW = lv_output.
S_DATE-HIGH = SY-DATUM.
S_DATE-SIGN = 'I'.
S_DATE-OPTION = 'BT'.
APPEND s_date.
*AT SELECTION-SCREEN ON S_DATE.
*SELECT MASSN INTO TABLE IT_TABLE FROM PA0000 WHERE BEGDA IN S_DATE.
*SELECT STATEMENTS....
start-of-selection.
  SELECT   t529t~MASSN t529t~MNTXT  INTO TABLE IT_table  FROM T529T where SPRSL EQ 'E' and t529t~massn in ('10','13','16','20','28','30','45','01','03') .
DATUM IN S_DATE.
PERFORM LAYOUT.
  loop at it_table into wa_table.
LD_COLOR = 2.
  LD_COLOR = LD_COLOR + 1.
if LD_COLOR = 8.
LD_COLOR = 1.
endif.
concatenate 'C' '1' '11'  into wa_table-LINE_COLOR . "='C410'.
modify it_table from wa_table.
endloop.
  LOOP AT IT_TABLE INTO WA_TABLE." = 'C410'.
select massn from pa0000 into table lt_pa0000 where begda in s_date and  massn = wa_table-massn.
*write : / sy-dbcnt.  gt s_date-low and endda lt s_date-high
*DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
move sy-dbcnt to wa_table-total.
READ TABLE lt_pa0000 INTO LT_PA0000_T WITH KEY MASSN = wa_TABLE-MASSN BINARY SEARCH.
DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
MOVE  LV_LINES to  wa_TABLE-TOTAL.
  MODIFY IT_TABLE FROM WA_TABLE.
MOVE SY-TABIX TO WA_TABLE-SLNO.
  MODIFY IT_TABLE FROM WA_TABLE.
REFRESH : LT_PA0000_t.
CLEAR : LV_LINES.
  ENDLOOP.
loop at it_table into wa_table.
SELECT MASSN FROM PA0000 INTO TABLE lt_pa0000 where begda between '01.02.2008' and '20.02.2008'.
MOVE SY-DBCNT TO   WA_TABLE-APRIL.
MODIFY IT_TABLE FROM WA_TABLE.
*endloop.
*PERFORM STATEMENTS...
PERFORM FCAT USING '1' 'MASSN' 'ACTIONCODE'.
PERFORM FCAT USING '2' 'MNTXT' 'ACTION TYPE'.
PERFORM fcat USING '3' 'TOTAL' 'TOTAL'.
DEFINE m_fieldcat.
    is_fieldcat-fieldname = &1.
    is_fieldcat-hotspot = &2.
    is_fieldcat-seltext_m = &3.
    is_fieldcat-col_pos = &4.
    is_fieldcat-outputlen = &5.
    is_fieldcat-hotspot = &6.
    append is_fieldcat to it_fcat.
    clear is_fieldcat.
  END-OF-DEFINITION.
   m_fieldcat 'SLNO' '' Text-012 '1' '17'  ''.
  m_fieldcat 'MASSN' '' Text-010 '2' '40'  ''.
  m_fieldcat 'MNTXT'  ''  Text-009  '3' '50' ''  .
  m_fieldcat 'TOTAL'  ''  Text-011  '4' '10' 'X'.
  m_fieldcat 'april'  ''  Text-013  '5' '10' 'X'.
*FOR DISPLAYING THE RECORDS...
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
   I_CALLBACK_PROGRAM                = gd_repid
  IS_LAYOUT = GD_LAYOUT
  I_CALLBACK_USER_COMMAND           = ' '
   I_GRID_TITLE                      = 'REPORT'
   IS_LAYOUT                         = gd_LAYOUT
   IT_FIELDCAT                       = IT_FCAT
   I_SAVE                            = 'X'
   IT_EVENTS                         = IT_EVENTS
  TABLES
    T_OUTTAB                          = IT_TABLE.
**&      Form  FCAT
*FORM FCAT  USING   FP_COL_POS
                 FP_FIELDNAME
                 FP_SELTEXT_M.
WA_FCAT-COL_POS = FP_COL_POS.
WA_FCAT-FIELDNAME = FP_FIELDNAME.
wa_fcat-seltext_m = fp_seltext_m.
APPEND WA_FCAT TO IT_FCAT.
ENDFORM.
*&      Form  HEADER
      text
-->  p1        text
<--  p2        text
form header .
  DATA : IT_HEADER TYPE SLIS_T_LISTHEADER,
        WA_HEADER LIKE LINE OF it_header.
  WA_HEADER-TYP = 'H'.
  WA_HEADER-INFO = 'ACTION TYPE REPORT'.
  APPEND WA_HEADER TO IT_HEADER.
  wa_header-typ  = 'S'.
  wa_header-key = Text-022.
  CONCATENATE  s_date-low+6(2) '.'
               s_date-low+4(2) '.'
               s_date-low(4)
               temp
               '.     TO      .'
               s_date-high+6(2) '.'
               s_date-high+4(2) '.'
               s_date-high(4)
               INTO wa_header-info SEPARATED BY space.
  APPEND wa_header TO it_header.
  CLEAR wa_header.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = IT_HEADER
      I_LOGO             = 'HRRU_51050061'.
*select single bstkd into CORRESPONDING FIELDS OF gt_vbkd
*from vbkd where vbeln = rt_outtab-vgbel
*and posnr = '000000'.
*rt_outtab-bstkd = gt_vbkd-bstkd.
ENDFORM.                    " HEADER
*&      Form  LAYOUT
      text
-->  p1        text
<--  p2        text
FORM LAYOUT .
GD_LAYOUT-NO_INPUT = ''.
gd_layout-colwidth_optimize = ''.
gd_layout-totals_text = 'TOTALS'(201).
gd_layout-info_fieldname =      'LINE_COLOR'.
ENDFORM.                    " LAYOUT

Similar Messages

  • How to get head of the department(HOD) as an approver.

    Hi Experts,
    Existing scenario:
    Created travel(international) request after getting approved by 1st level(line-manager) work item will go for next level(final approver Line exco).
    existing code is attached.
    To be developed Scenario:
    After getting approved by 1st level (line-manager) work item will go 2nd level (Head odf hte department) prior to final approval(line-exco).
    Please suggest me how to get Head of the department using bellow logic.
    Pick the ORGEH ( Org unit)  as on 31.12.9999 and pass it to HRP1001 with the following field values
    RSIGN      A
    RELAT      803
    And pick the SOBID ID as on 31.12.9999
    Now pass the SOBID in table HRP1001 , and pass the data with the following field values
    OTYPE – O
    OBJID – same as SOBID
    RSIGN      B
    RELAT      012
    Pick the SOBID
    Now pass the SOBID to HRP1001 and
    RSIGN      A
    RELAT      0008
    SOBID : PERNR
    Pass the PERNR in PA0105  pick the data against SUBTY 0001 .
    Thanks in advance
    Goutam

    why not use an HR evaluation path (transaction OOAW see for example WF_ORGUN ) and read the path with RH_STRUC_GET function module?
    https://help.sap.com/saphelp_erp60_sp/helpdata/en/c5/e4b2c8453d11d189430000e829fbbd/frameset.htm

  • '@' not getting displayed in the ALV report

    Hello,
    I am facing  a strange issue in the ALV report display. A string starting with '@' is not getting displayed and says "default icon " on the report. and this is varying from system to system for the same user.
    can anyone please help me in resolving the issue.
    Thanks in advance.
    Thanks and Regards,
    Santhosh Guptha N.

    @ is a default value as per ALV internal process. This is used in icons .
    I think this is causing the confusion.
    Check in the fieldcat if there is any adjsutment to be made to handle this.
    Br,
    Vijay

  • How to add link in the ALV report?

    Hi ,
      Now, I want to turn to a t-code (e.x.  Va03) after double click column for order of ALV report.
      Is it possible? what i should do?
    Thanl you all~

    Yes  , it is Possible  in ALV  .
    From the  Sales order Field (VBLEN)  in the Basic List to Sales Order Display TrascationCode  : (VA03).
    Here is the Sample code  for Purchase  Order Display .
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    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_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Reward  Points if it is usefull,,,
    Girish

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • How to add 2 more field to the  Header of FBL5N ALV report output

    Hi All,
    I have copied and made some modification to the standard transaction FBL5N and added some fields to the ALV report line Items but how to add fields to the header part i.e if you execute the transaction FBL5n, you will get the ALV report, in the header part customer no, company code then I need to add the 2 more fields. can any one tell me that which structure or where I need to add these fields to be appear in ALV output screen.
    Thanks in advance.
    Swapna.

    Hi Mohamed,
    If you copied Z-FM successfully, then you have to go to subroutine TOP_OF_PAGE to add your field:
    *&      Form  TOP_OF_PAGE
    FORM top_of_page.
      DATA: b_suppress   LIKE boole-boole,
            opfi_text    LIKE eptext OCCURS 10 WITH HEADER LINE,
            n_color      TYPE i.
    *  IF     NOT it_items-bukrs IS INITIAL               "737295
    *     AND NOT it_items-konto IS INITIAL               "737295
    *     AND NOT it_items-koart IS INITIAL.              "737295
      gs_items = gt_alv.
    *  ENDIF.                                             "737295
    * skip first call at top of page:
      IF NOT gd_first_top IS INITIAL.
        CLEAR gd_first_top.
        EXIT.
      ENDIF.
      IF x_grid = c_x OR x_inet = c_x.                          "1012201
        PERFORM grid_top_of_page.
        EXIT.
      ENDIF.
    *... open FI: get header text.
    * first fill some RFXPO fields for general info:
      CLEAR: s_rfxpo, wa_kna1, wa_lfa1, wa_ska1.
      s_rfxpo-bukrs = gs_items-bukrs.
      s_rfxpo-kkber = gs_items-kkber.
      s_rfxpo-koart = gs_items-koart.
      s_rfxpo-konto = gs_items-konto.
      s_rfxpo-vrbez = gs_variant-variant.
      s_rfxpo-waers = gs_items-waers.
    * update master record:
      PERFORM fill_master_rec  USING gs_items-koart
                                     gs_items-konto
                                     gs_items-bukrs. " note 698396
      CALL FUNCTION 'OPEN_FI_PERFORM_00001640_E'
        EXPORTING
          i_rfxpo             = s_rfxpo
          i_kna1              = wa_kna1
          i_lfa1              = wa_lfa1
          i_ska1              = wa_ska1
        IMPORTING
          e_suppress_standard = b_suppress
        TABLES
          t_lines             = opfi_text.
    *... display open FI text:
      IF x_konto_sort = 'X'.
        LOOP AT opfi_text.
          CASE opfi_text-color.
            WHEN 1.
              FORMAT COLOR 1.
            WHEN 2.
              FORMAT COLOR 2.
            WHEN 3.
              FORMAT COLOR 3.
            WHEN 4.
              FORMAT COLOR 4.
            WHEN 5.
              FORMAT COLOR 5.
            WHEN 6.
              FORMAT COLOR 6.
            WHEN 7.
              FORMAT COLOR 7.
          ENDCASE.
          WRITE: / opfi_text-text.
        ENDLOOP.
        FORMAT RESET.
      ENDIF.
    *... display other header text:
      IF b_suppress NE 'X'.
        PERFORM display_custom_header.
        PERFORM display_ccard_lines.
      ENDIF.
    " Put your field somewhere...
    ENDFORM.                               " TOP_OF_PAGE
    Good luck,
    Thanks,

  • Need to display data on the right side in the header area of alv report.

    hi experts,
                       I want to display data in the header area of alv report on the right side  . I have already used function for events on the header side data is getting displayed on the left side .but i want data to be displayed on the right side.
    regards,
    andrews.

    Hi,
    Hope this below code helps you.
    Take care,
    Çağatay.
    * build header for alv
    FORM top_of_page_split USING r_top TYPE REF TO cl_dd_document.
    DATA: s_tab TYPE sdydo_text_table,
          c_area TYPE REF TO cl_dd_area,
          text TYPE sdydo_text_element.
    TYPES: BEGIN OF tab_text,
    text TYPE sdydo_text_element,
    END OF tab_text.
    DATA: i_text TYPE TABLE OF tab_text.
    DATA: w_text TYPE tab_text.
    CALL METHOD r_top->initialize_document.
    CALL METHOD r_top->vertical_split
    EXPORTING
    split_area = r_top
    split_width = '70%'
    IMPORTING
    right_area = c_area.
    CONCATENATE sy-datum+4(2)
    sy-datum+6(2)
    sy-datum(4)
    INTO date1.
    CONCATENATE 'DATE'  date1
    INTO w_text-text
    SEPARATED BY ':'.
    APPEND w_text TO i_text.
    CONCATENATE 'time:' sy-uzeit INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'uesr:' sy-uname INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'local date:' sy-datlo INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'time zone:' sy-zonlo INTO w_text .
    APPEND w_text TO i_text.
    s_tab[] = i_text[].
    CALL METHOD c_area->add_text
    EXPORTING
    text_table = s_tab
    fix_lines = 'X'
    sap_fontsize = cl_dd_document=>medium
    sap_emphasis = cl_dd_document=>strong.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 60.
    text = 'THIS IS REPORT HEADING'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 70.
    text = 'THIS IS REPORT HEADING1'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 80.
    text = 'THIS IS REPORT HEADING2'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading1'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading2'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading3'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    ENDFORM. "TOP_OF_PAGE_SPLIT

  • How to do the ALV report output in groups and caluculate the tOTALS(URGENT

    Hi
    In my ALV report output .I have to group the output based on the DAYS field
    0-10 days in one group
    10-30 days in one group
    above 30 days one group
    There is also a field by name "AMOUNT" in my output.
    I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
    Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
    Thanks in Advance

    Please don't repost your questions...
    Check out my answer in your other post.
    How to make the ALV report in groups  and caluculate the TOTALS
    Regards,
    Naimesh Patel

  • Crystal 6.0 : How to hide the Page footer and Page Header of the Main Report on the Sub report.

    Post Author: pranay
    CA Forum: Crystal Reports
    Hi ,
    I have a Main report and a Sub report .  When a subreport spans across multiple pages , the page header and page footer of the main report gets displayed along with it . I want to hide the Page Footer and Page Header of the main report when a sub report is displayed . Is there any way it could be acheived in Crystal Report 6.0.

    I am assuming you are talking about the JSControl dropdown menu navigation. The easiest way to hide Community pages is to disable the Below Banner View for that navigation scheme, although it also disables the Subcommunties, Related Communities and Go up to Parent Community links. If you still want these in below the banner menu you could not display Community Pages in the "In this Community" tab and only leave the "Community Members and Knowledge Directly" link in there.
    You would think that it would be better to remove the "In this Community" tab althogether but it is tricky to remove it due to the fact that there needs to be a default horizontal menu displayed all the time. Not all Communities will have a Subcommunities or Related Communities tab so these communities would not display any below banner menus at all if there is no "In this Community" tab, which could be confusing.

  • How to display the alv report blocks wise with out using the blocked alv

    Hi
    How to display the alv report with out using the blocked alv function module.
    Thanks
    Chinnu

    see this Standard Program
    RPR_ABAP_SOURCE_SCAN

  • How to obtain the alv reports in the dilog programing.

    how to obtain the alv reports in the dialog programming, that is when the push button in the screen in clicked it must be directed to the report, where to write the code for the report.

    Hi
    Use LEAVE TO LIST PROCESSING and develop your normal ALV dispaly as usual. System automatically takes care of this.
    I tried for normal report but try above even in the case of ALV reports
    Cheerz
    Ram

  • Issue in displaying header details in ALV report

    Hi,
    I have used slis_t_listheader and REUSE_ALV_COMMENTARY_WRITE to display the header details in ALV report.I want the details to be displayed as below.
    Requester : ----------------------                                                                               Page: 1
    Program: -----------------------                                                                                Date:---------
                                                                     Title of Report
    But when I use the structure slis_t_listheader to display the header details,all the fields are coming one below the other.
    How can I get the fields as shown in the above format
    Edited by: Abaper12345 on Jun 25, 2009 7:54 AM

    Hi,
    Go through following code... its showing the data exactly the way you want....
    REPORT  TEST3.
    TYPE-POOLS:slis.
    TABLES:MARA.
    *Type Declaration
    TYPES:BEGIN OF t_mara,
          matnr TYPE mara-matnr,
          ersda TYPE mara-ersda,
          ernam TYPE mara-ernam,
          END OF t_mara.
    *Internal Table
    data:it_mara type standard table of t_mara.
    *Work Area
    data:wa_mara type t_mara.
    DATA:i_repid TYPE sy-repid .
    i_repid = sy-repid.
    *Declaration for field catalog
    DATA : fcat TYPE slis_t_fieldcat_alv,
           wa_fcat TYPE slis_fieldcat_alv.
    *Declaration for Layout
    data : WA_LAYOUT type SLIS_LAYOUT_ALV.
    *Initializing ColumnWidth_Optimize For Layout
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    *Fetching data into internal tables
      PERFORM get_data.
    *Buil Fieldcatalog
      PERFORM build_fcat.
    *Display ALV Report
      PERFORM alv_display.
    *Build Fieldcat
    FORM build_fcat .
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Material Number'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERSDA'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Date'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERNAM'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'User'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      endform.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    select matnr ersda ernam from mara into table it_mara.
    endform.                    " GET_DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form ALV_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = i_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
       I_CALLBACK_HTML_TOP_OF_PAGE       = 'HTML_TOP_OF_PAGE'
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = fcat
      TABLES
        t_outtab                          = it_mara
    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.                    " ALV_DISPLAY
    *&      Form  html_top_of_page " I_CALLBACK_HTML_TOP_OF_PAGE  "
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Program'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Requester'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_gap
      EXPORTING
         width      = 125
    CALL METHOD document->add_text
      EXPORTING
        text          = 'This Is Test Data'
        sap_color     = document->list_group
       sap_fontsize  = document->LARGE
       sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    ENDFORM.                    "HTML_TOP_OF_PAGE
    Thanks & Regards
    Ashu SIngh

  • How to get check box in alv output

    hi gurus
    can anyone explian me how to get check box in alv output
    it should not be a pop up window
    i want to get in output itself
    tahnk you
    regards
    kals.

    Hi
    by using rs_selfield
    ty to call dynamic subroutine..
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield. "#EC CALLED
    read table rs-selfield with key cond = 'X'
    endform.
    see the below example
    REPORT Z_GET_REFRESH no standard page heading.
    type-pools : slis.
    tables : makt,
    mara.
    data : i_fieldcat type slis_t_fieldcat_alv.
    CONSTANTS :
    gc_refresh TYPE syucomm VALUE '&REFRESH'.
    data : begin of i_makt occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of i_makt.
    data : v_repid like sy-repid,
    g_user_command type slis_formname value 'USER_COMMAND',
    g_status_set type slis_formname value 'SET_PF_STATUS',
    lt_event_exit TYPE slis_t_event_exit,
    ls_event_exit TYPE slis_event_exit.
    DATA:LC_GLAY TYPE LVC_S_GLAY.
    select-options s_matnr for mara-matnr .
    start-of-selection.
    select matnr maktx from makt into table i_makt
    where matnr in s_matnr.
    end-of-selection.
    Fill the fieldcatlog
    perform fill_field.
    Call the FM
    perform call_fm.
    *& Form fill_field
    text
    --> p1 text
    <-- p2 text
    FORM fill_field.
    data wa_fieldcat type slis_fieldcat_alv.
    clear : wa_fieldcat.
    wa_fieldcat-tabname = 'I_MAKT'.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-outputlen = '18'.
    wa_fieldcat-seltext_l = 'Material #'.
    wa_fieldcat-col_pos = '1'.
    append wa_fieldcat to i_fieldcat.
    clear : wa_fieldcat.
    wa_fieldcat-tabname = 'I_MAKT'.
    wa_fieldcat-fieldname = 'MAKTX'.
    wa_fieldcat-outputlen = '40'.
    wa_fieldcat-seltext_l = 'Material Desc'.
    wa_fieldcat-col_pos = '2'.
    append wa_fieldcat to i_fieldcat.
    ENDFORM. " fill_field
    *& Form call_fm
    text
    --> p1 text
    <-- p2 text
    FORM call_fm.
    v_repid = sy-repid.
    LC_GLAY-EDT_CLL_CB = 'X'.
    CLEAR ls_event_exit.
    ls_event_exit-ucomm = gc_refresh. " Refresh
    ls_event_exit-after = 'X'.
    APPEND ls_event_exit TO lt_event_exit.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = v_repid
    I_CALLBACK_PF_STATUS_SET = g_status_set
    I_CALLBACK_USER_COMMAND = g_user_command
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS = LC_GLAY
    IS_LAYOUT =
    IT_FIELDCAT = i_fieldcat
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT = lt_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
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT =
    IT_HYPERLINK =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IT_EXCEPT_QINFO =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = i_makt
    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. " call_fm
    FORM USER_COMMAND *
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield. "#EC CALLED
    data i_RSPARAMS like RSPARAMS occurs 0.
    CASE R_UCOMM.
    WHEN '&IC1'.
    read table i_makt index rs_selfield-tabindex.
    SET PARAMETER ID 'MAT' FIELD i_makt-matnr.
    if not i_makt-matnr is initial.
    call transaction 'MM02' and skip first screen.
    endif.
    when '&REFRESH'.
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    CURR_REPORT = v_repid
    IMPORTING
    SP =
    TABLES
    SELECTION_TABLE = i_RSPARAMS
    EXCEPTIONS
    NOT_FOUND = 1
    NO_REPORT = 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.
    submit z_get_refresh with selection-table i_RSPARAMS.
    rs_selfield-refresh = 'X'.
    ENDCASE.
    MOVE '&REFRESH' TO r_ucomm.
    ENDFORM.
    FORM set_pf_status *
    FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
    DELETE Rt_extab WHERE fcode = gc_refresh.
    SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
    EXCLUDING Rt_extab.
    *SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
    SET TITLEBAR sy-tcode.
    ENDFORM.

  • How to get check box in alv grid list output

    hi gurus,
    can anyone inform me
    how to get check box in alv output it should not be a pop up window
    thank you
    regards
    kals.

    or
    hi go through the fallowing code.
    code*&----
    *& Report YGS_ALV_BOM *
    REPORT YGS_ALV_BOM .
    TABLES : MAST,STKO,STPO.
    TYPE-POOLS: SLIS.
    TYPES : BEGIN OF TY_MAST,
    CHECK_BOX,
    MATNR TYPE MAST-MATNR,
    WERKS TYPE MAST-WERKS,
    STLAN TYPE MAST-STLAN,
    STLNR TYPE MAST-STLNR,
    STLAL TYPE MAST-STLAL,
    END OF TY_MAST.
    TYPES : BEGIN OF TY_STKO,
    STLTY TYPE STKO-STLTY,
    STLNR TYPE STKO-STLNR,
    STLAL TYPE STKO-STLAL,
    STKOZ TYPE STKO-STKOZ,
    BMENG TYPE STKO-BMENG,
    BMEIN TYPE STKO-BMEIN,
    END OF TY_STKO.
    TYPES : BEGIN OF TY_STPO,
    LIGHTS,
    STLTY TYPE STPO-STLTY,
    STLNR TYPE STPO-STLNR,
    STLKN TYPE STPO-STLKN,
    STPOZ TYPE STPO-STPOZ,
    IDNRK TYPE STPO-IDNRK,
    MENGE TYPE STPO-MENGE,
    MEINS TYPE STPO-MEINS,
    END OF TY_STPO.
    DATA : IT_MAST TYPE TABLE OF TY_MAST,
    WA_MAST TYPE TY_MAST,
    IT_STKO TYPE TABLE OF TY_STKO,
    WA_STKO TYPE TY_STKO,
    IT_STPO TYPE TABLE OF TY_STPO,
    WA_STPO TYPE TY_STPO.
    DATA : lt_fieldcat TYPE slis_t_fieldcat_alv,
    ls_layout TYPE slis_layout_alv,
    ls_event TYPE slis_alv_event,
    lt_event TYPE slis_t_event,
    it_sortinfo type slis_t_sortinfo_alv,
    ls_header TYPE slis_listheader,
    lt_header TYPE slis_t_listHEADER.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS : S_MATNR FOR MAST-MATNR.
    START-OF-SELECTION.
    PERFORM GET_DATA.
    PERFORM BUILD_FIELDCAT USING LT_FIELDCAT.
    PERFORM BUILD_LAYOUT.
    END-OF-SELECTION.
    PERFORM DISPLAY_DATA.
    *& Form GET_DATA
    text
    --> p1 text
    <-- p2 text
    form GET_DATA .
    REFRESH : IT_MAST.
    SELECT MATNR
    WERKS
    STLAN
    STLNR
    FROM MAST
    INTO CORRESPONDING FIELDS OF TABLE IT_MAST
    WHERE MATNR IN S_MATNR.
    endform. " GET_DATA
    *& Form BUILD_FIELDCAT
    text
    --> p1 text
    <-- p2 text
    form BUILD_FIELDCAT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    REFRESH : LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 1.
    L_FIELDCAT-FIELDNAME = 'MATNR'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'MATNR'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 2.
    L_FIELDCAT-FIELDNAME = 'WERKS'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'WERKS'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 3.
    L_FIELDCAT-FIELDNAME = 'STLNR'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    endform. " BUILD_FIELDCAT
    *& Form BUILD_LAYOUT
    text
    --> p1 text
    <-- p2 text
    form BUILD_LAYOUT .
    CLEAR LS_LAYOUT.
    LS_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
    LS_LAYOUT-BOX_TABNAME = 'IT_MAST'.
    endform. " BUILD_LAYOUT
    *& Form DISPLAY_DATA
    text
    --> p1 text
    <-- p2 text
    form DISPLAY_DATA .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_STRUCTURE_NAME =
    IS_LAYOUT = LS_LAYOUT
    IT_FIELDCAT = LT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    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
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = IT_MAST
    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 PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
    SET PF-STATUS 'YSTATUS' OF PROGRAM SY-REPID
    EXCLUDING RT_EXTAB.
    ENDFORM.
    FORM USER_COMMAND USING RF_UCOMM TYPE SY-UCOMM
    SELFIELD TYPE SLIS_SELFIELD.
    CASE RF_UCOMM.
    WHEN '&NEXT'.
    PERFORM GET_DATA_BOM .
    PERFORM BUILD_FIELDCAT_BOM USING LT_FIELDCAT.
    PERFORM BUILD_LAYOUT_BOM.
    PERFORM DISPLAY_DATA_BOM.
    ENDCASE.
    ENDFORM.
    *& Form GET_DATA_BOM
    text
    --> p1 text
    <-- p2 text
    form GET_DATA_BOM .
    CLEAR : WA_STPO,
    WA_MAST.
    REFRESH : IT_STPO.
    DATA : IT_CHECK TYPE TABLE OF TY_MAST.
    LOOP AT IT_MAST INTO WA_MAST.
    IF WA_MAST-CHECK_BOX EQ 'X'.
    APPEND WA_MAST TO IT_CHECK.
    ENDIF.
    ENDLOOP.
    SELECT STLTY
    STLNR
    STLKN
    VGKNT
    IDNRK
    MENGE
    MEINS
    FROM STPO
    INTO CORRESPONDING FIELDS OF TABLE IT_STPO
    FOR ALL ENTRIES IN IT_CHECK
    WHERE IDNRK EQ IT_CHECK-MATNR.
    CLEAR WA_STPO.
    LOOP AT IT_STPO INTO WA_STPO.
    SELECT SINGLE * FROM MAST WHERE MATNR EQ WA_STPO-IDNRK.
    IF SY-SUBRC = 0.
    WA_STPO-LIGHTS = '2'.
    ELSE.
    WA_STPO-LIGHTS = '1'.
    ENDIF.
    MODIFY IT_STPO FROM WA_STPO.
    ENDLOOP.
    endform. " GET_DATA_BOM
    *& Form BUILD_FIELDCAT_BOM
    text
    --> p1 text
    <-- p2 text
    form BUILD_FIELDCAT_BOM USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    REFRESH : LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 1.
    L_FIELDCAT-FIELDNAME = 'STLTY'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLTY'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 2.
    L_FIELDCAT-FIELDNAME = 'STLNR'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 3.
    L_FIELDCAT-FIELDNAME = 'STLKN'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLKN'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 4.
    L_FIELDCAT-FIELDNAME = 'IDNRK'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'IDNRK'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 5.
    L_FIELDCAT-FIELDNAME = 'MENGE'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'MENGE'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    endform. " BUILD_FIELDCAT_BOM
    *& Form BUILD_LAYOUT_BOM
    text
    --> p1 text
    *<-- p2 text
    form BUILD_LAYOUT_BOM .
    CLEAR : LS_LAYOUT.
    LS_LAYOUT-LIGHTS_FIELDNAME = 'LIGHTS'.
    LS_LAYOUT-LIGHTS_TABNAME = 'IT_STPO'.
    endform. " BUILD_LAYOUT_BOM
    *& Form DISPLAY_DATA_BOM
    text
    --> p1 text
    <-- p2 text
    form DISPLAY_DATA_BOM .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND_BOM'
    I_CALLBACK_TOP_OF_PAGE = 'TOP9'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = 'ALV_BACKGROUND'
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT = LS_LAYOUT
    IT_FIELDCAT = LT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    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
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = IT_STPO
    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_BOM
    FORM TOP9 .
    CLEAR LS_HEADER.
    REFRESH LT_HEADER.
    LS_HEADER-TYP = 'H'.
    LS_HEADER-INFO = 'BILL OF MATERIALS'.
    APPEND LS_HEADER TO LT_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = LT_HEADER
    I_LOGO = 'ENJOYSAP_LOGO'
    I_END_OF_LIST_GRID =
    ENDFORM.
    FORM USER_COMMAND_BOM USING RF_UCOMM_BOM LIKE SY-UCOMM
    SEL_FIELD TYPE SLIS_SELFIELD.
    CASE RF_UCOMM_BOM.
    WHEN '&IC1'.
    SET PARAMETER ID 'MAT' FIELD WA_STPO-IDNRK.
    SET PARAMETER ID 'WRK' FIELD WA_MAST-WERKS.
    SET PARAMETER ID 'CSA' FIELD WA_MAST-STLAN.
    CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
    ENDCASE.[/code]

  • How to get f4 help in alv grid in container-urgent

    hi,
    how to get f4 help in alv grid in container using abap objects
    ganesh

    Hi Ganesh,
    Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
    Here is part of the header documentation:
    *& Report  BCALV_GRID_F4_HELP                                          *
    Purpose:
    ~~~~~~~~
    This report illustrates the use of f4-Help in an alv grid control.
    Background:
    ~~~~~~~~~~~
    There a two possibilities to implement an f4-Help in the alv grid
    control: one can either use standard f4-help or write one by Hand.
    For the former there is nothing to do at all. This report shows how
    to implement user-defined f4-help.
    I am sure you will find within this report the solution you are looking for.
    Reward points if this Helps.
    Manish

Maybe you are looking for

  • Some Doubts in JAXB

    1. I want compile multiple schemas at a time. should I give same package for all schema ? 2. When I give same package for all schema, The generate ObjectFactory class is of last schema. 3. Should I give different package for each schema ?

  • Group e-mail problem

    When sending a group e-mail, with my new iMac (retina 5K), everyone has been able to see the other addressees.  Checked 'When sending to a group, show all member addresses': this box was NOT ticked.

  • Deployment in OWB

    Hi, I have developed a mapping in OWB.Now there is a new source which is added in the mapping. Is it possible to execute the mapping with the new changes without deploying the mapping or re-deploying the changed mapping. Is there any option in OWB fo

  • Bapi_material_savedata and material master change log

    Hi, The BAPI_MATERIAL_SAVEDATA is called to extend a part number to a storage location and change MRP4 Re-order point qty and Replenishment qty. The material master (MM03) correctly shows that the part number was extended successfully and the Re-orde

  • Desktop freezes to solid blue screen. Why?

    Computer will freeze with solid blue screen slightly descending to lighter blue at bottom with horizontal (very faint) lines. Please help. Not computer savvy. Can't afford professional tax hourly rate. Thank you thank you.!!