Execution of command from SAP

Hi,
There is a requirement wherein one folder is created on presentation server ( Desktop ) in which we are putting excel files from
SAP ABAP using FM GUI_DOWNLOAD and now that folder contain file in excel forma lets say that folder name is INPUT. We have also created one more folder named OUTPUT and now the requirement is there is one executable converter file .exe in another folder lets say CONVERTER . Now the requirement is i need to execute that .exe file on  excel  file which it will then convert into necessary format which can be uploaded in bank site. The command works fine from windows i need to incorporate and execute the same command from SAP Kindly suggest any Function module,syntax or class n method exists for same.
The command which executed successfully from windows command prompt is
c:\>CONVERTER\ converter.exe  C:\INPUT\FILE.XLS C:\OUTPUT\
The same command i need to execute it from SAP Report
Thanks
Parag

Hi:
Try with this:
CALL METHOD cl_gui_frontend_services=>execute
  EXPORTING
    application             = u2018C:\CONVERTER\converter.exeu2019
    parameter               = u2018C:\INPUT\FILE.XLS C:\OUTPUT\u2019
    minimized               = u2018Xu2019
EXCEPTIONS
   cntl_error             = 1
   error_no_gui           = 2
   bad_parameter          = 3
   file_not_found         = 4
   path_not_found         = 5
   file_extension_unknown = 6
   error_execute_failed   = 7
   synchronous_failed     = 8
   not_supported_by_gui   = 9
   others                 = 10.

