<?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: SXPG_COMMAND_EXECUTE - returns an error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sxpg-command-execute-returns-an-error/m-p/7870933#M1593758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue has been resolved. I was writing the pdf file in the application server, wheras the Unix script had some other directory as its present working directory.&lt;/P&gt;&lt;P&gt;As we are using the same directory for the purpose, this directory and folder name was hard coded in the Unix script as well,&lt;/P&gt;&lt;P&gt;so that the confusion of path is resolved.&lt;/P&gt;&lt;P&gt;Thus this issue was resolved from the Unix script itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Anita Jeyan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 May 2011 08:35:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-05-07T08:35:27Z</dc:date>
    <item>
      <title>SXPG_COMMAND_EXECUTE - returns an error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sxpg-command-execute-returns-an-error/m-p/7870932#M1593757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt; I am using the FM SXPG_COMMAND_EXECUTE to run a unix script which fetches a pdf file written from ABAP code into&lt;/P&gt;&lt;P&gt;application server.&lt;/P&gt;&lt;P&gt;I have written the pdf file, and while run separately the Unix script is working fine.&lt;/P&gt;&lt;P&gt;But the FM which calls the unix script, SXPG_COMMAND_EXECUTE, returns errors which say that the pdf file could not be opened. I have written the pdf file in binary form on the application server.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'CONVERT_OTF'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      format                = 'PDF'&lt;/P&gt;&lt;P&gt;      max_linewidth         = 132&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      bin_filesize          = gv_bin_filesize&lt;/P&gt;&lt;P&gt;      bin_file              = gt_bin&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      otf                   = gt_otf&lt;/P&gt;&lt;P&gt;      lines                 = gt_pdf_tab&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      err_max_linewidth     = 1&lt;/P&gt;&lt;P&gt;      err_format            = 2&lt;/P&gt;&lt;P&gt;      err_conv_not_possible = 3&lt;/P&gt;&lt;P&gt;      OTHERS                = 4.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data:    mstr_print_parms LIKE pri_params,&lt;/P&gt;&lt;P&gt;           gv_file type string value '/usr/sap/ABAP-TMP/',&lt;/P&gt;&lt;P&gt;           wa_pdf_tab like line of gt_pdf_tab,&lt;/P&gt;&lt;P&gt;           it_docs TYPE STANDARD TABLE OF docs,&lt;/P&gt;&lt;P&gt;           it_lines TYPE STANDARD TABLE OF tline,&lt;/P&gt;&lt;P&gt;           gv_frontfile type string ,&lt;/P&gt;&lt;P&gt;           wa_lines type tline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate gv_file wa_final-pernr '.pdf' into gv_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset gv_file for output in binary mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;transfer gt_bin to gv_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset gv_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: c_extcom    TYPE sxpgcolist-name VALUE 'ZHRPAYSLIP',&lt;/P&gt;&lt;P&gt;           c_oper      TYPE syopsys VALUE 'Linux'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: v_dir_input      TYPE sxpgcolist-parameters.  " Input Directory&lt;/P&gt;&lt;P&gt;DATA: t_result         TYPE STANDARD TABLE OF btcxpm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate wa_final-pernr&lt;/P&gt;&lt;P&gt;            gs_reclist-receiver&lt;/P&gt;&lt;P&gt;            '93210951'&lt;/P&gt;&lt;P&gt;            into v_dir_input&lt;/P&gt;&lt;P&gt;            separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    commandname                   = c_extcom&lt;/P&gt;&lt;P&gt;    additional_parameters         = v_dir_input&lt;/P&gt;&lt;P&gt;    operatingsystem               = c_oper&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    exec_protocol                 = t_result&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    no_permission                 = 1&lt;/P&gt;&lt;P&gt;    command_not_found             = 2&lt;/P&gt;&lt;P&gt;    parameters_too_long           = 3&lt;/P&gt;&lt;P&gt;    security_risk                 = 4&lt;/P&gt;&lt;P&gt;    wrong_check_call_interface    = 5&lt;/P&gt;&lt;P&gt;    program_start_error           = 6&lt;/P&gt;&lt;P&gt;    program_termination_error     = 7&lt;/P&gt;&lt;P&gt;    x_error                       = 8&lt;/P&gt;&lt;P&gt;    parameter_expected            = 9&lt;/P&gt;&lt;P&gt;    too_many_parameters           = 10&lt;/P&gt;&lt;P&gt;    illegal_command               = 11&lt;/P&gt;&lt;P&gt;    wrong_asynchronous_parameters = 12&lt;/P&gt;&lt;P&gt;    cant_enq_tbtco_entry          = 13&lt;/P&gt;&lt;P&gt;    jobcount_generation_error     = 14&lt;/P&gt;&lt;P&gt;    OTHERS                        = 15.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 May 2011 05:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sxpg-command-execute-returns-an-error/m-p/7870932#M1593757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-07T05:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: SXPG_COMMAND_EXECUTE - returns an error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sxpg-command-execute-returns-an-error/m-p/7870933#M1593758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue has been resolved. I was writing the pdf file in the application server, wheras the Unix script had some other directory as its present working directory.&lt;/P&gt;&lt;P&gt;As we are using the same directory for the purpose, this directory and folder name was hard coded in the Unix script as well,&lt;/P&gt;&lt;P&gt;so that the confusion of path is resolved.&lt;/P&gt;&lt;P&gt;Thus this issue was resolved from the Unix script itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Anita Jeyan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 May 2011 08:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sxpg-command-execute-returns-an-error/m-p/7870933#M1593758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-07T08:35:27Z</dc:date>
    </item>
  </channel>
</rss>

