REPORT zabd.

TABLEScrmd_orderadm_h.

TYPE-POOLSslis.

TYPES:BEGIN OF t_table,

        guid        TYPE crmd_orderadm_h-guid,
        object_id   TYPE crmd_orderadm_h-object_id,
        object_type TYPE crmd_orderadm_h-object_type,
        description TYPE crmd_orderadm_h-description,
        date        TYPE dats,
        time        TYPE /saptrx/time,

      END OF t_table.


DATA gt_table TYPE TABLE OF t_table.
DATA gs_table TYPE t_table.


DATAgs_layout    TYPE slis_layout_alv,
      fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      gd_layout    TYPE slis_layout_alv,
      gd_repid     LIKE sy-repid,
      g_save       TYPE VALUE 'X',
      g_variant    TYPE disvariant.




SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS so_tarih FOR sy-datum NO-EXTENSION.

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

  PERFORM read_data
  PERFORM build_fieldcatalog
  PERFORM display_alv

END-OF-SELECTION.

FORM read_data.

  DATA t_pdlist   TYPE TABLE OF bbp_pds_pdlist,
         t_messages TYPE TABLE OF bbp_pds_messages.


  DATAwa_pdlist TYPE bbp_pds_pdlist,
        ls_date   TYPE sy-datlo,
        ls_time   TYPE sy-timlo.



  CALL FUNCTION 'BBP_PD_SC_GETLIST'
    EXPORTING
      i_create_date    so_tarih-low
      i_create_date_to so_tarih-high
    TABLES
      e_messages       t_messages
      e_pdlist         t_pdlist.

  gs_table-date ls_date.
  gs_table-time ls_time.

  LOOP AT t_pdlist INTO wa_pdlist.

    gs_table-guid wa_pdlist-guid.
    gs_table-object_id wa_pdlist-object_id.
    gs_table-object_type wa_pdlist-object_type.
    gs_table-description wa_pdlist-description.

    APPEND gs_table TO gt_table.

  ENDLOOP.

ENDFORM.



FORM display_alv .
  gd_repid sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program gd_repid
      it_fieldcat        fieldcatalog[]
      i_save             'X'
    TABLES
      t_outtab           gt_table
    EXCEPTIONS
      program_error      1
      OTHERS      2.
  IF sy-subrc <> 0.
  ENDIF.
ENDFORM.




Serkan AKKAVAK

Computer Engineer

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com