FTP COMMANDS IN BACK GROUND

Hi every one,
I am using ftp_connect, ftp_command function modules.
i want to schedule my program in backround,but this s not working....
RFC DEST used is SAPFTP and also tried SAPFTPA..
no use..
THANKS IN ADVANCE
RAVI

Along with rfcdestination one has to provide the key also.
Just check below code, may be useful...
  DATA: l_slen     TYPE i,
        l_error,
        l_pwd(30)  TYPE c.
  CONSTANTS: c_dest TYPE rfcdes-rfcdest VALUE 'SAPFTP',
             c_key  TYPE i              VALUE 26101957.
  l_error = 0.
connect to ftp server
  l_pwd = p_pwd.
  l_slen = STRLEN( l_pwd ).
  CALL FUNCTION 'HTTP_SCRAMBLE'
    EXPORTING
      SOURCE      = l_pwd
      sourcelen   = l_slen
      key         = c_key
    IMPORTING
      destination = l_pwd.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = 'Connect to FTP Server'.
To Connect to the Server using FTP
  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = p_user
      password        = l_pwd
      host            = p_host
      rfc_destination = c_dest
    IMPORTING
      handle          = w_hdl
    EXCEPTIONS
      OTHERS          = 1.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CLEAR : w_outfile, w_file_count.
  MOVE 'ERC/GLOBALSAP/M_ERC_GLOBALSAP_COACODE' TO w_outfile.
  PERFORM download_to_ftp TABLES it_coacode USING w_outfile.
To disconnect the FTP
  CALL FUNCTION 'FTP_DISCONNECT'
    EXPORTING
      handle = w_hdl.
To disconnect the RFC Connection
  CALL FUNCTION 'RFC_CONNECTION_CLOSE'
    EXPORTING
      destination = c_dest
    EXCEPTIONS
      OTHERS      = 1.
FORM download_to_ftp TABLES it_tab
                     USING l_string TYPE char64.
  CALL FUNCTION 'FTP_R3_TO_SERVER'
    EXPORTING
      handle         = w_hdl
      fname          = l_string
      character_mode = 'X'
    TABLES
      text           = it_tab[]
    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
            RAISING invalid_output_file.
  ENDIF.
ENDFORM.                    " download_to_ftp

