Run the Report as a Background job and Get the Output in Excel in Local PC

Hello Gurus,
I have one following requirement.
One should be able to run the report as a background job and it should be possible to get the report in Excel format, also when running the report in background. The excel report should have the same information and look as the current SAPreport.
Please provide some solution.
Any helpful answer get surely awarded.
Thanks a lot,
Varlanir

GUI_* WS_* Function In Background, CSV Upload
GUI_* and WS_* function modules do not work in background
When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
At anytime, a user can switch of the Personal Computers even though the job is still running in the background.  Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
To choose the correct download method to used, you can check the value of SY-BATCH in your code,
if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
*-- Open dataset for reading
DATA:
  dsn(20) VALUE '/usr/test.dat',
  rec(80).
OPEN DATASET dsn FOR INPUT IN TEXT MODE.
IF sy-subrc = 0.
  DO.
    READ DATASET dsn INTO rec.
    IF sy-subrc <> 0.
      EXIT.
    ELSE.
      WRITE / rec.
    ENDIF.
  ENDDO.
ENDIF.
CLOSE DATASET dsn.
*-- Open dataset for writing
DATA rec(80).
OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.
  TRANSFER rec TO '/usr/test.dat'.
CLOSE DATASET dsn.
What is the difference when we use upload, ws_upload, gui_upload function modules?
UPLOAD, WS_UPLOAD, GUI_UPLOAD, are used in BDC concepts.  ie., Batch Data Communication.
Batch Data Conversion is a concept where user can transfer the Data from non SAP to SAP R/3.  So , in these various Function Modules are used.
UPLOAD---  upload a file to the presentation server (PC)
WS_UPLOAD----    Load Files from the Presentation Server to Internal ABAP Tables.
WS means Work Station.
This is used upto SAP 4.6 version.
GUI_UPLOAD-------    Replaces WS_UPLOAD. Upoad file from presentation server to the app server.  From 4.7 SAP version it is replaced.
How to Upload csv file to SAP?
Common File Download Upload Questions:
How  you upload the data from text file to sap internal table?  From my knowledge its by upload or gui_upload. 
How you download the data from sap internal table to text file?
How  you upload the data from xls (excel) file to sap internal table how you download the data from sap internal table to xls(excel) file.
You can upload data from presentation server to an internal table using gui_upload. Use gui_download to download from internal table to flat file.
Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.
Use function module GUI_UPLOAD
The FILETYPE refer to the type of file format you need: For e.g 'WK1' - Excel format , 'ASC' - Text Format etc.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = 'C:\test.csv'
   FILETYPE                      = 'ASC'
  TABLES
    DATA_TAB                      = itab
EXCEPTIONS
   FILE_OPEN_ERROR               = 1
   FILE_READ_ERROR               = 2
   NO_BATCH                      = 3
   GUI_REFUSE_FILETRANSFER       = 4
   INVALID_TYPE                  = 5
   NO_AUTHORITY                  = 6
   UNKNOWN_ERROR                 = 7
   BAD_DATA_FORMAT               = 8
   HEADER_NOT_ALLOWED            = 9
   SEPARATOR_NOT_ALLOWED         = 10
   HEADER_TOO_LONG               = 11
   UNKNOWN_DP_ERROR              = 12
   ACCESS_DENIED                 = 13
   DP_OUT_OF_MEMORY              = 14
   DISK_FULL                     = 15
   DP_TIMEOUT                    = 16
   OTHERS                        = 17.

