<?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: How to Call Function from SAPSCRIPT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-call-function-from-sapscript/m-p/874662#M50465</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to write this code in SAPScript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM formname IN PROGRAM includename &lt;/P&gt;&lt;P&gt;USING &amp;amp;field1&amp;amp;                                       &lt;/P&gt;&lt;P&gt;USING &amp;amp;field2&amp;amp;                                       &lt;/P&gt;&lt;P&gt;CHANGING &amp;amp;field3&amp;amp;                                      &lt;/P&gt;&lt;P&gt;ENDPERFORM                                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here includename is your include type program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to write this code in your include type program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM formname TABLES in_par STRUCTURE itcsy&lt;/P&gt;&lt;P&gt;                        out_par STRUCTURE itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : var1 like field1,&lt;/P&gt;&lt;P&gt;       var2 like field2,&lt;/P&gt;&lt;P&gt;       var3 like field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE in_par WITH KEY 'field1'.&lt;/P&gt;&lt;P&gt;  CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  var1 = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE in_par WITH KEY 'field2'.&lt;/P&gt;&lt;P&gt;  CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  var2 = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After processing on VAR3...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE out_par WITH KEY 'field3'.&lt;/P&gt;&lt;P&gt;  out_par-value = VAR3.&lt;/P&gt;&lt;P&gt;  MODIFY out_par INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndForm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes if this works than dont forget to give the points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2005 07:23:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-01T07:23:09Z</dc:date>
    <item>
      <title>How to Call Function from SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-call-function-from-sapscript/m-p/874661#M50464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2005 06:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-call-function-from-sapscript/m-p/874661#M50464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-01T06:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Call Function from SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-call-function-from-sapscript/m-p/874662#M50465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to write this code in SAPScript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM formname IN PROGRAM includename &lt;/P&gt;&lt;P&gt;USING &amp;amp;field1&amp;amp;                                       &lt;/P&gt;&lt;P&gt;USING &amp;amp;field2&amp;amp;                                       &lt;/P&gt;&lt;P&gt;CHANGING &amp;amp;field3&amp;amp;                                      &lt;/P&gt;&lt;P&gt;ENDPERFORM                                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here includename is your include type program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to write this code in your include type program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM formname TABLES in_par STRUCTURE itcsy&lt;/P&gt;&lt;P&gt;                        out_par STRUCTURE itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : var1 like field1,&lt;/P&gt;&lt;P&gt;       var2 like field2,&lt;/P&gt;&lt;P&gt;       var3 like field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE in_par WITH KEY 'field1'.&lt;/P&gt;&lt;P&gt;  CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  var1 = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE in_par WITH KEY 'field2'.&lt;/P&gt;&lt;P&gt;  CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  var2 = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After processing on VAR3...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE out_par WITH KEY 'field3'.&lt;/P&gt;&lt;P&gt;  out_par-value = VAR3.&lt;/P&gt;&lt;P&gt;  MODIFY out_par INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndForm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes if this works than dont forget to give the points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2005 07:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-call-function-from-sapscript/m-p/874662#M50465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-01T07:23:09Z</dc:date>
    </item>
  </channel>
</rss>