Similar Messages

  • Want commands running in the back ground in sql developer

    HI all,
    I am new user to oracle sql developer. i started using it and found interseting. It is very easy just using the GUI interfaces. what ever i need to do i can do using the GUI interfaces instead of using commnads. makes my work easier. BUt there starts my concern
    if i continue to use the tools one day i will not know the commands which are executed actually.
    Is there any way throught which i can look what every that commands or queries that are executed in the back ground for my instruction in the foreground

    Hi,
    If you truly wish to see all the SQL and PL/SQL executed for a given connection, you can try the following:
    1. Tools -> Monitor Sessions...
    2. Select a connection for a user with appropriate privileges (e.g., must be able to run DBMS_MONITOR)
    3. In the list of sessions, right-click on a session of interest, select Trace Session and click Apply
    4. After completing the desired activity on the connection of interest, close the connection.
    5. Open the trace file in SQL Developer (File -> Open, or drag and drop it) -- make sure the Filter drop-down is set to All -- to see the SQL.
    6. Pick one of the four tabbed views of the trace file data: List, Tree, Statistics, History
    Step 5 is easy if the DB is local. For example, with Oracle 10g Xe on Windows, look for the most recent trc file in a directory like
    C:\oraclexe\app\oracle\admin\XE\udumpFor a remote DB you would need to copy the trc onto a shared network drive or ftp it to your local machine.
    If you just wish to see DDL commands as you manipulate DB object definitions from the Connection Navigator tree or the Object Viewer Actions list, the UI usually provides a SQL tab so that you may view the SQL before clicking the Apply button.
    Hope this helps,
    Gary
    SQL Developer Team

  • Truly dumb question. How do I get PS to actually complete a command, eg straighten an horizon, and finalise the change. Even doing a "save as" with a new file name and reloading brings the image back, straightened, but with the skewed back ground frame st

    Truly dumb question. How do I get PS to actually complete a command, eg straighten an horizon, and finalise the change. Even doing a "save as" with a new file name and reloading brings the image back, straightened, but with the skewed back ground frame still there. Is there a "apply change" or similiar command that I simply cannot see.

    brings the image back, straightened, but with the skewed back ground frame
    PSE did what you told it to do. Choose the Straighten and crop edges or fill edges options when you use the straighten tool if you want it to do more than just straighten the contents of the image. Many people prefer the plain straighten because they'd rather crop themselves than let PSE do it.

  • Scheduling Back Ground job

    Hi All,
    I need to schedule a daily background job for MB52 transaction and need to save the output of MB52 in a specified directory .
    Can any one tell me whether it is possible to save back ground job output in specified directory?
    Thanks & Regards
    k.Nirmala

    Hi Nirmala,
    Set up variant at MB52 transaction and use SM37 and Sm36 transaction to schedule job.
    Define job at Sm36 and use program - RM07MLBS and use your variant.
    schedule job and set up time and date for periodcally.
    and it will run and you can see the status at SM37 Transaction .
    the background job will create spool and which will contain your output.
    if you want to download your output ,then you need to write custom program to get spool information from TSP01 table and use open dataset command to down load specifi directory.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Submiting report in back ground with values

    Hello all abapers,
      I m working on one application where one module pool program will take input from user for user id and password. After verification, one back ground report will be scheduled by this program to change user pw and add some role in user's profile.
    when i schedule the prg in background i need to pass some values like user id and password entered on module pool screen...
    how do i pass it to background job when scheduling and how bg job prg will read these values..
    please advise me as its needed asap...
    thanks in advance,
    jigs.
    any helpful suggestions will be rewarded.

    Hi,
    Put the following code in user command:
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname                = 'ZSUBMIT'
    IMPORTING
       jobcount               = jbcnt
    EXCEPTIONS
       cant_create_job        = 1
       invalid_job_data       = 2
       jobname_missing        = 3
       OTHERS                 = 4
    IF sy-subrc <> 0.
    ENDIF.
    SUBMIT <program to be submitted> WITH P_user_id = user id  VIA JOB 'ZSUBMIT' NUMBER jbcnt AND RETURN.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount                          = jbcnt
        jobname                           = 'ZSUBMIT'
        strtimmed                         = 'X'
    EXCEPTIONS
       CANT_START_IMMEDIATE              = 1
       INVALID_STARTDATE                 = 2
       JOBNAME_MISSING                   = 3
       JOB_CLOSE_FAILED                  = 4
       JOB_NOSTEPS                       = 5
       JOB_NOTEX                         = 6
       LOCK_FAILED                       = 7
       INVALID_TARGET                    = 8
       OTHERS                            = 9
    IF sy-subrc <> 0.
    ENDIF.
    A job called 'ZSUBMIT' will be released in background.
    Please try and award points if useful.
    Thanks and regards,
    S. Chandra Mouli.

  • Program with Back Ground User.

    Hi ,
    In my development we are sending data from MDM to R3 through XI.
    Here iam having the following issue:
    When sending IDOC's from XI to R3, some of the IDOC's are struck in Queue  with status 64 and, those not going to be processed at all. This is because of the unavailability of the work processes at that time. All this is done through the back ground user XIS_REMOTE.
    Iam trying to process the unprocessed IDOC's through a standard program, all the IDOC's are processed, but the data created under the Fore Ground user (i.e. my id).
    <b>I want to know is there any possibility to run or write the program using back ground user XIS_REMOTE</b> <b>so that all the unprocessed IDOC's will process and get the back ground user XIS_REMOTE.</b>
    Any inputs appriciated.
    Best Regards
    Shyam Reddy.

    ST05 you can trace SQL-statements and get expainings how these statements are being worked upon by the database. this is more a tool for investigating the performance of abaps on your 'special' database.
    since you posted your request in the security forum i will assume that you want to do an authority trace. use tx. ST01 instead of ST05. Set the filter options to the program and/or user you want to trace and flag the areas you want traced like 'authority check' 'database access' 'kernel commands' ...
    activate the trace using the matchlight-icon. run the background job to be traced. stop the trace after a sufficient time (or until the job hits the error you want to investigate). then press 'evaluation' and check the boxes for the lines to be displayed again ...
    if both my answers don't fit to your problem come back here and state a bit more precisely what your problem is, maybe we find another approach to it.

  • Back Ground Job not showing in SM50,

    Hi Friends,
    I am running XK99 to Mass update Vendor details in Back ground, I am getting some error while running the job in back ground, I would like debugg the issue.
    But in SM50  Iam not able to see the job I sechduled using program MASSBACK or transaction XK99.
    Please let me know, what could be the problem.
    Thanks,
    Veerendra.

    Hi,
    Try this - goto SM37 select the background job and enter JDBG in the command field (similar to entering /h to debug).
    Cheers.
    ...Reward if useful

  • Receiving FTP commands/parameters in SAP ABAP

    Hi Friends
    In My program I need to receive acknowledgement from external systems
    they will send some parameters thru FTP Commands to SAP
    my sap ABAP program need to receive when ever External system sends parameters
    and update them in SAP
    can anybody know how to handle the FTP commands and receiving them in
    SAP ABAP program, it should done automatically
    i will be very happy if any one send me some piece of code
    Thanks
    Anil

    I think you will need to watch for the arrival of the file delivered via the FTP, rather than try to act on the FTP commands themselves (as they will be handled by the FTP server software)... for example, if you were to FTP into a subdirectory called "inbox" and then have a cron job or an ABAP program that runs every X minutes to see if the directory contents have changed, you could have an event triggered back job fire up automatically (i.e. using SAPEVT from the operating system, or FM BP_EVENT_RAISE in APAP... see links:
    http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e5e543b11d1898e0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_40b/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/content.htm
    for more on this.
    Jonathan

  • Back ground process

    Hi all,
    I want to run a java program in the background . Yet it should display the results in the foreground itself. In my foreground I have another program runnig. But if I call a function from there the control will be transfered to there na? But I should be able to continue with my current program yet the other program should also run in the back ground. Can I use System command to do so? I tried to execute the following system command from my current program :
    nohup backgroundprogram &
    It is compiling correctly but exiting on running without showing anything.
    Please help me.
    Regards,
    Cochu.

    Use Runtime run = Runtime.getRuntime().exec(....); This should be executed in a separate Thread so you don't block the current application.
    In anticipation of you next question, search the forum, there are plenty of examples of how to use the Runtime class.

  • How to debug the back ground job

    Hi All,
    I want to debug the program, but it is taking more time so iam running it in back ground, but i need to debug the program from some particular point....is there any other way to debug the program...
    Means...to run the program in background upto particular point and later i need to run it in debug mode.
    Please suggest.
    Thanks & Regards,
    Hari

    Hi,
    You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.
    Use SM37 to get list of jobs , type 'JDBG' in the command line ( no '/' ), put the cursor on the job and press ENTER
    You are in debug mode now. Step through SAP program (press F7 couple of times) until you get to code you need.
    Hope this helps u.
    Thanks.

  • FTP Command Not in /usr/bin

    My hard drive seems to have partially died, I can't seem to boot it up in to Target mode, but I can boot in to recover mode and then open up a terminal and navigate around the drive.  I'm trying to FTP to my NAS so I can back up as much of my HD as possible, but I can't find the ftp command.  I thought it was in /usr/bin but I only see sftp there and I can't sftp to my NAS (it's a WD MyBookLive).
    I can ping my NAS, so I know it is there, I just don't know how to connect to it from terminal in recovery mode.  Any other suggestion on how to connect to my NAS?

    Hi,
    1.     Type ftp to get into FTP mode - if this does not work, try accessing root by typing sudo -i and entering password for the machine. Then type ftp again. This should give you the command line ftp>
    2.     Type open <ip address>.
    3.     At this point you should be provided with a box where you type in your username and password for the NAS.
    4.     Type lcd<folder> or lcd <folder>.
    5.     Type ls and cd commands to place yourself into the desired folder on the NAS.
    6.     Type the ascii or bin command to set your file transfer to ASCII or Binary respectively.
    7.     Type one of the following commands to send or receive the desired files: get, mget, put and mput.
    8.     When finsihed, type the quit command to close the connection and exit to exit the FTP session.

  • How To Handle With Back Ground JOB From WEBUI When Click On "Appove"

    Hi
    How To Scheduled A Job Through ABAP Report In back end  Of CRM when i click on "Approve" Button in WEBUI  From result list.
    As per My requirement I have a Search View and Result View
    In Search View I have  Below Fields
    ITC Vendor ID    
    Claim Status
    User status (date status changed)
    Model
    Serial Number
    Date completed of Service Completion
    Based on Search Criteria I will get Result In Result View.(Suppose 10 Records I got In Result View)
    In the Result View I need to Add one Button As "Approve"
    When i Click On Approve button One Pop up Message Need to Open And In that popup window I need to Display Below Text
    "Approve  Claim Job Has Started In Background  
    Note: Only Claims Which are in Submitted  Status  Will be  Approved. you May Close This Window"
    In SAP CRM System  Back Ground Job Need To Start When Click On "Approve" Button In WEBUI .
    In the Back Ground ABAP Report which will validate based on Result List Records"
    In the Result List we may have all types of Claims which are status in "Submitted" "Pending" "Rejected" "Approve".
    I need to collect all records from Result list and validate Those Records who's Status in "Submitted
    1)Sort all the claims based on ITC Vendor ID.
    2)Grouped all the submitted claims against each ITC Vendor ID from the search result
    3)Change the status of the selected submitted claims to Approved.
    4)Displays information messages as mentioned whenever a claim is approved, the same message will be captured in the job log.
    ‘Claims <ClaimID 1>,…<ClaimID N> now approved for ITC Vendor ID’.
    5)Sending Email to each IRC.
    6)Capture all the approved claims in the below format (Format Attached "Screen Shot Attachment")
    7)Store the file in the Application Server AL11 in .csv format
    Please Find Attachement For Reference.
    1)ITC Claim Screen Shot
    2)Screen Shot For Attachment
    Thanks
    Raj

    Hi,
    You can add the following code in on approve method to show popup to the user,
    IF req_edit IS NOT BOUND. " gloabl attribute in impl class of the view
        REFRESH lt_buttons.
        lss_button-id  = 'btnyes'.
        lss_button-text = 'YES'.
        lss_button-on_click = 'YES'.
        APPEND lss_button TO lt_buttons.
        CLEAR lss_button.
        lss_button-id  = 'btnno'.
        lss_button-text = 'NO'.
        lss_button-on_click = 'NO'.
        APPEND lss_button TO lt_buttons.
        CLEAR lss_button.
        CALL METHOD comp_controller->window_manager->create_popup_2_confirm
          EXPORTING
            iv_title          = 'ATTENTION'
            iv_text           = 'Are you sure you want to edit this document?'
            iv_btncombination = '99'
            iv_custombuttons  = lt_buttons
          RECEIVING
            rv_result         = req_edit.
        req_edit->set_on_close_event( iv_event_name = 'EDIT' iv_view = me ). "#EC NOTEXT
        req_edit->open( ).
        RETURN.
      ELSE.
        lr_node ?= req_edit->get_context_node( 'OUTPUTNODE' ).
        lv_outbound = lr_node->get_event_name( ).
    *  CLEAR ptc_pricing_status.
    *    lv_outbound = req_edit->get_fired_outbound_plug( ).
        IF lv_outbound = 'YES'.
    you can use the submit report code here and you can al the validations here
        ELSE. " No
    if user clicks no nothing to do..
        ENDIF.
        CLEAR req_edit.
      ENDIF.
    Best Regards,
    Dharmakasi.

  • Safari problem:  when I switch back into safari from another application, the menu bar comes up but no tabs or windows.  What's going on?  Just started yesterday.  I have found a workaround: when I Command Tab back to safari, I hit command T to open a new

    Safari problem:  when I switch back into safari from another application, the menu bar comes up but no tabs or windows.  What's going on?  Just started yesterday.  I have found a workaround: when I Command Tab back to safari, I hit command T to open a new tab and Command W to close it, and my other tabs are visible.
    I have tried shutting down, closing tabs, with no success.  What's going on and how can I fix it?
    Thanks,
    Cindi B
    PS:  I'm not sure of the actual OS level, but I have not allowed it to upgrade to Maverick yet; concerned about it because of a few things I've read...

    A Safari extension or third party plugin may be causing the menu bar issue.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test. If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.
    If it's not an extensions issue, try troubleshooting third party plug-ins.
    Back to Safari > Preferences. This time select the Security tab. Deselect:  Allow plug-ins. Quit and relaunch Safari to test.
    If that made a difference, instructions for troubleshooting plugins here.
    As for which OS X is installed.
    Click the Apple () menu top left in your screen. From the drop down menu click About This Mac.
    The version is noted there.
    v10.6 Snow Leopard v10.7 Lion  v10.8 Mountain Lion
    It's your choice whether or not to upgrade to Mavericks. If you decide to do this, make sure your Mac meets the requirements noted here.

  • How to find the back ground job details

    Hi All,
       I have a back ground  job running from many days, now we would like to know when this job was created on what date this job actvlly created and schuduled.
               Please informe me how to check this.
    Thanks & Regards,
    Muralikrishna

    On SM37 screen there is plenty of options are there:
    This is what i got from SAP help
    Explanation for each selection field:                                                                               
    o   Jobname: Name of the job as an identifier.                                                                               
    o   Username: Name of the user who designed and planned the job.                                                                               
    o   Start date: The start condition of the job, which could be a time 
    frame or an event that the job is waiting for. Specifying both will   
    yield jobs whose starting condition is  either of the two             
    conditions.                                                                               
    ABAP program step: Name of an ABAP program that acts as a step in a   
    job.                                                                               
    Status selection: The current status of the job. By default, the      
    SCHEDULED option is not marked. To see the scheduled jobs, you must   
    explicitly check this.
    also give the proper values in Job Satus also.

  • Any restictions on back ground job when submit the session?

    Hello friends
    below is my code part. problem is when i execute this program in back ground the data is not picking from APQI. but in fore ground it is picking . for this SESSION submission in back ground am i missing any thing here. please suggest me , any restiction is their in back ground? if possible please send a sample code to submit SESSION automatically in background.
        SUBMIT rsbdcsub AND RETURN
                        USER sy-uname
                        WITH mappe    =  p_group
                        WITH von      =  sy-datum
                        WITH bis      =  sy-datum
                        WITH z_verarb =  'X' .
          SELECT userid credate groupid qstate FROM apqi
             INTO TABLE it_apqi
             WHERE userid  = sy-uname
             AND   credate = sy-datum
             AND   groupid = p_group
             AND   qstate  = 'E'.              "Only look for 'Error' status
       DESCRIBE TABLE it_apqi[] LINES temp.

    Codes for Submitting the session through RSBDCSUB (via Job)...
    " The function module JOB_OPEN is called to create the job.
        call function 'JOB_OPEN'
             exporting
                  delanfrep        = 'X'  "Delete job after execution
                  jobname        = fv_jobname  "Job name
             importing
                  jobcount         = fv_jobcount  "Internally generated
             exceptions
                  cant_create_job  = 1
                  invalid_job_data = 2
                  jobname_missing  = 3
                  others           = 4.
        if sy-subrc = 0.
          submit rsbdcsub
                 with       mappe = v_filec
                 with            von = sy-datum      "From
                 with            bis = sy-datum      "To
                 with     z_verarb = 'X'
                 with         fehler = ' '
                 with      batchsys = space
                 with         logall = ' '
                 via  job          fv_jobname
                      number       fv_jobcount
                 and return.
          call function 'JOB_CLOSE'
               exporting
                    jobcount             = fv_jobcount
                    jobname              = fv_jobname
                    strtimmed            = 'X'
               exceptions
                    cant_start_immediate = 1
                    invalid_startdate    = 2
                    jobname_missing      = 3
                    job_close_failed     = 4
                    job_nosteps          = 5
                    job_notex            = 6
                    lock_failed          = 7
                    others               = 8.
    Hope this helps!
    Edited by: Vin on Jun 4, 2009 10:58 AM

