You are on page 1of 15

REPORT ZBEN_ESTIMAT_BUDGETARY .

*----------------------------------------------------------------------*
* Topic:
Project Proposal Quick Estimated Budget
*
*
*
* Description: The program will realize a model of an project
*
*
structure to enable the user an immediate estimation
*
*
of budgetary proposal. The program model is based on *
*
the assumption that a project core team employees are *
*
to be employed throughout the project life, plus sub
*
*
contractors, travels, equiped office, structure leasing *
*
and None Recurring Expenses.
*
*
*
*
*
* Programmer: Contribution from Benjamin halperb@013.net.il
*
*
*
* Date:
February 2004
*
*
*
*----------------------------------------------------------------------*
* Including classes:
INCLUDE YDISPLAY_LCL_CORE_EMPLOYEE.
INCLUDE YDISPLAY_LCL_CONTRACTOR.
INCLUDE YDISPLAY_LCL_TRAVELS.
INCLUDE YDISPLAY_LCL_INTEGRATIONS.
* Constants for display margins:
CONSTANTS: pos_1 TYPE i VALUE 30,
pos_2 TYPE i VALUE 40.
* Create a reference to classes:
DATA: employee
TYPE REF TO lcl_core_employee,
contractor TYPE REF TO lcl_contractor,
marketing
TYPE REF TO lcl_travels,
integrations TYPE REF TO lcl_integrations.
* Intermmediate variables:
DATA: employeesval
TYPE
contractorsval
TYPE
proposalcost
TYPE
marketingcost
TYPE
integrationcost
TYPE
office_furniture
TYPE
office_equipment
TYPE
office_hardware
TYPE
office_content
TYPE
structure_lease_fee TYPE
structure_service
TYPE
structure_tax
TYPE
structure_insur
TYPE
structure_current
TYPE
structure_area
TYPE
structure_duration TYPE
structure_month_exp TYPE
structure_total_exp TYPE
nretotal
TYPE
nre_test_equip
TYPE
nre_hardware_misc
TYPE
nre_design_proto
TYPE
TmpVal
TYPE

i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i,
i.

* Inputs:
* Section of project core employees to be employed throughout
* all project life plus the warranty period obligation time
SELECTION-SCREEN BEGIN OF BLOCK CORE WITH FRAME TITLE TIT1.
PARAMETERS: core_qty TYPE i DEFAULT 3, "no. of core employees
hour_fee TYPE i DEFAULT 30, "work hour value
monthkey TYPE i DEFAULT 200, "hours per month
duration TYPE i DEFAULT 36. "employment duration [m]
SELECTION-SCREEN END OF BLOCK CORE.
* Section of project sub contractors required and time of employment
SELECTION-SCREEN BEGIN OF BLOCK CONTR WITH FRAME TITLE TIT2.
PARAMETERS: cntr_qty TYPE i DEFAULT 5, "no. of conractors
cntrt_hf TYPE i DEFAULT 20, "work hour value
cntrt_mk TYPE i DEFAULT 100, "hours per month
cntrt_du TYPE i DEFAULT 12. "employment duration [m]
SELECTION-SCREEN END OF BLOCK CONTR.
* Section of project marketing travels - based on:
* up to 2 participants for short stay (3 days ea.)
SELECTION-SCREEN BEGIN OF BLOCK MRKTRV WITH FRAME TITLE TIT3.
PARAMETERS: mt_parti TYPE i DEFAULT 2, "participants no.
mt_numbr TYPE i DEFAULT 5. "number of marketing travels
SELECTION-SCREEN END OF BLOCK MRKTRV.
* Section of project installation & integration travels - based on:
* up to 5 participants for long stay (15 days ea.)
SELECTION-SCREEN BEGIN OF BLOCK INTGRTRV WITH FRAME TITLE TIT4.
PARAMETERS: it_parti TYPE i DEFAULT 5, "participants no.
it_numbr TYPE i DEFAULT 2. "number of integration travels
SELECTION-SCREEN END OF BLOCK INTGRTRV.
* Section of project's office contenet purchase
SELECTION-SCREEN BEGIN OF BLOCK OFCCONT WITH FRAME TITLE TIT5.
PARAMETERS: ofc_furn TYPE i DEFAULT 20000, "office furniture
ofc_equp TYPE i DEFAULT 15000, "office equipment
ofc_hrdw TYPE i DEFAULT 5000. "office hardware
SELECTION-SCREEN END OF BLOCK OFCCONT.
* Section of the structure leasing expenses - based on:
* main leasing fee and environmental expenses
SELECTION-SCREEN BEGIN OF BLOCK LEASING WITH FRAME TITLE TIT6.
PARAMETERS: st_lease TYPE i DEFAULT 15, "lease fee per 1 square m
st_srvic TYPE i DEFAULT 2,
"service per 1 square m
st_taxpm TYPE i DEFAULT 2,
"taxation per 1 square m
st_insur TYPE i DEFAULT 100, "insurance per 1 month
st_currn TYPE i DEFAULT 2000, "monthly current expense
st_area TYPE i DEFAULT 100, "structure area in square m
st_durat TYPE i DEFAULT 36. "structure lease duration
SELECTION-SCREEN END OF BLOCK LEASING.
* Section of the non recurring expenses
SELECTION-SCREEN BEGIN OF BLOCK NRE WITH FRAME TITLE TIT7.
PARAMETERS: nre_tseq TYPE i DEFAULT 10000, "special test equipment
nre_hrdw TYPE i DEFAULT 5000, "required hardware
nre_dsgn TYPE i DEFAULT 50000. "design & development
SELECTION-SCREEN END OF BLOCK NRE.

