<?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: OOPS ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558533#M856303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes X and Y are radiobuttons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Mar 2008 11:37:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-15T11:37:30Z</dc:date>
    <item>
      <title>OOPS ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558531#M856301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When user chooses say X then the first data table with its fieldcatalog should be output and when he chooses Y then second data table with its fieldcatalog should be output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I m transfering my output data table and fieldcatalog to global parameters: &amp;lt;DATA&amp;gt; and it_fieldcatalog, where &amp;lt;DATA&amp;gt; is the fieldsymbol of type table and it_fieldcatalog is of type lvc_t_fcat and then calling the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT g_container&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;container_name = 'C_CONTAINER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT g_grid&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_parent = g_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD g_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = &amp;lt;DATA&amp;gt; it_fieldcatalog = it_fieldcatalog&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;program_error = 2&lt;/P&gt;&lt;P&gt;too_many_lines = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem i m facing is that when i user chooses X then the first output table's data is displayed in the ALV but when he chooses Y the same data is shown instead of second table's data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why the current data is not displayed though respective table and fieldcatalog tables match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLZ HELP!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Mar 2008 11:06:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558531#M856301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-15T11:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558532#M856302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How ll de user select X/Y radio buttons?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Mar 2008 11:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558532#M856302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-15T11:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558533#M856303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes X and Y are radiobuttons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Mar 2008 11:37:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558533#M856303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-15T11:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558534#M856304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code ..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;custom control name = 'CUSTOM'..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF tp_display,
        fld1  TYPE char10,
        fld2  TYPE p,
        fld3  TYPE i,
        END   OF tp_display.

DATA : container1   TYPE REF   TO cl_gui_custom_container,
       grid         TYPE REF   TO cl_gui_alv_grid,
       it_display1  TYPE TABLE OF tp_display,
       it_display2  TYPE TABLE OF tp_display,
       it_field_cat TYPE          lvc_t_fcat,
       it_sort      TYPE          lvc_t_sort,
       wa_display   TYPE          tp_display,
       wa_field_cat TYPE LINE  OF lvc_t_fcat,
       wa_sort      TYPE LINE  OF lvc_t_sort.

PARAMETERS : rb1 RADIOBUTTON GROUP rb,
             rb2 RADIOBUTTON GROUP rb.

FIELD-SYMBOLS &amp;lt;it_display&amp;gt; TYPE STANDARD TABLE.

START-OF-SELECTION.

CASE 'X' .
  WHEN rb1.
    ASSIGN it_display1 to &amp;lt;it_display&amp;gt;.
  WHEN rb2.
    ASSIGN it_display2 to &amp;lt;it_display&amp;gt;.
ENDCASE.

  CALL SCREEN 100.



*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'BASIC'.
*  SET TITLEBAR 'xxx'.
  PERFORM build_it_display.
  PERFORM build_it_field_cat.
  PERFORM build_it_sort.
  PERFORM create_objects.


ENDMODULE.                 " STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  CASE sy-ucomm.
    WHEN 'BACK'.
      CALL METHOD grid-&amp;gt;free.
      SET SCREEN 0.
      LEAVE SCREEN.
    WHEN 'EXIT'.
      SET SCREEN 0.
      LEAVE SCREEN.
    WHEN 'CANC'.
      SET SCREEN 0.
      LEAVE SCREEN.
  ENDCASE.

ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_it_display
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM build_it_display.
  MOVE : 'Hi 1'  TO wa_display-fld1,
         10    TO wa_display-fld2,
         -25   TO wa_display-fld3.

  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  MOVE : 'Hello 1' TO wa_display-fld1,
         15      TO wa_display-fld2,
         -5      TO wa_display-fld3.

  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.
  APPEND wa_display TO it_display1.

    MOVE : 'Hi 2'  TO wa_display-fld1,
         10    TO wa_display-fld2,
         -25   TO wa_display-fld3.

  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  MOVE : 'Hello 2' TO wa_display-fld1,
         25      TO wa_display-fld2,
         55      TO wa_display-fld3.

  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
  APPEND wa_display TO it_display2.
ENDFORM.                    "build_it_display

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_it_field_cat
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM build_it_field_cat.
  REFRESH it_field_cat.

  wa_field_cat-fieldname = 'FLD1'.
  wa_field_cat-emphasize = 'X'.
  wa_field_cat-reptext   = 'Character'.
  APPEND wa_field_cat TO it_field_cat.

  wa_field_cat-fieldname = 'FLD2'.
  wa_field_cat-emphasize = ' '.
  wa_field_cat-reptext   = 'Pack integer'.
  wa_field_cat-do_sum    = 'X'.
  APPEND wa_field_cat TO it_field_cat.

  wa_field_cat-fieldname = 'FLD3'.
  wa_field_cat-emphasize = ' '.
  wa_field_cat-reptext   = 'Integer'.
  wa_field_cat-do_sum    = 'X'.
  APPEND wa_field_cat TO it_field_cat.


ENDFORM.                    "build_it_field_cat
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_it_sort
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM build_it_sort .
  wa_sort-fieldname = 'FLD1'.
  wa_sort-up        = ' '.
  wa_sort-down      = 'X'.
  APPEND wa_sort TO it_sort.
ENDFORM.                    " build_it_sort
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  create_objects
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM create_objects .


 IF container1 IS INITIAL.
    CREATE OBJECT container1
      EXPORTING
   container_name              = 'CUSTOM'.
    CREATE OBJECT grid
      EXPORTING
         i_shellstyle      = 1
         i_parent          = container1
         i_appl_events     = 'X'.
    CALL METHOD grid-&amp;gt;set_table_for_first_display
      CHANGING
        it_outtab       = &amp;lt;it_display&amp;gt;
        it_fieldcatalog = it_field_cat
        it_sort         = it_sort.
  ENDIF.

ENDFORM.                    "create_objects&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Mar 2008 11:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-alv/m-p/3558534#M856304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-15T11:42:06Z</dc:date>
    </item>
  </channel>
</rss>

