0% found this document useful (0 votes)
4 views6 pages

OOP Tasks for Purchase Order Management

The document outlines a series of tasks focused on Object Oriented Programming (OOP) using local and global classes to manage purchase order details, including sales header and item data, and displaying results in ALV format. Each task involves creating classes with specific methods for fetching and displaying data based on user input, implementing inheritance, and using interfaces for method definitions. The tasks emphasize the use of constructors for default values, method access control, and dynamic output based on user selections.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

OOP Tasks for Purchase Order Management

The document outlines a series of tasks focused on Object Oriented Programming (OOP) using local and global classes to manage purchase order details, including sales header and item data, and displaying results in ALV format. Each task involves creating classes with specific methods for fetching and displaying data based on user input, implementing inheritance, and using interfaces for method definitions. The tasks emphasize the use of constructors for default values, method access control, and dynamic output based on user selections.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Object Oriented Programming

(OOPS)

Task - 1

Create 3 local classes, first class is used to fetch the sales header data,
second class is used to fetch the sales item data and third class is used
to display the final data in ALV grid display. First class is a super class
for the other two classes. Inherit the First class and use it in other two
classes. Input is Sales document number in select options. If the user
has not given any input, then use constructor to fix the input as ‘4900’ to
‘5000’. All the methods should be static methods.

Have to do the task in SE24 and also in Global Class

Task - 2

Create 3 local classes, first class in used to get mara details, second
class is used to get makt details, third class is used to get marc details.
Define an interface with the method named getdetails, use this interface
method in all the three class and fetch the respective details. Display the
final result in alv ( Final table fileds – Matnr, Ernam, mtart, Maktx,
werks ). Input – Matnr ( Select options). Use alias for the interface name.

Have to do the task in SE24 and also in Global Class

Task - 3

Create 2 Local classes, First class is a super class with 3 methods ( one
private (get PO Condition type), one public ( PO header ) and on
protected ( get po items ). Access the 3 methods of the super class in
second class and display the final table in alv. Use ME variable to call
the method.

Have to do the task in SE24 and also in Global Class

Task - 4

1. Develop 4 global class for Purchase order header details, item details,
condition types and final table details.

2. Keep the header details class as super class for other three class.
3. If user doesn’t give any input for ebeln select-option , Use a
constructor for giving default ebeln value ‘3000000004’ to
‘3000000010’.

4. Use a method named ‘getpodetails’ in all 4 global classes.

5. This method should behave differently in all four global class

6. Vendor number and name is fetched in a protected method in super


class.

7. It should be accessed in all other sub classes. All reports should


contain vendor number and name.

8. Keep 4 radio buttons in the input screen namely PO header details,


PO Item details, PO Condition details, PO final details.

9. The class must be called based on the radio button selected.

10. The output must be displayed based on the radio button


selected. Use ALV report for the output.

Output for different options

Header details - Take any 6 fields from EKKO table

Item details - Take any 6 fields from EKPO

table

Condition details - Ebeln, kposn, kschl, kbetr, waers (KONV –


condition table)

Final table details - Refer the output shown below (t685t –


condition text table )

Final table output


Task - 5

1. Develop 4 local class for Purchase order header details, item


details, condition types and final table details.

2. Keep the header details class as super class for other three class.

3. If user doesn’t give any input for ebeln select-option , Use a


constructor for giving default ebeln value ‘3000000004’ to
‘3000000010’.

4. Use a method named ‘getpodetails’ in all 4 local classes.

5. This method should behave differently in all four local class

6. Vendor number and name is fetched in a protected method in


super class.

7. It should be accessed in all other sub classes. All reports should


contain vendor number and name.

8. Keep 4 radio buttons in the input screen namely PO header details,


PO Item details, PO Condition details, PO final details.

9. The class must be called based on the radio button selected.

10. The output must be displayed based on the radio button


selected. Use ALV report for the output.

Output for different options

Header details - Take any 6 fields from EKKO table

Item details - Take any 6 fields from EKPO

table

Condition details - Ebeln, kposn, kschl, kbetr, waers (KONV –


condition table)

Final table details - Refer the output shown below (t685t –


condition text table )
Final table output

Task - 6

1. Create 2 global classes - se24. The requirement is to display the


purchase order details with discount (discount is calculated based
on vendor).

2. In first class, create two methods for getting PO item details & for
setting discount indicator for based on Vendor.

If vendor = 5550, then set the indicator as ‘A’.

If vendor = 3730, then set the indicator as ‘B’.

If vendor = 3020, then set the indicator as ‘C’.

If vendor = others, then set the indicator as

‘X’.

3. In PO item details method, fetch ebeln, ebelp and netpr fields from
ekpo.

4. Assign PO item details method as ‘PROTECTED’ and assign


discount indicator method as ‘PRIVATE’.

5. Inherit the second class from first class. Use the PO item details
and discount indicator details for the inherited method in the class
2 for calculation of discount.

6. Create an interface with a method for amount after discount.


7. Use this interface in Class two and implement the interface
method in the class. This class takes the select options (EBELN) as
input and gives the table amount after discount as output.

Output fields – Ebeln, Ebelp & Netpr ( Amount after discount )

Logic – If discount indicator is ‘A’ give 10% discount from netpr, If


discount indicator is ‘B’ give 20% discount from netpr, If discount
indicator is ‘C’ give 30% discount from netpr and If discount
indicator is ‘X’ give 5% discount from netpr.

8. Use ‘alias’ and ‘me’ referencing while calling methods

Output

Task - 7

1. Create 2 local classes in your program. The requirement is to


display the purchase order details with discount ( discount is
calculated based on vendor ).

2. In first class, create two methods for getting PO item details & for
setting discount indicator for based on Vendor.

If vendor = 5550, then set the indicator as ‘A’.

If vendor = 3730, then set the indicator as ‘B’.

If vendor = 3020, then set the indicator as ‘C’.

If vendor = others, then set the indicator as

‘X’.

3. In PO item details method, fetch ebeln, ebelp and netpr fields from
ekpo.
4. Assign PO item details method as ‘PROTECTED’ and assign
discount indicator method as ‘PRIVATE’.

5. Inherit the second class from first class. Use the PO item details
and discount indicator details for the inherited method in the class
2 for calculation of discount.

6. Create an interface with a method for amount after discount.

7. Use this interface in Class two and implement the interface


method in the class. This class takes the select options (EBELN) as
input and gives the table amount after discount as output.

Output fields – Ebeln, Ebelp & Netpr ( Amount after discount )

Logic – If discount indicator is ‘A’ give 10% discount from netpr, If


discount indicator is ‘B’ give 20% discount from netpr, If discount
indicator is ‘C’ give 30% discount from netpr and If discount
indicator is ‘X’ give 5% discount from netpr.

8. Use ‘alias’ and ‘me’ referencing while calling methods

Output

You might also like