* Input frames titles init:


INITIALIZATION.
TIT1 = 'Core Employees'.
TIT2 = 'Contractors'.
TIT3 = 'Marketing Travels'.
TIT4 = 'Integration Travels'.
TIT5 = 'Office Content'.
TIT6 = 'Structure Leasing'.
TIT7 = 'Non Recurring Expense'.
* Create the special itab for the graph display:
DATA: BEGIN OF ITAB_DATA OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
QUANTITY4 TYPE I,
QUANTITY5 TYPE I,
QUANTITY6 TYPE I,
END OF ITAB_DATA,
BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.

********************************************************************
*
*
*
M A I N
P R O G R A M
*
*
*
********************************************************************
START-OF-SELECTION.
* Create
PERFORM
PERFORM
PERFORM
PERFORM
PERFORM
PERFORM
PERFORM

objects:
CreateEmployee.
CreateContractor.
CreateMarketingTravel.
CreateIntegrationsTravels.
CreateOfficeContent.
CreateStructureLease.
CreateNre.

* Create selection switch for display reports:


WRITE: / 'Click for core employees report !'
COLOR 5 INVERSE
WRITE: / 'Click for contractors report !'
COLOR 5 INVERSE
WRITE: / 'Click for travels expenses !'
COLOR 5 INVERSE
WRITE: / 'Click for integrations expenses !'
COLOR 5 INVERSE
WRITE: / 'Click for Office content expenses !'
COLOR 5 INVERSE
WRITE: / 'Click for Structure leasing expenses !' COLOR 5 INVERSE
WRITE: / 'Click for Non Recurring Expenses !'
COLOR 5 INVERSE
WRITE: / 'Click for proposal price report !'
COLOR 6 INVERSE
WRITE: / 'Click for graphic summary !'
COLOR 4 INVERSE
SKIP.
********************************************************************
*
*
* S U M M A R I Z E D
R E P O R T
O F
P R O P O S A L *
*
*

ON.
ON.
ON.
ON.
ON.
ON.
ON.
ON.
ON.

********************************************************************
AT LINE-SELECTION.
CASE sy-lilli.
WHEN 3.
WRITE: / '

','Core employees group budgetary expense'


COLOR COL_KEY.
','--------------------------------------'.

WRITE: / '
SKIP.
CALL METHOD employee->display_attributes.
CALL METHOD employee->calculate.
WHEN 4.
WRITE: / '

','Contractors group budgetary expense'


COLOR COL_KEY.
','-----------------------------------'.

