Saturday, November 22, 2014

Dərs 24: ABAP ilə ALV Hesabatı hazırmaq üsulu2 (REUSE_ALV_GRID_DISPLAY)...


SE38 Əməliyyat kodundan proqram yaradırıq və SPFLİ Table-dan məlumatlari İnternal table-a Select edirik. Sonra isə Pattern düyməsinə vururuq. Açılan Pəncərədə CALL FUNCTİON (REUSE_ALV_GRID_DISPLAY) bölməsinə funksiyanın adını yazırıq və Enter düyməsinə basırıq.

Proqramı çalışdıran zaman açılan ilk pəncərənin seçim ekranından dəyərləri seçirik və proqramı yenidən çalışdırırıq.


*& Report  ZALV_GOSTER
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report  zalv_goster.

tables spfli.
type-pools slis.

select-options pa_car for spfli-carrid.

datagt_test type table of spfli.



start-of-selection.

  select from spfli
           into table gt_test where carrid in pa_car.
  if sy-subrc <> 0.
    message 'Melumat yoxdur...' type 'I'.
  endif.

  perform alv_goster.
*&---------------------------------------------------------------------*
*&      Form  ALV_GOSTER
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form alv_goster .
  call function 'REUSE_ALV_GRID_DISPLAY'
   exporting
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
      i_callback_program                'ZALV_GOSTER'
*     I_CALLBACK_PF_STATUS_SET          = ' '
 *     i_callback_user_command           =
      i_callback_top_of_page            'BASLIQ'
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
      i_structure_name                  'SPFLI'
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
*     IS_LAYOUT                         =
*     IT_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
*     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                          gt_test
*   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_GOSTER

*&---------------------------------------------------------------------*
*&      Form  BASLIQ
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form basliq.
  datalt_comment type slis_t_listheader.
  datals_comment like line of lt_comment.
  datalv_tarix type length 10.



  ls_comment-typ 'H'.
  ls_comment-info 'SAP ABAP AZERBAIJAN...'.
  append ls_comment to lt_comment.

  ls_comment-typ 'S'.
  write sy-datum to lv_tarix mm/dd/yyyy.
  ls_comment-info lv_tarix.
  append ls_comment to lt_comment.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
      it_list_commentary lt_comment
*     I_LOGO             =
*     I_END_OF_LIST_GRID =
*     I_ALV_FORM         =
    .



endform.                    "BASLIQ

No comments:

Post a Comment