Background job cancelled , where as working fine in foreground

Hi,
In selection screen , I have a to provide a file name and execute the program.
When I execute in foreground its working fine, but where are when I execute in background with variant it shows invalid file name and job cancelled in long text.
Please suggest me what would be the problem and possible solution.
Thanks,
Ameer

Hi Ameer,
Add the following condition for running the prgram in Background.
*****To upload file*********
IF sy-batch = 'X'.  "-----> If backgroung execution option is selected.
OPEN DATASET p_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.
WHILE sy-subrc = 0.
      READ DATASET p_filename INTO wa_struc.
      APPEND wa_struc TO itab_struc.
ENDWHILE.
CLOSE DATASET p_filename .
ENDIF.
*****To download file*********
IF sy-batch = 'X'.
   OPEN DATASET p_filename1 IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
   IF sy-subrc = 0.
    LOOP AT itab_struc INTO wa_struc.
      TRANSFER wa_struc TO p_filename1.
    ENDLOOP.
    CLOSE DATASET p_filename1.
  ENDIF.
ENDIF.
Hope this addresses your issue.
Regards,
Arnab

Similar Messages

  • In background job  how commit & rollback work works?

    Hello Friends,
         My requirement is, to fetch all sales order items based on some condition and load them into one table say OCC1 in job J1. Now the second requirement is to upload the job information J1 with job name, user name, end date in second table say OCC2 in job J2.
         My question is if there is some error I found while processing job 2 I have to rollback entire work which means I have to remove all records those I have inserted in to table OCC1. Can any one suggest me how to handle such problem? Some how I am able to create two job and update the tables. However, what about rollback work? Whether there is an implicit commit work after every background job? I am working on SAP 4.6C version.
    Thanks,
    Amol C.

    I think by using just ROLL BACK work it will not rollback your first job's data.
    You need to make some mechanism which can delete the data from OCC1 if the J2 got error.
    Regards,
    Naimesh Patel

  • Background job canceled in  Solution Manager system

    Dear all expert ,
    Two background jobs canceled in solution manager  system before some time.
    details-
    Background jobs :
                        1 -  LANDSCAPE FETCH
        Program name : RSGET_SMSY
    Job log : Job started
    Step 001 started (program RSGET_SMSY, variant ,
    The SLD server connection is inactive
    Job cancelled after system exception ERROR_MESSAGE
                       2 - SEND_SYSTEM_RELATIONSHIP_TO_SUP
        Program name : AI_SC_SEND_SYSTEM_RELATIONSHIP
    Job log :  
                       Job started
    Step 001 started (program AI_SC_SEND_SYSTEM_RELATIONSHIP, variant ,
    SOL determined as monitoring Solution Manager system
    SAP customer number unknown for installation number 0020606335
    Job cancelled after system exception ERROR_MESSAGE
    please help me , what should i do ?
    I am waiting for your positive response.
    Regards
    Shubh

    hi,
    You can try following ....
    For the job SEND_SYSTEM_RELATIONSHIP_TO_SUP
    Program : AI_SC_SEND_SYSTEM_RELATIONSHIP
    1. Up to Support Package 09:
    a) Start transaction SMSY.
    b) Choose Shft+F5.
    c) Select the system named in the message.
    d) Choose F6.
    e) Select the "System Data in SAP Support Portal" tab.
    f) Using the input help, fill the system number field with the correct system.
    g) Save the data.
    2. Up to and including Support Package 08:
    a) Start transaction SOLMAN_CONNECT.
    b) Select the system in question in the ID field and choose the filter pushbutton.
    c) Select the system and select "Create configuration".
    d) Fill the system number field using the input help with the correct system.
    e) For example, select the "BW GUI Connection" service type.
    f) Carry out all of the subsequent steps of the Configuration Assistant until you see the "Finish" pushbutton.
    This establishes a unique relationship between your system in the Solution Manager and the system number in the SAP Support Portal. Problems no longer occur with this system when the SEND_SYSTEM_RELATIONSHIP_TO_SUPP job is next run. However, the problem may still exist for other systems (in these cases, you should follow the same steps).
    Hope this will help to solve your issue..
    Regards
    Bhuban
    RKFL

  • BDC for ME22N not working in background but working fine in foreground

    Hi guys,
    I have done a BDC recording for ME22N.
    Its working fine in foreground but failing in background.
    Can anyone sugesst a solution.
    Thanks!

    There is a note on this subject, BDC with control may (and of course will) not perform correctly in background, they need the Sapgui) [Note 381630 - Batch input for Enjoy transaction in MM not possible|https://service.sap.com/sap/support/notes/381630]
    You may need to use the old ME22 transaction or BAPI like BAPI_PO_CHANGE [Note 217437 - ME21N/ME51N: Batch input and CATT not possible|https://service.sap.com/sap/support/notes/217437]
    Regards
    Regards

  • SAP_COLLECTOR_FOR_PERFMONITOR background job cancelled in SM37

    Dear all ,
    One of the scheduled background job has been  cancelled .
    Kindly check the below loga and Background job details .
    Job name        SAP_COLLECTOR_FOR_PERFMONITOR
    Job class       C
    Status          Canceled
    (ABAP Program
    Name           RSCOLL00
    Variant
    Language       EN)
    Job Log :
    30.05.2010 06:20:32 Job started
    30.05.2010 06:20:32 Step 001 started (program RSCOLL00, variant , user ID DDIC)
    30.05.2010 06:20:37 Clean_Plan:Cleanup of DB13 Plannings
    30.05.2010 06:20:37 Clean_Plan:started by RSDBPREV                       on server PRDCIXI
    30.05.2010 06:20:38 Clean_Plan:Cleaning up jobs of system IRP
    30.05.2010 06:20:39 Clean_Plan:finished
    30.05.2010 06:20:43 ABAP/4 processor: DBIF_RTAB_SQL_ERROR
    30.05.2010 06:20:43 Job cancelled
    Kindly suggest

    Dear all ,
    Kindly check the ST22 error logs .
    Short text SQL error occurred in the database when accessing a table. What happened? The database system detected a deadlock and avoided it by rolling back your transaction. What can you do? If possible (and necessary), repeat the last database transaction in the hope that locking the object will not result in another deadlock. Note which actions and input led to the error. For further help in handling the problem, contact your SAP administrator . You can use the ABAP dump analysis transaction ST22 to view and manage termination messages, in particular for long term reference. Error analysis The database system recognized that your last operation on the database would have led to a deadlock. Therefore, your transaction was rolled back to avoid this. ORACLE always terminates any transaction that would result in deadlock. The other transactions involved in this potential deadlock are not affected by the termination. Last error logged in SAP kernel Component............ "SAP-Gateway" Place................ "SAP-Gateway on host PRDCIXI / sapgw01" Version.............. 2 Error code........... 679 Error text........... "program prodoradb.sapccmsr.99 not registered" Description.......... "TP prodoradb.sapccmsr.99 not registered" How to correct the error Database error text........: "ORA-00060: deadlock detected while waiting for resource" Internal call code.........: "[RTAB/UPD /MONI ]" Please check the entries in the system log (Transaction SM21). If the error occures in a non-modified SAP program, you may be able to find an interim solution in an SAP Note. If you have access to SAP Notes, carry out a search with the following keywords: "DBIF_RTAB_SQL_ERROR" " " "RSHOST3M" or "RSHOST3M" "PUT_LOGBOOK" If you cannot solve the problem yourself and want to send an error notification to SAP, include the following information: 1. The description of the current problem (short dump) To save the description, choose "System->List->Save->Local File (Unconverted)". 2. Corresponding system log Display the system log by calling transaction SM21. Restrict the time interval to 10 minutes before and five minutes after the short dump. Then choose "System->List->Save->Local File (Unconverted)". 3. If the problem occurs in a problem of your own or a modified SAP System call.......... " " Module............... "gwr3cpic.c" Line................. 1835 The error reported by the operating system is: Error number..... " " Error text....... " "
    for detail log.
    System environment
    SAP-Release 700
    Application server... "PRDCIXI"
    Network address...... "10.54.145.32"
    Operating system..... "AIX"
    Release.............. "5.3"
    Hardware type........ "000184CAD400"
    Character length.... 16 Bits
    Pointer length....... 64 Bits
    Work process number.. 8
    Shortdump setting.... "full"
    Database server... "PRODORADB"
    Database type..... "ORACLE"
    Database name..... "IRP"
    Database user ID.. "SAPSR3"
    Terminal................. " "
    Char.set.... "C"
    SAP kernel....... 700
    created (date)... "Mar 7 2010 21:00:49"
    create on........ "AIX 2 5 005DD9CD4C00"
    Database version. "OCI_102 (10.2.0.2.0) "
    Patch level. 246
    Patch text.. " "
    Database............. "ORACLE 10.1.0.., ORACLE 10.2.0.., ORACLE 11.2...*"
    SAP database version. 700
    Operating system..... "AIX 1 5, AIX 2 5, AIX 3 5, AIX 1 6"
    Memory consumption
    Roll.... 1217248
    EM...... 0
    Heap.... 0
    Page.... 32768
    MM Used. 1050520
    MM Free. 146024
    and Transaction
    Client.............. 000
    User................ "DDIC"
    Language key........ "E"
    Transaction......... " "
    Transactions ID..... "4BFF227871E00187E10080000A369120"
    In the source code you have the termination point in line 521
    of the (Include) program "RSHOST3M".
    The program "RSHOST3M" was started as a background job.
    Job Name....... "SAP_COLLECTOR_FOR_PERFMONITOR"
    Job Initiator.. "DDIC"
    Job Number..... 02033500
    In the source code you have the termination point in line 521
    of the (Include) program "RSHOST3M".
    The program "RSHOST3M" was started as a background job.
    Job Name....... "SAP_COLLECTOR_FOR_PERFMONITOR"
    Job Initiator.. "DDIC"
    Job Number..... 02033500
    Program............. "RSHOST3M"
    Screen.............. "SAPMSSY0 1000"
    Screen line......... 6
    rmation on where terminated
    Termination occurred in the ABAP program "RSHOST3M" - in "PUT_LOGBOOK".
    The main program was "RSHOST3M ".

  • Custom Background Job Cancelling

    Hi Folks,
    I'm working on a custom development and I'm experiencing some trouble - I would greatly appreciate any help / effort from anyone in providing me with some ideas as to what the cause may be.
    Basically my development is made up of two parts - Part 1) A custom RFC used to trigger a custom program in the background - here i'm using job_open / submit program / job_close. This works fine and a job is successfully created to run the custom program
    Part 2) - The custom program, running in the background job tries to create a background job  to trigger standard program (f.05) with a variant. Again using job_open / submit program / job_close. However on this occassion when the second background job starts it cancels immediately -  stating "Make an entry in all required fields". . However the variant is fine and all the parameters for the standard program are filled. I can even trigger this program and variant seperately and it works.
    Are there conflicts in creating a background job from a background job ? I'm confused as to why this is not working and i would appreciate any help or ideas anyone could give me on this.
    Thanks alot for your time.
    Regards
    DK
    Overview
    RFC -> Create Background Job # 1 -> Background Job # 1 created successfully - Custom program running in Background Job # 1 tries to run standard program in backgroun - Background Job # 2 created successfully but immediately cancels - Job log message - "Make an entry in all required fields". Job cancelled after system exception ERROR_MESSAGE.

    Hi Guys,
    Thanks for your answers. The job log does say "Make an entry in all required fields" - but all the required fields are specified under the variant. I can even run this program with the same variant with no problems. I'm wondering what would affect the submit to program to prevent it passing the variant correctly - here is my submit
        SUBMIT sapf100 VIA JOB l_jobnam NUMBER l_jobcnt
        USING SELECTION-SET l_vari
        AND RETURN.
    l_vari = Variant Name
    l_jobname = job name
    l_jobcnt  = job count
    here is the message from the job log. your help is appreciated - thanks
    10.09.2009 14:22:18 Job started                                                             
    10.09.2009 14:22:18 Step 001 started (program SAPF100, variant &0000000000018, user ID XXXX)
    10.09.2009 14:22:18 Make an entry in all required fields                                    
    10.09.2009 14:22:18 Job cancelled after system exception ERROR_MESSAGE

  • BWREMOTE background job canceled in sap r/3 system

    Hi my friends,
    Thanks for your help ahead.
    Today I checked the background job in SAP R/3 created by BWREMOTE via SM37. It showed me some jobs had been canceled.
    I displayed its log, the detail message is:
    ==========================================
    Step 001 started (program SBIE0001, variant &0000000083494, user name BWREMOTE)
    DATASOURCE = ZQM_NOT_SHFGRP
    Call up of customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 1,593 records
    Result of customer enhancement: 1,593 records
    Call up of customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 1,593 records
    ABAP/4 processor: SAPSQL_INVALID_FIELDNAME
    Job cancelled
    ==========================================
    Then I displayed the "Long Text" of the job log. It is
    One of the field names in the SELECT clause was not recognized.
    Error analysis
    The SELECT clause was specified in an internal table at runtime.
    It contains the field name "TPR00", but this does not occur in any of
    the database tables listed in the FROM clause.
    Information on where termination occurred
    The termination occurred in the ABAP/4 program "SAPLXRSA " in
    "EXIT_SAPLRSAP_001".
    The main program was "SBIE0001 ".
    Source code extract
    008840 concatenate 'TPR'
    008850 day_temp+6(2)
    008860 ' = '
    008870 ' ''' zshift '''' into
    008880 cond .
    008890 append cond to itab .
    008900 select schkz into i_not_shfgrp-zzschkz from t552a
    008910 where zeity = '2'
    008920 and mofid = 'CN'
    008930 and mosid = '28'
    008940 and ( schkz = 'SFTA' or
    008950 schkz = 'SFTB' or
    008960 schkz = 'SFTC' or
    008970 schkz = 'SFTD' )
    008980 and kjahr = day_temp+0(4)
    008990 and monat = day_temp+4(2)
    > and (itab) .
    009010 endselect.
    I guess that there is not a field named TPR00 in table t552a.
    Next, I opened the 'project management of sap enhancement' via CMOD, entering the project name and chosing 'Display'.
    Then Double click the Components 'EXIT_SAPLRSAP_001', we can see the function module 'EXIT_SAPLRSAP_001'. In the source codes, there is an include program, it is 'INCLUDE ZXRSAU01.'.
    Then, I double clicked the Include program and find the position program terminated. The source codes are:
    ZQM_NOT_SHFGRP *
    when 'ZQM_NOT_SHFGRP'.
    loop at c_t_data into i_not_shfgrp .
    l_tabix = sy-tabix .
    clear :mbatch ,zshift,cond ,zfield, zcharg, day_temp .
    refresh itab.
    if i_not_shfgrp-ausvn is initial.
    else.
    aa = '080000'.
    bb = '160000'.
    cc = '235959'.
    day_temp = i_not_shfgrp-ausvn.
    if i_not_shfgrp-auztv ge aa and
    i_not_shfgrp-auztv lt bb .
    zshift = 'MSHF' .
    elseif i_not_shfgrp-auztv ge bb and
    i_not_shfgrp-auztv le cc .
    zshift = 'LSHF'.
    else .
    zshift = 'NSHF'.
    day_temp = i_not_shfgrp-ausvn - 1.
    endif.
    concatenate 'TPR'
    day_temp+6(2)
    ' = '
    ' ''' zshift '''' into
    cond .
    append cond to itab .
    select schkz into i_not_shfgrp-zzschkz from t552a
    where zeity = '2'
    and mofid = 'CN'
    and mosid = '28'
    and ( schkz = 'SFTA' or
    schkz = 'SFTB' or
    schkz = 'SFTC' or
    schkz = 'SFTD' )
    and kjahr = day_temp+0(4)
    and monat = day_temp+4(2)
    and (itab) .
    endselect.
    endif.
    I found that we got a TPR00 during concatenation. In other words, day_temp+6(2) = 00. But I think it is impossible. I can not explain this.
    Any ideas, my friends. Many thanks.

    select schkz into i_not_shfgrp-zzschkz from t552a
    where zeity = '2'
    and mofid = 'CN'
    and mosid = '28'
    and ( schkz = 'SFTA' or
    schkz = 'SFTB' or
    schkz = 'SFTC' or
    schkz = 'SFTD' )
    and kjahr = day_temp+0(4)
    and monat = day_temp+4(2)
    <b>and (itab) .</b>  => doesn't make sense?!
    endselect.
    endif.
    it seems something got deleted between 'and' and '(itab)'... so, you'll have to recheck the requirements for your select to fill the 'and' statement further.
    so, it should look like
    and monat = day_temp+4(2)
    and <b><some kind of condition that needs to be fulfilled></b>.
    endselect.
    <b><some logic to fill a line in your internal table></b>.
    append cond to itab.
    endif.
    obviously <some kind of condition that needs to be fulfilled> needs to be replaced by a real condition
    and <some logic to fill a line in your internal table> needs to be replaced by some kind of formula
    I assume something like (otherwise it would be really weird to select that field):
    cond = i_not_shfgrp-zzschkz.
    or a formula using the i_not_shfgrp-zzschkz field.
    It would also be a lot better to replace your select ... endselect by a select single as you'll be selecting 1 record only anyways.
    Message was edited by:
            RafB

  • Notification upon Background Job Cancellation

    Hi All,
    We would like to send a notification to responsible person upon CANCELLATION of background job for various reasons.
    What would be the best way to do it?
    I tried to various events of business objects BPJOB/BPJOB_SMAN, with no sucess.
    Will appreciate any guidance in this regard.
    Thanks in Advance.
    Regards,
    Lakshmi Narayana

    HI ,
    You create one Z- Report and Write the following logic in it :-
    1. Give a Job Name as selection selection parameter on the selection screen.
    2. Select all those records from the Table TBTCO where JOBNAME = selection screen job name and SDLSTRTDT - sy-datum and STATUS = 'A'.
       This will return you with all those jobs which were scheduled and canceled on current date. Status 'A' Means Canceled jobs.
    3. Now you use FM 'EFG_GEN_SEND_EMAIL' to send a notification to the required user as per your requirement.
    4. Now Enter all the JOb name which you want to monitor and save one varient for it
    5. Now go to SM36 and Schedule this Z-Report with the created variant and the frequency you want.
    This will Satisfy your requirement.
    Please check and Revert.
    Regards,
    Nikhil Joshi

  • BDC is not working in background mode and working fine in Foreground mode

    Hi Experts,
    I have created a BDC in SHDB for the transaction code:CWBQM for creating and deleting the record and converted the BDC recording into the program using call transaction. It is working fine in both foreground and background. When I given the same program for users testing one for the user was able to delete the records but Creation is not working in the same BDC. He is able to create the same records in another PC and the problem is only in that PC and only during the creation of the record. When I change the mode to 'A' mode for testing and request the user to execute and it is working fine the records created successfully. What could be the issue ?
    Thanks,
    Hema

    Hello,
    While recording BDC in SHDB try setting "Simulate background mode" flag and give a try.
    Cheers,
    Nag

  • Background Job cancelling with error Data does not match the job definition

    Dear Team,
    Background Job is getting cancelled when I run a Job on periodically but the same Job is executing perfectly when I run it manually(repeat scheduling) .
    Let me describe the problem clearly.
    We have a program which picks up files from an FTP server and posts the documents into SAP. We are scheduling this program as a background Job daily. This Job is running perfectly if the files contain no data. But if the file contains data the JOb is getting cancelled with the following messages.
    And also the same Job is getting executed perfectly when repeat scheduling is done ( even for files with data).
    Time     Message text                                                                       Message class Message no. Message type
    03:46:08 Job PREPAID_OCT_APPS2_11: Data does not match the job definition; job terminated        BD           078          E
    03:46:08 Job cancelled after system exception ERROR_MESSAGE                                      00           564          A
    Please help me in resolving this issue.
    Thanks in advance,
    Sai.

    hi,
    If you have any GUI function modules used in the program of job
    you cannot run it in background mode.

  • Background Job Hanged but no work process assigned

    Hi,
    Background job has hanged When i see in SM37. But no work process assigned to this job. All work process are waiting status.
    What could be the reason. What is the resolution process.
    Thanks,
    Dayakar

    How did you come to a conclusion that the bg job is hangend.
    What is the status of the job. ? I guess  Job defined, but not yet eligible to run even if the start condition has been fulfilled so it should be in Scheduled status.

  • Background job cancelled due to user validation expired

    Hi Experts,
    One background job is cancelled due to user (owner of the job) validation has been expired. This job is executing for every 1 Hr.
    I don't want to change the user id validation at this movement.but i want to change the owner of the job.
    Please let me know how can change the owner of this background job.
    Regards,
    Reddy V.

    Hi kaushal,
    Thank you for your valuable information.
    I Followed the same below mentioned steps.i.e  I changed the user name and after this i deleted this job from old user. But now this job is not executable with new user id.
    i.e In SM37 T.code > Entered the job name and New user name>Selected all job status but it showing below message
    No job matches the selection critera.
    Please let me know how can i execute the same jod with new user id.
    Regards,
    Reddy V

  • Suddenly, I am unable to add photos to my project in Imovie 11. I have an IMac Snow Leopard 10.6.8 and have made several movies where this worked fine but for some reason, it has quit. Everything seems to be working fine except that?

    I'm an oldtimer and have had this Mac for less than 2 yrs and have LOTS to learn - but I've climbed the curve a little.  !'ve made several movies and published to YouTube and burned to disc using IDVD with reasonably good results. Each time I have added stills to my movies it has worked fine - but tonight, I'm suddenly unable to add them. I click "Photos" -     select my photo - left click the photo and drag into the project while holding the click. Have the green "+" and the green highlight and even get the green vertical bar in the project but when I release the click, the photo simply disappears!  One "clue" here may be this:  I was able to add one still to this project and the only diff between it and the other still thumbnails now is that there is a "green check mark" on the thumbnail of the one successfully added.  Any suggestions?  (I do have the "advanced tools" option selected in IMovie Preferences.)
    Thank you so much for any help at all.
    Sam

    Hi
    My first thoughts are
    • iMovie ill behaving - Trash the iMovie pref file - use to set things right
    • in reg. to Photos - Did You change iPhoto Photo Library - Then iMovie get's lost as it peeks into iPhoto on start up to see where photos are stored. Set iPhoto back to first Photo Library (when iMovie is not running) then start iMovie.
    Yours Bengt W

  • Why Background job cancelled ?

    Hi Experts,
    I developed a report for execution that is taking too much time so i kept it in background job using SM37,
    but it is getting canceled with in an half an hour am not getting why it is canceled.
    so plz assist me to know the reason.
    thanks and regards
    Jani

    Check the Transaction ST22 for dumps.
    Check the Transaction SM21 - for system logs. and also check the connectivity.
    Contact you basis team to check in to the issue to get the root cause.

  • Background Job cancellation-Alert config in Solman

    Team,
    We would like to send an alert to the distribution list or the user whenever a particular background job is getting cancelled.
    Could you please let me know the steps how it can be done in solution manager.
    Regds,
    Satyanarayana N

    Hello,
    I recommend to setup the Job Monitoring of Business Process Montoring from a Job Documentation. The alerts can either generate notifications (E-Mail, SMS) or workflow documents (messages in Support Desk).
    This is demonstrated in a RKT tutorial:
    http://service.sap.com/~sapidb/011000358700001911422008E.sim
    The process is also documented:
    http://help.sap.com/saphelp_smehp1/helpdata/en/8e/3ad6f807e147669036d2a6aed597aa/frameset.htm
    Please also visit our Service Markteplace representation: http://service.sap.com/jsm
    Kind regards,
    Martin

Maybe you are looking for