<?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 Grid Printing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-printing/m-p/4053570#M969008</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;On one of my previous posts (&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6532648"&gt;&lt;/A&gt;) you mentioned you had a problem with a grid going on to several pages. I have not done that as the output I required was vertical (ie. 1 page horizontally but many pages).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether you can design a Smartform to print your ALV grid across several pages I do not know, but might be worth considering. This is how I managed to get the A3 and A4 printout layouts and then used a custom print button to trigger the print dialog with the correct Smartform. In turn this then prinited either A4 or A3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code for what I used in the USER-COMMAND form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*:---   When printing
        when '&amp;amp;PRINT'.
          clear fm_name .
*:---     If A4 (default) is selected use this.
          if p_a4 = 'X'.
            call function 'SSF_FUNCTION_MODULE_NAME'
              exporting
                formname                 = 'SMARTFORM_A4'
             importing
               fm_name                  =  fm_name
             exceptions
               no_form                  = 1
               no_function_module       = 2
               others                   = 3   .
          endif.
*:---     If A3 is selected use this.
          if p_a3 = 'X'.
             call function 'SSF_FUNCTION_MODULE_NAME'
              exporting
               formname                 = 'SMARTFORM_A3'
             importing
               fm_name                  =  fm_name
             exceptions
               no_form                  = 1
               no_function_module       = 2
               others                   = 3   .
          endif.

          if sy-subrc &amp;lt;&amp;gt; 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.

*:---   Call the SmartForm with the relevant parameters
          call function fm_name
            exporting
              param1                   = param1
              param2                   = param2
            tables
              table1                    = table1
            exceptions
             formatting_error           = 1
             internal_error             = 2
             send_error                 = 3
             user_canceled              = 4
             others                     = 5  .

          if sy-subrc &amp;lt;&amp;gt; 0.
           message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will notice the A3 and A4 selection options depict which Smartform is chosen when you click the Print icon (not the one on the menu). Remember it is a custom print button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Nov 2008 12:51:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-13T12:51:04Z</dc:date>
    <item>
      <title>ALV Grid Printing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-printing/m-p/4053569#M969007</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;I get a requirement that requires to print an ALV grid of width around 700 columns.&lt;/P&gt;&lt;P&gt;Through the printer setting, I am able to print all the columns on an A3 paper (format = X_65_768).&lt;/P&gt;&lt;P&gt;However, the font is simply too small.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of fit to page width, I would like to ask if I can print the ALV grid spanning across several pages ...&lt;/P&gt;&lt;P&gt;just like when we are printing an excel with too many columns ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV Grid Width.&lt;/P&gt;&lt;P&gt;0 ... 255 | 256 ... 511 | 512 ... 767&lt;/P&gt;&lt;P&gt;page 1     page 2         page 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please advise. thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2008 03:05:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-printing/m-p/4053569#M969007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-10T03:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Grid Printing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-printing/m-p/4053570#M969008</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;On one of my previous posts (&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6532648"&gt;&lt;/A&gt;) you mentioned you had a problem with a grid going on to several pages. I have not done that as the output I required was vertical (ie. 1 page horizontally but many pages).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether you can design a Smartform to print your ALV grid across several pages I do not know, but might be worth considering. This is how I managed to get the A3 and A4 printout layouts and then used a custom print button to trigger the print dialog with the correct Smartform. In turn this then prinited either A4 or A3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code for what I used in the USER-COMMAND form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*:---   When printing
        when '&amp;amp;PRINT'.
          clear fm_name .
*:---     If A4 (default) is selected use this.
          if p_a4 = 'X'.
            call function 'SSF_FUNCTION_MODULE_NAME'
              exporting
                formname                 = 'SMARTFORM_A4'
             importing
               fm_name                  =  fm_name
             exceptions
               no_form                  = 1
               no_function_module       = 2
               others                   = 3   .
          endif.
*:---     If A3 is selected use this.
          if p_a3 = 'X'.
             call function 'SSF_FUNCTION_MODULE_NAME'
              exporting
               formname                 = 'SMARTFORM_A3'
             importing
               fm_name                  =  fm_name
             exceptions
               no_form                  = 1
               no_function_module       = 2
               others                   = 3   .
          endif.

          if sy-subrc &amp;lt;&amp;gt; 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.

*:---   Call the SmartForm with the relevant parameters
          call function fm_name
            exporting
              param1                   = param1
              param2                   = param2
            tables
              table1                    = table1
            exceptions
             formatting_error           = 1
             internal_error             = 2
             send_error                 = 3
             user_canceled              = 4
             others                     = 5  .

          if sy-subrc &amp;lt;&amp;gt; 0.
           message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will notice the A3 and A4 selection options depict which Smartform is chosen when you click the Print icon (not the one on the menu). Remember it is a custom print button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2008 12:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-printing/m-p/4053570#M969008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-13T12:51:04Z</dc:date>
    </item>
  </channel>
</rss>

