‎2007 May 21 6:30 AM
How to create a resizable screen?
i mean, a screen which can be resized with a mouse...
does anyone know?
‎2007 May 21 7:03 AM
Hi Julia,
Kindly be specific about your requirement. Why exactly do you want a resizable screen??
Karan.
‎2007 May 21 7:37 AM
i want to be able to resize the screen. make it wider or longer.
does it make sense?
‎2007 May 21 7:44 AM
I mean, instead of cl_gui_custom_container,
i want to use
cl_gui_dialogbox_container
but how exactly to use it?
‎2007 May 21 8:03 AM
Just as you use cl_gui_custom_container, in the same way you can use cl_gui_dialogbox_container. (i hope you know how to use the former one). The only difference is that , it would create an entirely different screen for your contrl (ex. different screen for displaying ALV grid report). The navigation between this different window and main program is taken care by SAP itself.
Try using it in your application and revert if you have any issues.
See the following sample code. It is about ALV grid display using dialog box. The piece of code shown is the PBO module of the ALV screen.
DATA: g_custom_container TYPE REF TO cl_gui_dialogbox_container,
g_alv_grid TYPE REF TO cl_gui_alv_grid.
DATA: gt_fieldcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo.
DATA: gt_mara TYPE STANDARD TABLE OF mara,
gs_mara LIKE LINE OF gt_mara.
SET PF-STATUS 'ZKM_ALV'.
SET TITLEBAR 'ZKM'.
CREATE OBJECT g_custom_container
EXPORTING
PARENT =
WIDTH = 30
HEIGHT = 30
STYLE =
REPID =
DYNNR =
LIFETIME = lifetime_default
TOP = 0
LEFT = 0
CAPTION =
NO_AUTODEF_PROGID_DYNNR =
METRIC = 0
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
event_already_registered = 6
error_regist_event = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT g_alv_grid
EXPORTING
i_parent = g_custom_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PERFORM get_data.
PERFORM prepare_field_catlog.
PERFORM prepare_layout.
CALL METHOD g_alv_grid->set_table_for_first_display
EXPORTING
i_save = 'A'
I_DEFAULT = 'X'
is_layout = gs_layout
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
it_outtab = gt_mara
it_fieldcatalog = gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Hope this helps.
Revert in case of issues and mark helpful answers.
Karan
‎2007 May 21 8:31 AM
yes thats what i was trying to do.
it works but i get two windows(screens) instead of one. one of them has buttons and the status and another one has ALV grid.
‎2007 May 21 9:02 AM
Do u understand what i was sayin?
how to make it as one screen?
‎2007 May 21 9:30 AM
Hi Julia,
Thats the advantage. You normally use dialogbox only when you want to display the details in seperate window. You can not have resizable window for your main output list. If you want one screen, that means you want the custom container to be resizable, and thats ofcourse possible. But you will not get any other functionality for resizable screen except that given by cl_gui_dialogbox_container.
Hope i am clear.
Karan
‎2007 May 21 9:44 AM
I dont understand. is it possible to make custom container resizable?
One more thing, i cant close the screen if i use the dialogbox container.
‎2007 May 21 9:56 AM
No, its not possible to make the custome container resizable. And if you want to close the dialogbox container then , you will have to add an extra button on the application tool bar of the ALV . And in the PAI module , read the sy-ucomm value, and when its equal to the Fcode you assigned, you just say "Leave to screen 0'. In that way you will be able to close that screen. This is because, whenever you create a custom dialogbox (for ALV or anyother thing), the cancel button which all the normal screens have on the top right corner, is always disabled and there's no way you can enable that.
Regards,
Karan
‎2007 May 21 10:01 AM
ok good. thank you.
But is it possible to take away the empty screen with the status?
so that users could see only screen with ALV.
‎2007 May 21 10:27 AM
Hi Julia,
A dialogbox always has a calling screen attached to it and it can never be closed. So, in the same manner, the empty screen which you see behind your ALV screen is the calling screen of that ALV and hence it can not be kept away or closed. It is always displayed.
Hope this is clear.
Reward if helpful.
Regards,
Karan
‎2007 May 21 10:32 AM
‎2007 May 21 10:32 AM