SAP PUT ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID PUT
• PUT ABAP Statement

PUT
Short Reference

ABAP_SYNTAX_OBS
PUT ${ node $| < node> $}.

What does it do?
This statement is only possible in the database program of a logical database in the subroutine named put_node. In the runtime framework, it raises the event GET node and thereby signals that data is available in the table work area of the node node . If there is an appropriate event block implemented in the executable program linked with the logical database, this block is executed.
After the associated event block has been processed, the subroutine put_next_node of the node next_node that follows in the logical database structure is called, if this node is processed in the linked executable program. Once this subroutine is exited, the event GET node LATE is raised and, if implemented, its event block is processed in the executable program.
The database program must contain one of the statements NODES or TABLES for the node node. The syntax of the statement PUT depends on the node type.
If the node is type C, S, or T, the name of the node node must be specified after PUT.
If the node is type A, a field symbol < node> must be specified with the name of the node after PUT. In the statement PUT, the field symbol must be assigned a data object of the data type that is requested in the TYPE addition of the statement NODES in the linked executable program. This data type can be taken from the internal table dyn_node_types that is predefined in the database program.



Latest notes:

If the logical database is not directly linked with an executable program, but is called using the function module LDB_PROCESS instead, the statement PUT does not raise an event and ensures that the corresponding callback routine is called in the calling program instead.
See also Database Program.
If logical databases are no longer created, the statement PUT is no longer needed either.
ABAP_HINT_END



Example ABAP Coding

The subroutine put_root_node is part of the database program of a logical database with a node root_node of type A, which is assigned the data types S_CARR_ID and S_CONN_ID from the ABAP Dictionary. Accordingly, a field symbol < root_node> is specified after PUT, and its value is set depending on the content of the corresponding line of the internal table dyn_node_types. FORM put_root_node.

DATA carr TYPE s_carr_id.
DATA conn TYPE s_conn_id.
DATA dyn_node LIKE LINE OF dyn_node_types.

READ TABLE dyn_node_types INTO dyn_node
WITH KEY node = 'ROOT_NODE'.

CASE dyn_node-type.
WHEN 'S_CARR_ID'.
carr = ...
ASSIGN carr TO < root_node>.
WHEN 'S_CONN_ID'.
conn = ...
ASSIGN conn TO < root_node>.
WHEN OTHERS.
EXIT.
ENDCASE.

PUT < root_node>.

ENDFORM.
The following lines can be part of an executable program that is linked with the logical database. The specification after TYPE in the statement NODES defines the type of the field symbol < root_node> and writes the type to the column type in the corresponding line in the internal table dyn_node_types in the database program of the logical database. NODES root_node TYPE s_carr_id.
'TYPE s_conn_id.

GET root_node.
...
ABAP_EXAMPLE_END

Return to menu