<?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 sub-routines in scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008485#M78345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;             i have copied the standard script F140_DOCU_EXC_01 into zf140_doc, in that form i need to caluculate Net amount in text element 521 in main window. for that i have written the subroutine.&lt;/P&gt;&lt;P&gt;PERFORM &amp;lt;subroutin_name&amp;gt; IN PROGRAM &amp;lt;prog_name&amp;gt;&lt;/P&gt;&lt;P&gt;USING &amp;lt;parms&amp;gt;&lt;/P&gt;&lt;P&gt;CHANGING &amp;lt;parms&amp;gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt; FORM &amp;lt;form_name&amp;gt; TABLES in_var type ITCSY&lt;/P&gt;&lt;P&gt;out_var type ITCSY.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;the above code is not a complete one.i need to caluculate the net amount (&amp;amp;RF140-WRSHB). i am not able to calucualte the net amount, i mean from where should i get the data. and y do u we need the ITCSY stru.. could some one help me with a code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks &lt;/P&gt;&lt;P&gt; Srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2005 16:10:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-05T16:10:57Z</dc:date>
    <item>
      <title>sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008485#M78345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;             i have copied the standard script F140_DOCU_EXC_01 into zf140_doc, in that form i need to caluculate Net amount in text element 521 in main window. for that i have written the subroutine.&lt;/P&gt;&lt;P&gt;PERFORM &amp;lt;subroutin_name&amp;gt; IN PROGRAM &amp;lt;prog_name&amp;gt;&lt;/P&gt;&lt;P&gt;USING &amp;lt;parms&amp;gt;&lt;/P&gt;&lt;P&gt;CHANGING &amp;lt;parms&amp;gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt; FORM &amp;lt;form_name&amp;gt; TABLES in_var type ITCSY&lt;/P&gt;&lt;P&gt;out_var type ITCSY.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;the above code is not a complete one.i need to caluculate the net amount (&amp;amp;RF140-WRSHB). i am not able to calucualte the net amount, i mean from where should i get the data. and y do u we need the ITCSY stru.. could some one help me with a code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks &lt;/P&gt;&lt;P&gt; Srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 16:10:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008485#M78345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T16:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008486#M78346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you looked at the standard program for this form.  It should show you how this field is calculated.  Also, there is no need to do a subroutine here.  Why make it harder on yourself.   The RF140-WRSHB field is most likely a global field in the print program.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 17:10:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008486#M78346</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-05T17:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008487#M78347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;        Could you please tell me the name of the print program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 17:13:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008487#M78347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-05T17:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008488#M78348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like there are a hand full which use this structure in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

