<?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: Copying ALV variants/layouts between programs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369389#M182184</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;plz refer asnwer to similar query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="101728"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="91903"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="13463"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jun 2006 13:25:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-07T13:25:45Z</dc:date>
    <item>
      <title>Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369388#M182183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to copy ALV layouts between programs in the same client?  I have created a copy of a report which uses the ALV functionality via the REUSE_* function modules.  The original report has over 40 layouts, so I don't want to have to re-create them manually in the new program.  These programs are in the same client on the  same system, so the Import Layout and Transport Layout options aren't going to be of any use (as far as I can see...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas greatly appreciated.&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;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369388#M182183</guid>
      <dc:creator>afordham</dc:creator>
      <dc:date>2006-06-07T13:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369389#M182184</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;plz refer asnwer to similar query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="101728"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="91903"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="13463"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369389#M182184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369390#M182185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do like this..  &lt;/P&gt;&lt;P&gt;instead of sy-repid&lt;/P&gt;&lt;P&gt;G_VARIANT-REPORT = sy-REPID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this..&lt;/P&gt;&lt;P&gt; repid = 'the program which is having 40 variants'.&lt;/P&gt;&lt;P&gt;  G_VARIANT-REPORT = repid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and but when you create new one then the new variant also saves under the original program(having 40 layouts)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope you got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369390#M182185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369391#M182186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii Andrew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First call &amp;lt;b&amp;gt;LVC_VARIANT_SELECT&amp;lt;/b&amp;gt; to read variant from the first program and &lt;/P&gt;&lt;P&gt;then call &amp;lt;b&amp;gt;LVC_VARIANT_SAVE&amp;lt;/b&amp;gt; to save it for the second program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this demo program for more info&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BCALV_GRID_11&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369391#M182186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369392#M182187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Vijay.  This will certainly help in the short term, but as you correctly point out, this will just make my new program work with the old program's variants, and any changes I make will also affect the old program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still looking for a way to copy the display variants/layouts from one program to the other so they each have their own.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369392#M182187</guid>
      <dc:creator>afordham</dc:creator>
      <dc:date>2006-06-07T13:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ALV variants/layouts between programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369393#M182188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I took this approach and it worked for me:&lt;/P&gt;&lt;P&gt;1) Change your program so that everytime an ALV function is called it is using the original program name in the variant declaration, ensure you keep the original code commented out, you will need to put it back later. Examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM variant_init USING varname TYPE slis_vari.&lt;/P&gt;&lt;P&gt;CLEAR g_variant.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;g_variant-report = g_repid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;g_variant-report = 'ORIGINAL_PROGRAM_NAME'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM f4_for_variant.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;g_variant-report = sy-repid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;g_variant-report = &amp;#145;ORIGINAL_PROGRAM_NAME&amp;#146;.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_VARIANT_F4'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM check_variant.&lt;/P&gt;&lt;P&gt;IF NOT p_vari IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;g_variant-report = sy-repid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;g_variant-report = &amp;#145;ORIGINAL_PROGRAM_NAME&amp;#146;.&lt;/P&gt;&lt;P&gt;g_variant-variant = p_vari.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Display function lt_variant_save via SE37, set a breakpoint at the first executable line:&lt;/P&gt;&lt;P&gt;perform variant_save tables it_fieldcat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Run your program with the layout variant you wish to copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) Hit Save Variant. You are now in debug mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Enter variable CS_VARIANT-REPORT in the variables 1 panel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7) Double-click on CS_VARIANT-REPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Hit the Change Field Content button&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9) Change the value to the name of your new program, then hit Enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10) Hit Execute (F8). You have now saved the variant under your new program name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11) Exit and rerun your program as necessary for as many variants as you want to copy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12) Change your program back to using sy-repid (or whatever else it was referencing) wherever you changed it in step 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;13) The variants have now been copied and you can run your program with the new variants.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 20:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copying-alv-variants-layouts-between-programs/m-p/1369393#M182188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T20:34:41Z</dc:date>
    </item>
  </channel>
</rss>

