Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Get Node & Get Node last.

Former Member
0 Kudos

i am not able to apply the concept of get node and get node last,

Assuming the scenario,

Root Node - (0,0)

Child nodes of (0,0) at Level 1 - (0,1) (0,2)

child node of (0,2) - (2,1)

we have the statements say

GET NODE (0,0)

GET NODE (0,2)

GET NODE (0,0) LATE

what happens when each of the above statements are executed?

when does the late event get processed?

What are the nodes that are processed ( at each stage and after all statements are executed)

3 REPLIES 3

Former Member
0 Kudos

Hi Annapurna,

try to debug these standarad demo programs and see if u can get answers for ur questions

<b>

demo_program_get_late

demo_program_get</b>

Also check this link

http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9b8535c111d1829f0000e829fbfe/content.htm

FORM PUT_<node>

Called in the sequence defined in the structure. Reads the data from the node <node> and uses the

PUT <node>.

statement to trigger a corresponding GET event in the ABAP runtime environment. The PUT statement is the central statement in this subroutine: It can only be used within a subroutine of a logical database. The logical database must contain the node <node>, and the subroutine name must begin with PUT_<node>. The PUT statement directs the program flow according to the structure of the logical database. The depth to which the logical database is read is determined by the GET statements in the application program or the interface parameter CALLBACK of the function module LDB_PROCESS.

First, the subroutine PUT_<root> is executed for the root node. The PUT statement then directs the program flow as follows:

i) If the database program contains the subroutine AUTHORITY_CHECK_<table>, the first thing the PUT_<node> statement does is to call it.

ii) Next, the PUT statement triggers a GET event in the runtime environment. If there is a corresponding GET <node> statement in the executable program to which the logical database is linked, the associated event block is processed. If the CALLBACK parameter of the function module LDB_PROCESS is filled accordingly, the corresponding callback routine is called.

iii) The PUT statement then directs the program flow as follows:

(a) To the next subroutine of a node that follows directly, if a lower-level node (not necessarily the very next) in the same subtree is requested by GET in the executable program or in the function module.

(b) To the subroutine of a node at the same level, if the preceding node branches to such a node and if a GET statement exists for such a node in the executable program or the function module.

The PUT statement in that subroutine starts again at step (i). In the subroutine of the lowest node in a subtree to be processed using GET, the program control does not branch further. Instead, the current subroutine is processed further. When a subroutine PUT_<node> has been executed in its entirety, the program flow returns to the PUT statement from which it branched to the subroutine PUT_<node>.

iv) When control has returned from a lower-level subroutine PUT_<node>, the PUT statement triggers the event GET <node> LATE in the runtime environment.

Former Member
0 Kudos

Well, according to the documentation for GET:

"Addition 1

... LATE.

Effect

Executes the code following "GET dbtab LATE." only when all the subordinate tables have been read and processed.

Example

Count the smokers among the bookings already made:

NODES: SFLIGHT, SBOOK.

DATA SMOKERS TYPE I.

GET SFLIGHT.

ULINE.

WRITE: / SFLIGHT-SEATSMAX,

SFLIGHT-SEATSOCC.

SMOKERS = 0.

GET SBOOK.

CHECK SBOOK-SMOKER <> SPACE.

ADD 1 TO SMOKERS.

GET FLIGHT LATE.

WRITE SMOKERS. "

Rob

Former Member
0 Kudos

In LDB program there will be a PUT node command to fetch the data from tables.

When GET event is trigerred the LDB program retrieve the necessary data from tables and fill the structure using PUT command. Also few internal table are filled too.

GET LATE is triggered only when all the child nodes of parent node is processed. If there are 3 nodes like below,

GET (0,0)

GET (0,2)

GET NODE (0,0) LATE - This event is triggered only after processing (0,0) and (0,2).