banner ads

Calling a Report from another Report with Parameter

Calling a Report from another Report with Parameter

In the following example we are calling a report (zsr_test1) from another report (zsr_test). To do these functions we use SUBMIT statement in the zsr_test report like following.

SUBMIT zsr_test1.

This statement will let us enter directly into the zsr_test1 report. We also can pass parameter values from one program to another like following.

SUBMIT zsr_test1 WITH p_text1 EQ p_text.

Here p_text is the parameter declared in zsr_test report and p_text1 is the parameter declared in zsr_test1 report. We can enter our custom text into p_text and want to display by zsr_test1 report. Here the calling program will be as follows.

PARAMETERS p_text TYPE char50.
SUBMIT zsr_test1 WITH p_text1 EQ p_text.

Next we need to create the called program zsr_test1 as follows.


PARAMETERS p_text1 TYPE char40.
  WRITE: / p_text1.

Now we shall look at the debugging level step by step. At first we set the break point on the calling program zsr_test and execute.

We can see that the p_text is accessible whereas p_text1 is not. Now pressing the F5 we directly enter into the called program and then p_text1 gets accessible and populates the data.

The output is as follows.

No comments