WRITE: / '
SKIP.
CALL METHOD contractor->display_attributes.
CALL METHOD contractor->calculate.
WHEN 5.
WRITE: / '

','Project travels expenses'


COLOR COL_KEY.
','------------------------'.

WRITE: / '
SKIP.
CALL METHOD marketing->display_attributes.
CALL METHOD marketing->calculate.
WHEN 6.
WRITE: / '

','Project integrations travels expenses'


COLOR COL_KEY.
','-------------------------------------'.

WRITE: / '
SKIP.
CALL METHOD integrations->display_attributes.
CALL METHOD integrations->calculate.
WHEN 7.
WRITE: / '
WRITE: / '
SKIP.
WRITE: / '

','Office content expenses'


COLOR COL_KEY.
','-----------------------'.

Office furniture cost:', AT pos_2


office_furniture,
/ '
Office equipment cost:', AT pos_2
office_equipment,
/ ' Hardware for office requirements:', AT pos_2
office_hardware,
/ '
Office content expenses:', AT pos_2
office_content COLOR COL_POSITIVE INTENSIFIED OFF,
' USD'.

WHEN 8.
WRITE: / '
WRITE: / '
SKIP.
WRITE: / '

','Structure leasing expenses'


COLOR COL_KEY.
','--------------------------'.

Lease fee per 1 square meter:', AT pos_2


structure_lease_fee,
/ 'Service expense per 1 square meter:', AT pos_2
structure_service,

/ '
/

Tax per 1 square meter:', AT pos_2


structure_tax,
'
Monthly insurance payment:', AT pos_2
structure_insur,
'
Monthly current expense:', AT pos_2
structure_current,
'
Structure area in meters:', AT pos_2
structure_area,
' Structure monthly total expense:', AT pos_2
structure_month_exp COLOR COL_POSITIVE INTENSIFIED OFF.

/
/
/

WHEN 9.
WRITE: / '
WRITE: / '
SKIP.
WRITE: / '
/ '
/ '
/ '

','Non Recurring Expenses (NRE) details'


COLOR COL_KEY.
','------------------------------------'.
NRE Test equipment:', AT pos_2
nre_test_equip,
Hardware purchase expense:', AT pos_2
nre_hardware_misc,
Design & Development:', AT pos_2
nre_design_proto,
Total NRE:', AT pos_2
nretotal COLOR COL_POSITIVE INTENSIFIED OFF.

WHEN 10.
WRITE: / '

Proposal Summarized budgetary report


'
COLOR COL_GROUP INVERSE,
sy-vline.
WRITE: / '----------------------------------------------------'.
CALL METHOD employee->calculate_summary.
CALL METHOD lcl_core_employee=>display_employees_summary IMPORTING
TmpVal = employeesval.
CALL METHOD contractor->calculate_summary.
CALL METHOD lcl_contractor=>display_contractors_summary IMPORTING
TmpVal = contractorsval.
CALL METHOD marketing->calculate_summary.
CALL METHOD lcl_travels=>display_travels_summary IMPORTING
TmpVal = marketingcost.
CALL METHOD integrations->calculate_summary.
CALL METHOD lcl_integrations=>display_integrations_summary IMPORTING
TmpVal = integrationcost.
PERFORM Print_Total_Office_Expense USING office_content.
PERFORM Print_Total_Structure_Expense USING structure_total_exp.
PERFORM Print_Total_Nre_Expense USING nretotal.
WRITE: / '----------------------------------------------------'.

* Total proposal
proposalcost
+
+

cost:
= employeesval + contractorsval + marketingcost
integrationcost + office_content + structure_total_exp
nretotal.

WRITE: / ' Here is the proposal total cost:'


COLOR COL_POSITIVE INTENSIFIED OFF,
sy-vline,
AT pos_2 proposalcost RIGHT-JUSTIFIED
COLOR COL_NEGATIVE INTENSIFIED OFF,
sy-vline.
WRITE: / '----------------------------------------------------'.
SKIP.

