n the last post Dynamic Parameter Texts in Selection Screen (which was so many weeks ago), we discussed how we can change the selection screen parameter by changing the values of some selection screen specific variables. Greets Enno suggested to use the FM SELECTION_TEXTS_MODIFY to handle the selection screen parameters more easily and in standard way.
Some of the readers also left comment on the previous post about the use of this trick. One scenario I came in my mind: Certain Parameter Texts based on the Radio button selection. E.g. We have some radio buttons like Sales Order, Credit Memo, Debit Memo and so on. Based on this radiobutton selection, we want to display the Date's parameter text.
This code snippet will realize this scenario using the FM SELECTION_TEXTS_MODIFY.
if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours email-id :- avinashkr_raj@yahoo.com(any email) email-id :- avinaskr_raj.abap@blogger.com
Go on link..
link us with ...
Showing posts with label Selection Screen. Show all posts
Showing posts with label Selection Screen. Show all posts
Monday, January 3, 2011
Display ALV report output in the SAME Selection Screen
After a lot of analysis (and of course Trials-&-Errors), I found the solution which requires minimal development. Before giving the solution, check out how it looks-
When we start running the report, it will be a normal Selection Screen:

After executing the report, our output will overlay on the Selection Screen. And it will look like this:

Doesn't it look good ?
Journey to find the solution:
After reading the problem in the thread, suddenly I got a strike: Why not to create a Docking Container and place the ALV inside it..!!
I have started with placing the docking container in the INITIALIZATION event and the code to generate the ALV in the START-OF-SELECTION event. In this try, I got the docking container on the selection screen but no ALV inside of that docking container. Than I realize that I missed on of the basics of report programming - as soon as control goes to INITALIZATION all memory allocation will be destroyed and global data will be initialized. That's why I was not getting the ALV in the docking container. Selection screen was looking like this:

So, I moved the ALV logic in the INITALIZATION event. After this try, I got the Docking container with the empty ALV - ALV with the field catalog but no Data. Here again, I have the same problem - all my data allocation got destroyed as soon as control come to INITALIZATION event. To overcome this I used the ABAP local memory. I exported my output table and imported back it into the INITALIZATION to initialize my ALV. Selection-screen was looking like this:

Here is the code which will generate the output as shown in the second picture.
Steps to create an ALV on the Selection Screen, in summary :
Create docking container in the INITALIZATION event Create ALV on that Docking container After selecting all the data, export output table to ABAP memory Before generating the output, import the output table from the memroy
When we start running the report, it will be a normal Selection Screen:

After executing the report, our output will overlay on the Selection Screen. And it will look like this:

Doesn't it look good ?
Journey to find the solution:
After reading the problem in the thread, suddenly I got a strike: Why not to create a Docking Container and place the ALV inside it..!!
I have started with placing the docking container in the INITIALIZATION event and the code to generate the ALV in the START-OF-SELECTION event. In this try, I got the docking container on the selection screen but no ALV inside of that docking container. Than I realize that I missed on of the basics of report programming - as soon as control goes to INITALIZATION all memory allocation will be destroyed and global data will be initialized. That's why I was not getting the ALV in the docking container. Selection screen was looking like this:

So, I moved the ALV logic in the INITALIZATION event. After this try, I got the Docking container with the empty ALV - ALV with the field catalog but no Data. Here again, I have the same problem - all my data allocation got destroyed as soon as control come to INITALIZATION event. To overcome this I used the ABAP local memory. I exported my output table and imported back it into the INITALIZATION to initialize my ALV. Selection-screen was looking like this:

Here is the code which will generate the output as shown in the second picture.
| Code Snippet to Display ALV output on the Selection Screen |
|
Steps to create an ALV on the Selection Screen, in summary :
Labels:
Selection Screen
Subscribe to:
Posts (Atom)
link us...
For Visitors
if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours
email-id :- avinashkr_raj@yahoo.com(any email)
email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)
email-id :- avinashkr_raj@yahoo.com(any email)
email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)

