REPORT zinfir_asset_history.
************************************************************************
* PROGRAM TITLE : ZINFIR_ASSET_HISTORY
* MODULE : FI
* PROGRAM TYPE : Report
* INPUT : Company code and report run date
* OUTPUT : Asset history for current year
* CREATED BY : PRATIK PRAKASH KAMBLE
* CREATION DATE : 29.11.2017
*-----------------------------------------------------------------------
* DESCRIPTION : 50053C
************************************************************************
* Modification history:
* ----------------------------------------------------------------------
* DATE | User ID | TR
* 29.11.2017 | ABAP_YASH | E7DK918824
* ----------------------------------------------------------------------
DATA: lv_tcode TYPE sy-tcode,
lv_date TYPE sy-datum,
lv_bukrs TYPE bukrs,
s_anlkl TYPE RANGE OF anlkl WITH HEADER LINE,
lv_anlkl TYPE anlkl.
DATA: bukrs TYPE RANGE OF bukrs WITH HEADER LINE,
it_asset1 TYPE TABLE OF fiaa_salvtab_ragitt,
it_asset2 TYPE TABLE OF fiaa_salvtab_ragitt,
it_asset3 TYPE TABLE OF fiaa_salvtab_ragitt,
it_asset4 TYPE TABLE OF fiaa_salvtab_ragitt,
it_asset5 TYPE TABLE OF fiaa_salvtab_ragitt,
it_asset6 TYPE TABLE OF fiaa_salvtab_ragitt,
fs_asset TYPE fiaa_salvtab_ragitt,
fs_asset1 TYPE fiaa_salvtab_ragitt.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_date TYPE sy-datum.
SELECT-OPTIONS: s_bukrs FOR lv_bukrs.
SELECTION-SCREEN END OF BLOCK b1.
FIELD-SYMBOLS <lt_pay_data1> TYPE ANY TABLE.
FIELD-SYMBOLS <lt_pay_data2> TYPE ANY TABLE.
FIELD-SYMBOLS <lt_pay_data3> TYPE ANY TABLE.
DATA lr_pay_data TYPE REF TO data.
DATA: lv_gjahr TYPE gjahr,
lv_gjahr1 TYPE gjahr,
lv_gjahr2 TYPE gjahr,
lv_date1 TYPE sy-datum,
lv_date2 TYPE sy-datum,
lv_date3 TYPE sy-datum.
DATA : gr_layout TYPE REF TO cl_salv_layout,
gr_layout_key TYPE salv_s_layout_key,
ls_layout TYPE salv_s_layout,
lt_layout_info TYPE salv_t_layout_info.
DATA : gr_display TYPE REF TO cl_salv_display_settings,
lv_title TYPE lvc_title.
DATA : gr_sort TYPE REF TO cl_salv_sorts.
DATA : gr_select TYPE REF TO cl_salv_selections.
DATA : gr_aggr TYPE REF TO cl_salv_aggregations.
DATA : gr_table TYPE REF TO cl_salv_table.
DATA: gr_coloumns TYPE REF TO cl_salv_columns_table,
gr_column TYPE REF TO cl_salv_column_table.
DATA : gr_functions TYPE REF TO cl_salv_functions_list.
lv_gjahr1 = p_date+0(4).
lv_gjahr2 = p_date+0(4) - 1.
CONCATENATE lv_gjahr1 '03' '31' INTO lv_date1.
CONCATENATE lv_gjahr2 '12' '31' INTO lv_date2.
CONCATENATE lv_gjahr2 '03' '31' INTO lv_date3.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
SUBMIT ragitt_alv01 WITH bukrs IN s_bukrs
WITH so_anlkl IN s_anlkl
WITH berdatum EQ lv_date1
WITH bereich1 EQ '01'
WITH srtvr EQ '0007'
WITH xeinzel EQ 'X'
WITH summb EQ ' '
WITH p_grid EQ 'X'
WITH pa_gitvs EQ 'DK01'
WITH pa_xgbaf EQ 'X'
EXPORTING LIST TO MEMORY AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_pay_data ).
ASSIGN lr_pay_data->* TO <lt_pay_data1>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
CLEAR lr_pay_data.
CALL METHOD cl_salv_bs_runtime_info=>clear_all.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
SUBMIT ragitt_alv01 WITH bukrs IN s_bukrs
WITH so_anlkl IN s_anlkl
WITH berdatum EQ lv_date2
WITH bereich1 EQ '01'
WITH srtvr EQ '0007'
WITH xeinzel EQ 'X'
WITH summb EQ ' '
WITH p_grid EQ 'X'
WITH pa_gitvs EQ 'DK01'
WITH pa_xgbaf EQ 'X'
EXPORTING LIST TO MEMORY AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_pay_data ).
ASSIGN lr_pay_data->* TO <lt_pay_data2>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
CLEAR lr_pay_data.
CALL METHOD cl_salv_bs_runtime_info=>clear_all.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
SUBMIT ragitt_alv01 WITH bukrs IN s_bukrs
WITH so_anlkl IN s_anlkl
WITH berdatum EQ lv_date3
WITH bereich1 EQ '01'
WITH srtvr EQ '0007'
WITH xeinzel EQ 'X'
WITH summb EQ ' '
WITH p_grid EQ 'X'
WITH pa_gitvs EQ 'DK01'
WITH pa_xgbaf EQ 'X'
EXPORTING LIST TO MEMORY AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_pay_data ).
ASSIGN lr_pay_data->* TO <lt_pay_data3>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
IF <lt_pay_data1> IS ASSIGNED.
LOOP AT <lt_pay_data1> ASSIGNING FIELD-SYMBOL(<fs_data>).
ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<field>).
IF <field> IS ASSIGNED.
fs_asset-bukrs = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLKL' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anlkl = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'TXT50' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-txt50 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'AKTIV' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-aktiv = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'WAERS' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-waers = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR3' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr3 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR4' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr4 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR5' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr5 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR6' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr6 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR7' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr7 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR8' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr8 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR9' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr9 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR10' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr10 = <field>.
UNASSIGN <field>.
ENDIF.
APPEND fs_asset TO it_asset1.
CLEAR fs_asset.
* UNASSIGN <fs_data>.
ENDLOOP.
ENDIF.
IF <lt_pay_data2> IS ASSIGNED.
LOOP AT <lt_pay_data2> ASSIGNING <fs_data>.
ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-bukrs = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLKL' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anlkl = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'TXT50' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-txt50 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'AKTIV' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-aktiv = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'WAERS' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-waers = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR3' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr3 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR4' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr4 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR5' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr5 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR6' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr6 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR7' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr7 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR8' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr8 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR9' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr9 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR10' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr10 = <field>.
UNASSIGN <field>.
ENDIF.
APPEND fs_asset TO it_asset2.
CLEAR fs_asset.
* UNASSIGN <fs_data>.
ENDLOOP.
ENDIF.
IF <lt_pay_data3> IS ASSIGNED.
LOOP AT <lt_pay_data3> ASSIGNING <fs_data>.
ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-bukrs = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLN2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anln2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'ANLKL' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-anlkl = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'TXT50' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-txt50 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'AKTIV' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-aktiv = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'WAERS' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-waers = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR1' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr1 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR2' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr2 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR3' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr3 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR4' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr4 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR5' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr5 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR6' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr6 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR7' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr7 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR8' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr8 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR9' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr9 = <field>.
UNASSIGN <field>.
ENDIF.
ASSIGN COMPONENT 'BTR10' OF STRUCTURE <fs_data> TO <field>.
IF <field> IS ASSIGNED.
fs_asset-btr10 = <field>.
UNASSIGN <field>.
ENDIF.
APPEND fs_asset TO it_asset3.
CLEAR fs_asset.
* UNASSIGN <fs_data>.
ENDLOOP.
ENDIF.
LOOP AT it_asset1 INTO fs_asset.
READ TABLE it_asset2 INTO fs_asset1 WITH KEY anln1 = fs_asset-anln1
anln2 = fs_asset-anln2.
IF sy-subrc EQ 0.
fs_asset-btr1 = fs_asset-btr1 - fs_asset1-btr1.
fs_asset-btr2 = fs_asset-btr2 - fs_asset1-btr2.
fs_asset-btr3 = fs_asset-btr3 - fs_asset1-btr3.
fs_asset-btr4 = fs_asset-btr4 - fs_asset1-btr4.
fs_asset-btr5 = fs_asset-btr5 - fs_asset1-btr5.
fs_asset-btr6 = fs_asset-btr6 - fs_asset1-btr6.
fs_asset-btr7 = fs_asset-btr7 - fs_asset1-btr7.
fs_asset-btr8 = fs_asset-btr8 - fs_asset1-btr8.
fs_asset-btr9 = fs_asset-btr9 - fs_asset1-btr9.
fs_asset-btr10 = fs_asset-btr10 - fs_asset1-btr10.
ENDIF.
APPEND fs_asset TO it_asset4.
CLEAR: fs_asset,
fs_asset1.
ENDLOOP.
LOOP AT it_asset2 INTO fs_asset.
READ TABLE it_asset3 INTO fs_asset1 WITH KEY anln1 = fs_asset-anln1
anln2 = fs_asset-anln2.
IF sy-subrc EQ 0.
fs_asset-btr1 = fs_asset-btr1 - fs_asset1-btr1.
fs_asset-btr2 = fs_asset-btr2 - fs_asset1-btr2.
fs_asset-btr3 = fs_asset-btr3 - fs_asset1-btr3.
fs_asset-btr4 = fs_asset-btr4 - fs_asset1-btr4.
fs_asset-btr5 = fs_asset-btr5 - fs_asset1-btr5.
fs_asset-btr6 = fs_asset-btr6 - fs_asset1-btr6.
fs_asset-btr7 = fs_asset-btr7 - fs_asset1-btr7.
fs_asset-btr8 = fs_asset-btr8 - fs_asset1-btr8.
fs_asset-btr9 = fs_asset-btr9 - fs_asset1-btr9.
fs_asset-btr10 = fs_asset-btr10 - fs_asset1-btr10.
ENDIF.
APPEND fs_asset TO it_asset5.
CLEAR: fs_asset,
fs_asset1.
ENDLOOP.
LOOP AT it_asset4 INTO fs_asset.
READ TABLE it_asset5 INTO fs_asset1 WITH KEY anln1 = fs_asset-anln1
anln2 = fs_asset-anln2.
IF sy-subrc EQ 0.
fs_asset-btr1 = fs_asset-btr1 + fs_asset1-btr1.
fs_asset-btr2 = fs_asset-btr2 + fs_asset1-btr2.
fs_asset-btr3 = fs_asset-btr3 + fs_asset1-btr3.
fs_asset-btr4 = fs_asset-btr4 + fs_asset1-btr4.
fs_asset-btr5 = fs_asset-btr5 + fs_asset1-btr5.
fs_asset-btr6 = fs_asset-btr6 + fs_asset1-btr6.
fs_asset-btr7 = fs_asset-btr7 + fs_asset1-btr7.
fs_asset-btr8 = fs_asset-btr8 + fs_asset1-btr8.
fs_asset-btr9 = fs_asset-btr9 + fs_asset1-btr9.
fs_asset-btr10 = fs_asset-btr10 + fs_asset1-btr10.
ENDIF.
APPEND fs_asset TO it_asset6.
CLEAR: fs_asset,
fs_asset1.
ENDLOOP.
CALL METHOD cl_salv_bs_runtime_info=>clear_all.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
* r_container =
* container_name =
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = it_asset6.
CATCH cx_salv_msg .
ENDTRY.
CALL METHOD gr_table->get_columns
RECEIVING
value = gr_coloumns.
TRY.
gr_column ?= gr_coloumns->get_column( 'INDEX' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S1' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S2' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S3' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S4' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S5' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S1_TEXT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S2_TEXT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S3_TEXT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S4_TEXT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'S5_TEXT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'FLG_PICK_UP' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'RANGE' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'HLP_LEVEL' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'EXPAND' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'MANDT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'ANLN0' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'GSBER' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE01' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE02' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE03' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE04' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE05' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE06' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE07' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE08' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE09' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'DSPACE10' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'KTANSW' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'KANSW' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'KUMAFA' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BUCHWERT' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'AFABE' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'KTANSW' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'ERGSO' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'XANLGR' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR11' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR12' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR13' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR14' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR15' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR16' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR17' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR18' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR19' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR20' ).
gr_column->set_visible( if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'ANLN1' ).
gr_column->set_short_text( 'Asset' ).
gr_column->set_medium_text( 'Asset').
gr_column->set_long_text( 'Asset').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'ANLN2' ).
gr_column->set_short_text( 'Sub.No' ).
gr_column->set_medium_text( 'Asset Sub.No').
gr_column->set_long_text( 'Asset Sub.No').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR1' ).
gr_column->set_medium_text( 'APC Tot.Apr.1').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR2' ).
gr_column->set_medium_text( 'Acquis.curr.yr' ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR3' ).
gr_column->set_medium_text( 'Retmt.curr.yr' ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR4' ).
gr_column->set_medium_text( 'APC Tot.Mar.31').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR5' ).
gr_column->set_medium_text( 'Reval./wr-up').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR6' ).
gr_column->set_medium_text( 'Dep.Apr.1').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR7' ).
gr_column->set_medium_text( 'Dep.retir.').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR8' ).
gr_column->set_medium_text( 'Dep.curr.yr').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR9' ).
gr_column->set_medium_text( 'Dep.Mar31').
CATCH cx_salv_not_found.
ENDTRY.
TRY.
gr_column ?= gr_coloumns->get_column( 'BTR10' ).
gr_column->set_medium_text( 'Bookval.Mar31').
CATCH cx_salv_not_found.
ENDTRY.
gr_functions = gr_table->get_functions( ).
gr_functions->set_all( if_salv_c_bool_sap=>true ).
CLEAR : gr_layout, gr_layout_key.
MOVE sy-repid TO gr_layout_key-report.
gr_layout = gr_table->get_layout( ).
gr_layout->set_key( gr_layout_key ).
gr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
gr_layout->set_default( if_salv_c_bool_sap=>true ).
CLEAR : gr_display.
MOVE 'Asset History Sheet Based on Posted Depreciation - 01 Local Area ' TO lv_title.
gr_display = gr_table->get_display_settings( ).
gr_display->set_striped_pattern( if_salv_c_bool_sap=>true ).
gr_display->set_list_header( lv_title ).
gr_aggr = gr_table->get_aggregations( ).
gr_sort = gr_table->get_sorts( ).
IF gr_sort IS NOT INITIAL.
TRY.
gr_sort->add_sort( columnname = 'ANLKL'
position = 1
sequence = if_salv_c_sort=>sort_up
subtotal = if_salv_c_bool_sap=>true
group = if_salv_c_sort=>group_none
obligatory = if_salv_c_bool_sap=>false ).
CATCH cx_salv_not_found .
CATCH cx_salv_existing .
CATCH cx_salv_data_error .
ENDTRY.
ENDIF.
CALL METHOD gr_table->display.
It will helpful for calculate Asset for 1 single fiscal year
ReplyDelete