Similar Messages

  • Execute DOS command from SAP

    hi experts ,
    i need to execute DOS command from SAP .
    earlier we have 'GUI_EXEC' WS_EXECUTE , 'WS_DOWNLOAD' etc which are Obsolete now.
    as we are using ECC6.0. kindly guide how to do this.
    best regards,
    Rahul

    Try out...
    DSVAS_DOC_WS_EXECUTE_50
    or
    CL_GUI_FRONTEND_SERVICES=>EXECUTE
    <b><REMOVED BY MODERATOR></b>
    Thanks & Regards
    ilesh 24x7
    Message was edited by:
            Alvaro Tejada Galindo

  • Is it possible to run host command from SAP environment? How do you run?

    Hi
    Is it possible to run host command from SAP environment? How do you run?
    Thank You

    Hello Subhash
    You will more details in the following thread:
    Re: How to define command for SXPG_COMMAND_EXECUTE
    Regards
      Uwe

  • How to execute external command from SAP

    Hi gurus,
    i need to execute an external command from a Sap (rel ECC.5.0) to a server UNIX (no SAP); precisely i have to write a file into a directory in unix server.
    I see transaction SM49 and Sm69 but i don't know how can i use these features.
    Please coul'd you help me or give me a documentation.
    Thank's in advance
    Maurizio Ortolani
    email. [email protected]

    Hi Maurizio,
    i do it in this way:
    CONSTANTS: CMD_LS(50)   VALUE 'ls -al /transfer/sap'.
      DATA: BEGIN OF ITAB_LS OCCURS 0,
              LINE(200),
            END   OF ITAB_LS.
      CALL 'SYSTEM'
        ID 'COMMAND' FIELD CMD_LS
        ID 'TAB'     FIELD ITAB_LS-SYS.
    How do you write the file, via an UNIX-COMMAND than try the above call
    with your command.
    Another way is to write the file via OPEN DATASET ..., TRANSFER ... TO ..., CLOSE DATASET.
    If you mean this i can give you an example.
    Hope it helps.
    Regards, Dieter

  • Data extraction from SAP r/3 to sql 2000, bpc server

    Hi All,
    I have posted a similar thread previously,sap r/3 to sql 2000/2005, and understood how to transfer data from SAP R/3 to SQL 2005, but I need to transfer data from SAP R/3 to SQL 2000 server, not SQL 2005 server.
    Any help will be greatly appreciated.
    Regards,
    Kranthi.

    If you want to extract SAP R/3 data to SQL 2000, here are some alternatives:
    1. It becomes very easy if by any chance, you are using SAP BW with SAP R/3. You can extract the data into BW using standard or custom extractors and then send it out with open hub. SQL2000 can pick the flat files from a specified location at regular intervals.
    2. You can use Business Object extractors. You can get more info at:
    http://www.france.businessobjects.com/pdf/products/dataintegration/rapid_marts_sap_infosheet.pdf
    3. If that is not an option, then you need to have a tool that allows being called via RFC. This agent will then execute the required command on behalf of your application and return the result. I do not know if there is a ready-to-use RFC-compliant agent for SQL Server. If you have a tool that does it for you, you might have to check your network connections (ping), permissions etc. and see if you can execute an rSQL from the remote machine on the SQL server.
    There is a general solution to connect to nearly any kind of modern server application from a remote site by using simple HTTP requests. Suitable HTTP server for most needs would be:
    1. Microsoft IIS
    2. Java Tomcat or IBM WebSphere
    3. SAP WebAS
    In most cases, the IIS would probably be the one as it is installed on the Windows 2000 server anyway.
    Define an Active Server Page (ASP.NET) and insert the necessary code in your favorite language to extract the data from the SQL server.
    Your ASP.NET page would pack the result in the HTTP response object to be returned. In order to call the page from SAP you call the function modules HTTP_POST (using a HTTP POST request) or HTTP_GET (for HTTP GET request) on the standard RFC destination SAPHTTPA. (Pointing to a SAP utility program saphttp that resides in the SAP binary directory of your SAP database server and can be called from the command line in order to test its functionality without RFC).
    Regards
    Pravin

  • How do you send by secure ftp from SAP R/3 4.6C on iseries

    We have been using the SAP Standard program, RSFTP002, to ftp files to remote servers for many years. We have now had a requirement to send via secure ftp. We are using R/3 4.6C. Unfortunatley this is not a straight forward change and it seems we may need to install some client software to enable this.
    I have searched for any SAP notes and in several user groups but have not been too sucessful.
    Has anyone ever set this up before? What client software did you use?
    Any pointers / advice on this would be much appreciated.
    Many thanks,
    Steven

    Further to my initial post, I have now discovered that there are additional options on the ftp command on iseries, so I am hoping if I can perform this manaully, then a CL called from SAP would allow me to resolve this challenge.
    I am trying to use the command below but this will use the port 990.
    FTP RMTSYS(INTNETADR) INTNETADR('*.*.*.*') PORT(SECURE) SECCNN(*SSL)
    The vendor is requesting that we use port 443 for secure ftp with SSL and even specifying this in the command as below still does not work. It seems to me there may be an issue at the receiving end. Port 443 is normally used for https so not sure whether specifying this port could cause issues. The resultant error is below.
    FTP RMTSYS(INTNETADR) INTNETADR('*.*.*.*') PORT(443) SECCNN(SSL)
    Connecting to remote host 62.39.53.181 using port 443.  
    No response from remote host; all connections closed.
    Any other comments would be welcomed.
    Many thanks,
    Steven

  • Issue running a report from SAP Business One

    I have an issue running a particular report from SAP Business One. I am using Crystal Reports Add-On, all of the reports are working fine except one. When accessing the last page of the report or any page from inside the report the followiong error appears in the dialog box:
    Error in the File CollectionDate_Branch_wise {609BA059-89AF-41E9-9AEB-28CB16D13852}.rpt:
    The request could not be submitted for background processing.
    Edited by: Iqbal Faisal on Feb 22, 2010 6:03 AM

    Hi,
    Do you mean you have a Main report that is written based on SQL Command and there are 8 subreports linked to the main report?
    If that is the case, I assume when user select 'Document Type" eg invoice, it will pass that to the subreport and retrieve information?
    This is how I will approach it.
    1. Make sure the connection is consistent, if you are using ODBC(RDO) then make sure that is the same for main and subreport. You can check that in Set database connection. Right click on the connection, look at the Properties.  Don't assume that the name is the same, eg: SBO_DemoUS, they are all ODBC(RDO) for instannce.
    In Crystal, when you are using different connection, it will just prompts you a warning message and it will still run.
    2. Delete all and only keep one subreport, example AR invoice and see it will still give a problem.
    Replace the parameter with a set value in Record selection in subreport and see what happen.

  • Print a pdf file from sap

    Hello,
    I'm looking for a way to print a .pdf file from sap . The file  was created manualy and is in a newtwork folder.
    I have to send the print to a network printer . Is it possible to use the AcroRd32.exe as a command line?
    Thank you.

    hii,
    try this
    CONVERT_OTFSPOOLJOB_2_PDF
    http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm
    PDF - Printing a PDF file from ABAP or SAP Script
    regards,
    Sri.

  • FTP from SAP - how to make file UTF-8 format?

    We are collecting data from SAP on a 4.7 system  and sending it as an psv file to an external server using the FTP function modules . We do not have XI.  After being told we were missing the BOM id I added this to the first line of the file.
    DATA: l_len TYPE i.
      DATA: c_cr(1).
      DATA: c_bom(3)    TYPE x.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      c_cr = cl_abap_char_utilities=>cr_lf.
      c_bom = cl_abap_char_utilities=>byte_order_mark_utf8.
      gs_ftp = c_bom.
      APPEND gs_ftp TO gt_ftp.
      CLEAR gs_ftp.
      LOOP AT gt_survey INTO gs_survey.
    *create file
        CONCATENATE: gs_survey-division
                     gs_survey-bus_unit
                     gs_survey-site
                     gs_survey-survey
                     gs_survey-co_name
                     gs_survey-kunnr
                     gs_survey-first_name  INTO gs_ftp-record SEPARATED BY '|'.
    * Work out length of string in GS_FTP_RECORD and populate last character
    * with a carriage return.  This will denote the end of the line.
        l_len = STRLEN( gs_ftp-record ).
        SUBTRACT 1 FROM l_len.
        gs_ftp-record+l_len(1) = c_cr.
        APPEND gs_ftp TO gt_ftp.
      ENDLOOP.
    We then  scramble the password and open the FTP and then call commandFTP_COMMAND  before calling FTP_R3_TO_SERVER:
    * Find out how many lines exist in GT_FTP
        DESCRIBE TABLE gt_ftp LINES sy-tfill.
    * Width of table x no. of lines in GT_FTP
        l_blob = 1024 * sy-tfill.
        CONCATENATE: 'CSVC1_SO' sy-datum '_' sy-uzeit '.psv' INTO g_file.
    * Set command to transmit in ASCII
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
           handle                = v_handle
            command               = 'ascii'
          TABLES
            data                  = result
    * EXCEPTIONS
    *   TCPIP_ERROR           = 1
    *   COMMAND_ERROR         = 2
    *   DATA_ERROR            = 3
    *   OTHERS                = 4
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    * Send file onto FTP
        CALL FUNCTION 'FTP_R3_TO_SERVER'
          EXPORTING
            handle         = v_handle
            fname          = g_file
            blob_length    = l_blob
            character_mode = 'X'
          TABLES
            text           = gt_ftp
          EXCEPTIONS
            tcpip_error    = 1
            command_error  = 2
            data_error     = 3
            OTHERS         = 4.
    Any ideas?

    As far as I see, you are opening the FTP-Connection in ASCII-Mode.
    This means that the Data transfered is "converted" in a way as the FTP-Server think its correct.
    Try to open the FTP-Connection in Binary mode, hopefully this helps?
    Regards
    Rene

  • Print Jpeg files from SAP

    Hi,
    We have JPEG files (pictures) stored in Custom Z table (Cluster table). We would like to know how to print these files from SAP on to a certain printer.
    We know that it is not possible to convert JPEG to BMP within SAP and print using SAPScript OR SmartForms.
    We want to find out if there is any print command to print these files to SAP printer  ?
    Any help is appreciated.
    Niranjan

    Hi Gregory,
    I had checked this tcode earlier. However, I don't see any 'Print' jpeg or any other file functionality here. What SAP might be doing here is, allow upload of any document like excel, word or pic files (jpeg, gihf, bmp) and so on and just display.
    I am interested in printing functionality without usng SAP Script OR Smartforms, because, when we get into it, we have to talk only TIF or BMP as JPGs are not supported.
    Niranjan

  • Create a new folder in windows from SAP

    Hi,
    I can execute progrmas from sapusing the WS_EXECUTE function, but how can I crete a new folder in windows from SAP?.
    Thnaks

    Hi,
    I have a idea about this problem.
    Firstly, I made a batch file. The file is a text file, so you can create easily the file from the WS_DOWNLOAD function. The file include a command - md (folder name).
    Secondarily, I executed the batch file by the function 'WS_EXECUTE'.
    Finally, I deleted the temporary file by the WS_FILE_DELETE function.
    It's easy.
    If do you need the source, you should send a mail to me.
    The source is given you.
    Best regards,
    Don

  • Automatic Replication of Vendors from SAP R/3 Backend System to SRM System

    Hi All,
    I am searching for any existing standard configuration in SRM V 4.0 System for replicating Vendors of selected Purchasing Organizations from SAP R/3 Backend System to SRM System.
    I have checked in the SPRO  settings of SRM System and found/could make out from the documentation avalable in help itself, that there is a standard configuration by which you can automatically replicate the Vendors created in SAP R/3 by activating the following in SPRO: By putting a tick mark against the Check Box existing against "Create New Vendors also"  under Vendor Synchronization with Make Global Settings I hope.
    If the above statement is correct, then I hope we have to schedule a job ,since the above configuration is based on a job based execution which should run at least once a day.
    In that case,which would be the relevant job which has to be created WITH A VARIANT in order to filter the Purchasing Organizations desired for.
    Please help me out since we have to implement this asap.And if the above solution is not at all feasible,then please do reply at the earliest.
    Awaiting for your early reply .
    Regards
    Annette

    Hi
    Please try this ->
    <b>http://help.sap.com/saphelp_srm50/helpdata/en/56/54f137a5e6740ae10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/bb/6c0e3b02616a42e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/62/fb7d3cb7f58910e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/5e/88ef3bc8821d0de10000000a114084/frameset.htm</b>
    Regards
    - Atul

  • File from SAP R/3 to other Server

    Hi,
    Can anyone here please let me know how to store a file on a server which is not SAP R/3 from SAP.
    Can we use CALL FUNCTION 'FTP_CONNECT'.
    Thanks
    K.Kiran.

    hi ,
    yes you can use FTP_CONNECT.
    try the below code.
    FTP Using SAP Functions
    Here is an example of how to FTP a file from the Application server to a remote server using standard SAP functions.
    DATA: BEGIN OF MTAB_DATA OCCURS 0,LINE(132) TYPE C,END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,MI_KEY TYPE I VALUE 26101957,MI_PWD_LEN TYPE I,MI_HANDLE TYPE I.
    START-OF-SELECTION.
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
           HOST            = 'servername'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.

  • Flat File Transfer from SAP R/3 4.7 to SAP Business Connector 4.8

    Hi Experts,
    I have a requirement of transferring a flat file from my R/3 SAP 4.7 Box Application Server to the Business Connector 4.8 Box. I am new to SAP Business Connector and I am not to sure whether FTP works if I use a shell script in SAP R/3. Also, is there any way Business Connector Box can pull the file from R/3 Application Server and store the file in the Business Connector Server.
    Any help will be appreciated!!!
    Regards,
    Subhhrangsu

    Hi,
    There are many ways thru which you can pass document to SAP BC:
    You can HTTP, FTP, Email document to SAP BC.
    SAP BC has predefined services for all of them.
    For FTP document to SAP BC:
    1 Initiate an FTP session on SAP BC Serveru2019s FTP listening port ( this can be found out from SAP BC administrator or from SAP BC homepage).
    2 Point to the directory that contains the service to which you want to pass the XML
    document.
    Example cd \ns\Purchasing\SubmitOrder
    3 Copy the XML document to this directory using the following command:
    put XMLDoc.xml
    Where XMLDoc.xml is the name of the file that you want to pass to SAP BC Server.
    Example put PurchaseOrder.xml
    Above code can be written in a batch file and you can schedule it to run at interval of minutes.
    You can write java client program as well to upload file and map it to String variable of Flow service of SAP BC.
    As Micheal said, you can look at sapbc/Developer/doc folder to look for more options.
    Best Regards,
    Divyesh

  • Automatic replication of vendor masters from SAP R/3 to EBP

    Hi
    For this issue I found the below program and steps to do the automatic replication of vendor master from SAP R/3 to EBP
    PROGRAM BBP_VENDOR_SYNC
    The program BBP_VENDOR_SYNC automatically synchronizes the backend vendors with the SRM system.
    To run the program BBP_VENDOR_SYNC, you first have to make the following settings:
    Path in the Implementation Guide (IMG):
    Supplier Relationship Management --> SRM Server  -->Technical Basic Settings -->Settings for Vendor Synchronization --> Make Global Settings
    Supplier Relationship Management --> SRM Server  -->Technical Basic Settings -->Settings for Vendor Synchronization --> Define Settings for Each Backend System
    Then you have to make the following settings in transaction SA38:
    · Enter program BBP_VENDOR_SYNC.
    · Click on the pushbutton Background.
    · Enter the report name BBP_VENDOR_SYNC.
    · Either define a new variant or use an existing variant ( The new Variant as Test Vendor)
    · Click on the pushbutton Schedule.
    · Enter the job.
    · Define the start date.
    · Either schedule once or schedule periodically. Then you have to define the period interval.
    I followed  the above mention steps and I am able to setup the Schedule on timely basis and the job was completed successfully, but the vendors are not replicated successfully .
    I am receiving the below error in transaction code SLG1.
    1.The Specified Node does not Exist in the Org. Plan(Message no. BBP_VENR006).
    2.No Vendor Replicated from Backend MD1CLNT(Message no. BBP_VENR017).
    Please check and advice.
    Thanks & Regards
    Sada

    Hi Sadasivam,
    Make Global Settings
    Use
    In Customizing for vendor synchronization, you define between which mySAP or ERP backend systems and the EBP System you wish to automatically synchronize the vendor master data. This setting is necessary in order to start a job-based execution of the synchronization, so that the vendor master data that is newly created or changed in the backend is updated regularly in the EBP System.
    Requirements
    You wish to use the automatic vendor synchronization functionality.
    In the Implementation Guide (IMG) activity Define RFC Destinations, you have defined the RFC destinations for your systems.
    Under Define Backend Systems, you have defined the backend systems for your systems.
    Activities
    Customizing for Vendor Synchronization consists of two parts. In the first part you make those settings that are valid for all backend systems. In the activity Make Settings for Each Backend System you can define or display detail data for the individual backend systems.
    Make Global Settings
    By setting the indicator Create New Vendors Also, you can determine that those vendors newly created in the backend systems are also newly created during the synchronization. If this indicator is not set, the only data updated is that of the vendors in the Enterprise Buyer System whose data was changed in the backend systems.
    Note:
    If you have not yet made an entry here, an empty screen appears when you start the activity. To make the settings, choose New entries or press F5.
    Further Settings:
    Carry Out Address Check for Duplicates :
    Organizational Unit in EBP for the Vendor
    Enter the eight-digit number, for example, 50001234.
    Vendor Number Assignment Type
    In the dropdown box, choose the method with which the number is to be allocated when a new vendor is created, for example, internal number allocation.
    Hope this makes you more clear. My mail i.d is [email protected]
    Rgds,
    Teja

