Report program when run in background job getting cancelled immediately

Hi
When i run a program in foreground i am able to see the output. But when run in background not able to run the job successfully. The job is getting cancelled immediately.
I am using the below function module for output display. Should i need to pass any parameters in the below function module so that i can run the program in background  successfully.
  CALL METHOD DETAIL_GRID->SET_TABLE_FOR_FIRST_DISPLAY     
      EXPORTING                                            
        IS_LAYOUT         = IS_LAYOUT                    
        I_SAVE            = 'A'                        
        IS_VARIANT        = GS_VARIANT                   
      CHANGING                                           
        IT_FIELDCATALOG   = IT_FIELDCATALOG               
        IT_OUTTAB         = BLOCKED_STOCK_TAB_ALV[].     
Please suggest.
Thanks and regards
Rajani Yeluri

Hi Rajani.
  ALV require the DRYPOR(screen) for display but incase you run in back ground which have to write to spool but in spool we can only write in format of LIST REPORT not inter-active report like ALV. That why
system cancelled your process immediately.
Hope it helps.
Sayan.

Similar Messages

  • Getting the variant name when the report program is run in background

    Hi All,
    How to get the variant name for the report program when run in background? My requirement is to create an email attachement with the name 'variant.XLS', where variant = selection screen variant, when the report program is run in background. The system field SY-SLSET holds the variant name only when run online.
    Any pointers to this will be highly appreciated.
    Thanks and regards,
    Nilesh.

    Hello Nilesh,
    Please find the algo:
    1. Call the FM: GET_JOB_RUNTIME_INFO to get the background job details.
    2. Select data from TBTCP using these details:
    DATA:
    FP_EVENTID   TYPE BTCEVENTID
    FP_EVTPARM   TYPE BTCEVTPARM
    FP_ACTIVE    TYPE BTCXPGFLAG
    FP_JOBCNT    TYPE BTCJOBCNT
    FP_JOBNM     TYPE BTCJOB
    FP_STEPCNT   TYPE BTCSTEPCNT.
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
        IMPORTING
          EVENTID                 = FP_EVENTID
          EVENTPARM               = FP_EVTPARM
          EXTERNAL_PROGRAM_ACTIVE = FP_ACTIVE
          JOBCOUNT                = FP_JOBCNT
          JOBNAME                 = FP_JOBNM
          STEPCOUNT               = FP_STEPCNT
        EXCEPTIONS
          NO_RUNTIME_INFO         = 1
          OTHERS                  = 2.
      IF SY-SUBRC <> 0.
    *   Error calling FM: GET_JOB_RUNTIME_INFO
      ENDIF.
    DATA: FP_VARIANT TYPE BTCVARIANT.
      SELECT JOBNAME JOBCOUNT STEPCOUNT VARIANT
      FROM   TBTCP
      INTO TABLE L_IT_TBTCP
      WHERE  JOBNAME   = FP_JOBNM
      AND    JOBCOUNT  = FP_JOBCNT
      AND    STEPCOUNT = FP_STEPCNT.
      IF SY-SUBRC = 0.
        SORT L_IT_TBTCP BY JOBNM JOBCNT STEPCNT.
        READ TABLE L_IT_TBTCP INTO L_WA_TBTCP INDEX 1.
        IF SY-SUBRC = 0.
          FP_VARIANT = L_WA_TBTCP-VARIANT.
        ENDIF.
      ENDIF.
    Hope this helps.
    BR,
    Suhas

  • Background Job get Cancelled when executing the report. Reason?

    Hi All,
    I have scheduled a Back ground Job and executed Immediately.
    when checking transacion SM37 the job get canceled.
    How to find out the problem for the Job Cancellation.
    Regards,
    Viji

    hi
    After scheduling back ground job ( give a time laps of 2 min )
    then go to sm37 ( at this moment , the job is not yet started) .
    select ur job in sm 37 and when job starts processing , type JDBG as the command and press enter.
    Now it will go to the debugging screen, where u will find system program . Now set a break point at the stements used in ur program from the debugging screen itself.( menu - breakpoint- breakpoint at - statement ) and press F8 .
    Now you can start debug ur code.
    Revrt back if any issues.
    Regards,
    Naveen

  • ABAP program to run in Background job

    Hi,
    We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground).  Is it possible to convert it to something that can run thru background job?
    Please help.
    Thanks.

    Hi Deo ,
    Unfortunately cl_gui_frontend_services will not work in background.
    Please have a look at following information about cl_gui_frontend_services :
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
    Regards,
    Nikhil

  • Background job getting cancelled : Choose at least one scope of list

    Hello to all,
    I am trying to Run on Z report in background which conatins SUBMIT statement to standard progarm for MB5B .This report already programmed to call a report in background.It takes stocks for given period,I am taking the values using "import memory-id" statement.It gives an error log in SM37 as:
    Choose at least one scope of list
    Message no. M7829
    Can we call a submit stmt in a report that is to run in background?? or pls provide any alternative for this problem??
    Thnax & Regards
    Sonal

    Hi Sonal,
    1. This is happening because there are some checkboxes on the selection screen
       which are ticked by default when we run in fore ground
       and are blank when run in  background.
      Hence the system gives the error meaning to select atleast one of them.
    2. We can simulate this error in foreground also.
       There is one button on selection screen in the middle frame.
       "> Category"
       Just push it.
       Some checkboxes will appear now.
       Untick all of them and run the report. You will get the same error
    Choose at least one scope of list
    3. So while doing SUBMIT in the z report, you can pass the values of those checkboxes (which ever you require) as 'X'.
    eg.
    report abc.
    submit RM07MLBD
    with matnr = '3'
    with pa_wdzer = 'X'.
    4. The checkboxes field names are:
    PARAMETERS : pa_wdzer    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_wdzew    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_wdwiz    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_wdwuw    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_wdwew    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_ndzer    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    PARAMETERS : pa_ndsto    LIKE AM07M-MB5B_XONUL
                              modif id liu.
    regards,
    amit m.

  • Different result when running as background job

    Hi,
    We got a program which has a selection screen with a couple of select-options.
    When we start this programm with a specified variant, it proceeds to a result screen. If we click back now (to the selection-screen) and run the programm with the exactly same settings again, one select-option is getting ignored and therefore we get incorrect results.
    This happens only, if you go back from the result screen and  excecute it again from the selection screen or if we start it as a background job.
    If you exit the programm completely and restart it, the results are correct again.
    It makes no sense to post any code snippets here, since the program is very complex. I just can't imagine any reason, why the select-option is sometimes getting ignored.
    Does anyone have an idea?
    Thanks in advance.
    Regards,
    Tobi

    oh well it DOES explain it.
    just think of following select:
    Select *
    from   vbap
    into    ls_vbap
    where vbeln not in lr_vbeln.
    if lr_vbeln is not cleard you will run into problems maybe.
    anyway, may it be that somewhere in coding you are manually modifying your select option?
    It´s just an internal table of type range, so have a look there.

  • Force Dialog in ATP when run in Background Job

    Hi gurus,
    Can we set the ATP to always show even if in Background Job? I have a requirement to run a program in background job and set the confirmed qty to 0. In foreground the process is ok (the ATP screen shows up so my BDC is correct). But when I run the program in background, I have an error in my BDC because the screen for the ATP does not show up.
    Best regards,
    Andre
    Edited by: Andre Reforma on Jun 5, 2009 9:28 AM

    chdir("..") Err#13 EACCES [file_dac_search]
    I suspect that an underlying mount point has improper file access.
    Unmount the ZFS filesystem (either /zones or /zones/test) and check the perms on the directory that it's mounted on.
    Darren

  • Difference in runtime of a program when run in background vs foreground

    Hi,
    Is running the program in background would result to better performance in terms of speed compared to foreground? If yes, what's the reason behind.
    Thanks!

    Hi Advait,
    >
    Advait Gode wrote:
    > Yes, program does run faster in background process than running in foreground.
    sorry... an ABAP program will NOT run faster in background.
    As could be seen from your link:
    - a program in background does not have a timout limit
    - a program in background can use a different memory allocation sequence (depends on configuration)
      and may be able to allocate more memory than a foreground program (depends on configuration as well)
    but it will not run faster... .
    Kind regards,
    Hermann

  • Background job getting CANCELLED

    hello,
    i have  a background job scheduled for a report program.it is getting cancelled and giving the following error:
    "TABLE_ILLEGAL_STATEMENT"
    You attempted to change, delete or create a line in the       
    internal table "???", but no valid cursor exists              
    for the table.                                                
    Possible reasons:                                             
    1. The relevent ABAP/4 statement does not include the addition
       "...INDEX...", although the statement is not               
       inside a "LOOP...ENDLOOP" loop processing this table.      
    2. The relevent ABAP/4 statement was called from within a     
       "LOOP...ENDLOOP" loop after a DELETE "???".                                                                               
    what could be the reason?

    it is also giving following error message:
    Caution: Program has changed
    Caution: At time of termination,  Active source code no longer available  and after above two statements its giving sign "?" before every statement in below manner:
    024300 ?     lit_ekpo_dummy1[] = it_ekpo[].                     
    024310 ?     DELETE lit_ekpo_dummy1 WHERE ebeln NE tab1-ebeln.  
    024320 ?     DESCRIBE TABLE lit_ekpo_dummy1 LINES count01.      
    024330 ?                                                        
    024340 ?     REFRESH lit_ematn_dummy[].                         
    024350 ?     lit_ematn_dummy[] = lit_ematn[].

  • Background Jobs getting Cancelled

    Hi SRM Gurus
    we are working on SRM  4.0  and follow a classic scenarios.
    We have schedulled following background jobs
    1 BBP_GET_STATUS_2
    2 CLEAN_REQREQ_UP
    3 SMWP_BATCH
    Which were running successfully however from yesterday this all jobs are showing status cancelled.
    Can any one throw some light as to why this jobs are getting cancelled or how to check the reaons for the cancelling of jobs.
    regards,
    Nimish Sheth

    Hi Nimish,
    for how long where they running ?
    They might be cancelled because of time out (ex: R/3 system not available temporary).
    Do you have traces in SM21 in the same time fence ?
    Rgds
    Christophe

  • Wrapper program when run in background not generating SPOOL

    I have created Program A which calls internally Program B or C based on the condition. When I run the program B or C independently in Background it generates the spool on completion. But When I run the program A in Background, Spool is not getting generated.
    My requirement is that Spool should be generated when Program A is executed in Background.
    Below is the code of program A:
    PROGRAM A.
        IF p_cons = 'X'.
    *-->Detailed Details of Interim or Final Settlement
          SUBMIT B               WITH  p_vtnr   EQ p_vtnr
                                 WITH  p_setqty EQ p_setqty
                                 WITH  p_test   EQ p_test
                                 WITH  s_abrdat IN s_abrdat
                                 WITH  r2       EQ r2
                                 WITH  r1       EQ r1
                                 AND RETURN.
        ELSE.
    *-->Summary Details of Interim or Final Settlement
          SUBMIT C                   WITH  p_vtnr   EQ p_vtnr
                                     WITH  p_setqty EQ p_setqty
                                     WITH  p_test   EQ p_test
                                     WITH  s_abrdat IN s_abrdat
                                     WITH  r2       EQ r2
                                     WITH  r1       EQ r1
                                     AND RETURN.
        ENDIF.
    Please guide me on this.
    Regards,
    Naveen

    Hi Naveen,
    Check this
    Submit report to job
    submit ztest via job l_jobname
                                   number l_jobcount
                                  to sap-spool without spool dynpro
                                 spool parameters ls_params
                              and return.

  • Distribute System  - Error when run tcode DB13 - Job Log - Cancel

    i have two server and I installed SAP ERP 6.0 (Application ABAP) on two server base on Distribute System model
    Server A : I installed Global Host Preparation and Central Instance
    Server B : I installed Database Instance
    On server A, I exported /sapmnt, /usr/sap
    On server B, I mounted /samnt, /usr/sap from Server A
    Process Installation -> OK
    and finally , I logged in SAP through server A -> OK
    But when i run tcode DB13 to run Action Pad : Cleanup Logs, Check and Update Optimize Statistic ....etc -> Cancel
    -> with error in tab Job Log below
    20.01.2010     14:37:07     Job started
    20.01.2010     14:37:07     Step 001 started (program RSDBAJOB, variant &0000000000041, user ID BASIS)
    20.01.2010     14:37:07     No application server found on database host - rsh/gateway will be used
    20.01.2010     14:37:07     Execute logical command BRCONNECT On host sapree2
    20.01.2010     14:37:07     Parameters: -u / -jid CLNUP20100120143706 -c -f cleanup
    20.01.2010     14:37:29     SXPG_STEP_XPG_START: is_local_host: rc = 403
    20.01.2010     14:37:29     SXPG_STEP_XPG_START: host = sapree2
    20.01.2010     14:37:29     SXPG_STEP_XPG_START: is_local_r3_host: rc = 802
    20.01.2010     14:37:29     SXPG_STEP_XPG_START: RFC_TCPIP_CONNECTION_OPEN: rc = 1003
    20.01.2010     14:37:29     SXPG_STEP_COMMAND_START: SXPG_STEP_XPG_START returned: 1.003
    20.01.2010     14:37:29     SXPG_COMMAND_EXECUTE(LONG)
    20.01.2010     14:37:29     <timestamp> = 20100120143729
    20.01.2010     14:37:29     COMMANDNAME = BRCONNECT
    20.01.2010     14:37:29     ADDITIONAL_PARAMETERS = -u / -jid CLNUP20100120143706 -c -f cleanup
    20.01.2010     14:37:29     LONG_PARAMS
    20.01.2010     14:37:29     OPERATINGSYSTEM = ANYOS
    20.01.2010     14:37:29     TARGETSYSTEM = sapree2
    20.01.2010     14:37:29     DESTINATION
    20.01.2010     14:37:29     SY-SUBRC = 1003
    20.01.2010     14:37:29     SXPG_COMMAND_EXECUTE failed for BRCONNECT - Reason: program_start_error: For More Information, See SYS
    20.01.2010     14:37:29     Job cancelled after system exception ERROR_MESSAGE
    and then , I checked tcode SM59 -> TCP/IP Connection -> SAPXPG_DBDEST_SAPREE2 -> Test Connection -> not OK with error
    Logon     Connection Error
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: timeout during allocate
    Error Details     LOCATION: SAP-Gateway on host sapree1.reecorp.com / sapgw00
    Error Details     DETAIL: no connect of TP sapxpg from host sapree2.reecorp.com after 20 sec
    Error Details     COMPONENT: SAP-Gateway
    Error Details     COUNTER: 22
    Error Details     MODULE: gwr3cpic.c
    Error Details     LINE: 1973
    Error Details     RETURN CODE: 242
    Error Details     SUBRC: 0
    Error Details     RELEASE: 701
    Error Details     TIME: Wed Jan 20 14:42:39 2010
    Error Details     VERSION: 2
    thanks for your advice

    Hi,
    For installation you can refer the standalone gateway installation guide available under http://service.sap.com/instguides
    For operating the standalone gateway you can use the below link
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f13194b9b11d189750000e8322d00/content.htm
    Cheers.....,
    Raghu

  • Standard Background Job getting cancelled

    Hello Guru ,
    In my BI dev server one standard event periodic job is geting cancelled due to following reason
    Job Name : AP_CCMS_MONI_BATCH_STARTUP_DP
    Program:  RSAL_BATCH_TOOL_STARTUPDISP
    cancelled error
    No alerts in configuration range
    Internal error:
    Job cancelled after system exception ERROR_MESSAGE
    can anybody help me in this regards
    Regards
    Deepak

    Run the job once again and lets see what happens... sometimes system cancels the job....check in ST22 if there is short dump.
    Thanks....
    Shambhu

  • ALV List only 80 Columns when runinning as background job

    Hello Guys,
    I have a Problem with an ALV List.
    We use the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY for a Document Journal.
    When I run it in foreground it works fine. But when I view the spool in background the list makes a break at excactly 80 signs, but the line size should be about 120.
    In the report the Line-Size is set correctly, even the print parameters seem to be ok. We are running it with X_65_255.
    I saw that there are some SAP Notes to this topic, but on our release (SAP_BASIS 700) the notes are already implemented.
    Has anyone a solution to this topic?
    Thanks and regards
    Roland

    Try this.
    [ALV List only 80 Columns when running in background job|https://forums.sdn.sap.com/click.jspa?searchID=25735042&messageID=5686003]

  • SAP  Back ground Jobs getting cancel automatically

    Hi All,
    All schedule Background jobs getting cancel  automatically in ECC 5 server. Also not getting any job log in respective schedule job. please help me out with expert suggestions.
    Regards
    Gyan

    1)Are the bgd workprocess free in the system currently?Check if there are any long running jobs holding them.
    Bgd Work process are free but with error code 373,223,007 etc for all 5 bg wp
    error reports from work directory as per work process:---
    wp 22 :Fri Sep 25 15:07:04 2009

    A  ABAP/4 Program SAPLSYDB                                .
    A  Source LSYDBU27                                 Line 7.
    A  Error Code DBIF_DSQL2_DEFAULT_CR_ERROR.
    A  Module  $Id: //bas/640_REL/src/krn/runt/abexsql.c#5 $ SAP.
    A  Function DsqlErrorHandler Line 1986.
    A  COMMIT/ROLLBACK error on "DEFAULT" database connection..

    M  ***LOG R68=> ThIRollBack, roll back () [thxxhead.c   12289]
    C  Rollback Work (0)
    M  *** ERROR => ThCallHooks: event handler rsts_before_commit for event BEFORE_COMMIT failed [thxxtool3.c  252]
    B  ComRolHook(BEFORE_COMMIT, free_all) failed
    B  db_con_commit received an error return code in before-commit action
    M  ***LOG R38=> ThICommit3, db_commit98 ( 001024) [thxxhead.c   12036]
    WP23: Fri Sep 25 15:06:05 2009
    B  dbtran INFO (init_connection '<DEFAULT>' [MSSQL:640.00]):
    B   max_blocking_factor =  50,  max_in_blocking_factor      = 255,
    B   min_blocking_factor =   5,  min_in_blocking_factor      =  10,
    B   prefer_union_all    =   1,  prefer_union_for_select_all =   0,
    B   prefer_fix_blocking =   0,  prefer_in_itab_opt          =   0,
    B   convert AVG         =   1,  alias table FUPD            =   0,
    B   escape_as_literal   =   0,  opt GE LE to BETWEEN        =   0,
    B   select *            =0x00,  character encoding          = STD / []:X,
    B   use_hints           = abap->1, dbif->0x1, upto->0, rule_in->0,
    B                         rule_fae->0, concat_fae->0, concat_fae_or->0
    M  ***LOG R68=> ThIRollBack, roll back () [thxxhead.c   12289]
    C  Rollback Work (0)
    M  *** ERROR => ThCallHooks: event handler rsts_before_commit for event BEFORE_COMMIT failed [thxxtool3.c  252]
    B  ComRolHook(BEFORE_COMMIT, free_all) failed
    B  db_con_commit received an error return code in before-commit action
    M  ***LOG R38=> ThICommit3, db_commit98 ( 001024) [thxxhead.c   12036]
    wp 24:Fri Sep 25 14:33:10 2009
    M  *** ERROR => ThCallHooks: event handler rsts_before_commit for event BEFORE_COMMIT failed [thxxtool3.c  252]
    B  ComRolHook(BEFORE_COMMIT, free_all) failed
    B  db_con_commit received an error return code in before-commit action
    B  ***LOG BZY=> unexpected return code 32768      calling DBACDS     [dbacds#2 @ 1225] [dbacds  1225 ]

    *WP25: *** ERROR => BtcCleanUp: BtcLgAp-call failed (rc = 4) [btcjcntl.c   1308]*
    M  ThCallHooks: call hook >ITSP: EndOfSession< for event BEFORE_SESSION_CANCEL
    M  ThCallHooks: call hook >RtmClearSession< for event BEFORE_SESSION_CANCEL
    M  ThCallHooks: call hook >HttpClearSession< for event BEFORE_SESSION_CANCEL
    M  ThCallHooks: call hook >SpoolHandleHook< for event BEFORE_SESSION_CANCEL
    M  ***LOG R47=> ThResFree, delete (001009) [thxxmode.c   1284]
    M  ThCallHooks: call hook >ASTAT-collect commit handling< for event BEFORE_COMMIT
    M  ThCallHooks: call hook >rsts_before_commit< for event BEFORE_COMMIT
    M  ThCallHooks: call hook >rsts_after_commit< for event AFTER_COMMIT
    M  ThCallHooks: call hook >ThNoClearPrevErr< for event AFTER_COMMIT
    M  ThCallHooks: call hook >SpoolHandleHook< for event AFTER_COMMIT
    M  ThCallHooks: call hook >SAP-Trace buffer write< for event BEFORE_TASK_SWITCH
    M  ThCallHooks: call hook >ImcResetPtr< for event BEFORE_TASK_SWITCH
    M  ThCallHooks: call hook >DbgBeforeTaskSwitch< for event BEFORE_TASK_SWITCH
    M  ThCallHooks: call hook >HttpResetPtr< for event BEFORE_TASK_SWITCH

    B Fri Sep 25 14:47:04 2009
    B  Disconnected from connection con_da={R/3*WORKFLOWTRACE,26000006,1}
    please let me know where i can send log file if req.
    2)Check for the sm21/sm50 bgd wp traces.
    Getting so may Tem se management errors.
    Some TemSe objects are stored in files. To do this, a path name is set up from the TemSe object name. To be able to use this path, TemSe management requires a directory. It attempted to create it itself. However, this did not succeed.
    3)Check if the filesystem is full as you suggest no logs are being written.
    File system having free space
    4)Check if the user who has scheduled the job is locked ?
    user unlocked
    please help me to resolv this issue.
    thanks
    Gyan
    Edited by: Gyan Prakash on Oct 9, 2009 10:02 AM

Maybe you are looking for

  • Need to modify Sales order Item additional tab B

    Hello all, I need to modify Sales order item additional tab B ...by removing the exisitng fields and should add some new fields ....does it have any impact on this screen could be used in any of the other transaction .......i  just wanted if we remov

  • Reg file adapter with Synchronous

    Hi , i have sce like send IDOCs to File ,get back the response  to PI with CSV formate.it is possible to do without BPM. Thanks

  • MacBook can't get on the the Internet?

    My Wifi is working but I can't get Internet connection on my MacBook. I have rebooted five times but no success. My laptop was bought in 2009.

  • Outbound created with zero value against STO PO

    Hi experts, I have created an outbound delivery (VL10D) against STO PO. OBD has been created with zero value. in PGI correct accounting entry is getting generated. However, material price is maintained in STO PO. Please highlight the gaps, due to whi

  • Acebook contacts is not showing in new version

    in old version skype 7.3 facebook supports is enable but its disable in new versions Please fix this in new update..