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: 

Restrict report display again when still inside transaction

Former Member
0 Kudos

Hi Experts,

I have a requirement where in I am displaying a report. If I execute the transaction it displays a selection screen, I give values and execute to see the report.

Now, when I go back and still in selection screen and press execute button. it should an error message. But If I go back from the transaction and execute it should execute.

6 REPLIES 6

Former Member
0 Kudos

You may have observed that after execution and coming back parameters and select option values will remain as user given. So you can use this property. Declare one parameter in no display mode and fill that while executing first time, while executing second time you can validate by checking the value in the parameter.

If not create a custom pf status and assign for that report. While clicking on back button redirect to easy access screen,don't come back to selection screen.

0 Kudos

In which Report event I should fill the value when I am executing for the first time?

0 Kudos

Start of Selection

0 Kudos

Selection screen value is changed to original value every time I execute. How to determine when to write the message.

0 Kudos

Create a additional parameter in no display mode. And use that for your validation.

pranay570708
Active Contributor
0 Kudos

Create a global variable (say lv_flag) and use memory ID, clear it in INITIALIZATION event. And set it to 'X' when you are displaying report. And check for lv_flag value in START of SELECTION. Make use of Import/Export.

INITIALIZATION.

Clear lv_flag.   "Gets cleared every time transaction gets callled.

FREE MEMORY ID 'MID'.

START OF SELECTION.

IMPORT LV_FLAG FROM MEMORY ID 'MID'.

if lv_flag is initial.

-----ALV display logic----

Export

      lv_flag = 'X'.   "Set flag

      EXPORT LV_FLAG TO MEMORY ID 'MID'.

else.

-----error message----

endif.

So, when your ALV gets displayed properly, flag will be set and next time you hit execute, it will throw error as condition will fail.