SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Create Business Object in SAP

ABAP programmers can create business object in SAP system using SWO1 transaction code. I used Business Object to attach image and document files in Web Dynpro component development for a custom application header data. As an important part of file upload and display on SAP Web Dynpro tutorial, before using GOS Service cl_fitv_gos class the business object should be created. I tried to share how to create business object step by step in this ABAP tutorial.

Create Business Object using SWO1 Business Object Builder

Call SAP transaction code SWO1. SWO1 will display the initial screen for Business Object Builder.
Enter the name of the Object type you want to create in the "Object/Interface Type" input text field.
Make sure that the Category is selected as "Object type"
Then press Create button.

SWO1 transaction for SAP Business Object Builder

Provide the object type properties and attributes like name, description, program, application, etc.
All these defined values are new and will be created in the end of this process except the Application information.
Since my target business object is related with sales processes, I chosed V as Application value.

create Object Type in SWO1 SAP transaction

After you press OK or press Enter, SAP users will be displayed with below screenshot where the details of the business object type are shown.

SAP business object type properties

To define the key fields which are used to define uniqueness of a business object, click on "Key fields" line. Then press Create (F5) button from menu.

create key fields for SAP business object

A wizard screen will let you copy the key fields from an ABAP dictionary object. Press Yes to make the key field selection simplier.

create key field wizard

Since my business objects are records from a ABAP transaction table where the header data of the custom proforma process is kept, I entered the table name and press Enter. Key fields defined on the ABAP table will be listed on the screen.

SAP business objects from ABAP table

Select the fields by highlighting the rows. After you select all the fields that you want to define as key fields of your new business object, press Enter. Please note that, it is possible to select more than one key field for your business object if your ABAP table has.

create Key Fields with Data Dictionary Field Proposals

A summary information will be displayed after your selection. Press Create icon to continue.

create business object key field

You will see the key field is listed under the Key fields of new object type on "Change Object Type" ABAP screen.

SAP business objects key fields

Before you generate the business object, from top menu follow menu selections:
Edit > Change Release Status > Object Type > To implemented

change relase status of SAP business object type

Now you can generate the business object type.

generate ABAP business object type

We have successfully created our Z_PROFORMA custom business object type.

SAP business object type generated


Test Business Object using SAP transaction OAOR Business Document Navigator

Call SAP transaction OAOR, Business Document Navigator.
Enter the class name as the one you have just created in above steps and class type as "BO", then press Enter..

SAP transaction OAOR Business Document Navigator

The following screen will request from the user the key field values of the business object.
Enter the appropriate value.

enter key field values for SAP business object

SAP user will successfully reach the Business Document Navigator. Using Create document icon, users can attach documents like MS Office documents, text files or images, etc to this business object.

Business Document Navigator for SAP business object for attachments

It is also possible to attach files to business objects using the GOS service cl_fitv_gos class automatically by ABAP code.



SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.