<?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: alv variant in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671305#M1575122</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey this is almost the same code. i used this just in case i forgot something but the problem remains.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Feb 2011 11:29:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-02-02T11:29:50Z</dc:date>
    <item>
      <title>alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671301#M1575118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! &lt;/P&gt;&lt;P&gt;i Have a problem with the selected layout (p_vari) . When i execute the alv (for first time ) everything is OK, but if the user clicks  the back button or f3 and re-executes the program the displayed layout isn't the one i selected even if in the selection screen the p_vari is not inital.&lt;/P&gt;&lt;P&gt;i Use this part of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INITIALIZATION.
VAR-REPORT = SY-REPID.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
perform choose_layout.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  CHOOSE_LAYOUT
*&amp;amp;---------------------------------------------------------------------*

FORM CHOOSE_LAYOUT .


  DATA nof4 TYPE c.

  CLEAR nof4.
  LOOP AT SCREEN.
    IF screen-name = 'P_VARI'.
      IF screen-input = 0.
        nof4 = 'X'.
      ENDIF.
    ENDIF.
  ENDLOOP.


CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = VAR
  i_save     = 'A'
IMPORTING
ES_VARIANT = VAR.

P_VARI = VAR-VARIANT.

ENDFORM.                    " CHOOSE_LAYOUT

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANY IDEAS??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 10:57:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671301#M1575118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T10:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671302#M1575119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is any default layout marked inlayout management, uncheck it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:15:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671302#M1575119</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-02-02T11:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671303#M1575120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no default layout&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:18:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671303#M1575120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T11:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671304#M1575121</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;PARAMETER : P_LAYOU TYPE DISVARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;*Add the above in declaration part&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Add the below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  P_LAYOU = '/DEFAULT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAYOU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WA_VARIANT-REPORT = SY-REPID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      IS_VARIANT = WA_VARIANT&lt;/P&gt;&lt;P&gt;      I_SAVE     = 'A'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ES_VARIANT = WA_VARIANT&lt;/P&gt;&lt;P&gt;NOT_FOUND  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 2.&lt;/P&gt;&lt;P&gt;    MESSAGE I001(ZID) WITH 'Layout not found'.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    P_LAYOU = WA_VARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Syed Maheboob on Feb 2, 2011 12:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:18:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671304#M1575121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T11:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671305#M1575122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey this is almost the same code. i used this just in case i forgot something but the problem remains.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:29:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671305#M1575122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T11:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671306#M1575123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the ALV is OO&lt;/P&gt;&lt;P&gt;free the ALV data before create a new instance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:58:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671306#M1575123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T11:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671307#M1575124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pass this P_LAYOU  into alv grid display FM in Is_variant parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 13:24:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671307#M1575124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-02T13:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671308#M1575125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did this a long back . &lt;/P&gt;&lt;P&gt;PARAMETERS S(12) TYPE C.&lt;/P&gt;&lt;P&gt;Data Is_var type disvariant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_VARIANT_F4'.&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;Is_variant = IS_VAR&lt;/P&gt;&lt;P&gt;Is_display_via_grid = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;Es_variant = IS_VAR&lt;/P&gt;&lt;P&gt;S = IS_VAR_VARIANT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check in this way . it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fm 'Reuse_alv_grid_display'.&lt;/P&gt;&lt;P&gt;i_save = 'x'&lt;/P&gt;&lt;P&gt;is_variant  = is_var &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madhurao123 on Feb 2, 2011 2:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 13:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671308#M1575125</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-02-02T13:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: alv variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671309#M1575126</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;&lt;/P&gt;&lt;P&gt;Create a new input parameter p_disvar like disvariant-variant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In selection screen output set the default variant using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_VARIANT_DEFAULT_GET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide value request help using REUSE_ALV_VARIANT_F4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set the display variant before calling ALV display using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_VARIANT_SELECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the user can select the ALV variant on the selection screen. They can create new variants and save it. Next time they use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the report, the can select the variant before executing the report, or in the report variant for background execution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Feb 2011 10:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-variant/m-p/7671309#M1575126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-04T10:00:27Z</dc:date>
    </item>
  </channel>
</rss>

