Start of Content Area

Procedure documentation Unit 3: Creating Object Database Field Attributes  Locate the document in its SAP Library structure

Use

In this unit you create and implement the object database field attribute sold-to party. Database field attributes are attributes that evaluate the content of a database field directly. In this case, the attribute reads the sold-to party from the database and creates from it a reference to an object of the type customer.

The system helps you implement this attribute by generating source text automatically.

Procedure

  1. Position the cursor on the entry Attributes.
  2. Choose This graphic is explained in the accompanying text and answer the query Create with ABAP Dictionary field proposals? with Yes. This simplifies the entry of the data type reference.
  3. Enter VBAK in the Table field.
  4. Select the field KUNNR (sold-to party) from the table fields displayed.
  5. Choose This graphic is explained in the accompanying text.
  6. Check the proposed texts. You do not need to make any changes.
  7. Since the value of the database field is to be formatted and returned as an object reference, enter KNA1 (customer) in the object type field.
  8. Make sure that the object type entered here only has one key field and can be identified via the database field entered.

  9. Choose This graphic is explained in the accompanying text.

The attribute is transferred into the object type definition with the automatically-proposed name SoldToParty.

Implementing attributes in the implementation program

Check your object type. To do so, choose This graphic is explained in the accompanying text.

If you have completed the previous unit, you will see that no further implementation is required. Database field attributes that refer to fields in the table VBAK are already fully implemented.

Result

Testing the SoldToParty attribute

  1. Choose This graphic is explained in the accompanying text.
  2. This regenerates your object type.

  3. Choose This graphic is explained in the accompanying text.
  4. The Test Object Type <Object Name>: No Instance screen appears.

  5. Choose This graphic is explained in the accompanying text Instance.
  6. Identify an object of the type sales order by entering the number of a sales order of your choice. Use the F4 input help if necessary.

  7. Choose This graphic is explained in the accompanying text.

The Test Object Type <Object Name> screen then appears, in which you can test your object type (execute methods, check attribute values).