Maybe you are looking for

  • Problem with camera calibration profiles

    I've been using Lightroom 4.2 on windows with a Canon 450D for a while and i only use raw files. Under the "Camera Calibration" tab I could chose betwen acr4.4, Adobe Standard and a few canon presets (paysage, neutral, etc.) In my opinion the ACR4.4

  • Characters in String : Unicode 16-bit to custom 32-bit

    I understand that internally in Java, characters in Strings are actually Unicode characters, with each character represented with 16 bits. So, character �L� in Unicode is 0x004C which is also 0000 0000 0100 1100 Now, I wish to encode each of the 4 bi

  • I want to import info from iViewPro

    I want to import info from iView MediaPro3, a similar product with a few years of history, yet I see no references at all to it. My guess is that LR cannot import any info (labels, ratings, keywords, etc) from it. Does any one know anything about imp

  • Email Address Quickfill Problem

    MAIL evidently has a quick fill option for addressing emails. I like that but... whenever I write to a particular friend, I now have an address that MAIL insists on putting into the email that is no longer the correct address for that particular pers

  • What is the best way to reuse functions in MVC environment?

    I have several commands (using Cairngorm MVC) which use the same type of function that returns a value. I would like to have this function in one place, and reuse it, rather than duplicate the code in each command. What is the best way to do this?