<?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: Call function..Destination in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020450#M1608682</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 didn't get your requirement wxatly but you can do as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am assuming is you have a java batch file at your desktop and you want to encrypt the file through this batch file execution from SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to execute the batch file at runtime and to pass data at runtime you can use below function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;W_RFCENCRY = 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'.
W_RFCDEST = 'ZRFC'.


CALL FUNCTION 'RFC_REMOTE_PIPE'
      DESTINATION W_RFCDEST
      EXPORTING
        COMMAND               = W_RFCENCRY
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        OTHERS                = 4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here ZRFC is the RFC created in SM59 as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) select TCP/IP and create ZRFC &lt;/P&gt;&lt;P&gt; in program option type as below &lt;STRONG&gt;C:\RfcSdk\bin\rfcexec.exe&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; RFCDSK folder is required to execute the batch file at your workstation at path specified as above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2) In activation type select &lt;STRONG&gt;start on front end work station&lt;/STRONG&gt; radio button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now save the RFC and check the connection, same will be there if RFC SDK folder is available as specified in the program option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In W_RFCENCRY give the inputs that you want to pass with the batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here I have mentioned as 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'. in the program where C:\Encrypt\enc.exc is the path for batch file and C:\Encrypt\test.txt is the path of the file on the work station which is to be encrypted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you, I think at your end batch file can be different and inputs to be passed in the batch file can also be different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 05:45:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-07-21T05:45:32Z</dc:date>
    <item>
      <title>Call function..Destination</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020449#M1608681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to call a RFC Java function in SAP. The Java function is an encryption function which has 4 parameters (Password, Message, Strength128, Strength256). I need to pass the data for the parameters from SAP to JAVA. With the help of SDN, I tried to call this function in ABAP. A destination named 'INTEGRATION' is created in SM59, with the registered Program ID 'ASEncryptionHelper'. ASEncryptionHelper is the Java function name and the program ID is registered with this name only. The following is the code I wrote in my report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: XPASS TYPE STRING.&lt;/P&gt;&lt;P&gt;XPASS = 'PASS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ASENCRYPTIONHELPER' DESTINATION 'INTEGRATION'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    PASSWORD          = XPASS&lt;/P&gt;&lt;P&gt;    MESSAGE             = XML_RESULT&lt;/P&gt;&lt;P&gt;    STRENGTH128       = ' '&lt;/P&gt;&lt;P&gt;    STRENGTH256       = 'X'&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a RFC function module in my SAP system with the name ASENCRYPTIONHELPER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION ASENCRYPTIONHELPER.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(PASSWORD) TYPE  STRING&lt;/P&gt;&lt;P&gt;*"     VALUE(MESSAGE) TYPE  STRING&lt;/P&gt;&lt;P&gt;*"     VALUE(STRENGTH128) TYPE  BOOLEAN&lt;/P&gt;&lt;P&gt;*"     VALUE(STRENGTH256) TYPE  BOOLEAN&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I execute the program I get a runtime error "Bean ASENCRYPTIONHELPER not found on host HOSTNAME".&lt;/P&gt;&lt;P&gt;I am not able tofigure out the exact problem.&lt;/P&gt;&lt;P&gt;Also I wanted to know whether the way I am coding is right. Do I need to create a RFC function module in SAP also as I did above?&lt;/P&gt;&lt;P&gt;Does the Uppercase of the function 'ASENCRYPTIONHELPER' matter? In SM59 the program id is mentioned as 'ASEncryptionHelper'.&lt;/P&gt;&lt;P&gt;I tried to change the function name with 'ASEncryptionHelper' in the CALL FUNCTION, but then I get another error, "JCO.Server could not find server function 'ASEncryptionHelper' '. What is wrong? I am confused.&lt;/P&gt;&lt;P&gt;Please guide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 05:12:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020449#M1608681</guid>
      <dc:creator>anub</dc:creator>
      <dc:date>2011-07-21T05:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Call function..Destination</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020450#M1608682</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 didn't get your requirement wxatly but you can do as below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am assuming is you have a java batch file at your desktop and you want to encrypt the file through this batch file execution from SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to execute the batch file at runtime and to pass data at runtime you can use below function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;W_RFCENCRY = 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'.
W_RFCDEST = 'ZRFC'.


CALL FUNCTION 'RFC_REMOTE_PIPE'
      DESTINATION W_RFCDEST
      EXPORTING
        COMMAND               = W_RFCENCRY
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        OTHERS                = 4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here ZRFC is the RFC created in SM59 as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) select TCP/IP and create ZRFC &lt;/P&gt;&lt;P&gt; in program option type as below &lt;STRONG&gt;C:\RfcSdk\bin\rfcexec.exe&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; RFCDSK folder is required to execute the batch file at your workstation at path specified as above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2) In activation type select &lt;STRONG&gt;start on front end work station&lt;/STRONG&gt; radio button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now save the RFC and check the connection, same will be there if RFC SDK folder is available as specified in the program option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In W_RFCENCRY give the inputs that you want to pass with the batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here I have mentioned as 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'. in the program where C:\Encrypt\enc.exc is the path for batch file and C:\Encrypt\test.txt is the path of the file on the work station which is to be encrypted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you, I think at your end batch file can be different and inputs to be passed in the batch file can also be different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 05:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020450#M1608682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-21T05:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Call function..Destination</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020451#M1608683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Umang for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my requirement I already have the encrypt and decrypt function at the Java end. What I need to do is call this encrypt function in SAP and pass the four parameters as I mentioned in my post above. I don't have any batch files generated here. The XML_RESULT is the xml output of the data that I need to send to JAVA. XML_RESULT contains SAP data that I get after I use CALL TRANSFORMATION in my report. Without the CALL FUNCTION..DESTINATION my report is able to make connection to the JAVA system and its able to send the SAP data also. The error comes when I use CALL FUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 06:02:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-destination/m-p/8020451#M1608683</guid>
      <dc:creator>anub</dc:creator>
      <dc:date>2011-07-21T06:02:10Z</dc:date>
    </item>
  </channel>
</rss>

