Scenario: I came accross a scenario where the client wanted us to check for the number of records picked up during the full load.If the number of records were found to be zero, the load was to be terminated so that further loads do not happen as they would be incorrect if this load fetched zero records.

Solution: We created a program to check the number of records in table( in our case it was the PSA table) and terminate the process chain by using an error message if zero records were fetched. In our case, it was always a full load from ECC to BW, as it was a small table with limited entries and the table was supposed to be updated by a particular time in ECC  by the users’. There were other loads which were dependent on this load. so in case, this load did not fetch any records(because the table wasn’t updated by the time process chain ran) other loads were supposed to stop.

The program:

REPORT  Z_CHECK_number_of _records.

  o_ref TYPE REF TO data.
         TYPE ANY,
      TYPE ANY,
     TYPE ANY.
  p_tab       TYPE tabname.       ” Table name
  CREATE DATA o_ref TYPE TABLE OF (p_tab).
  “ASSIGN p_field TO .
  ASSIGN o_ref->* TO .

    FROM (p_tab).
if ( sy-subrc NE 0 ).
  MESSAGE e213(/MAP/E).

When the program is run it asks for the name of the table for which the records are to be checked. Following is the screenshot of the selection screen:

While using this in a process chain, this has be inserted before the step where you want to stop the process chain.

Create a variant of this program by entering the name of the table in the selection screen and saving it.

Now select the process chain variant ABAP Program and insert this variant of the program.

Now, when the process chain runs, it encounters this step and checks for the number of records and sends ou an error message if it finds zero records.

New NetWeaver Information at

Very Helpfull

User Rating: Be the first one !