Thursday, 24 April 2014

Creating a Business Object

Important Transactions while working with BOPF:
  • BOB: Business Object Builder.
  • BOPF: BOPF: Business Object Configuration.
  • BOBT: Business Object Builder – Test.

Simple step by step example for creating Business Object in BOPF.
  1. Start T-code: BOB (Business Object Builder). Click on “Custom Business Object”. A wizard opens as below proceed with continue.Capture.PNG
  2. Provide with a Prefix and Name and continue.1.png
  3. Propose a constant interface name and continue.1.png
  4. Propose a Persistent structure name, the Root node name is auto filled with ROOT.
    The Persistent Structure defines the attributes that are stored in the database.
    The Transient Structure defines the attributes calculated at runtime.
    Both structures are implemented as regular DDIC structures and are created in the DDIC transaction SE11. You can simply double click the structure to proceed with the structure creation.
    1.png
    I have created the following structure.1.png
    In the Currency/Quantity fields tab. Provide the Ref table and Ref fields:
    1.png
  5. Proceed with Continue in the wizard. The Combined Structure, Table type and the Database Table is automatically proposed.1.png
  6. Proceed with Continue and complete the wizard. You will be prompted for package, which I have assigned to Local Object.1.png
  7. The BO is created as below, by default a Query is created SELECT_ALL:1.png
  8. We are now creating ITEM node. Right click ROOT and create a Sub node.1.png
    A wizard opens proceed with the ITEM as node name.1.png
  9. Provide a Persistent structure which is created in se11 or create it through Forward navigation.1.png
    The following Item structure is created.1.png
    Provide with the Ref table and Ref field.
    1.png

  10. Continuing we get the Combined Structure, Table type and Database Table.1.png
    Proceed with continue and complete the wizard. We now have the ITEM node created.1.png

Testing: Let us now proceed with Testing of the BO:
  1. Open T-code BOBT (Business Object Builder – Test). Provide with your Business Object name.
  2. Select the ROOT and click Add node instance. Provide with your input data.1.png
  3. Select the record and click “Execute Association” button and click on “ITEM”.1.png
  4. You can add two item level records.
    1.png
  5. Save your records by clicking the save button.

Thank you. On my further posts I will be providing with creating of Alternate Keys, some examples for using retrieve, retrieve by association, association to a delegated node and FPM BOPF Integration(FBI).

Wednesday, 23 April 2014

Creating Alternative Keys

  1. Start T-code: BOBF (BOPF: Business Object Configuration). Select your Business Object.
  2. Create Secondary Indexes for the ROOT database table. 1.jpg
  3. Double click the table. Change to edit mode and click Indexes and create Indexes. Provide the Index name Eg: A1.2.jpg
  4. Provide with the Index fields. Save and activate. Also Activate the Table. 1.png
  5. Type DEBUG in the T-code. Confirm the POPUP box as Yes. Click on Change mode button. Since for creating Alternate keys the option is disabled. 1.png
  6. Provide with the details as below and Save: 1.png
  7. I have created a structure for TRQ ID and assigned to Table type. 1.png
  8. Double click combined table type in ROOT. 1.png
  9. Select Secondary Key Tab. Select Key component as TRQ_ID from F4 help and Key Access as Non-Unique Sorted. Save and activate.1.png
  10. Regenerate the Constant Interface from Extras.
  11. Testing the Alternative Keys:
    Open T-code BOBT (Business Object Builder – Test). Provide with your Business Object name. Here we can pass the Alternative Key. Eg: 1001. You get the corresponding record. 
    1.png