Maybe you are looking for

  • MSI GE60: Downgrade from Windows 8 to Windows 7

    Hi, this is unrelated to the previous topic so I'm creating a new one. I want to install Windows 7 since 8 is causing me so many problems. I'm having trouble doing so. Let me explain. I have an old Windows 7 DVD that I got "somewhere" which came with

  • I'm trying to sync my iCal on my iPhone 4s to my MacBook Pro.

    I have an MacBook Pro that I got in 2009 and an iPhone 4s I got like 2 months ago. I'm trying to sync my calender events that I have on my phone to my iCal on my Mac. I have everything switched to "on" for syncing on my iPhone, but when I try check t

  • How can I add Internet browser back/forward buttons to the main toolbar?

    The developper of the software I'm testing manages to open web-pages in a window within our software. We find this a great feature, although it has one downside: no back/forward buttons the users have gotten used to thru standard Internet browsers. I

  • Newly created FKs not imported in DB diagram

    Hi there I am using database diagrams functionality in JDeveloper 10.1.3.3.0 to document an existing Oracle 10g database. I am finding it great, but I am having some problems with FKs. What I did: 1 - I created a connection to the schema I want to im

  • Phone is searching...cannot text, make or receive calls

    I have powered off and back on and it's still doing the same thing. I have an unlimited data plan, but cannot get onto the internet either. However, I can connect to the wifi at my work and am receiving emails and can get online. Still cannot text, m