<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Common Screen function module when using CL_GUI_ALV_GRID in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375499#M810472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice Idea but I,d already rejected this approach as the cl_salv_table class doesn't have any editable functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 20:36:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-22T20:36:39Z</dc:date>
    <item>
      <title>Common Screen function module when using CL_GUI_ALV_GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375497#M810470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one of the problems in using CL_GUI_ALV_GRID in programs as opposed to the old fashioned SLIS function modules is that each separate program normally requires its own screen (and a status).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A really easy way to avoid this problem is to define a number of screens (I usually ever want 2 at the most) in a function module and call it instead of having a call screen in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;



call function 'ZZ_CALL_SCREEN'
 exporting
 screen_number = '100'
 form = 'DISPLAY_GRID1'
 Program = invoker.
*  call screen 100.
if sy-ucomm  = 'BACK'.
 leave program.

form display_grid1.
call method dog-&amp;gt;inhibit_input.
CALL METHOD dog-&amp;gt;display_grid
    EXPORTING
      g_outtab = &amp;lt;dyn_table&amp;gt;
      g_fldcat = it_fldcat
      i_gridtitle = 'Jimbos test - entry 1'
      i_edit = ' '
      i_zebra = ' '
       CHANGING
      it_fldcat = it_fldcat
      gt_outtab = &amp;lt;dyn_table&amp;gt;.
endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module is simply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

function zz_call_screen.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(SCREEN_NUMBER) TYPE  SY-DYNNR
*"     REFERENCE(FORM) TYPE  CHAR30
*"     REFERENCE(PROGRAM) TYPE  SY-REPID
*"----------------------------------------------------------------------
perform (form)  in program (program).
case screen_number.
 when '100'.
 call screen 100.
 when '200'.
 call screen 200.
endcase.


endfunction.

* the screen logic

process before output.
 module status_0100.
*
process after input.
 module user_command_0100.

process before output.
 module status_0200.
*
process after input.
 module user_command_0200.

*----------------------------------------------------------------------*
***INCLUDE LZHR_MISCO01 .
*----------------------------------------------------------------------*
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
   set pf-status '001'.
     set titlebar '000'.

  endmodule.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0200  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0200 output.
set pf-status '001'.
  set titlebar '000'.

endmodule.                 " STATUS_0200  OUTPUT

*----------------------------------------------------------------------*
***INCLUDE LZHR_MISCI01 .
*----------------------------------------------------------------------*
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.

  case sy-ucomm.
    when 'BACK'.
      leave to screen 0.
    when 'EXIT'.
      leave program.
    when 'RETURN'.
      leave program.
    when others.
  endcase.
endmodule.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0200  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0200 input.
case sy-ucomm.
    when 'BACK'.
      leave to screen 0.
    when 'EXIT'.
      leave program.
    when 'RETURN'.
      leave program.
    when others.
  endcase.


endmodule.                 " USER_COMMAND_0200  INPUT


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-UCOMM is available to the calling program after PAI executed .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need dummy screens with a custom container on each CCONTAINER1, CCONTAINER2 and a standard status (SE41)  with BACK, EXIT and CANCEL buttons on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The custom container names are dependent on what you call your custom container(s) when calling the ALV GRID handling class. I use CCONTAINER1, CCONTAINER2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having this in the Function Module code means your cl_gui_alv_grid class call programs now no longer need their own screens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is of help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(you could incorporate this into an ALV GRID calling class itself but you would still need the function module so this (IMO) is the simplest way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:24:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375497#M810470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T16:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Common Screen function module when using CL_GUI_ALV_GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375498#M810471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.  If the idea here is to be able to create a simply ALV output display, without using the REUSE function, and using OO concepts, and without creating a screen,  I would suggest using the ALV Object Model, basically it allows you to use OO concepts and create an ALV without creating a screen, but the option is always there.  Check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy implementation of this would be something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT rich_0001.

DATA: ispfli TYPE TABLE OF spfli.

DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_functions TYPE REF TO cl_salv_functions.

START-OF-SELECTION.

  SELECT * INTO TABLE ispfli FROM spfli.

  cl_salv_table=&amp;gt;factory(
*  EXPORTING
*    list_display   = IF_SALV_C_BOOL_SAP=&amp;gt;FALSE
*    r_container    =
*    container_name =
   IMPORTING
     r_salv_table   = gr_table
   CHANGING
     t_table        = ispfli ).

  gr_functions = gr_table-&amp;gt;get_functions( ).
  gr_functions-&amp;gt;set_all( abap_true ).

  gr_table-&amp;gt;display( ).

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice in the IMPORTING parameters, you could implement this in a container within a screen, but it is not required, if you don't pass these parameters, it will implement as fullscreen.  And yes, it will use the REUSE function underneath to do this.   This functionality was introduced in NetWeaver 2004.  So Jimbo, your approach would be VERY useful to people who are working pre-NetWeaver.  Very nice and thanks for sharing.  &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:50:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375498#M810471</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-22T16:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Common Screen function module when using CL_GUI_ALV_GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375499#M810472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice Idea but I,d already rejected this approach as the cl_salv_table class doesn't have any editable functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 20:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/common-screen-function-module-when-using-cl-gui-alv-grid/m-p/3375499#M810472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T20:36:39Z</dc:date>
    </item>
  </channel>
</rss>