Similar Messages

  • R/3 job and get the details of variants like (from and to)

    Hi,
    How to find R/3 job and get the details of variants like (from and to) for that job.
    the job is extraction job and running for 4 hours in R/3 once atfer this job completes BW job will start executing. Now i have to analyse R/3 job that how many years of data it is extracting (from, to) and other useful information why it is taking time for 4 hours.
    Please let me know what transaction i have to use and how to check this information in R/3 side.
    Thanks,

    Hi........
    Go to SM37 >> select the job >> Click on Job log.........Check there whether u r getting any Clue or not...........Is this load is through PSA..........? if so check the records of the First data packet...........then the Last data packet............from there u can get some idea..................
    Also u can check the data in the Extractor.......is it a full load?.............Go to RSA3 >> Execute..........there check the data........
    Is it a LO datasource ? if so................Go to LBWE >> Click on maintenance link for your datasource........>> Here in the Right pane u can see the Structute associated with that Datasource ...........If u remove MC from those structure name............u will get the table name..............In those tables also u can check the data...............there should be some data field.............from where u can get some idea.........
    If ur Extractor is extracting data using some Function Module.............then open the datasource using RSA2.............there double click on the Exrtractor..............u will get the function module.................u can try to analyze the function module............
    For Variants..................select the job >> click on Step in the top >> then Go to in the top >> Variant..............but I don't think this will help u............this will tell u that this Extraction job is part of which chain or IP......
    Regards,
    Debjani..........

  • Hi, i'm trying to download the Lightroom 6 stand alone version and get the following message right after a click the checkout box: "The account was registered for a different country. Please sign out and sign in using an existing account for this country.

    Hi, i'm trying to download the Lightroom 6 stand alone version and get the following message right after a click the checkout box: "The account was registered for a different country. Please sign out and sign in using an existing account for this country." I'm in Namibia and tried to change my country from Africa to USA but still the same problem. TIA

    Hi Annen,
    Please refer the following forum thread.
    Trying to purchase trial period in different email address - error message "Error in Your Order The account was registered for a different country. Please sign out and sign in using an existing account for this country. Ok"
    Regards,
    Sumit Singh

  • "Open In Excel" button inside the Xlviewer.aspx page return Error and I can not open excel using local office

    Inside the xlviewer.aspx page when I click on "Open In Excel" at first I receive this Error: 
    Some files contain viruses that can be harmful to your computer. it is important to be certain that this file is from a trustworthy sourceDo you want to open this file?
    Then, When I click on Yes, the second error message(below) shows and I can not open Excel using my local Excel Application.
    This action couldn't be performed because office doesn't recognize the command it was given.
    I should notice that the application is published under the HTTPS protocol.
    It is just working with IE 9.0. Neither Chrome nor IE after 9.0.

    Sure. I posted here since I suspect that the lastest upgrade may have a bearing on it.
    What do I need to move it over to Number and Lion?

  • Schedule report MM60 as background job and send out in Excel format

    Hi there,
    I would like to schedule a background job for report MM60, then send to the user in Excel format.
    I know that we can enter the recipient in the job setting(SM36) but the report is send in HMTL format.
    Is it possible to send in Excel format?
    Thanks,
    Janice

    Hi,
    I think it's not possible from SM36 you better get help from ABAPer to get the require output.
    Also visit below thread for same issue:
    mail, output of spool as an excel attachment
    Regards;

  • ITunes match says "matched" I delete the song to download better version and get the same bit rate

         HI,
    title says it all. :-) I made a smart playlist to filter out the tracks that I can upgrade to a better version. This worked well for most of my library but there are a couple of songs that are listed at 128kbps. I delete these and then click on the cloud icon. While downloading itunes lists them at 256 but then revert to 128!
    A bug? Should I report it or are other users having the same problem?
    Cheers,
    Philly

    Generally setting a common Album title and Album Artist will fix things.
    For deeper problems see Grouping tracks into albums.
    tt2

  • Trying to set the entity attributes in before commit and get the following

    i get the following error when i try to set the entity attributes before commit.
    JBO-28202: Entities invalidated in beforeCommit(). Need to re-validate and post.
    can somebody let me know, how to re-validate and post.

    I Suggest you set its Attribute on EOImpl, override doDML, and before call super.doDML set your Attribute. There is a special reason to set Attribute on beforeCommit?
    Best Regards

  • When we try to run one of the reports in server with parameters, we get the following error, do you have any idea what might be causing it.

    Failed to retrieve data from the database. Details:[Database Vendor Code:936] Failed to retrieve data from the database. Error in file - 29D140CA-540C-42AC-9A4E-224304492642-.rpt: Failed to retrieve data from the database. Details:[Database Vendor Code:936]

    Or google Database Vendor Code: 936
    E.g.;
    Crystal Reports XI SQL Expression error: ORA-00936
    Error in Compiling SQL Expression
    Etc., etc., etc.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • IOS 6, drop the pin in the maps to your known locations and get the incorrect postal code. Thumbs up if I am right. :)

    The maps gives me wrong information for the postal code all the time.
    Please make sure the postal code twice before you use it for any legal purposes.

    Could you be a little more specific?  I took that section out of my CSS file but the problem persists.
    Thank you.
    Sincerely,
    Michael Yannetta
    Mio Web Designs
    530-414-3313
    [email protected]

  • Internal parameter - The report parameter is read-only and cannot be modified.

    Hello,
    We have an SSRS report that has an Internal parameter for the user that is logged in (gets the Report.User!UserID in custom code and assigns to parameter called Login).  We would like it to remain internal as it is for security purposes - we filter
    data depending on whether or not the user has access.  We would not like it to be accessible from the URL.  The report has drill-through functionality where the user can click a link and the report is filtered on certain criteria.  This seems
    to work fine in SSRS 2005, but since i have upgraded the report to SSRS 2012, I am getting the error on the drill-through:
    The report parameter 'Login' is read-only and cannot be modified. (rsReadOnlyReportParameter) 
    The properties in Report Manager have the "Hide" option selected.  Any help would be appreciated.  Thanks.
     

    Hi Hhewson,
    In Reporting Services, if you create a hidden parameter, you can set values for it on a report URL or in a subscription definition. If you set a parameter to Internal, it is not exposed in any way except in the report definition. An internal parameter must
    have a default value, which can be null if the Allow null value option has been selected. Internal Parameters are not configurable by the end-user at run-time.
    In your scenario, I suggest you changing internal parameter to hidden parameter to check whether the issue persists.
    Reference:
    In SSRS, how does an “Internal” parameter differ from a “hidden” parameter?
    Hope this helps.
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • How to run commands like "ipconfig" and get the output in adobe AIR in windows?

    import flash.desktop.NativeProcess; 
    import flash.desktop.NativeProcessStartupInfo;   
    if (NativeProcess.isSupported) {     
         var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();     
         var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");     
         var process:NativeProcess = new NativeProcess();       
         npsi.executable = processpath;     
         process.start(npsi); 
    The above can only run a sub-application, but how to run an independent  application(command) like ipconfig and get the result?

    Hi,
    here is an example of running a net Use command line from AIR, unig the new NativeProcess. Hope it will help !
    function launchProcess()
      var file = air.File.applicationDirectory;
      // set command path
      file = file.resolvePath("C:/Windows/system32/net.exe");
      var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
      nativeProcessStartupInfo.executable = file;
      // prepare command parameters
      var args = new runtime.Vector["<String>"]();
      args.push('USE');
      args.push('W:');
      args.push('/delete');
      args.push('/y');
      // set arguments
      nativeProcessStartupInfo.arguments = args;
      // add listeners to catch command outputs
      process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
      process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
      process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
      // create and run Native process
      process = new air.NativeProcess();
      process.start(nativeProcessStartupInfo);
    function onOutputData(ProgressEvent)
      var processResults = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
      air.trace("Results: \n" + processResults);
    function onErrorData(ProgressEvent)
      var processResults = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
      if(processResults.search('password') > -1){
        window.alert('Bad password');
      air.trace("Errors: \n" + processResults);
    function onExit(NativeProcessExitEvent)
      air.trace("Process ended with code: " + NativeProcessExitEvent.exitCode);

  • TS3297 What is iTunes Error -609, I try to like a song in my iTunes via Ping and get the error?

    I go to hit the Ping button for any song and get the error code -609, what does it mean?

    Normally that hits people when they're trying to download album artwork.
    If you sign out of the Store and then sign back in again, does that fix your 609?
    (That's usually worth a try with the artwork variation ... fingers crossed it'll also work with your Ping 609.)

  • Retrieve cancelled background job and display it user on the selection scre

    Hi all,
    i am executing a background job and if successful it sends an email to the user .
    if the job gets cancelled i want to display the job status to the user or email the user .
    can anyone share your experiences on this .
    thanks in advance.
    regards,
    Ry

    U can use the FM 'BP_JOBLOG_READ' for the aborted jog to get their  status log..then u can send this log to the user via mail.
    pl. check this sample code..
    REPORT ZEXAMPLE.
    DATA: JOBLIST LIKE TBTCJOB OCCURS 0 WITH HEADER LINE,
          JOBDETS LIKE BTCSELECT,
          JOBLOG  LIKE TBTC5 OCCURS 0 WITH HEADER LINE,
          V_ANS.
    PARAMETERS P_UNAME LIKE SY-UNAME DEFAULT SY-UNAME OBLIGATORY.
    IF NOT P_UNAME IS INITIAL.
      JOBDETS-JOBNAME     = '*'.
      JOBDETS-USERNAME    = P_UNAME.
      JOBDETS-FROM_DATE   = SY-DATUM.
      JOBDETS-TO_DATE     = SY-DATUM.
      JOBDETS-NO_DATE     = 'X'.
      JOBDETS-WITH_PRED   = 'X'.
      JOBDETS-PRELIM      = 'X'.
      JOBDETS-SCHEDUL     = 'X'.
      JOBDETS-READY       = 'X'.
      JOBDETS-RUNNING     = 'X'.
      JOBDETS-FINISHED    = 'X'.
      JOBDETS-ABORTED     = 'X'.
    ENDIF.
    CALL FUNCTION 'BP_JOB_SELECT'
         EXPORTING
              JOBSELECT_DIALOG    = 'Y'
              JOBSEL_PARAM_IN     = JOBDETS
         TABLES
              JOBSELECT_JOBLIST   = JOBLIST
         EXCEPTIONS
              INVALID_DIALOG_TYPE = 1
              JOBNAME_MISSING     = 2
              NO_JOBS_FOUND       = 3
              SELECTION_CANCELED  = 4
              USERNAME_MISSING    = 5
              OTHERS              = 6.
    IF SY-SUBRC EQ 0.
      IF NOT JOBLIST[] IS INITIAL.
        READ TABLE JOBLIST INDEX 1.
        CALL FUNCTION 'BP_JOBLOG_READ'
             EXPORTING
                  JOBCOUNT              = JOBLIST-JOBCOUNT
                  JOBNAME               = JOBLIST-JOBNAME
             TABLES
                  JOBLOGTBL             = JOBLOG
             EXCEPTIONS
                  CANT_READ_JOBLOG      = 1
                  JOBCOUNT_MISSING      = 2
                  JOBLOG_DOES_NOT_EXIST = 3
                  JOBLOG_IS_EMPTY       = 4
                  JOBLOG_NAME_MISSING   = 5
                  JOBNAME_MISSING       = 6
                  JOB_DOES_NOT_EXIST    = 7
                  OTHERS                = 8.
        IF JOBLOG[] IS INITIAL.
          WRITE:/ 'NO JOB LOG FOUND'.
        ELSE.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
               EXPORTING
                    TITLEBAR      = 'DELETE JOB LOGS'
                    TEXT_QUESTION = 'JOB LOGS FOUND. DELETE?'
                    POPUP_TYPE    = 'W'
               IMPORTING
                    ANSWER        = V_ANS.
        ENDIF.
        IF V_ANS EQ '1'.
          CALL FUNCTION 'BP_JOB_DELETE'
               EXPORTING
                    JOBCOUNT                 = JOBLIST-JOBCOUNT
                    JOBNAME                  = JOBLIST-JOBNAME
               EXCEPTIONS
                    CANT_DELETE_EVENT_ENTRY  = 1
                    CANT_DELETE_JOB          = 2
                    CANT_DELETE_JOBLOG       = 3
                    CANT_DELETE_STEPS        = 4
                    CANT_DELETE_TIME_ENTRY   = 5
                    CANT_DERELEASE_SUCCESSOR = 6
                    CANT_ENQ_PREDECESSOR     = 7
                    CANT_ENQ_SUCCESSOR       = 8
                    CANT_ENQ_TBTCO_ENTRY     = 9
                    CANT_UPDATE_PREDECESSOR  = 10
                    CANT_UPDATE_SUCCESSOR    = 11
                    COMMIT_FAILED            = 12
                    JOBCOUNT_MISSING         = 13
                    JOBNAME_MISSING          = 14
                    JOB_DOES_NOT_EXIST       = 15
                    JOB_IS_ALREADY_RUNNING   = 16
                    NO_DELETE_AUTHORITY      = 17
                    OTHERS                   = 18.
          IF SY-SUBRC EQ 0.
            WRITE:/ JOBLIST-JOBCOUNT, JOBLIST-JOBNAME, 'LOG DELETED'.
            EXIT.
          ELSE.
            WRITE:/ JOBLIST-JOBCOUNT, JOBLIST-JOBNAME, 'LOG NOT DELETED'.
          ENDIF.
        ELSE.
          CALL FUNCTION 'BP_JOBLOG_SHOW'
               EXPORTING
                    JOBCOUNT                  = JOBLIST-JOBCOUNT
                    JOBNAME                   = JOBLIST-JOBNAME
               EXCEPTIONS
                    ERROR_READING_JOBDATA     = 1
                    ERROR_READING_JOBLOG_DATA = 2
                    JOBCOUNT_MISSING          = 3
                    JOBLOG_DOES_NOT_EXIST     = 4
                    JOBLOG_IS_EMPTY           = 5
                    JOBLOG_SHOW_CANCELED      = 6
                    JOBNAME_MISSING           = 7
                    JOB_DOES_NOT_EXIST        = 8
                    NO_JOBLOG_THERE_YET       = 9
                    NO_SHOW_PRIVILEGE_GIVEN   = 10
                    OTHERS                    = 11.
        ENDIF.
      ELSE.
        WRITE:/ 'NO JOBS FOR', P_UNAME.
        EXIT.
      ENDIF.
    ENDIF.
    Regards,
    Joy.

  • Can we call a transaction in background and get the list in report?

    I want to call the standard T-Code MC.9 from a report in background using Call Transaction and get the list in the report.There are some enhancement done to its base program RMCB0300 due to which if I use Submit ... exporting to memory and then import the list from memory, the result doesnt match to the values given by T-Code MC.9.
    The option apparently for me is to use Call Transaction method, but if I use Call transaction method, how do I make the report to be executed in background and then get the resultant list in the report?

    Copy the program in Z and than modify it saving the list on memory on database table.

  • Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi,
    I believe this would be your Prod system, so don't just cancel it but look at the job log. If it is still processing then don't kill it and wait for the change run to complete but if you can see that nothing is happening and it is stuck for a long time then you can go ahead and cancel it.
    But please be sure, as these kind of jobs can create problems if you cancel them in the middle of a job.
    Regards,
    Arminder Singh

Maybe you are looking for

  • How do I extract the name of the incoming file from the Header?ta

    Hi all, I am using 11g TP4: I have an File Adapter Service that reads a file. In the Routing Service I want to include the name of the file that was read in the message passed onwards to the target service. Previously we used an expression like <xsl:

  • How to handle double click on af:table ?

    ..... I use JDev 11g ....... I have an af:table I want when I double click on row in this table I execute a method in backing bean. ( I know there is a selectionListener in table but this for single click I want a method call only if I double click o

  • Downloading one months premiere pro

    Hello, I'm a very very horribly amatuer wannabe film maker. I don't know or (right now) care much for presets, codecs and all those fine details that I will learn later on in my career. I do however know how to use the editing software effectively an

  • See the details...

    Firefox 4 doesn't support my printer. How dumb is that? It's an HP4500, a pretty common one. I can't believe that a new version of Firefox suggests that I need to find a new printer driver -- what the hell have you done to your software. If I had pro

  • Can a6614f boot from PCIe x1 card?

    I've got an a6614f desktop PC. There are 4 SATA connections on the motherboard and they are all used up (2 optical drives, 2 HDDs). I've got an SSD coming and will be getting a PCIe x1 card to add more SATA ports. (PCIe x16 slot is being used by my G