WHEN 11.
PERFORM CreateMyGraph.
ENDCASE.
********************************************************************
*
*
*
F O R M
R O U T I N E S
*
*
*
********************************************************************
*&---------------------------------------------------------------------*
*&
Form CreateEmployee
*&---------------------------------------------------------------------*
form CreateEmployee.
CREATE OBJECT employee EXPORTING
im_qty
= core_qty
im_hour_fee
= hour_fee
im_monthly_key = monthkey
im_duration
= duration.
endform.
" CreateEmployee
*&---------------------------------------------------------------------*
*&
Form CreateContractor
*&---------------------------------------------------------------------*
form CreateContractor.
CREATE OBJECT contractor EXPORTING
im_qty
= cntr_qty
im_hour_fee
= cntrt_hf
im_monthly_key = cntrt_mk
im_duration
= cntrt_du.
endform.
" CreateContractor
*&---------------------------------------------------------------------*
*&
Form CreateMarketingTravel
*&---------------------------------------------------------------------*
form CreateMarketingTravel.
CREATE OBJECT marketing EXPORTING
im_participants_num = mt_parti
im_travels_num
= mt_numbr.
endform.
" CreateMarketingTravel
*&---------------------------------------------------------------------*
*&
Form CreateIntegrationsTravels
*&---------------------------------------------------------------------*
form CreateIntegrationsTravels.
CREATE OBJECT integrations EXPORTING
im_participants_num = it_parti
im_travels_num
= it_numbr.
endform.
" CreateIntegrationsTravels
*&---------------------------------------------------------------------*
*&
Form CreateOfficeContent
*&---------------------------------------------------------------------*
form CreateOfficeContent.
* Input parameters:
office_furniture = ofc_furn.
office_equipment = ofc_equp.
office_hardware = ofc_hrdw.

* Calculate all office input procurments:


office_content =
office_furniture + office_equipment + office_hardware.
endform.
" CreateOfficeContent
*&--------------------------------------------------------------------*&
Form Print_Total_Office_Expense
*&--------------------------------------------------------------------*
---> import the office_content
*---------------------------------------------------------------------form Print_Total_Office_Expense USING office_content.
WRITE: / ' Total expense on office content:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 office_content RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
endform.
" Print_Total_Office_Expense
*&---------------------------------------------------------------------*
*&
Form CreateStructureLease
*&---------------------------------------------------------------------*
form CreateStructureLease.
* Input parameters:
structure_lease_fee = st_lease.
structure_service = st_srvic.
structure_tax
= st_taxpm.
structure_insur
= st_insur.
structure_current = st_currn.
structure_area
= st_area.
structure_duration = st_durat.
* Calculate structure monthly expense:
structure_month_exp =
( structure_area *
( structure_lease_fee + structure_service + structure_tax ) ) +
structure_insur + structure_current.
* Calculate structure total expense:
structure_total_exp = structure_duration * structure_month_exp.
endform.
" CreateStructureLease
*&---------------------------------------------------------------------*
*&
Form Print_Total_Structure_Expense
*&---------------------------------------------------------------------*
*
--> import the P_STRUCTURE_TOTAL_EXP
*----------------------------------------------------------------------*
form Print_Total_Structure_Expense using
p_structure_total_exp.
WRITE: / ' Structure leasing total expense:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 structure_total_exp RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
endform.
" Print_Total_Structure_Expense
*&---------------------------------------------------------------------*
*&
Form CreateNre

