2008 Jul 06 12:27 PM
hi,
Please Give Me Details Of A Business Object,like step by step creation of a new business object and it's utilization.
2008 Jul 06 12:57 PM
Create a business object (SWO1).
Give the business object name prefixed with Z_.
Enter the following fields with values:
Object type: Z_TESTXX
This is the internal technical key. Page: 1
Object type can have maximum 10 characters. This must be unique across all object type. Objects are specific instances of object types at runtime.
Object name: Object_Name_for_XX
The object type is addressed with this name by external applications. This is a descriptive English name and can be up to 32 characters. This also must be unique across all object type.
Name: Object Name: XX
This is a meaningful name of the business object.
Description: Object Description: XX
Page: 1
Object description, can be up to 40 characters.
Program: Z_TESTXX
Each object type has an ABAP/4 program in which methods of the object are implemented. This program is generated automatically when you create or revise an object type.
Application: indicates cross application.
3: Create an event.
Open the Object type in change mode. When you change your subtype the first step is to create a new event, this is done by selecting the Event node and clicking the create button. Give the event a name and a description. Next set the status of this object type component to implemented.
Event: Z_EVENT_XX
Name: Event name: XX
Description: Event Description: XX
Click on the new event andu2026
Edit - Change Release Status- Object Type Component - Implemented
(A small box sign vanishes from the right side of the event, indicating that it is implemented)
There can be multiple triggering events for a standard/customer task.
In R/3 4.0 the release strategy for new Object Types and Object Type Components (methods, attributes, events, etc.) was enhanced. Now when an object type and/or components are created, there are different statuses to select, based on its required purpose. The statuses are:
u2022 Modeled - objects cannot be accessed at runtime. This is the status that is automatically set when an object type or component is created. Items with a modeled status cannot be referenced in any type of workflow task.
u2022 Implemented - objects can be used internally in a test environment. They are accessible, but may not be stable (especially if no delegation has been defined).
u2022 Released - objects are ready for production. Note: Local objects cannot be released.
u2022 Obsolete - objects are typically replaced by new functionality or incompatible with previous versions. This status is optional.
4: Create a method.
Next a method must be created without using any function module template. When creating the method ensure that the method call is synchronous - this means that the method doesn't require a terminating event.
A method can be synchronous or asynchronous. Synchronous Method
Method that, for the duration of its execution, assumes the process control and, after its execution, reports to the calling component (work item manager, in this case).
Synchronous methods can return the following data, if defined: Return parameters, one result and Exceptions.
Terminating events can also be defined for a single-step task described with a synchronous method. At runtime, the relevant work item is then terminated either when the synchronous method is successfully executed or when one of the defined terminating events occurs.
Asynchronous Method
Method that, after its execution, does not report directly to the calling component (work item manager, in this case).
Asynchronous object methods do not return results, parameters or exceptions.
At least one terminating event must be defined for a single-step task described with an asynchronous object method.
At runtime, the relevant work item is only terminated if one of the defined terminating events occurs.
Next set the status of this object type component to implemented. The methods are not implemented unless you once open their program. Select the method and open its program. It gives a message u201CDo you want to generate a template automatically for the missing sectionu201D. Click u201CYesu201D. Inside the program insert the code u201CCALL TRANSACTION u2018FB03u2019. Display Financial Document.
Method: Z_METHODXX
Name: Method name: XX
Description: Method Description: XX
Edit - Change Release Status - Object Type Component - Implemented
5. Create Key fields.
Create key fields with ABAP dictionary field proposal.
It is the identifying key, via which the system can access a specific object, that is, an instance of the object type. The key fields of an object type are usually also the key fields in the table containing the header data for the object type. Only character-based data types are allowed as key fields. The total length allowed for all key fields is 70 characters. Each key field refers to a field in the ABAP Dictionary.
Enter u2018BKPFu2019 in table name field and select all the key fields. Press Continue button. Next set the status of these key fields to implemented.
Edit - Change Release Status -Object Type Component - Implemented
6:Implement business object.
The whole business object needs to be implemented so click on the business object title andu2026
Edit - Change Release Status - Object Type - Implemented
Now you can check the syntax, generate the Business Object and then test it. Execute the custom method you created and give the Company code, Document number and Year.