‎2009 Aug 31 8:21 AM
Hi,
I have a Report program written where in I am writing a code something similar to this;
START OF SELECTION-SCREEN '1020'.....
PARAMETERS: p_test1 TYPE I.
END OF SELECTION-SCREEN.....
So a selection screen gets created with the number 1020 and has a parameter p_test1 when the report is executed.
Then I am going to the screen 1020's layout and I am creating a CONTAINER to display something.
When the report is executed, the parameter p_test1 and the CONTAINER (containing the data) are displayed.
Now, I am adding another parameter p_test2 to the code.
START OF SELECTION-SCREEN '1020'.....
PARAMETERS: p_test1 TYPE I.
PARAMETERS: p_test2 TYPE I.
END OF SELECTION-SCREEN.....
When I do this and activate the code, the Selection-Screen 1020 gets regenerated and the CONTAINER that I manually created in the Screen Layout gets deleted.
So every time, I am making a change to that SELECTION-SCREEN code, I have to manually recreate the CONTAINER.
Is there any work around for this apart from creating a normal screen and call it in the program? That is can I create a CONTAINER in the program itself just like the Radio buttons, Checkboxes, List boxes, etc?
‎2009 Aug 31 10:32 AM
When ever your change in the Selection screen parameters in your report it will not reflect in already defiend screen.You have to define manually in the screen level.This one is applicable for selection screen.
Kanagaraja L
‎2009 Aug 31 10:42 AM
Hi,
When you try to change the selection screen, it actually gets regenerated resulting in your container that you created in the Screen Layout to disappear. It is always advisable not to change the selection screen when you have a container manually laid out in the Screen Painter.
What you can do is create a docking container using cl_gui_docking_container, that is a container created programmatically. SDN gives you a lot of examples on this.
Check the code given by Alvaro
Edited by: Nitwick on Aug 31, 2009 3:15 PM
‎2009 Aug 31 12:29 PM
hi,
It is not advised to modify the selection-screen generated via code in SE51, as every re-generation of the code removes any manual modifications. In the current case since you just want to add a custom container in the selection screen, you need to achieve the same via code only. SAP provides a docking container for the same u201Ccl_gui_docking_containeru201D. Using this you can create a placeholder on your selection-screen to hold a custom container and then host any object in that custom container.
DATA: lo_dock TYPE REF TO cl_gui_docking_container,
lo_cont TYPE REF TO cl_gui_container.
CREATE OBJECT lo_dock
EXPORTING
repid = <sy-cprog>
dynnr = <sy-dynnr>
ratio = 80
side = cl_gui_docking_container=>dock_at_bottom
name = 'DOCK_CONT'.
IF sy-subrc <> 0.
MESSAGE 'Error in the Docking control' TYPE 'E'.
EXIT.
lo_cont ?= lo_dock.
ENDIF.
Or you will need to code your program in dynpro (SE51).
Thanks and Regards,
Ahamed.
‎2009 Sep 15 4:02 PM
Hi,
if you need selection screen together with other GUI elements, you can also create a normal screen with all the elements you need and a subscreen area for your selection screen. Create your selection screen like this
selection-screen begin of screen1020 as subscreen.
...
tahn call your screen and your subscreen from PBO/PAI of that screen.
regards,
Hans Hohenfeld