*&---------------------------------------------------------------------*
form CreateNre.
* Input parameters:
nre_test_equip
= nre_tseq.
nre_hardware_misc = nre_hrdw.
nre_design_proto = nre_dsgn.
* Calculate nre expense:
nretotal = nre_test_equip + nre_hardware_misc + nre_design_proto.
endform.
" CreateNre
*&---------------------------------------------------------------------*
*&
Form Print_Total_Nre_Expense
*----------------------------------------------------------------------*
*
--> import the P_NRETOTAL text
*----------------------------------------------------------------------*
form Print_Total_Nre_Expense using
p_nretotal.
WRITE: / '
NRE total expense:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 nretotal RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
endform.
" Print_Total_Nre_Expense
*&---------------------------------------------------------------------*
*&
Form CreateMyGraph
*&---------------------------------------------------------------------*
form CreateMyGraph.
ITAB_DATA-DATANAME = 'Expenses'.
ITAB_DATA-QUANTITY1 = employeesval.
ITAB_DATA-QUANTITY2 = contractorsval.
ITAB_DATA-QUANTITY3 = marketingcost.
ITAB_DATA-QUANTITY4 = integrationcost.
ITAB_DATA-QUANTITY5 = office_content + structure_total_exp.
ITAB_DATA-QUANTITY6 = nretotal.
APPEND ITAB_DATA.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
COL1
= 'Employees'
COL2
= 'Contractors'
COL3
= 'Marketing'
COL4
= 'Integration'
COL5
= 'Office'
COL6
= 'NRE'
TITL
= 'Proposal Expenses in US$.'
TABLES
DATA
= ITAB_DATA
OPTS
= ITAB_OPTIONS
EXCEPTIONS
OTHERS
= 1.
endform.

" CreateMyGraph

**************************************
****************************************

***INCLUDE YDISPLAY_LCL_CORE_EMPLOYEE .
*----------------------------------------------------------------------*
* CLASS lcl_core_employee DEFINIION
*----------------------------------------------------------------------*
CLASS lcl_core_employee DEFINITION.
PUBLIC SECTION.
TYPES: quantity
workhour_fee
monthly_hours
empl_duration

TYPE
TYPE
TYPE
TYPE

i,
i,
i,
i.

CONSTANTS: pos_1 TYPE i VALUE 30,


pos_2 TYPE i VALUE 40.
METHODS: constructor IMPORTING
im_qty
im_hour_fee
im_monthly_key
im_duration
set_attributes IMPORTING
im_qty
im_hour_fee
im_monthly_key
im_duration
display_attributes,
calculate_summary,
calculate.

TYPE
TYPE
TYPE
TYPE

quantity
workhour_fee
monthly_hours
empl_duration,

TYPE
TYPE
TYPE
TYPE

quantity
workhour_fee
monthly_hours
empl_duration,

CLASS-METHODS: display_employees_summary EXPORTING TmpVal TYPE i.


PROTECTED SECTION.
DATA: num
hourlyfee
monthlyhours
duration
monthlsalary
totalexpense

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

i,
workhour_fee,
monthly_hours,
empl_duration,
i,
i.

PRIVATE SECTION.
CLASS-DATA: n_o_core_empl
total_core_empl_expense

TYPE i,
TYPE i.

ENDCLASS.
*---------------------------------------------------------------------* CLASS lcl_core_employee IMPLEMENTATION
*---------------------------------------------------------------------CLASS lcl_core_employee IMPLEMENTATION.
METHOD constructor.

num
hourlyfee
monthlyhours
duration
ENDMETHOD.

=
=
=
=

im_qty.
im_hour_fee.
im_monthly_key.
im_duration.

METHOD set_attributes.
num
= im_qty.
hourlyfee
= im_hour_fee.
monthlyhours = im_monthly_key.
duration
= im_duration.
ENDMETHOD.
METHOD calculate.
monthlsalary = hourlyfee * monthlyhours.
totalexpense = monthlsalary * duration.
total_core_empl_expense = totalexpense * num.
WRITE: / '
Monthly salary:',
monthlsalary COLOR COL_POSITIVE,
totalexpense COLOR COL_GROUP,
' USD'.
ENDMETHOD.
METHOD calculate_summary.
monthlsalary = hourlyfee * monthlyhours.
totalexpense = monthlsalary * duration.
total_core_empl_expense = totalexpense * num.
ENDMETHOD.
METHOD display_attributes.
WRITE: / '
Num of employees:', AT pos_1 num, AT pos_2 ' Prsn',
/ '
Empl. duration [m]:', AT pos_1 duration,
/ 'Hour fee & monthly key:', AT pos_1 hourlyfee
COLOR COL_TOTAL,
monthlyhours COLOR COL_TOTAL.
ENDMETHOD.
METHOD display_employees_summary.
WRITE: / ' Total expense on core employees:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 total_core_empl_expense RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
TmpVal = total_core_empl_expense.
ENDMETHOD.
ENDCLASS.
********************************
********************************
***INCLUDE YDISPLAY_LCL_CONTRACTOR .
*----------------------------------------------------------------------*
* CLASS lcl_contractor DEFINIION
*----------------------------------------------------------------------*
CLASS lcl_contractor DEFINITION.

