<?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: Sapscript, check, writet document distribution data on stub in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904506#M55876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see two solutions to your problem, a brute force approach and a difficult one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Brute force&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write your /: PERFORM as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: DEFINE &amp;amp;V_LINE1&amp;amp; ' '
/: DEFINE &amp;amp;V_LINE2&amp;amp; ' '
...
/: DEFINE &amp;amp;V_LINE9&amp;amp; ' '
/: DEFINE &amp;amp;V_LINE10&amp;amp; ' '
/: PERFORM 'Z_DISTRIBUTION' IN PROGRAM 'ZFM05A01'
/: USING ®UP-BUKRS&amp;amp; 
/: USING ®UP-BELNR&amp;amp; 
/: USING ®UP-GJAHR&amp;amp; 
/: USING &amp;amp;V_COUNT&amp;amp; 
/: CHANGING &amp;amp;V_LINE1&amp;amp; 
/: CHANGING &amp;amp;V_LINE2&amp;amp; 
...
/: CHANGING &amp;amp;V_LINE9&amp;amp; 
/: CHANGING &amp;amp;V_LINE10&amp;amp; 
/: ENDPERFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for each possible return line use an IF statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: IF &amp;amp;V_LINE1&amp;amp; NE ' '
T1 &amp;amp;V_LINE1&amp;amp;
/: ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do away with the IF statements if your form design will allow you to set the "No Blank Lines" box in the Standard Attributes of paragraph T1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Difficult approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Z_DISTRIBUTION, write any number of lines into a standard text using FM SAVE_TEXT. Use the exact same paragraph fields in this text as you would in your SAPscript form text element lines. Then use the INCLUDE command to write them back out into your documents text elements like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: INCLUDE &amp;lt;name&amp;gt; OBJECT &amp;lt;object&amp;gt; ID &amp;lt;id&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or just&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: INCLUDE &amp;lt;name&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you stick to the default values of  inside the SAPscript printing process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Apr 2005 23:45:59 GMT</pubDate>
    <dc:creator>juan_suros</dc:creator>
    <dc:date>2005-04-27T23:45:59Z</dc:date>
    <item>
      <title>Sapscript, check, writet document distribution data on stub</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904505#M55875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to modify a layout set that we use for our accounts payable checks.  Currently the stub has one line for each document that makes up this check.  Now additional detail from each documents distribution lines has also been requested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there was a consistent number of detail lines for every document, I understand how this could be accomplished.  But since the number of distribution lines varies for each document, I don't see any way that this can be done within the form itself because Sapscript does not have any syntax for looping (While.....Endwhile  Loop....endloop  Do....Endo).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A form could be performed in an external program to determine the number of distribution lines, but how would you move through those distribution lines and write information on the check stub?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want to modify RFFOUS_C or copy this program and make a commodification to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone aware of any looping syntax for Sapscript in version 4 .7?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this syntax doesn't work, but this is what I am trying to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&amp;gt;&amp;gt; Build ditribution line&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;V_DISTRIB&amp;amp; '123456789012345678901234567890'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&amp;gt;&amp;gt; Create a counter to keep track of Distrib line #&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;V_COUNT&amp;amp; '001'                           &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/: WHILE V_DISTRIB&amp;amp; &amp;gt; '                              '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: &amp;amp;V_COUNT&amp;amp;  =  &amp;amp;V_COUNT&amp;amp;  + 1&lt;/P&gt;&lt;P&gt;/: PERFORM 'Z_DISTRIBUTION' IN PROGRAM 'ZFM05A01'&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-BUKRS&amp;amp;                              &lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-BELNR&amp;amp;                              &lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-GJAHR&amp;amp;                              &lt;/P&gt;&lt;P&gt;/: USING &amp;amp;V_COUNT&amp;amp;                              &lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;V_DISTRIB&amp;amp;                            &lt;/P&gt;&lt;P&gt;/: ENDPERFORM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/*&amp;gt;&amp;gt; Write distribution line fields, from external program&lt;/P&gt;&lt;P&gt;T1 &amp;amp;V_DISTRIB&amp;amp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/: ENDWHILE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 22:58:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904505#M55875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-27T22:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sapscript, check, writet document distribution data on stub</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904506#M55876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see two solutions to your problem, a brute force approach and a difficult one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Brute force&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write your /: PERFORM as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: DEFINE &amp;amp;V_LINE1&amp;amp; ' '
/: DEFINE &amp;amp;V_LINE2&amp;amp; ' '
...
/: DEFINE &amp;amp;V_LINE9&amp;amp; ' '
/: DEFINE &amp;amp;V_LINE10&amp;amp; ' '
/: PERFORM 'Z_DISTRIBUTION' IN PROGRAM 'ZFM05A01'
/: USING ®UP-BUKRS&amp;amp; 
/: USING ®UP-BELNR&amp;amp; 
/: USING ®UP-GJAHR&amp;amp; 
/: USING &amp;amp;V_COUNT&amp;amp; 
/: CHANGING &amp;amp;V_LINE1&amp;amp; 
/: CHANGING &amp;amp;V_LINE2&amp;amp; 
...
/: CHANGING &amp;amp;V_LINE9&amp;amp; 
/: CHANGING &amp;amp;V_LINE10&amp;amp; 
/: ENDPERFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for each possible return line use an IF statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: IF &amp;amp;V_LINE1&amp;amp; NE ' '
T1 &amp;amp;V_LINE1&amp;amp;
/: ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do away with the IF statements if your form design will allow you to set the "No Blank Lines" box in the Standard Attributes of paragraph T1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Difficult approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Z_DISTRIBUTION, write any number of lines into a standard text using FM SAVE_TEXT. Use the exact same paragraph fields in this text as you would in your SAPscript form text element lines. Then use the INCLUDE command to write them back out into your documents text elements like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: INCLUDE &amp;lt;name&amp;gt; OBJECT &amp;lt;object&amp;gt; ID &amp;lt;id&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or just&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: INCLUDE &amp;lt;name&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you stick to the default values of  inside the SAPscript printing process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2005 23:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904506#M55876</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2005-04-27T23:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sapscript, check, writet document distribution data on stub</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904507#M55877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;closing old post&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2009 18:29:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-check-writet-document-distribution-data-on-stub/m-p/904507#M55877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-18T18:29:53Z</dc:date>
    </item>
  </channel>
</rss>

