Entering content frame

Procedure documentation Creating a Table and Adding a Segment Locate the document in its SAP Library structure

...

       1.      Invoke transaction SE11 (ABAP Dictionary).

       2.      Create the table with the necessary fields.

                            a.      Create the new table: Name must be as per the Customer namespace (ZZ)

                            b.      Enter the description, other attributes, and Technical settings.

                            c.      Enter the fields directly. You do not need to use Append Structures.

                            d.      Enter the Mandt field if the table is client-specific.

                            e.      Mark the key fields.

                              f.      Save, Check, and Activate the table.

       3.      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 root segment and right click. Choose Add a Child Segment.

                            c.      Enter a name and description for the segment. Select the Cascaded Delete and Use map options. In the Mappings tab, enter the CDB table name and an alias for it. Select the Update map option.

                            d.      In the Segment Fields tab, scroll to the right and enter the table alias that was entered in the Mappings tab. Select the table field name. By default, the segment field and table field name are same. However, you can change this if required.

                            e.      Save the changes made to the BDoc type.

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

This graphic is explained in the accompanying text

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.

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

This graphic is explained in the accompanying text

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.

This graphic is explained in the accompanying text

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

                            b.      If you are adding a new segment, you need to set the task and sendbits fields. You can use the function COM_SENDBITS_FETCH to generate the sendbits for all the fields in the segment. The function expects the structure name to correspond to the segment.

This graphic is explained in the accompanying text

To view structures corresponding to all the segments of a BDoc type, enter the BDoc structure as the data type (transaction SE11).

                            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.

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

Leaving content frame