*&---------------------------------------------------------------------*
*& Report Z_MTR_READ_RESULT_LCL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_MTR_READ_RESULT_LCL .
CLASS lcl_class DEFINITION DEFERRED.
TABLES : EANL,ERCH.
***********SELECTION SCREEN************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_INST FOR EANL-ANLAGE, "Installation number
S_CONT FOR ERCH-VERTRAG, "Contarct
S_PORT FOR ERCH-PORTION, "Portion
S_PART FOR ERCH-GPARTNER. "Business Partner
SELECTION-SCREEN END OF BLOCK B1.
***********END OF SELECTION SCREEN*****************
TYPES : BEGIN OF TY_ERCH ,
BELNR TYPE ERCH-BELNR, " Billing doc no
GPARTNER TYPE ERCH-GPARTNER, " Businee partner
VERTRAG TYPE ERCH-VERTRAG, " Contract
PORTION TYPE ERCH-PORTION, "Portinon
ABLEINH TYPE ERCH-ABLEINH, " Meter reading Unit
END OF TY_ERCH.
TYPES : BEGIN OF TY_EABL,
ABLBELNR TYPE EABL-ABLBELNR, " Internal MR doc num
GERNR TYPE EABL-GERNR, " Device
EQUNR TYPE EABL-EQUNR, " Euipment
ZWNUMMER TYPE EABL-ZWNUMMER, "Register
ADAT TYPE EABL-ADAT, " MR date
ADATSOLL TYPE EABL-ADATSOLL, " Scheduled MRD
V_ZWSTAND TYPE EABL-V_ZWSTAND, " Pd MR Reading
N_ZWSTAND TYPE EABL-N_ZWSTAND, "Pd MR Reading
END OF TY_EABL.
TYPES : BEGIN OF TY_EABLG,
ABLBELNR TYPE EABLG-ABLBELNR, " Internal MR doc num
ANLAGE TYPE EABLG-ANLAGE, " Installation
ABLESGR TYPE EABLG-ABLESGR, " MR Reason
ABLEINH TYPE EABLG-ABLEINH, " MR Unit
END OF TY_EABLG.
TYPES : BEGIN OF TY_EVER,
VERTRAG TYPE EVER-VERTRAG, "Contract
ANLAGE TYPE EVER-ANLAGE, " Installation
END OF TY_EVER.
TYPES : BEGIN OF TY_FINAL,
PORTION TYPE ERCH-PORTION, "Portion
MRUNIT TYPE ERCH-ABLEINH, "MR Unit
BP TYPE GPARTNER, "Business Partner
CONTRACT TYPE VERTRAG, "Contract
INSTALLATION TYPE ANLAGE, "Installation
DEVICE TYPE GERAET, "Device
EQUIPMENT TYPE EQUNR, "Equipment
REGISTER TYPE E_ZWNUMMER, "Register
MR_DATE TYPE ADAT, "Meter Reading date
SCHEDULED_MRD TYPE ADATSOLL, "Scheduled MR Date
METER_REASON TYPE ABLESGR, "MR REason
METER_READING TYPE READINGRESULT, "Metre Reading
END OF TY_FINAL.
*****************Internal Table Decleration********************
DATA : IT_EVER TYPE TABLE OF TY_EVER.
DATA : IT_ERCH TYPE TABLE OF TY_ERCH, "Billing Doc. Data Internal Table
WA_ERCH TYPE TY_ERCH. "Billing Doc. Data Work area
DATA : IT_EABL TYPE TABLE OF TY_EABL, " MR Document Internal Table
WA_EABL TYPE TY_EABL. " MR Document Work area
DATA : IT_EABLG TYPE TABLE OF TY_EABLG, " MR Reasons in MR Document Internal Table
WA_EABLG TYPE TY_EABLG. " MR Reasons in MR Document Work area
DATA : IT_FINAL TYPE TABLE OF TY_FINAL, " Final Internal Table
WA_FINAL TYPE TY_FINAL. " Final Work area
**data : obj_disp TYPE REF TO lcl_class.
****************End Of Decleration******************************
data : obj_disp TYPE REF TO lcl_class.
CLASS lcl_class DEFINITION ."DEFERRED.
PUBLIC SECTION .
METHODS : get_data,
display.
ENDCLASS.
*&---------------------------------------------------------------------*
*& Class (Implementation) lcl_class
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_class IMPLEMENTATION.
METHOD get_data.
PERFORM get_data.
ENDMETHOD.
METHOD display.
PERFORM dispaly.
ENDMETHOD.
ENDCLASS. "lcl_class
START-OF-SELECTION.
CREATE OBJECT OBJ_DISP.
CALL METHOD OBJ_DISP->GET_DATA.
CALL METHOD OBJ_DISP->DISPLAY.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
IF S_INST IS NOT INITIAL .
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE ANLAGE IN S_INST .
IF S_INST IS NOT INITIAL AND S_CONT IS NOT INITIAL.
CLEAR IT_EVER.
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE ANLAGE IN S_INST AND VERTRAG IN S_CONT.
ENDIF.
IF IT_EVER IS NOT INITIAL .
SELECT ABLBELNR
ANLAGE " INSTALLATION
ABLESGR " MR REASON
ABLEINH
FROM EABLG
INTO TABLE IT_EABLG
FOR ALL ENTRIES IN IT_EVER
WHERE ANLAGE = IT_EVER-ANLAGE.
**** WHERE ANLAGE IN S_INST AND ABLESGR = '01'.
ENDIF.
IF IT_EABLG IS NOT INITIAL.
SELECT ABLBELNR
GERNR
EQUNR
ZWNUMMER
ADAT
ADATSOLL
V_ZWSTAND
N_ZWSTAND
FROM EABL
INTO TABLE IT_EABL
FOR ALL ENTRIES IN IT_EABLG
WHERE ABLBELNR = IT_EABLG-ABLBELNR.
ENDIF.
IF IT_EVER IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = '' .
ENDIF.
ELSEIF S_CONT IS NOT INITIAL.
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE VERTRAG IN S_CONT.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = '' .
ENDIF.
*********** portion ***************************
IF S_PORT IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH "#EC CI_NOFIELD
WHERE PORTION IN S_PORT.
IF S_PORT IS NOT INITIAL AND S_PART IS NOT INITIAL .
CLEAR it_erch.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH "#EC CI_NOFIELD
FROM ERCH
INTO TABLE IT_ERCH
WHERE PORTION IN S_PORT
AND GPARTNER IN S_PART.
ENDIF.
IF S_PORT IS NOT INITIAL AND S_INST IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = ''
AND PORTION IN S_PORT
AND GPARTNER IN S_PART.
ENDIF.
CLEAR :IT_EVER,IT_EABLG,IT_EABL.
IF IT_ERCH IS NOT INITIAL .
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
FOR ALL ENTRIES IN IT_ERCH WHERE VERTRAG = IT_ERCH-VERTRAG.
ENDIF.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
ELSEIF S_PART IS NOT INITIAL. """""""""" partnter
CLEAR :it_ever,it_eablg,it_eabl.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH
WHERE GPARTNER IN S_PART.
""#EC CI_NOFIELD
IF IT_ERCH IS NOT INITIAL .
SELECT VERTRAG
ANLAGE FROM EVER
INTO TABLE IT_EVER
FOR ALL ENTRIES IN IT_ERCH
WHERE VERTRAG = IT_ERCH-VERTRAG.
ENDIF.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
ENDIF.
LOOP AT IT_EABL INTO WA_EABL.
WA_FINAL-DEVICE = WA_EABL-GERNR.
WA_FINAL-EQUIPMENT = WA_EABL-EQUNR.
WA_FINAL-REGISTER = WA_EABL-ZWNUMMER.
WA_FINAL-MR_DATE = WA_EABL-ADAT.
WA_FINAL-SCHEDULED_MRD = WA_EABL-ADATSOLL.
WA_FINAL-METER_READING = WA_EABL-V_ZWSTAND + WA_EABL-N_ZWSTAND.
READ TABLE IT_EABLG INTO WA_EABLG WITH KEY ABLBELNR = WA_EABL-ABLBELNR.
WA_FINAL-INSTALLATION = WA_EABLG-ANLAGE.
WA_FINAL-METER_REASON = WA_EABLG-ABLESGR.
WA_FINAL-MRUNIT = WA_EABLG-ABLEINH.
READ TABLE IT_ERCH INTO WA_ERCH WITH KEY ABLEINH = WA_EABLG-ABLEINH.
WA_FINAL-PORTION = WA_ERCH-PORTION.
WA_FINAL-BP = WA_ERCH-GPARTNER.
WA_FINAL-CONTRACT = WA_ERCH-VERTRAG.
APPEND WA_FINAL TO IT_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
ENDFORM. " get_data
*&---------------------------------------------------------------------*
*& Form dispaly
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM dispaly .
data : l_grid TYPE REF TO cl_salv_table,
lr_functions TYPE REF TO cl_salv_functions_list.
CONSTANTS: gc_true TYPE sap_bool VALUE 'X'.
data :lt_columns TYPE REF TO cl_salv_columns_table,
l_column TYPE REF TO cl_salv_column,
l_display TYPE REF TO cl_salv_display_settings,
l_heading TYPE lvc_title.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = l_grid
CHANGING
t_table = it_final.
lr_functions = l_grid->get_functions( ).
lr_functions->set_all( gc_true ).
l_display = l_grid->get_display_settings( ).
l_display->set_striped_pattern( cl_salv_display_settings=>true ).
l_heading = 'Meter Reading Results1'.
l_display->set_list_header( l_heading ).
lt_columns = l_grid->get_columns( ).
l_column = lt_columns->get_column('METER_READING').
l_column->set_long_text( ' meter reading' ).
l_grid->display( ).
ENDFORM. " dispaly
*&---------------------------------------------------------------------*
*& Form MR_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM MR_DATA .
CLEAR : it_eablg,it_eabl.
SELECT ABLBELNR
ANLAGE " INSTALLATION
ABLESGR " MR REASON
ABLEINH " MR UNIT
FROM EABLG
INTO TABLE IT_EABLG
FOR ALL ENTRIES IN IT_EVER
WHERE ANLAGE = IT_EVER-ANLAGE ."AND ABLESGR = '01'.
IF IT_EABLG IS NOT INITIAL.
SELECT ABLBELNR " INTERNAL MR ID
GERNR "DEVICE
EQUNR "EUIPMENT NUMBER
ZWNUMMER "REGISTER
ADAT " MR DATE
ADATSOLL " SCHEDULED MR DATE
V_ZWSTAND " PD METRE READING
N_ZWSTAND " DEC METER READING
FROM EABL INTO TABLE IT_EABL
FOR ALL ENTRIES IN IT_EABLG
WHERE ABLBELNR = IT_EABLG-ABLBELNR.
ENDIF.
ENDFORM. " MR_DATA
*& Report Z_MTR_READ_RESULT_LCL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_MTR_READ_RESULT_LCL .
CLASS lcl_class DEFINITION DEFERRED.
TABLES : EANL,ERCH.
***********SELECTION SCREEN************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_INST FOR EANL-ANLAGE, "Installation number
S_CONT FOR ERCH-VERTRAG, "Contarct
S_PORT FOR ERCH-PORTION, "Portion
S_PART FOR ERCH-GPARTNER. "Business Partner
SELECTION-SCREEN END OF BLOCK B1.
***********END OF SELECTION SCREEN*****************
TYPES : BEGIN OF TY_ERCH ,
BELNR TYPE ERCH-BELNR, " Billing doc no
GPARTNER TYPE ERCH-GPARTNER, " Businee partner
VERTRAG TYPE ERCH-VERTRAG, " Contract
PORTION TYPE ERCH-PORTION, "Portinon
ABLEINH TYPE ERCH-ABLEINH, " Meter reading Unit
END OF TY_ERCH.
TYPES : BEGIN OF TY_EABL,
ABLBELNR TYPE EABL-ABLBELNR, " Internal MR doc num
GERNR TYPE EABL-GERNR, " Device
EQUNR TYPE EABL-EQUNR, " Euipment
ZWNUMMER TYPE EABL-ZWNUMMER, "Register
ADAT TYPE EABL-ADAT, " MR date
ADATSOLL TYPE EABL-ADATSOLL, " Scheduled MRD
V_ZWSTAND TYPE EABL-V_ZWSTAND, " Pd MR Reading
N_ZWSTAND TYPE EABL-N_ZWSTAND, "Pd MR Reading
END OF TY_EABL.
TYPES : BEGIN OF TY_EABLG,
ABLBELNR TYPE EABLG-ABLBELNR, " Internal MR doc num
ANLAGE TYPE EABLG-ANLAGE, " Installation
ABLESGR TYPE EABLG-ABLESGR, " MR Reason
ABLEINH TYPE EABLG-ABLEINH, " MR Unit
END OF TY_EABLG.
TYPES : BEGIN OF TY_EVER,
VERTRAG TYPE EVER-VERTRAG, "Contract
ANLAGE TYPE EVER-ANLAGE, " Installation
END OF TY_EVER.
TYPES : BEGIN OF TY_FINAL,
PORTION TYPE ERCH-PORTION, "Portion
MRUNIT TYPE ERCH-ABLEINH, "MR Unit
BP TYPE GPARTNER, "Business Partner
CONTRACT TYPE VERTRAG, "Contract
INSTALLATION TYPE ANLAGE, "Installation
DEVICE TYPE GERAET, "Device
EQUIPMENT TYPE EQUNR, "Equipment
REGISTER TYPE E_ZWNUMMER, "Register
MR_DATE TYPE ADAT, "Meter Reading date
SCHEDULED_MRD TYPE ADATSOLL, "Scheduled MR Date
METER_REASON TYPE ABLESGR, "MR REason
METER_READING TYPE READINGRESULT, "Metre Reading
END OF TY_FINAL.
*****************Internal Table Decleration********************
DATA : IT_EVER TYPE TABLE OF TY_EVER.
DATA : IT_ERCH TYPE TABLE OF TY_ERCH, "Billing Doc. Data Internal Table
WA_ERCH TYPE TY_ERCH. "Billing Doc. Data Work area
DATA : IT_EABL TYPE TABLE OF TY_EABL, " MR Document Internal Table
WA_EABL TYPE TY_EABL. " MR Document Work area
DATA : IT_EABLG TYPE TABLE OF TY_EABLG, " MR Reasons in MR Document Internal Table
WA_EABLG TYPE TY_EABLG. " MR Reasons in MR Document Work area
DATA : IT_FINAL TYPE TABLE OF TY_FINAL, " Final Internal Table
WA_FINAL TYPE TY_FINAL. " Final Work area
**data : obj_disp TYPE REF TO lcl_class.
****************End Of Decleration******************************
data : obj_disp TYPE REF TO lcl_class.
CLASS lcl_class DEFINITION ."DEFERRED.
PUBLIC SECTION .
METHODS : get_data,
display.
ENDCLASS.
*&---------------------------------------------------------------------*
*& Class (Implementation) lcl_class
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_class IMPLEMENTATION.
METHOD get_data.
PERFORM get_data.
ENDMETHOD.
METHOD display.
PERFORM dispaly.
ENDMETHOD.
ENDCLASS. "lcl_class
START-OF-SELECTION.
CREATE OBJECT OBJ_DISP.
CALL METHOD OBJ_DISP->GET_DATA.
CALL METHOD OBJ_DISP->DISPLAY.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
IF S_INST IS NOT INITIAL .
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE ANLAGE IN S_INST .
IF S_INST IS NOT INITIAL AND S_CONT IS NOT INITIAL.
CLEAR IT_EVER.
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE ANLAGE IN S_INST AND VERTRAG IN S_CONT.
ENDIF.
IF IT_EVER IS NOT INITIAL .
SELECT ABLBELNR
ANLAGE " INSTALLATION
ABLESGR " MR REASON
ABLEINH
FROM EABLG
INTO TABLE IT_EABLG
FOR ALL ENTRIES IN IT_EVER
WHERE ANLAGE = IT_EVER-ANLAGE.
**** WHERE ANLAGE IN S_INST AND ABLESGR = '01'.
ENDIF.
IF IT_EABLG IS NOT INITIAL.
SELECT ABLBELNR
GERNR
EQUNR
ZWNUMMER
ADAT
ADATSOLL
V_ZWSTAND
N_ZWSTAND
FROM EABL
INTO TABLE IT_EABL
FOR ALL ENTRIES IN IT_EABLG
WHERE ABLBELNR = IT_EABLG-ABLBELNR.
ENDIF.
IF IT_EVER IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = '' .
ENDIF.
ELSEIF S_CONT IS NOT INITIAL.
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
WHERE VERTRAG IN S_CONT.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = '' .
ENDIF.
*********** portion ***************************
IF S_PORT IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH "#EC CI_NOFIELD
WHERE PORTION IN S_PORT.
IF S_PORT IS NOT INITIAL AND S_PART IS NOT INITIAL .
CLEAR it_erch.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH "#EC CI_NOFIELD
FROM ERCH
INTO TABLE IT_ERCH
WHERE PORTION IN S_PORT
AND GPARTNER IN S_PART.
ENDIF.
IF S_PORT IS NOT INITIAL AND S_INST IS NOT INITIAL.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH FOR ALL ENTRIES IN IT_EVER
WHERE VERTRAG = IT_EVER-VERTRAG
AND SIMULATION = ''
AND PORTION IN S_PORT
AND GPARTNER IN S_PART.
ENDIF.
CLEAR :IT_EVER,IT_EABLG,IT_EABL.
IF IT_ERCH IS NOT INITIAL .
SELECT VERTRAG
ANLAGE
FROM EVER
INTO TABLE IT_EVER
FOR ALL ENTRIES IN IT_ERCH WHERE VERTRAG = IT_ERCH-VERTRAG.
ENDIF.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
ELSEIF S_PART IS NOT INITIAL. """""""""" partnter
CLEAR :it_ever,it_eablg,it_eabl.
SELECT BELNR
GPARTNER
VERTRAG
PORTION
ABLEINH
FROM ERCH
INTO TABLE IT_ERCH
WHERE GPARTNER IN S_PART.
""#EC CI_NOFIELD
IF IT_ERCH IS NOT INITIAL .
SELECT VERTRAG
ANLAGE FROM EVER
INTO TABLE IT_EVER
FOR ALL ENTRIES IN IT_ERCH
WHERE VERTRAG = IT_ERCH-VERTRAG.
ENDIF.
IF IT_EVER IS NOT INITIAL.
PERFORM MR_DATA.
ENDIF.
ENDIF.
LOOP AT IT_EABL INTO WA_EABL.
WA_FINAL-DEVICE = WA_EABL-GERNR.
WA_FINAL-EQUIPMENT = WA_EABL-EQUNR.
WA_FINAL-REGISTER = WA_EABL-ZWNUMMER.
WA_FINAL-MR_DATE = WA_EABL-ADAT.
WA_FINAL-SCHEDULED_MRD = WA_EABL-ADATSOLL.
WA_FINAL-METER_READING = WA_EABL-V_ZWSTAND + WA_EABL-N_ZWSTAND.
READ TABLE IT_EABLG INTO WA_EABLG WITH KEY ABLBELNR = WA_EABL-ABLBELNR.
WA_FINAL-INSTALLATION = WA_EABLG-ANLAGE.
WA_FINAL-METER_REASON = WA_EABLG-ABLESGR.
WA_FINAL-MRUNIT = WA_EABLG-ABLEINH.
READ TABLE IT_ERCH INTO WA_ERCH WITH KEY ABLEINH = WA_EABLG-ABLEINH.
WA_FINAL-PORTION = WA_ERCH-PORTION.
WA_FINAL-BP = WA_ERCH-GPARTNER.
WA_FINAL-CONTRACT = WA_ERCH-VERTRAG.
APPEND WA_FINAL TO IT_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
ENDFORM. " get_data
*&---------------------------------------------------------------------*
*& Form dispaly
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM dispaly .
data : l_grid TYPE REF TO cl_salv_table,
lr_functions TYPE REF TO cl_salv_functions_list.
CONSTANTS: gc_true TYPE sap_bool VALUE 'X'.
data :lt_columns TYPE REF TO cl_salv_columns_table,
l_column TYPE REF TO cl_salv_column,
l_display TYPE REF TO cl_salv_display_settings,
l_heading TYPE lvc_title.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = l_grid
CHANGING
t_table = it_final.
lr_functions = l_grid->get_functions( ).
lr_functions->set_all( gc_true ).
l_display = l_grid->get_display_settings( ).
l_display->set_striped_pattern( cl_salv_display_settings=>true ).
l_heading = 'Meter Reading Results1'.
l_display->set_list_header( l_heading ).
lt_columns = l_grid->get_columns( ).
l_column = lt_columns->get_column('METER_READING').
l_column->set_long_text( ' meter reading' ).
l_grid->display( ).
ENDFORM. " dispaly
*&---------------------------------------------------------------------*
*& Form MR_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM MR_DATA .
CLEAR : it_eablg,it_eabl.
SELECT ABLBELNR
ANLAGE " INSTALLATION
ABLESGR " MR REASON
ABLEINH " MR UNIT
FROM EABLG
INTO TABLE IT_EABLG
FOR ALL ENTRIES IN IT_EVER
WHERE ANLAGE = IT_EVER-ANLAGE ."AND ABLESGR = '01'.
IF IT_EABLG IS NOT INITIAL.
SELECT ABLBELNR " INTERNAL MR ID
GERNR "DEVICE
EQUNR "EUIPMENT NUMBER
ZWNUMMER "REGISTER
ADAT " MR DATE
ADATSOLL " SCHEDULED MR DATE
V_ZWSTAND " PD METRE READING
N_ZWSTAND " DEC METER READING
FROM EABL INTO TABLE IT_EABL
FOR ALL ENTRIES IN IT_EABLG
WHERE ABLBELNR = IT_EABLG-ABLBELNR.
ENDIF.
ENDFORM. " MR_DATA
No comments:
Post a Comment