<?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: Print option in a module pool program with table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018489#M960195</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;You will have to write the code in the PAI for  the given task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will just write the pseudocode for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PAI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'ENTER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IT IS A NEW ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT DATABASE TABLE FROM THE INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(YOU WILL HAVE TO DECLARE AN INTERNAL TABLE &lt;/P&gt;&lt;P&gt;  WHOSE DATA TYPE IS THE SAME AS THE DATABASE&lt;/P&gt;&lt;P&gt;  TABLE ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;      ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  UPDATE DATABASE TABLE FROM INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DELETE FROM DATABASE TABLE WHERE KEY =&lt;/P&gt;&lt;P&gt;                           TABLE-CONTROL ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   INSERT FROM DATABASE TABLE WHERE KEY =&lt;/P&gt;&lt;P&gt;                           TABLE-CONTROL ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   IF SY-SUBRC = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2008 03:08:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-24T03:08:12Z</dc:date>
    <item>
      <title>Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018482#M960188</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 have developed a module pool program which contains a table control in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requriement where in I need to print the conents of the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could anyone help me out with this.&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;Sushanth H.S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 05:41:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018482#M960188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T05:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018483#M960189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Naveen Inuganti on Jun 19, 2008 11:52 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 05:43:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018483#M960189</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2008-06-19T05:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018484#M960190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you can use  below mentioned function module to convert table controls internal table into a spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; from spool number received you can take print from SP01. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function module is 'SLVC_TABLE_PS_TO_SPOOL'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 06:14:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018484#M960190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T06:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018485#M960191</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;When I use the function module SLVC_TABLE_PS_TO_SPOOL, it is giving me a short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for this is that the internal table of the table control is not of type LVC_S_1022 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you help me with  this.&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;Sushanth H.S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 08:11:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018485#M960191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T08:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018486#M960192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could simply try writing the data to a list (usual leave to list-processing approach), but preceeding the output with a "new-page print on" type setup... the code below was borrowed from the online help... in your cae, just loop at the internal table tha represents the table control contents and list that out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
report demo.

data: spfli_wa type spfli,
      sflight_wa type sflight.

data: print_parameters type pri_params,
      valid_flag       type c length 1.

start-of-selection.

  call function 'GET_PRINT_PARAMETERS'
    importing
      out_parameters       = print_parameters
      valid                = valid_flag
    exceptions
      invalid_print_params = 2
      others               = 4.

  if valid_flag = 'X' and sy-subrc = 0.
    select carrid connid
      from spfli
      into corresponding fields of spfli_wa.
      write: / spfli_wa-carrid, spfli_wa-connid.
      hide:    spfli_wa-carrid, spfli_wa-connid.
    endselect.
  else.
    ...
  endif.

at line-selection.
  new-page print on parameters print_parameters
                    no dialog.
  select *
         from sflight
         into sflight_wa
         where carrid = spfli_wa-carrid and
               connid = spfli_wa-connid.
    write: / sflight_wa-carrid, sflight_wa-connid,
             sflight_wa-fldate ...
  endselect.
  new-page print off.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 08:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018486#M960192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T08:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018487#M960193</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;In the Table control screen (main screen) place print/print preview button. if this is selected, provide an ALV list output withe the table contrao contents. The ALV will have the standard print functionality, using that we can print the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard SAP is also foloowing the same way, if you observe ant table maintenace view (SM30) it will have the table control, There if you perform print, it will take you to the ALV list output in next screen. There you can print the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajinikanth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 09:12:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018487#M960193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T09:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018488#M960194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi frnds&lt;/P&gt;&lt;P&gt;my requirement is in table control if i enter the data it should go and sit in DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the problem is wer to write code in pbo r pai.&lt;/P&gt;&lt;P&gt;plz gve the sample code........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we need create a structure for dat......&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 11:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018488#M960194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T11:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Print option in a module pool program with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018489#M960195</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;You will have to write the code in the PAI for  the given task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will just write the pseudocode for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PAI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'ENTER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IT IS A NEW ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT DATABASE TABLE FROM THE INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(YOU WILL HAVE TO DECLARE AN INTERNAL TABLE &lt;/P&gt;&lt;P&gt;  WHOSE DATA TYPE IS THE SAME AS THE DATABASE&lt;/P&gt;&lt;P&gt;  TABLE ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;      ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  UPDATE DATABASE TABLE FROM INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DELETE FROM DATABASE TABLE WHERE KEY =&lt;/P&gt;&lt;P&gt;                           TABLE-CONTROL ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   INSERT FROM DATABASE TABLE WHERE KEY =&lt;/P&gt;&lt;P&gt;                           TABLE-CONTROL ENTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   IF SY-SUBRC = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       ROLLBACK WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 03:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-option-in-a-module-pool-program-with-table-control/m-p/4018489#M960195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T03:08:12Z</dc:date>
    </item>
  </channel>
</rss>

