Skip to Content
Technical Articles

Creating Association and Parameterized Association Using BOBF T-CODE

this blog I will show how to create a association in BOBF T-code from scratch.  I hope it will definitely help developers to learn and understand how to create a BOBF object and creating association.        

BOBF (BOPF: Business object Configuration (Internal Use):  using BOBF T-Code we can create and display the objects.

->We can change the mode of object from display to edit by giving ‘DEBUG’ in command field.

bobf

 

bobf

Steps to Create Business Object:

Step1:

->click on create business icon or function key f5.

->Provide Business object name and description

Creating%20Business%20Object

Creating Business Object

Step2:

Create Constant Interface:

Def: It contains all constants of a business object or business object enhancement.

Use: Keys present in the constant interface are used for enhancement,

->Each entity of business object or a business object enhancement can be identified.

->Provide name ‘zif_demo_constant_interface’ in constant interface field then go toExtras->Generate Repository Object->Create Constant Interface.

->It will create the constant interface with ‘ zif_demo_constant_interface’

->Inside this constant interface by default a Set of attributes will be created.

Constant%20Interface

Constant Interface

Step3:

Create Table

Create a Global table with DB as mandatory key TYPE /BOBF/CONF_KEY.

Create global structure for this table.

Constant%20Interface%20Attributes

Table For Business Object

Structure

Structure

Step4:

Add Mandatory Fields to  Root

When we create a BOPF project the root node is automatically generate,

To this root node, add DDIC structure, combined structure, combined table type, and DDIC table, as shown below.

Root%20Node

Root Node

Root%20Node

Root Node

Create Combined Structure:

Create combined structure as shown below

Combined%20Structure

Combined Structure

Now the BOPF Object is created with all the required and manditary Structuers.

->Inside root node 6 Node elements generate by default.

1.validation.

2.Determination.

3.Action.

4.Association.

5.Alternativekey.

6.queries.

Hear I will show how to create Association and Conditional association.

Association:

->In BOPF, an association is used to define a direct and unidirectional relationship between two nodes.

->You can use an association to navigate from a source node to a related target node

->You can define associated nodes in one or more business objects or business object enhancements.

->If you define associated nodes in more than one business object, you define cross-business-object associations.

Association relationship:

Hierarchy%20Structure%20Of%20Node

Hierarchy Structure Of Node

->Above diagram Root Node is Node A, root node child is Node B, B child Node is Node c.

-> DB_KEY, PARENT_KEY, ROOT_KEY all are type RAW16.

Root Node A:

In root node key , Root key generated by default Parent key is empty because Root Node only first node no parent for root node .

Root%20Node%20A

Root Node A

Child Node B:

In child node B key generate automatically, parent key is same as root node of key and root key same as root node of root key

Child%20Node%20B

Child Node B

Child Node C:

In child node C key generate automatically, parent key is same as Child node B of key and root key same as root node of root key

Child%20Node%20C

Child Node C

Node Key Fields
ROOT

MANDT

DB_KEY (as KEY)

Sub node of ROOT

MANDT

DB_KEY (as KEY)

PARENT_KEY

Sub Node of Sub node (third level)

MANDT

DB_KEY (as KEY)
PARENT_KEY

ROOT_KEY

 

 Creating Association In BOBF:

->Heare i will show association b/w two tables.

->First create a TABLE with MANDT, DB_KEY, AND PARENT KEY AND global structure.

-> Create Root note, after go to Node Structure->Root->Right click on root->Create Sub node->Standard Node.

->Create Sub node with the node name, description, structure, combined structure, combined table type And DDIC Table name.

Table for child node:

Child%20Table

Child Table

Creating Association in Root Node:

Association%20In%20Root%20Node

Association In Root Node

Now the association is created.

 

Conditional Association:

Step1:  

Create association first as shown above.

Step2:

Creating Filter structure:

->we associate the ITEM to the ROOT node in a cardinality of 1:0…n. The condition is defined on the target – the ITEM – node

->we need to define the input parameters for the condition. This can be done by creating a Data Dictionary structure and referencing them in the association definition.

So, enter the name of your structure ‘ZFILTER_DEMO1’ in the input field Filter Structure and navigate to the Data Dictionary with double-click and Create structure with ID.

Filter St

Filter%20Structure

ructure

Step3:

Creating Association Parameter:

Right click on Association parameter value->Create code value set

->After that below showed screen will appear in that fill value set name, description, class/interface, this are the mandatory fields we should fil.

Association%20Parameter

Association Parameter

Step4:

Creating Association Attribute binding:

-> Right click on association ->Maintain Attribute Binding->Switch to the Association Binding tab. we start the definition by selecting the binding pattern Specialization in the dropdown list box. This creates an entry in the table with binding the keys of the parent and child node.

->We create a new entry with the New button and select Association Parameter Attribute as Association Binding Category in the dropdown list box.

Binding

Binding

Now the conditional association is created.

Testing the BO in BOBT:

In BOBT TCODE first fetch data from header node as shown below, then select the association.

BOBT

BOBT

 -> Once you select association one popup box appear as shown below and enter the Parameter ID value.

Passing%20Parameter%20Value

Passing Parameter Value

->The conditions maintained in the association definition are joined with AND. So, the result list displays only the items that exceed 00002.

Child%20Node

Child Node

->This Is the out put in Child Node.

->We execute a second test and enter the limit 00004.

Limit%2000004

Limit 00004

->The result list is empty, as record is not precent in the item table.

Child%20Node

Child Node

Like this we create a BO object and association we can test in bobt.

I hope u find this document helpful Thank You.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.