<?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 Layout fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992847#M1162911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have u passed repid field also to IS_VARIANT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 Jan 2009 09:45:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-11T09:45:12Z</dc:date>
    <item>
      <title>ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992844#M1162908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field with F4 help for Layout on the selection screen. Once, I press F4, Iam able to get the list of&lt;/P&gt;&lt;P&gt;Layouts already saved. But, when I give in a particular layout name and run the report, the output gets displayed in the default/old layout. How can I get the output in the layout which I have selected in the selection screen? &lt;/P&gt;&lt;P&gt;Also, when I run the report in background, Iam sending a file to the application server. Now, when I give the layout and run the report in background, the file iam sending to the app server should have the same layout which i have selected in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with example code, Iam stuck and not able to move forward. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guru Charan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 07:33:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992844#M1162908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-11T07:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992845#M1162909</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 link...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4950180"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 07:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992845#M1162909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-11T07:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992846#M1162910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for a quick one. &lt;/P&gt;&lt;P&gt;Iam already geting the variant from  'REUSE_ALV_VARIANT_F4'  when the user hits F4 on the selection screen.  Iam passing this variant in the REUSE_ALV_GRID_DISPLAY ( to is_variant parameter). But still Iam getting the output in the same old layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to use 'REUSE_ALV_VARIANT_EXISTENCE' also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;GuruCharan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 08:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992846#M1162910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-11T08:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992847#M1162911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have u passed repid field also to IS_VARIANT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 09:45:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992847#M1162911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-11T09:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992848#M1162912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I have passed the program name as well to the IS_VARIANT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 12:28:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992848#M1162912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-11T12:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Layout fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992849#M1162913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guru,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, its working:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*          TYPE POOLS
*&amp;amp;---------------------------------------------------------------------*
TYPE-POOLS : slis.

*&amp;amp;---------------------------------------------------------------------*
*          PARAMETER FOR VARIANT
*&amp;amp;---------------------------------------------------------------------*
PARAMETERS : s_var TYPE disvariant-variant.

*&amp;amp;---------------------------------------------------------------------*
*          FOR ALV GRID DISPLAY
*&amp;amp;---------------------------------------------------------------------*
*FIELD CATALOG
DATA : it_field TYPE slis_t_fieldcat_alv,
       wa_field TYPE slis_fieldcat_alv.

*FOR GRID TITLE
DATA : wa_title TYPE lvc_title.

*FOR LAYOUT
DATA : wa_layout TYPE slis_layout_alv.

*FOR VARIANT
DATA : wa_variant TYPE disvariant,
       wa_variant1 TYPE disvariant.

*&amp;amp;---------------------------------------------------------------------*
*          INITIALIZATION
*&amp;amp;---------------------------------------------------------------------*
INITIALIZATION.
  wa_variant-report = sy-repid.
  wa_variant1-report = sy-repid.

*GET DEFUALT ON THE SELECTION SCREEN FOR DEFAULT DISPLAY
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
      i_save        = 'A' " for all users
    CHANGING
      cs_variant    = wa_variant
    EXCEPTIONS
      wrong_input   = 1
      not_found     = 2
      program_error = 3
      OTHERS        = 4.
  IF sy-subrc = 0.               " IF DEFAULT VARIANT FOUND
    s_var = wa_variant-variant.  " PASS THE DEFAULT VARIANT TO THE SELECTION SCREEN FIELD
  ENDIF.

*&amp;amp;---------------------------------------------------------------------*
*          AT-SELECTION SCREEN ON VALUE REQUEST
*&amp;amp;---------------------------------------------------------------------*
*          TO GET THE F4 HELP FOR VARIANT
*&amp;amp;---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_var.

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant                = wa_variant
*   I_TABNAME_HEADER          =
*   I_TABNAME_ITEM            =
*   IT_DEFAULT_FIELDCAT       =
     i_save                    = 'A'
*   I_DISPLAY_VIA_GRID        = ' '
   IMPORTING
*   E_EXIT                    =
     es_variant                = wa_variant1
   EXCEPTIONS
     not_found                 = 1
     program_error             = 2
     OTHERS                    = 3.
  IF sy-subrc = 0.
    s_var = wa_variant1-variant. " PASS THE SELECTED VARIANT TO THE SELECTION SCREEN FIELD
  ENDIF.

*&amp;amp;---------------------------------------------------------------------*
*          AT-SELECTION SCREEN
*&amp;amp;---------------------------------------------------------------------*
*          TO CHECK THE EXISTENCE FOR VARIANT
*&amp;amp;---------------------------------------------------------------------*
AT SELECTION-SCREEN.
  wa_variant-variant = s_var.
  CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
      i_save        = 'A'
    CHANGING
      cs_variant    = wa_variant
    EXCEPTIONS
      wrong_input   = 1
      not_found     = 2
      program_error = 3
      OTHERS        = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE w001.
  ENDIF.

*&amp;amp;---------------------------------------------------------------------*
*          START OF SELECTION
*&amp;amp;---------------------------------------------------------------------*
START-OF-SELECTION.

" your code

*&amp;amp;---------------------------------------------------------------------*
*          FIELD CATALOG
*&amp;amp;---------------------------------------------------------------------*
  wa_field-fieldname = 'EBELN'.
  wa_field-tabname = 'IT_TAB'.
  wa_field-outputlen = 10.
  wa_field-seltext_l = 'PO #'.
  APPEND wa_field TO it_field.
  CLEAR wa_field.

" similarly other fields

*&amp;amp;---------------------------------------------------------------------*
*          SORT W.R.T. PURCHASE ORDER NUMBER
*&amp;amp;---------------------------------------------------------------------*
  wa_sort-spos = 1.
  wa_sort-fieldname = 'EBELN'.
  wa_sort-tabname = 'IT_EKPO'.
  wa_sort-up = "X". " for ascending
  APPEND wa_sort TO it_sort.
  CLEAR wa_sort.

*&amp;amp;---------------------------------------------------------------------*
*          FOR GRID TITLE
*&amp;amp;---------------------------------------------------------------------*
  wa_title = 'Hello'.

*&amp;amp;---------------------------------------------------------------------*
*          FOR LAYOUT
*&amp;amp;---------------------------------------------------------------------*
  wa_layout-zebra = check.

*&amp;amp;---------------------------------------------------------------------*
*          DISPLAY RECORDS IN ALV GRID
*&amp;amp;---------------------------------------------------------------------*
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program                = sy-repid " report id
      i_grid_title                      = wa_title " alv title bar
      is_layout                         = wa_layout " for layout design
      it_fieldcat                       = it_field " field catalog
      it_sort                           = it_sort " sort info
      i_save                            = 'A' " variant for all users
      is_variant                        = wa_variant "variant name
   TABLES
      t_outtab                          = it_ekpo " internal table
   EXCEPTIONS
     program_error                     = 1
     OTHERS                            = 2.

  IF sy-subrc &amp;lt;&amp;gt; 0.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Jan 2009 13:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-layout-fields/m-p/4992849#M1162913</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-01-11T13:43:39Z</dc:date>
    </item>
  </channel>
</rss>