PUBLIC SECTION.
TYPES: quantity
workhour_fee
monthly_hours
empl_duration

TYPE
TYPE
TYPE
TYPE

i,
i,
i,
i.

CONSTANTS: pos_1 TYPE i VALUE 30,


pos_2 TYPE i VALUE 40.
METHODS: constructor IMPORTING
im_qty
im_hour_fee
im_monthly_key
im_duration
set_attributes IMPORTING
im_qty
im_hour_fee
im_monthly_key
im_duration
display_attributes,
calculate_summary,
calculate.

TYPE
TYPE
TYPE
TYPE

quantity
workhour_fee
monthly_hours
empl_duration,

TYPE
TYPE
TYPE
TYPE

quantity
workhour_fee
monthly_hours
empl_duration,

CLASS-METHODS: display_contractors_summary EXPORTING TmpVal TYPE i.


PROTECTED SECTION.
DATA: num
hourlyfee
monthlyhours
duration
monthlsalary
totalexpense

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

i,
workhour_fee,
monthly_hours,
empl_duration,
i,
i.

PRIVATE SECTION.
CLASS-DATA: n_o_cont_empl
total_cont_empl_expense

TYPE i,
TYPE i.

ENDCLASS.
*---------------------------------------------------------------------* CLASS lcl_contractor IMPLEMENTATION
*---------------------------------------------------------------------CLASS lcl_contractor IMPLEMENTATION.
METHOD constructor.
num
= im_qty.
hourlyfee
= im_hour_fee.
monthlyhours = im_monthly_key.
duration
= im_duration.
ENDMETHOD.
METHOD set_attributes.

num
hourlyfee
monthlyhours
duration
ENDMETHOD.

=
=
=
=

im_qty.
im_hour_fee.
im_monthly_key.
im_duration.

METHOD calculate.
monthlsalary = hourlyfee * monthlyhours.
totalexpense = monthlsalary * duration.
total_cont_empl_expense = totalexpense * num.
WRITE: / '
Monthly salary:',
monthlsalary COLOR COL_POSITIVE,
totalexpense COLOR COL_GROUP,
' USD'.
ENDMETHOD.
METHOD calculate_summary.
monthlsalary = hourlyfee * monthlyhours.
totalexpense = monthlsalary * duration.
total_cont_empl_expense = totalexpense * num.
ENDMETHOD.
METHOD display_attributes.
WRITE: / '
Num of contractors:', AT pos_1 num, AT pos_2 ' Contr',
/ '
Empl. duration [m]:', AT pos_1 duration,
/ 'Hour fee & monthly key:', AT pos_1 hourlyfee
COLOR COL_TOTAL,
monthlyhours COLOR COL_TOTAL.
ENDMETHOD.
METHOD display_contractors_summary.
WRITE: / '
Total expense on contractors:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 total_cont_empl_expense RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
TmpVal = total_cont_empl_expense.
ENDMETHOD.
ENDCLASS.
********************************
********************************
***INCLUDE YDISPLAY_LCL_TRAVELS .
*---------------------------------------------------------------------* CLASS lcl_travels DEFINIION
*---------------------------------------------------------------------CLASS lcl_travels DEFINITION.
PUBLIC SECTION.
TYPES: n_o_participants TYPE i,
n_o_travels
TYPE i.
CONSTANTS: pos_1 TYPE i VALUE 30,
pos_2 TYPE i VALUE 40.

METHODS: constructor IMPORTING


im_participants_num
im_travels_num
set_attributes IMPORTING
im_participants_num
im_travels_num
display_attributes,
calculate_summary,
calculate.

TYPE n_o_participants
TYPE n_o_travels,
TYPE n_o_participants
TYPE n_o_travels,

CLASS-METHODS: display_travels_summary EXPORTING TmpVal TYPE i.


