Sei sulla pagina 1di 4

*&---------------------------------------------------------------------*

*& Include
ZIXX_CONVERSION_LOG
*&---------------------------------------------------------------------*
*
* This include is used to provide the necessary Output table format
* to display the log for all Conversion program.
*
*
*
* Caution:
*
See documentation for Function Modules REUSE_ALV_GRID_DISPLAY and
*
REUSE_ALV_COMMENTARY_WRITE if needed
*
*
* Usage:
*
rec_no(5)
TYPE n
*
msg_typ
TYPE bdc_mart
*
msg_id
TYPE bdc_mid
*
msg_num
TYPE msgnr
*
msg_key(40)
TYPE c
*
msg_txt(255) TYPE c
*
*REC_NO is for the record number from the flat file
*MSG_TYP is for the type of message we want display
*MSG_ID id the message class for the messages raised
*MSG_NUM is the number of message which has been raised
*MSG_KEY is the key fields for program - concatenate the key fields
*
separated by space
*MSG_TXT is text that has to be displayed for the message.
*
* Once it is filled, fill the parameters
*
gv_tot_rec(5)
TYPE c
*
gv_suc_rec(5)
TYPE c
*
gv_err_rec(5)
TYPE c
*
gv_ifnam
TYPE rlgrap-filename
*
gv_efnam
TYPE rlgrap-filename
* In case if we are not in need to download the error file
* then leave the field gv_efnam blank
*
*
The following is an example of how to make use of this include
*
*
PERFORM LOG_DISPLAY.
*----------------------------------------------------------------------*
TYPES : BEGIN OF gt_log,
rec_no(5)
msg_typ
msg_id
msg_num
msg_key(40)
msg_txt(255)
END OF gt_log.
DATA :

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

n,
bdc_mart,
bdc_mid,
msgnr,
c,
c,

gv_tot_rec(5)
gv_suc_rec(5)
gv_err_rec(5)
gv_ifnam
gv_efnam

TYPE
TYPE
TYPE
TYPE
TYPE

c,
c,
c,
rlgrap-filename,
rlgrap-filename .

DATA: gi_log TYPE TABLE OF gt_log,


gw_log TYPE gt_log.
data: gv_title type LVC_TITLE." value 'Detail Log'.
TYPE-POOLS: slis.
INITIALIZATION.
* generate texts
MOVE 'Detail Log'(uf0) TO gv_title.

"#EC *
"#EC *

*&---------------------------------------------------------------------*
*&
Form log_display
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM log_display.
DATA : li_fieldcat
lw_fieldcat
lw_print

TYPE slis_t_fieldcat_alv,
TYPE slis_fieldcat_alv,
TYPE slis_print_alv.

* Populating Field catlog.


lw_fieldcat-col_pos
= '1'.
lw_fieldcat-fieldname
= 'REC_NO'.
lw_fieldcat-seltext_s
= 'RECORD NUM'.
APPEND lw_fieldcat TO li_fieldcat.
lw_fieldcat-col_pos
= '2'.
lw_fieldcat-fieldname
= 'MSG_TYP'.
lw_fieldcat-seltext_s
= 'MSG TYPE'.
APPEND lw_fieldcat TO li_fieldcat.
lw_fieldcat-col_pos
= '3'.
lw_fieldcat-fieldname
= 'MSG_ID'.
lw_fieldcat-seltext_s
= 'MSG ID'.
APPEND lw_fieldcat TO li_fieldcat.
lw_fieldcat-col_pos
= '4'.
lw_fieldcat-fieldname
= 'MSG_NUM'.
lw_fieldcat-seltext_s
= 'MSG NUM'.
lw_fieldcat-outputlen
= '7'.
APPEND lw_fieldcat TO li_fieldcat.
lw_fieldcat-col_pos
= '5'.
lw_fieldcat-fieldname
= 'MSG_KEY'.
lw_fieldcat-seltext_s
= 'MSG KEY'.
lw_fieldcat-outputlen
= '40'.
APPEND lw_fieldcat TO li_fieldcat.
lw_fieldcat-col_pos
= '6'.
lw_fieldcat-fieldname
= 'MSG_TXT'.
lw_fieldcat-seltext_s
= 'MSG TEXT'.
lw_fieldcat-outputlen
= '255'.
APPEND lw_fieldcat TO li_fieldcat.
* clear sy-binpt.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING

i_callback_program
= sy-cprog
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title
= gv_title
it_fieldcat
= li_fieldcat
i_default
= 'X'
i_save
= 'A'
TABLES
t_outtab
= gi_log
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.

"log_display

*&---------------------------------------------------------------------*
*&
Form populate_fieldcat
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM top_of_page.
DATA gt_list_top_of_page TYPE slis_t_listheader.
DATA wa_list_top
TYPE slis_listheader.
DATA: gd_layout
TYPE slis_layout_alv.
* Initialize gt_list_top_of_page
REFRESH: gt_list_top_of_page.
MOVE: 'H'
'Nielsen'
APPEND wa_list_top

TO wa_list_top-typ,
TO wa_list_top-info.
TO gt_list_top_of_page.

"#EC NOTEXT

MOVE: 'S'
'Total No of Records'
gv_tot_rec
APPEND wa_list_top

TO
TO
TO
TO

wa_list_top-typ,
wa_list_top-key,
wa_list_top-info.
gt_list_top_of_page.

"#EC NOTEXT

MOVE: 'S'
TO wa_list_top-typ,
'No of Success Records' TO wa_list_top-key,
gv_suc_rec
TO wa_list_top-info.
APPEND wa_list_top
TO gt_list_top_of_page.

"#EC NOTEXT

MOVE: 'S'
TO wa_list_top-typ,
'No of Failed Records' TO wa_list_top-key,
gv_err_rec
TO wa_list_top-info.
APPEND wa_list_top
TO gt_list_top_of_page.

"#EC NOTEXT

MOVE: 'S'
'Input File Name'
gv_ifnam
APPEND wa_list_top

TO
TO
TO
TO

wa_list_top-typ,
wa_list_top-key,
wa_list_top-info.
gt_list_top_of_page.

"#EC NOTEXT

IF gv_efnam IS NOT INITIAL.


MOVE: 'S'
'Error File Name'
gv_efnam
APPEND wa_list_top

TO
TO
TO
TO

wa_list_top-typ,
wa_list_top-key,
wa_list_top-info.
gt_list_top_of_page.

"#EC NOTEXT

ENDIF.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo
= 'Z_NIELSEN'
it_list_commentary = gt_list_top_of_page.
ENDFORM.
"top_of_page

Potrebbero piacerti anche