<?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: Logic to run Unix script file through ABAP program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256579#M1384431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
report zsrchsap.

*-This is a demo report for Search Sap
*-Author : Sandeep Kulkarni
*-Date : 09/20/2001

parameters : p_sfile(60) lower case
          "File to be moved
          "Eg : /home/in/SFILE1.txt
            p_dfile(60) lower case.
          "File's Destination
          "Eg: /home/archive/SFILE1.txt

data : t_btcxpm
       like btcxpm occurs 0,
       p_addparam 
       like sxpgcolist-parameters.

  concatenate 
  '/home/ABAP/scripts/Archive_file.sh'
  p_sfile
  p_dfile
  into p_addparam separated by space.

  refresh t_btcxpm. clear t_btcxpm.
  call function 'SXPG_CALL_SYSTEM'
    exporting
      commandname = 'ZSHELL'
      additional_parameters = p_addparam
    tables
      exec_protocol = t_btcxpm
    exceptions
      no_permission              = 1
      command_not_found          = 2
      parameters_too_long        = 3
      security_risk              = 4
      wrong_check_call_interface = 5
      program_start_error        = 6
      program_termination_error  = 7
      x_error                    = 8
      parameter_expected         = 9
      too_many_parameters        = 10
      illegal_command            = 11
      others                     = 12.
  if sy-subrc = 0.
    write : / 
    'File',p_sfile,'moved to',p_dfile.
  else.
    write : / 'Error Occured'.
  endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2009 06:42:39 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2009-10-26T06:42:39Z</dc:date>
    <item>
      <title>Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256575#M1384427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;I need to run the Unix script file from abap program, for that user provided file directory of application server.&lt;/P&gt;&lt;P&gt;Is there any logic/FM  to run through abap programing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls can any one provide logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 03:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256575#M1384427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T03:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256576#M1384428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;link:[http://searchsap.techtarget.com/tip/0,289483,sid21_gci774071,00.html]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 04:24:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256576#M1384428</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-10-26T04:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256577#M1384429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;i could not get the above link information.&lt;/P&gt;&lt;P&gt;can you please provide some more clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 06:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256577#M1384429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T06:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256578#M1384430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the content of the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unix Shell scripts along with ABAP can be used to perform many tasks.&lt;/P&gt;&lt;P&gt;These can be used for sending internet mail w/o using SAP Connect,&lt;/P&gt;&lt;P&gt;archiving files, passing data from one system to another, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following example demonstrates how to use shell script for moving a file&lt;/P&gt;&lt;P&gt;from one folder to another folder. This can be used for archiving the processed files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement : SAP installed on Unix or&lt;/P&gt;&lt;P&gt;its clones. SAP version 4.0 or above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unix Setup to be done by Unix Admin&lt;/P&gt;&lt;P&gt;(1) Create a folder under unix&lt;/P&gt;&lt;P&gt;Eg: /home/ABAP/scripts/&lt;/P&gt;&lt;P&gt;Make sure this folder has Read Write and&lt;/P&gt;&lt;P&gt;Execute permissions.(Mode 777)&lt;/P&gt;&lt;P&gt;(2) Create a file Archive_file.sh in &lt;/P&gt;&lt;P&gt;Unix using any editor. &lt;/P&gt;&lt;P&gt;(2) Type &lt;/P&gt;&lt;P&gt;mv $1 $2 &lt;/P&gt;&lt;P&gt;in the file. Make you type the command as shown.&lt;/P&gt;&lt;P&gt;(3)Save it.&lt;/P&gt;&lt;P&gt;(4) Make sure the file has read write&lt;/P&gt;&lt;P&gt;execute permissions (Mode 777)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP Configuration&lt;/P&gt;&lt;P&gt;(1) Run transaction SM69&lt;/P&gt;&lt;P&gt;(2) Hit F5 and then Hit F6&lt;/P&gt;&lt;P&gt;(3) Enter Command Name : ZSHELL&lt;/P&gt;&lt;P&gt;(4) Operating System will default to &lt;/P&gt;&lt;P&gt;Unix or HP-UX etc.&lt;/P&gt;&lt;P&gt;(5)Enter Operating System Command : sh&lt;/P&gt;&lt;P&gt;(6)Additional Parameters allowed : X&lt;/P&gt;&lt;P&gt;(7) Save it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 06:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256578#M1384430</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-10-26T06:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256579#M1384431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
report zsrchsap.

*-This is a demo report for Search Sap
*-Author : Sandeep Kulkarni
*-Date : 09/20/2001

parameters : p_sfile(60) lower case
          "File to be moved
          "Eg : /home/in/SFILE1.txt
            p_dfile(60) lower case.
          "File's Destination
          "Eg: /home/archive/SFILE1.txt

data : t_btcxpm
       like btcxpm occurs 0,
       p_addparam 
       like sxpgcolist-parameters.

  concatenate 
  '/home/ABAP/scripts/Archive_file.sh'
  p_sfile
  p_dfile
  into p_addparam separated by space.

  refresh t_btcxpm. clear t_btcxpm.
  call function 'SXPG_CALL_SYSTEM'
    exporting
      commandname = 'ZSHELL'
      additional_parameters = p_addparam
    tables
      exec_protocol = t_btcxpm
    exceptions
      no_permission              = 1
      command_not_found          = 2
      parameters_too_long        = 3
      security_risk              = 4
      wrong_check_call_interface = 5
      program_start_error        = 6
      program_termination_error  = 7
      x_error                    = 8
      parameter_expected         = 9
      too_many_parameters        = 10
      illegal_command            = 11
      others                     = 12.
  if sy-subrc = 0.
    write : / 
    'File',p_sfile,'moved to',p_dfile.
  else.
    write : / 'Error Occured'.
  endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 06:42:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256579#M1384431</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-10-26T06:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to run Unix script file through ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256580#M1384432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use Function modules below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SXPG_COMMAND_EXECUTE or SXPG_COMMAND_EXECUTE_LONG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 06:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-to-run-unix-script-file-through-abap-program/m-p/6256580#M1384432</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-10-26T06:45:07Z</dc:date>
    </item>
  </channel>
</rss>

