Adding Fields to a Table

Invoke transaction SE11 (ABAP Dictionary).

Add the fields to the required table by using the Append Structure feature.

a. You can either add fields to an already existing structure or create a new structure.

b. The Append Structure button appears in the top right corner of the application toolbar.

c. Save and activate the appended or modified structure.

The newly added structure is copied to the table definition.

d. Save and activate the table.

Invoke the CRM BDoc Modeler (transaction SMW_BDM) and enhance the BDoc type by using the newly added fields.

a. Select the required BDoc type by using the Filter Conditions button.

b. Select the segment to which you need to add the field.

c. Insert a new row, enter the table alias, and chooseF4to select the field from the list. By default, the segment field and table field name are same. However, you can change this if required.

d. Save the changes made to the BDoc type.

e. Check the BDoc type for errors and then generate and activate the BDoc type.



We recommend you to check the generation process of the BDoc type as explained below:

Inbound adapter: Check whether the newly added segment is included in the code. To do this, double-click the BDoc type, go to General Data group box, and click on the name of the Function module.

Structure:Check whether the generated structure contains the components that were added during the enhancement. If not, invoke transaction SE11, open the BDoc structure, and append the structure corresponding to the newly added segment.

Invoke transaction SE37 to add code to populate the fields by using the user exits.



To identify the name of the user exit to which you need to add code, to populate the segments, see User Exits .

a. Create or change the BADI implementation.

i. Invoke transaction SE18.

ii. Enter the BADI definition name. For more information, see User Exits .

iii. Select Implementation in the menu bar.

iv. Check if any existing implementations meet your requirement. If not, create a new implementation.

v. Enter the required code in the appropriate method.



In the user exit, all the active implementations are executed in the order maintained in the V_EXT_ACT system table.

b. Generate the sendbits for the newly added fields or use the sendbits generated by the standard mapping. For more information, see Sample Code .

c. After you enter the code, check the code and activate the method. During coding, you can use only the parameters passed to the method. You cannot directly access the database table or global variables.

Generate table scripts and metadata. For more information, see Generating Metadata for Business Document Types and Generating Table Scripts .