Skip to Content
0

Dynamic ALV on selection screen

May 05, 2017 at 02:09 AM

155

avatar image
Former Member

Hi,

I need to create a program in which I need to display the ALV on the same screen as selection screen. I should be able to expand/collapse the selection screen and accordingly the ALV should adjust.

Could you please suggest me on the design?

Thanks,

Ayushi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Richard Harper May 05, 2017 at 07:17 AM
2

Or...

Run your selection and get your result set. Export that to a memory parameter.

In initialisation check to see if you have any results in the memory parameter. If you have, create a docking container docked to the default screen. Then use that as a parent for your alv grid:

Initialization.
   Perform Init Changing gs_Run_Parameters.
*
*  Re-populate the select options.
*
   s_Bullet[] = gs_Run_Parameters-Bulletins.
   s_Werks[]  = gs_Run_Parameters-Plants.
   s_ArbPl[]  = gs_Run_Parameters-Work_Centres.
*
*  Display prior results ?
*
   If gs_Run_Parameters-Populated = Abap_True.
      Perform Display_Bulletins Changing gs_Run_Parameters
                                         gs_Display.
   EndIf.

Don't forget to clear the memory parameter after you have read it:

     Clear es_Run_Parameters.
*
*    Protect the import from crashing - if there is a problem then just delete the
*    cluster.
*
     Try.
        Import ZDM_BULLETIN = es_run_Parameters From Memory.
     Catch CX_SY_IMPORT_MISMATCH_ERROR.
        Clear es_Run_Parameters.
        Delete From Memory Id 'ZDM_BULLETIN'.
     EndTry.
*
     If es_Run_Parameters-Populated = Abap_True.
        Delete From Memory Id 'ZDM_BULLETIN'.
     EndIf.

Regards

Rich


capture.jpg (105.7 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Yeah but OP also wants "Expand/collapse the selection screen and accordingly the ALV should adjust".

1

Grab the horizontal sash of the docking container and move it up or down.... :-)

Perhaps a better explanation of 'Expand/Collapse' of the selection screen would help, because I'm not exactly sure what he means. However, I would think a PAI would/needs to be involved some how and dependant on the input fields (for example if a check box radio button or drop down list is used) but other types of fields would require as far as I know a key stroke from the operator

Rich

0
Horst Keller
May 05, 2017 at 05:12 AM
1

Create a subscreen as a special case of a tabbed block and display your ALV in a custom container there.

Another way around, you can also display your ALV on a general screen and embed selection screen(s) as subscreen there.

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi May 05, 2017 at 07:21 PM
1

For the Expand/Collapse, you could use the MODIFY SCREEN and alike statements to hide or show fields at runtime, but if you use a selection screen containing a subscreen area, as Horst suggested, I think it can't collapse as the compiler defines the area with option "vertical resize" equal to OFF.

So, I guess the only option is to use a dynpro with embedded selection screen (see Horst second part of his answer). But then, only the layout of the selection screen will work but not the other features (like program variant).

Otherwise, using a docking container could be the solution as Richard said, by estimating an approximate container's height based on expand/collapse status.

Share
10 |10000 characters needed characters left characters exceeded