<?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 LOOP IN SAPSCRIPT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281271#M152785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i made a popup when i choose output type in va42.&lt;/P&gt;&lt;P&gt;i choose 2,3,4.... lines and i need to print for each line layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is: always the last line print twice.&lt;/P&gt;&lt;P&gt;my code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; perform item_print.-standard&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;  perform end_print.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; i add&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &amp;lt;b&amp;gt; perform print_additional_copies.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&amp;lt;/b&amp;gt;  perform form_close.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;///////////////////////////////&lt;/P&gt;&lt;P&gt;form print_additional_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_h.  "i_matnrs where check = 'X'.&lt;/P&gt;&lt;P&gt;    z_count = z_count + 1.&lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt; komk-exp_busobj = itab_h-sernr.-change&lt;/P&gt;&lt;P&gt;    komk-inco2 = itab_h-maktx.-change&amp;lt;/b&amp;gt;*    if z_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    perform restart_form using gvf_fonam nast-spras.&lt;/P&gt;&lt;P&gt;      perform print_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;////////////////////////////////////&lt;/P&gt;&lt;P&gt;form restart_form using    p_gvf_fonam&lt;/P&gt;&lt;P&gt;                           p_nast_spras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'END_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     RESULT                         =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   exceptions&lt;/P&gt;&lt;P&gt;     unopened                       = 1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     BAD_PAGEFORMAT_FOR_PRINT       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     SPOOL_ERROR                    = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     others                         = 4&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'START_FORM'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ARCHIVE_INDEX          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     form                   = p_gvf_fonam&lt;/P&gt;&lt;P&gt;     language               = p_nast_spras&lt;/P&gt;&lt;P&gt;     startpage              = 'FIRST '&lt;/P&gt;&lt;P&gt;     program                = tnapr-pgnam&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MAIL_APPL_OBJECT       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   LANGUAGE               =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;     form                   = 1&lt;/P&gt;&lt;P&gt;     format                 = 2&lt;/P&gt;&lt;P&gt;     unended                = 3&lt;/P&gt;&lt;P&gt;     unopened               = 4&lt;/P&gt;&lt;P&gt;     unused                 = 5&lt;/P&gt;&lt;P&gt;     spool_error            = 6&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   OTHERS                 = 7&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " RESTART_FORM&lt;/P&gt;&lt;P&gt;//////////////////////////////////////&lt;/P&gt;&lt;P&gt;form print_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform item_print.&lt;/P&gt;&lt;P&gt;  perform check_repeat.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " PRINT_COPIES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Apr 2006 12:11:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-20T12:11:33Z</dc:date>
    <item>
      <title>LOOP IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281271#M152785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i made a popup when i choose output type in va42.&lt;/P&gt;&lt;P&gt;i choose 2,3,4.... lines and i need to print for each line layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is: always the last line print twice.&lt;/P&gt;&lt;P&gt;my code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; perform item_print.-standard&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;  perform end_print.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; i add&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &amp;lt;b&amp;gt; perform print_additional_copies.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&amp;lt;/b&amp;gt;  perform form_close.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;///////////////////////////////&lt;/P&gt;&lt;P&gt;form print_additional_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_h.  "i_matnrs where check = 'X'.&lt;/P&gt;&lt;P&gt;    z_count = z_count + 1.&lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt; komk-exp_busobj = itab_h-sernr.-change&lt;/P&gt;&lt;P&gt;    komk-inco2 = itab_h-maktx.-change&amp;lt;/b&amp;gt;*    if z_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    perform restart_form using gvf_fonam nast-spras.&lt;/P&gt;&lt;P&gt;      perform print_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;////////////////////////////////////&lt;/P&gt;&lt;P&gt;form restart_form using    p_gvf_fonam&lt;/P&gt;&lt;P&gt;                           p_nast_spras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'END_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     RESULT                         =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   exceptions&lt;/P&gt;&lt;P&gt;     unopened                       = 1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     BAD_PAGEFORMAT_FOR_PRINT       = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     SPOOL_ERROR                    = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     others                         = 4&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'START_FORM'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ARCHIVE_INDEX          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     form                   = p_gvf_fonam&lt;/P&gt;&lt;P&gt;     language               = p_nast_spras&lt;/P&gt;&lt;P&gt;     startpage              = 'FIRST '&lt;/P&gt;&lt;P&gt;     program                = tnapr-pgnam&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MAIL_APPL_OBJECT       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   LANGUAGE               =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;     form                   = 1&lt;/P&gt;&lt;P&gt;     format                 = 2&lt;/P&gt;&lt;P&gt;     unended                = 3&lt;/P&gt;&lt;P&gt;     unopened               = 4&lt;/P&gt;&lt;P&gt;     unused                 = 5&lt;/P&gt;&lt;P&gt;     spool_error            = 6&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   OTHERS                 = 7&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " RESTART_FORM&lt;/P&gt;&lt;P&gt;//////////////////////////////////////&lt;/P&gt;&lt;P&gt;form print_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform item_print.&lt;/P&gt;&lt;P&gt;  perform check_repeat.&lt;/P&gt;&lt;P&gt;  check retcode = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " PRINT_COPIES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 12:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281271#M152785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T12:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281272#M152786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form print_additional_copies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_h. "i_matnrs where check = 'X'.&lt;/P&gt;&lt;P&gt;z_count = z_count + 1.&lt;/P&gt;&lt;P&gt;komk-exp_busobj = itab_h-sernr.-change&lt;/P&gt;&lt;P&gt;komk-inco2 = itab_h-maktx.-change* if z_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;*perform restart_form using gvf_fonam nast-spras.&amp;lt;/i&amp;gt;&amp;lt;b&amp;gt;Perform start_form.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform print_copies.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;perform close_form.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 12:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281272#M152786</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2006-04-20T12:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281273#M152787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 12:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281273#M152787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T12:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281274#M152788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the normal printing is taking place from perform item_print. only when the number of items finished then it must be executing the end_print. Check in debug if the data is again getting printed in this form. As u have not provided the form routines of the item_print and end_print, i think that could be the error point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 12:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-sapscript/m-p/1281274#M152788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T12:58:42Z</dc:date>
    </item>
  </channel>
</rss>

