Ansicht
Dokumentation

ABENMESH_INSERT - MESH INSERT

ABENMESH_INSERT - MESH INSERT

Vendor Master (General Section)   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

INSERT mesh_path

INSERT line_spec INTO TABLE mesh_path result.

Effect

Inserts lines in the last path node of a mesh path mesh_path. As in inserts into a directly specified table using INTO TABLE, the position of the lines to be inserted is determined using the primary table key. The behavior for duplicate lines encountered with respect to unique table keys is also the same. When specifying the inserted lines using line_spec, the same applies when inserting lines into directly specified internal tables and they must be compatible with the line type of the last path node.

A set of lines with the line type of the last path node is instantiated internally from the specification in line_spec and the result of the mesh path. This set is inserted into the last path node in accordance with the rules of INSERT:

  • For each line in line_spec or for each line in a table to be inserted, the same number of lines is created as described by the result. If the mesh path contains only the initial mesh associations, one line is created. In the case of path extensions, multiple lines can be created.
  • In the new lines, the columns in the ON condition of the last mesh association of the mesh path are filled as follows:
  • If the mesh path contains only an initial mesh association, each of these columns is filled with the current comparison value from source.

  • If the mesh path contains path extensions, each of these columns is filled with the value described by the result of the preceding mesh association.

The remaining components have the value of the lines specified in line_spec.

The following applies when specifying the mesh associations:

  • If the mesh path contains only an initial mesh association, the square brackets cannot contain an additional condition.
  • If the mesh path contains path extensions, all mesh associations can contain additional conditions using the additions USING KEY and WHERE log_exp. The square brackets [ ] for the mesh association of the last path extension must be empty.

The number of lines to be inserted is the number of lines specified in lin_spec multiplied by the number of lines described in result. If, due to an additional WHERE condition, the result set is empty, no lines are inserted.

result can be used to specify the output behavior when exactly one line is inserted, as in INSERT. Since more than one line can be inserted when path extensions are used, the addition result can only be specified in the following cases:

  • If the variant LINES OF is not used in line_spec.
  • The mesh path contains only the initial mesh association.

The return code sy-subrc is set in the same way as in the corresponding statement INSERT.

Notes

  • When INITIAL LINE is used to specify an initial line in line_spec, only those components remain initial that are not specified in the ON condition.
  • The square brackets of the mesh association of the last path extension are empty, since it needs only to indicate the mesh node in which the lines are inserted.






ABAP Short Reference   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 5547 Date: 20240420 Time: 180115     sap01-206 ( 80 ms )