J_1HKORD                         Print Program: Document Extract                            
RFCASH00                         Cash Journal                                               
RFKORB00                         Internal Documents                                         
RFKORD00                         Print Program: Payment Notice                              
RFKORD10                         Print Program: Account Statement                           
RFKORD11                         Print Program: Customer Statement                          
RFKORD20                         Print Program: Charges for a Bill of Exchange              
RFKORD30                         Print Program: Internal Documents                          
RFKORD40                         Print Program: Individual Letters and Standard Letters     
RFKORD50                         Print Program: Document Extract                            
RFKORD60                         Print Program: Failed Payments                             
RFKORD70                         Print Program: Periodic Settlement                         
RFKORD80                         Print Program: Cash Documents                              
RFKORDC1                         Print Program: Cash Receipts for Czech Republic and Slovaki
RFKORDJ1                         Receipt after Payment (Japan)                              
RFKORDJ2                         Receipt Before Payment (Japan)                             
RFKORDJ3                         Receipt - Cleared (Japan)                                  
RFKORDJ4                         Print Program: Statement of Account (Period. Billing)      
RFKORDP1                         Printout of Official Receipts After Payment (Philippines)  
RFKORDP2                         Printout of Official Receipts Before Payment (Philippines) 
RFKORDP3                         Printout of Customer Statements (Philippines)              
RFKORDR1                         Print Program: Internal Docs for Confederation of Independe
RFKORDR2                         Print Program: Cash Documents                              


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What exactly are you doing.....anything here ring a bell?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 18:25:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008488#M78348</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-05T18:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008489#M78349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srikanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Best way to know the print program is to findout which output type is being used for printing this script and then find out the print program using transaction NACE. A crude way is to look at table TNAPR and put your sapscipt name in the field for FORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sanjeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Aug 2005 19:58:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008489#M78349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-07T19:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008490#M78350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srikanth&lt;/P&gt;&lt;P&gt;The print program will have the code(logic) for the perform. All parameters (whether it is using or changing) is received in the print program in the internal table in_var which is of type itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the structure of itcsy and u will understand the details clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember 2 reward points to replies that have answered ur question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;PP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2005 03:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008490#M78350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-08T03:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008491#M78351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srikanath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a quick example of how to use the PERFORM statement in SAPscript:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SAPScript:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform get_net_amount in program zinvoice01&lt;/P&gt;&lt;P&gt;using &amp;amp;GROSS_AMOUNT&amp;amp;&lt;/P&gt;&lt;P&gt;using &amp;amp;TAX_AMOUNT&amp;amp;&lt;/P&gt;&lt;P&gt;changing &amp;amp;NET_AMOUNT&amp;amp;&lt;/P&gt;&lt;P&gt;endperform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In program ZINVOICE01:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_net_amount tables t_input structure itcsy&lt;/P&gt;&lt;P&gt;t_output structure itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_gross type wrbtr,&lt;/P&gt;&lt;P&gt;l_tax type wrbtr,&lt;/P&gt;&lt;P&gt;l_net type wrbtr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_input.&lt;/P&gt;&lt;P&gt;case i_input-name.&lt;/P&gt;&lt;P&gt;when 'GROSS_AMOUNT'.&lt;/P&gt;&lt;P&gt;l_gross = t_input-value.&lt;/P&gt;&lt;P&gt;when 'TAX_AMOUNT'.&lt;/P&gt;&lt;P&gt;l_tax = t_input-value.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_net = l_gross - l_tax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_output.&lt;/P&gt;&lt;P&gt;case t_output-name.&lt;/P&gt;&lt;P&gt;when 'NET_AMOUNT'.&lt;/P&gt;&lt;P&gt;t_output-value = l_net.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify t_output transporting value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this points you in the right direction!&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;Pat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. kindly assign reward points to the responses that you find helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2005 05:43:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008491#M78351</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-08-08T05:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: sub-routines in scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008492#M78352</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;Please see the code below,&lt;/P&gt;&lt;P&gt;In script&lt;/P&gt;&lt;P&gt;PERFORM GET_CUST_ADDRESS IN PROGRAM ZSHXS011_TESTING      &lt;/P&gt;&lt;P&gt; using &amp;amp;vbdkr-adrnr&amp;amp;&lt;/P&gt;&lt;P&gt; changing &amp;amp;strt4&amp;amp;&lt;/P&gt;&lt;P&gt; changing &amp;amp;str5&amp;amp;&lt;/P&gt;&lt;P&gt;ENDPERFORM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In program&lt;/P&gt;&lt;P&gt;                                               &lt;/P&gt;&lt;P&gt;*intab contains input parameters&lt;/P&gt;&lt;P&gt;*process the intab values and populate into out_tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_address tables in_tab structure itcsy&lt;/P&gt;&lt;P&gt;                        out_tab structure itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : addr1_sel like addr1_sel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table in_tab index 1.  *adrnr value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    move in_tab-value to addr1_sel-addrnumber.  &lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call function 'ADDR_GET'&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;              address_selection = addr1_sel&lt;/P&gt;&lt;P&gt;         importing&lt;/P&gt;&lt;P&gt;              address_value     = addr1_val&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*assign street 4 to outtab   &lt;/P&gt;&lt;P&gt;    read table out_tab index 1.&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        move addr1_val-str_suppl2 to out_tab-value.&lt;/P&gt;&lt;P&gt;        modify out_tab index 1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*assign street 5 to outtab   &lt;/P&gt;&lt;P&gt;    read table out_tab index 2.&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        move addr1_val-str_suppl2 to out_tab-value.&lt;/P&gt;&lt;P&gt;        modify out_tab index 2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after the process we need to populate the values into outab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2005 10:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routines-in-scripts/m-p/1008492#M78352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-08T10:59:35Z</dc:date>
    </item>
  </channel>
</rss>