PROTECTED SECTION.
DATA: participants TYPE n_o_participants,
num
TYPE n_o_travels,
totaltravels TYPE i.
PRIVATE SECTION.
CLASS-DATA: n_o_mrkt_travels
total_mrkt_expense

TYPE i,
TYPE i.

ENDCLASS.
*---------------------------------------------------------------------* CLASS lcl_travels IMPLEMENTATION
*---------------------------------------------------------------------CLASS lcl_travels IMPLEMENTATION.
METHOD constructor.
participants = im_participants_num.
num
= im_travels_num.
ENDMETHOD.
METHOD set_attributes.
participants = im_participants_num.
num
= im_travels_num.
ENDMETHOD.
METHOD display_attributes.
WRITE: / ' Num of participants:', AT pos_1 participants,
/ '
Num of travels:', AT pos_1 num.
ENDMETHOD.
* Method calculate - based on 5000 USD per 1 travel
METHOD calculate.
total_mrkt_expense = num * 5000 * participants.
WRITE: / '
Marketing travels:', AT pos_1
total_mrkt_expense COLOR COL_POSITIVE INTENSIFIED OFF,
' USD'.
ENDMETHOD.
METHOD calculate_summary.
total_mrkt_expense = num * 5000 * participants.
ENDMETHOD.

METHOD display_travels_summary.
WRITE: / '
Marketing travels:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 total_mrkt_expense RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
TmpVal = total_mrkt_expense.
ENDMETHOD.
ENDCLASS.
********************************
********************************
***INCLUDE YDISPLAY_LCL_INTEGRATIONS .
*---------------------------------------------------------------------* CLASS lcl_integrations DEFINIION
*---------------------------------------------------------------------CLASS lcl_integrations DEFINITION.
PUBLIC SECTION.
TYPES: n_o_participants TYPE i,
n_o_travels
TYPE i.
CONSTANTS: pos_1 TYPE i VALUE 30,
pos_2 TYPE i VALUE 40.
METHODS: constructor IMPORTING
im_participants_num
im_travels_num
set_attributes IMPORTING
im_participants_num
im_travels_num
display_attributes,
calculate_summary,
calculate.

TYPE n_o_participants
TYPE n_o_travels,
TYPE n_o_participants
TYPE n_o_travels,

CLASS-METHODS: display_integrations_summary EXPORTING TmpVal TYPE i.


PROTECTED SECTION.
DATA: participants TYPE n_o_participants,
num
TYPE n_o_travels,
totaltravels TYPE i.
PRIVATE SECTION.
CLASS-DATA: n_o_intgr_travels
total_intgr_expense
ENDCLASS.

TYPE i,
TYPE i.

*---------------------------------------------------------------------* CLASS lcl_integrations IMPLEMENTATION


*---------------------------------------------------------------------CLASS lcl_integrations IMPLEMENTATION.
METHOD constructor.
participants = im_participants_num.
num
= im_travels_num.
ENDMETHOD.
METHOD set_attributes.
participants = im_participants_num.
num
= im_travels_num.
ENDMETHOD.
METHOD display_attributes.
WRITE: / ' Num of participants:', AT pos_1 participants,
/ '
Num of travels:', AT pos_1 num.
ENDMETHOD.
* Method calculate - based on 10000 USD per 1 travel
METHOD calculate.
total_intgr_expense = num * 10000 * participants.
WRITE: / ' Integration travels:', AT pos_1
total_intgr_expense COLOR COL_POSITIVE INTENSIFIED OFF,
' USD'.
ENDMETHOD.
METHOD calculate_summary.
total_intgr_expense = num * 10000 * participants.
ENDMETHOD.
METHOD display_integrations_summary.
WRITE: / '
Integrations expenses:'
COLOR COL_TOTAL INTENSIFIED OFF,
sy-vline,
AT pos_2 total_intgr_expense RIGHT-JUSTIFIED
COLOR COL_HEADING,
sy-vline.
TmpVal = total_intgr_expense.
ENDMETHOD.
ENDCLASS.
********************************
********************************

You might also like