<?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 logical command... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911863#M1329918</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;Please help me on how to use the logical command. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the details of my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In program, a flat file is created and put on the file system. Right after storing the flat file on the file system, an additional logical command needs to be called that starts an FTP script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;logical command: Z_POSTING_PUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I don't know how to use the said logical command. Can any body help me please....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;massive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2009 02:59:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-28T02:59:40Z</dc:date>
    <item>
      <title>logical command...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911863#M1329918</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;Please help me on how to use the logical command. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the details of my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In program, a flat file is created and put on the file system. Right after storing the flat file on the file system, an additional logical command needs to be called that starts an FTP script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;logical command: Z_POSTING_PUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I don't know how to use the said logical command. Can any body help me please....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;massive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 02:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911863#M1329918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T02:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: logical command...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911864#M1329919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have already created your logical command thru Sm59 ( ie &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use fm SXPG_COMMAND_EXECUTE to call logical command script Z_POSTING_PUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call function 'SXPG_COMMAND_EXECUTE'
exporting
commandname = Z_POSTING_PUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 03:25:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911864#M1329919</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-07-28T03:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: logical command...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911865#M1329920</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;Thanks for your reply. May i know what is the use of the logical command in the program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;massive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 03:34:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911865#M1329920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T03:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: logical command...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911866#M1329921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is used to connect the various external system..&lt;/P&gt;&lt;P&gt;the commond varies according to the system you are using&lt;/P&gt;&lt;P&gt;it can be seen in SM49 transaction and according you need to chose that&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* connect to the FTP server and send the files.

* Calculate password length
u201C password used for connection
  v_slen = strlen( ppwd ). 

* Encrypt password
  call function 'HTTP_SCRAMBLE'
    exporting
      source      = ppwd
      sourcelen   = v_slen
      key         = v_key
    importing
      destination = v_encrypted_pwd.

* Connect to destination server
  call function 'FTP_CONNECT'
    exporting
      user            = puser
      password        = v_encrypted_pwd
      host            = phost     u201CHost address
      rfc_destination = c_rfc_destination u201Cit is a constant   c_rfc_destination type rfcdes-rfcdest value 'SAPFTPA'.

    importing
      handle          = v_handle
    exceptions
      not_connected.

  if sy-subrc &amp;lt;&amp;gt; 0.

    message e002 with phost sy-subrc.

  endif.

  refresh it_result.
  refresh it_commands.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commands will depend on which OS is being used on server side and client side.&lt;/P&gt;&lt;P&gt;This code is for unix machines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* change the directory on the destination machine
  concatenate 'cd' prpath into wa_command-line separated by space.
  append wa_command to it_commands.
* Change the local directory on the sap server
  concatenate 'lcd' plpath into wa_command-line separated by space.
  append wa_command to it_commands.
* Set Ascii mode
  clear wa_command-line.
  if pbin eq 'X'.
    move 'bin' to wa_command-line.
  else.
    move 'asc' to wa_command-line.
  endif.
  append wa_command to it_commands.
* files to be transferred
  loop at it_list into wa_list.


* Put the file from the sap server to the destination machine
    concatenate 'put' wa_list-name wa_list-name
                         into wa_command-line separated by space.
    append wa_command to it_commands.

  endloop.

* Send FTP commands to server
  call function 'FTP_COMMAND_LIST'
    exporting
      handle        = v_handle
    importing
      command_index = v_command_index
    tables
      data          = it_result
      commands      = it_commands
    exceptions
      command_error = 1
      tcpip_error   = 2.

  v_subrc = sy-subrc.


  if v_subrc ne 0.

* if there is an error disconnect from the server
* and display an appropriate message

    perform ftp_disconnect using v_handle c_rfc_destination.

    message e004.

  endif.

**************************************************************
form ftp_disconnect using
  in_handle
  in_rfc_destination.

* Disconnect from destination server
  call function 'FTP_DISCONNECT'
    exporting
      handle = in_handle.

* Close RFC connection
  call function 'RFC_CONNECTION_CLOSE'
    exporting
      destination = in_rfc_destination
    exceptions
      others      = 1.

endform.                    "ftp_disconnect&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 03:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911866#M1329921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T03:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: logical command...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911867#M1329922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please look into this thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/EN/c4/3a6047505211d189550000e829fbbd/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/EN/c4/3a6047505211d189550000e829fbbd/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 03:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-command/m-p/5911867#M1329922</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-07-28T03:46:35Z</dc:date>
    </item>
  </channel>
</rss>

