Hi Amaresh,
can you assure that the three runs of the BADI are executed inside the same user session? Then you could use EXPORT TO MEMORY, e.g. like this:
- Use IMPORT FROM MEMORY to read "counter" from session memory. If this fails: we are the first step in a sequence, so initialize "counter" with 0.
- Increment "counter" with current number of records.
- Use EXPORT TO MEMORY to save the current value of "counter" for the next step.
If each of the different steps is running in a fresh user session, it will be more difficult...
Regards, Ulrich