*&---------------------------------------------------------------------*
*& Report ZBSD_ZAR_5202222
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZBSD_ZAR_5202222.
************************************************************************
* Program Name : ZR_00188B3F78331ED2ABB29778F269541E
* Description :
* Created On : 25.04.13
* Developer :
* Modification Log
************************************************************************
* Transport# Date Developer Description
************************************************************************
* 25.04.13
************************************************************************
************************************************************************
************************************************************************
***************DATA DECLARATION*****************************************
************************************************************************
************************************************************************
************************************************************************
***************ALV TYPE POOLS*******************************************
************************************************************************
TYPE-POOLS:
SLIS,KKBLO.
************************************************************************
***************SAP TABLES***********************************************
************************************************************************
TABLES:
VBRP. "Billing Document: Item Data
************************************************************************
***************CONSTANTS************************************************
************************************************************************
Constants:
C_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
X VALUE 'X',
YES VALUE 'Y',
NO VALUE 'N'.
************************************************************************
***************TYPES****************************************************
************************************************************************
TYPES: BEGIN OF TP_VBRP,
VRKME TYPE VRKME, "VRKME
NETWR TYPE NETWR_FP, "NETWR_FP
MATNR TYPE MATNR, "MATNR
END OF TP_VBRP.
TYPES: BEGIN OF TP_COLLECT,
VRKME TYPE VRKME, "Sales unit
NETWR TYPE NETWR_FP, "Net value
MATNR TYPE MATNR, "Material
END OF TP_COLLECT.
************************************************************************
***************VARIABLES************************************************
************************************************************************
DATA:
GV_FIELDNAME TYPE FIELDNAME,
GV_FIELDVALUE TYPE CHAR100.
************************************************************************
***************DATA STRUCTURE*******************************************
************************************************************************
DATA:
GS_VBRP TYPE TP_VBRP,
GS_COLLECT TYPE TP_COLLECT.
************************************************************************
***************FIELD SYMBOLS********************************************
************************************************************************
FIELD-SYMBOLS:
<xicon1> TYPE icon_l2,
<xicon2> TYPE icon_l2,
<xicon1h> TYPE icon_l2,
<xicon2h> TYPE icon_l2,
<collect> TYPE tp_collect.
************************************************************************
***************INTERNAL TABLES******************************************
************************************************************************
DATA:
GT_VBRP TYPE TABLE OF TP_VBRP,
GT_COLLECT TYPE TABLE OF TP_COLLECT.
***ALV Tables*****
DATA:
gt_field_cat TYPE SLIS_T_FIELDCAT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
************************************************************************
************************************************************************
************************************************************************
***************PARAMETERS***********************************************
************************************************************************
************************************************************************
selection-screen begin of block b1 with frame.
selection-screen end of block b1.
************************************************************************
************************************************************************
************************************************************************
***************INIT SEL*************************************************
************************************************************************
************************************************************************
INITIALIZATION.
perform 010init_sel.
************************************************************************
************************************************************************
************************************************************************
***************MAIN PROGRAM*********************************************
************************************************************************
************************************************************************
START-OF-SELECTION.
perform 020select_data.
perform 030collect_data.
perform 040display_data.
END-OF-SELECTION.
************************************************************************
***************END OF MAIN PROGRAM**************************************
************************************************************************
form 010init_sel.
endform.
form 020select_data.
SELECT VBRP~VRKME VBRP~NETWR VBRP~MATNR
INTO CORRESPONDING FIELDS OF TABLE GT_COLLECT
FROM VBRP.
endform.
form 030collect_data.
loop at GT_COLLECT ASSIGNING <COLLECT>.
endloop.
endform.
form 040display_data.
data: lt_events TYPE slis_t_event,
ls_layout TYPE SLIS_LAYOUT_ALV.
ls_layout-colwidth_optimize = x.
perform ALV_catalog using:
'VRKME' space 'VRKME' 'Sales unit',
'NETWR' space 'NETWR_FP' 'Net value',
'MATNR' space 'MATNR' 'Material'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IT_FIELDCAT = gt_field_cat
IS_LAYOUT = ls_layout
I_SAVE = 'U'
it_events = lt_events[]
TABLES
T_OUTTAB = GT_COLLECT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
endform.
form ALV_catalog using: fieldname key rollname seltext_s.
data: ls_field_cat type slis_fieldcat_alv,
lv_col type i.
DESCRIBE TABLE gt_field_cat lines lv_col.
ls_field_cat-col_pos = lv_col + 1.
ls_field_cat-fieldname = fieldname.
ls_field_cat-key = key.
ls_field_cat-seltext_s = seltext_s.
ls_field_cat-seltext_l = seltext_s.
ls_field_cat-seltext_m = seltext_s.
ls_field_cat-reptext_ddic = seltext_s.
ls_field_cat-no_zero = x.
ls_field_cat-rollname = rollname.
append ls_field_cat to gt_field_cat.
endform.
form TOP_OF_PAGE .
perform HEADER_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
endform.
form HEADER_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER.
refresh: GT_TOP_OF_PAGE.
endform.
Output
*& Report ZBSD_ZAR_5202222
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZBSD_ZAR_5202222.
************************************************************************
* Program Name : ZR_00188B3F78331ED2ABB29778F269541E
* Description :
* Created On : 25.04.13
* Developer :
* Modification Log
************************************************************************
* Transport# Date Developer Description
************************************************************************
* 25.04.13
************************************************************************
************************************************************************
************************************************************************
***************DATA DECLARATION*****************************************
************************************************************************
************************************************************************
************************************************************************
***************ALV TYPE POOLS*******************************************
************************************************************************
TYPE-POOLS:
SLIS,KKBLO.
************************************************************************
***************SAP TABLES***********************************************
************************************************************************
TABLES:
VBRP. "Billing Document: Item Data
************************************************************************
***************CONSTANTS************************************************
************************************************************************
Constants:
C_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
X VALUE 'X',
YES VALUE 'Y',
NO VALUE 'N'.
************************************************************************
***************TYPES****************************************************
************************************************************************
TYPES: BEGIN OF TP_VBRP,
VRKME TYPE VRKME, "VRKME
NETWR TYPE NETWR_FP, "NETWR_FP
MATNR TYPE MATNR, "MATNR
END OF TP_VBRP.
TYPES: BEGIN OF TP_COLLECT,
VRKME TYPE VRKME, "Sales unit
NETWR TYPE NETWR_FP, "Net value
MATNR TYPE MATNR, "Material
END OF TP_COLLECT.
************************************************************************
***************VARIABLES************************************************
************************************************************************
DATA:
GV_FIELDNAME TYPE FIELDNAME,
GV_FIELDVALUE TYPE CHAR100.
************************************************************************
***************DATA STRUCTURE*******************************************
************************************************************************
DATA:
GS_VBRP TYPE TP_VBRP,
GS_COLLECT TYPE TP_COLLECT.
************************************************************************
***************FIELD SYMBOLS********************************************
************************************************************************
FIELD-SYMBOLS:
<xicon1> TYPE icon_l2,
<xicon2> TYPE icon_l2,
<xicon1h> TYPE icon_l2,
<xicon2h> TYPE icon_l2,
<collect> TYPE tp_collect.
************************************************************************
***************INTERNAL TABLES******************************************
************************************************************************
DATA:
GT_VBRP TYPE TABLE OF TP_VBRP,
GT_COLLECT TYPE TABLE OF TP_COLLECT.
***ALV Tables*****
DATA:
gt_field_cat TYPE SLIS_T_FIELDCAT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
************************************************************************
************************************************************************
************************************************************************
***************PARAMETERS***********************************************
************************************************************************
************************************************************************
selection-screen begin of block b1 with frame.
selection-screen end of block b1.
************************************************************************
************************************************************************
************************************************************************
***************INIT SEL*************************************************
************************************************************************
************************************************************************
INITIALIZATION.
perform 010init_sel.
************************************************************************
************************************************************************
************************************************************************
***************MAIN PROGRAM*********************************************
************************************************************************
************************************************************************
START-OF-SELECTION.
perform 020select_data.
perform 030collect_data.
perform 040display_data.
END-OF-SELECTION.
************************************************************************
***************END OF MAIN PROGRAM**************************************
************************************************************************
form 010init_sel.
endform.
form 020select_data.
SELECT VBRP~VRKME VBRP~NETWR VBRP~MATNR
INTO CORRESPONDING FIELDS OF TABLE GT_COLLECT
FROM VBRP.
endform.
form 030collect_data.
loop at GT_COLLECT ASSIGNING <COLLECT>.
endloop.
endform.
form 040display_data.
data: lt_events TYPE slis_t_event,
ls_layout TYPE SLIS_LAYOUT_ALV.
ls_layout-colwidth_optimize = x.
perform ALV_catalog using:
'VRKME' space 'VRKME' 'Sales unit',
'NETWR' space 'NETWR_FP' 'Net value',
'MATNR' space 'MATNR' 'Material'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IT_FIELDCAT = gt_field_cat
IS_LAYOUT = ls_layout
I_SAVE = 'U'
it_events = lt_events[]
TABLES
T_OUTTAB = GT_COLLECT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
endform.
form ALV_catalog using: fieldname key rollname seltext_s.
data: ls_field_cat type slis_fieldcat_alv,
lv_col type i.
DESCRIBE TABLE gt_field_cat lines lv_col.
ls_field_cat-col_pos = lv_col + 1.
ls_field_cat-fieldname = fieldname.
ls_field_cat-key = key.
ls_field_cat-seltext_s = seltext_s.
ls_field_cat-seltext_l = seltext_s.
ls_field_cat-seltext_m = seltext_s.
ls_field_cat-reptext_ddic = seltext_s.
ls_field_cat-no_zero = x.
ls_field_cat-rollname = rollname.
append ls_field_cat to gt_field_cat.
endform.
form TOP_OF_PAGE .
perform HEADER_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
endform.
form HEADER_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER.
refresh: GT_TOP_OF_PAGE.
endform.
Output
No comments:
Post a Comment