Submitting a updates in a prog to a background job

Hello everyone,
I am generating a alv report with production orders.In the toolbar i created a button for updating data.When i select some production orders in the alv list and select the button then transaction co02 is called and some updates are done.I done that the updating by using bdc recording and the updates are working fine.
But my problem is
1. when the user selects the updates button in the toolbar these updates should take place via. a background job.
2. Before submitting the background job the program needs to check if a version of a prog is running,the check should look for the prog name and the triggering user, if a match is found the user should receive a error message.
3. If a match is not found then the background job should be scheduled immediately and should be created with a name of prog name and the triggering user.
I need to these steps,can anyone please give me a sample code for this.
Thank you.
dp.

The approach I would probably take for this would be:
1. Write the records that need processing to a "Z" table from the ALV, and delete these back out (or mark as "done") once processed by the batch job.
2. It is possible to check for a batch job name and its status, but I've usually found an easier and more reliable way is to use a lock object to check this e.g. you could use and existing object such as ESRDIRE with a dummy lock argument such as 'CO02_IS_LOCKED' .  The batch job should contain code to set the enqueue... if this enqueue fails it means another job / program is already processing the requests so this instance can stop, otherwise the batch program can continue the CO02 processing.  In other words, you are creating a doorway through which only one instance of the job can pass at a time.
3. A couple of easy ways to do this are (a) event triggered jobs, wherein you define the job and have it fire up when an event is raised (e.g. by calling function BP_EVENT_RAISE) or (b) use the SIMPLE_BATCH_JOB_SUBMIT (which calls the JOB_OPEN, JOB_SUBMIT, JOB_CLOSE functions for you).
Jonathan

Similar Messages

  • Submitting a update in a porg to a background job?

    Hello everyone,
    I am generating a alv report with production orders.In the toolbar i created a button for updating data.When i select some production orders in the alv list and select the button then transaction co02 is called and some updates are done.I done that the updating by using bdc recording and the updates are working fine.
    But my problem is
    1. when the user selects the updates button in the toolbar these updates should take place via. a background job.
    2. Before submitting the background job the program needs to check if a version of a prog is running,the check should look for the prog name and the triggering user, if a match is found the user should receive a error message.
    3. If a match is not found then the background job should be scheduled immediately and should be created with a name of prog name and the triggering user.
    I need to these steps,can anyone please give me a sample code for this.
    Thank you.
    dp.

    The approach I would probably take for this would be:
    1. Write the records that need processing to a "Z" table from the ALV, and delete these back out (or mark as "done") once processed by the batch job.
    2. It is possible to check for a batch job name and its status, but I've usually found an easier and more reliable way is to use a lock object to check this e.g. you could use and existing object such as ESRDIRE with a dummy lock argument such as 'CO02_IS_LOCKED' .  The batch job should contain code to set the enqueue... if this enqueue fails it means another job / program is already processing the requests so this instance can stop, otherwise the batch program can continue the CO02 processing.  In other words, you are creating a doorway through which only one instance of the job can pass at a time.
    3. A couple of easy ways to do this are (a) event triggered jobs, wherein you define the job and have it fire up when an event is raised (e.g. by calling function BP_EVENT_RAISE) or (b) use the SIMPLE_BATCH_JOB_SUBMIT (which calls the JOB_OPEN, JOB_SUBMIT, JOB_CLOSE functions for you).
    Jonathan

  • Update table form local file as background Job

    Hi Expert,
         I have a requirement to update a database table through Text file in a background. I am trying to do through OPEN Database to upload the file to Application server and then triggerind a event for background job. please provide method to update the table in background job.
    Regards,
    Kapil.

    hi,
    if i have understood you can try this:
    1) create a custom event with transaction SM62.
    2) schedule the update job ( with the update program in its step )  trigging the event set in (1) .
    3) execute the program that upload the local file from presentation server to application server  .  The last istruction of this program has to be the call ot the custom event using BP_event raise fn module in the uplaoad is ok..
    4) if the event has been raised, the background job has been executed.
    Regards, luigi.

  • "Team Members have submitted x updates to the plan" message in Project 2013

    When opening a project in Project Pro 2007 and in 2010, and there were pending updates, a message pops up stating "Team members have submitted x updates to the plan. do you want to close this project and accept these updates". In 2013, this message
    doesn't always appear. Is this controlled by a setting or can something else influence this?
    Shimone Bezuidenhout

    From my experience in using Project Server 2013 this useful dialog box message does not seem to appear at all or at least I have not managed to provoke it despite processing status updates by a wide variety of ways.
    In my experience approving status updates and then opening the schedule does not result in the updates dialog box being displayed.
    In the Approval Centre the History for Status Updates includes a column showing the status and the ribbon includes a button that allows you to publish approved status updates. This was also available in 2010 but seems to be more "prominent" in
    the 2013 version.
    There are no changes in Time and Task Management settings within Server Settings to provoke this change in the user experience from the previous version of Project Server.
    I have taken a look at the "official" changes and enhancements to Project Server 2013 and there is no mention of the handling of Status Updates having been changed compared to previous versions.
    Perhaps others on this Forum can shed some light on this feature/experience.
    Dominic Moss | MAPM Microsoft Certified Technology Specialist | Our Newsletter:
    PM News Project Server Specialists
    Project Server PRIME | Twitter:
    @Twitter | Facebook:
    @Facebook | Linkedin:
    Wellingtone

  • Background job not updating data for some steps of program

    We have created a custom program and submitting the standard program RPRCCC_READ_KR1025
    which is used for conversion of AMEX credit card files.
    Since this program can update data for 1 company id at a time,we have created a background job
    for that program with 10 steps and 10 variants of data related to 10 different company codes.
    when this job is executed it is not updating data for all the 10 files , sometimes it updates 5,7,etc...
    If we execute the other files which didnt update in job manually they are getting updated.
    All the files executed with that program can be seen in PRTA transaction.
    Regards,
    Gautham.
    Edit: Solved.
    Since the standard program updates the database every time with commit work
    there should be some time until the next database update,so we can use wait command
    after the submit statement which will do the trick.
    Edited by: Gautham Vangaveti on Aug 5, 2010 7:20 PM

    Hi,
    I mean B(Sub Assembly)
    Item Rollup Flag
    A No
    --B                       Yes
    ---B1 No
    ---B2 No
    ---B3 No
    --C                      Yes
    In this case when we run cost rollup by giving item A, Oracle will consider below structure.
    A
    --C
    Regards,
    Sarvottam.

  • DYNPRO_SEND_IN_BACKGROUND when submitting a background job, when creating a

    Hi.
    We create sales orders via EDI.   When certain sales orders are created, we execute user exists on the Sales Order save.  During the User Exit, we submit/create (job_open_adk function, the submit command, and the job_close_adk function) a background job. 
    The background, is created and executed successfully, but we get 2
    short dumps everytime.
    The short dump is:
    DYNPRO_SEND_IN_BACKGROUND
    The description is:
    Screen output without connection to user.
    The short dump is for the user WF-BATCH.
    I've used DEBUG and the shortdump occurs on the submit command.
    submit zsd
    to sap-spool
    destination 'null'
    immediately ''
    keep in spool 'X'
    without spool dynpro
    and return
    user l_user via job tbtcjob-jobname
    number tbtcjob-jobcount
    with p_vbeln = l_order
    with p_ebeln = l_po
    with p_uname = l_user.
    Nothing should be displayed on the screen.
    I used 'without spool dynpro' to prevent the 'Print Screen List' window
    from appearing.
    I've put this code into a TEST program. I ran the test program
    myself. (under my ID) The program run perfectly. No
    shortdump.
    Similar code is used in other programs and it works perfectly - no shortdumps.
    The short dump occurs when we use ALE/EDI to create a sales order.
    The short dump has the ID WF-BATCH on it.
    I'm guessing the problem is with the WF-BATCH ID. Are printer setting
    missing on a Work Flow ID?
    Any ideas why the 'without spool dynpro' parameter doesn't work for the
    WF-BATCH ID?
    I've tried searching OSS and I looked at the on-line help/documentation
    on Submit. I saw a recommentation to use the
    fuction 'GET_PRINT_PARAMETERS' to set all of the print parameters. I
    tried this, but still got the short dumps.
    Any suggestion on how I can run the Submit command and not get a short dump?
    thanks,
    Michelle

    Hi,
    Try this notes:
    0100915 RSBDCREO: System hangs or parameters not effective
    0377038 HR-CA-ALE: DYNPRO_SEND_IN_BACKGROUND for HR doc. d
    0105165 Dump "DYNPRO_SEND_IN_BACKGROUND" in prog.SAPMSSY0
    0169303 Warning messages displayed for settlement mass pro
    0428489 VL10: Dump 'DYNPRO_SEND_IN_BACKGROUND' with backgr
    [[http://forums.sdn.sap.com/thread.jspa?threadID=14875|http://forums.sdn.sap.com/thread.jspa?threadID=14875]]
    Regards
    HM

  • Background job finishes but error Error While Updating Material into Standard SAP5678

    Dear
    we run background job which finishes successfully but when we sqw logs it shows
    Error While Updating Material into Standard SAP5678
    Kindly share the reasons
    Regards

    This is an ERP Upgrade space and you should consider raising threads in the right space for prompt replies. Next time consider using SAP NetWeaver Administrator space for issues like these. Also you should consider closing your previous thread with the correct answer for future reference.
    What I see is a custom job. You should check what the job does and also the trace file of the work process and the consult with the application team or the developer for more information. Unfortunately with that screenshot there is nothing much we can advice you.
    Regards
    RB

  • Name of Background job which updated daily Exchange Rates from R/3 to BW

    Hi All,
    Can anybody tell what is the name of Background job getting executed daily from R/3 to BW for updation of Exchange rates.
    Regards,
    C.V.

    Hi Serigo,
    How do I know status whether it has been schduled from R/3 to BW. Can we see job in sm37?
    Rgds,
    CV
    Message was edited by:
            C.V. P

  • Limit user from submitting a background job

    Hi,
    Is there a  parameter that would limit the user from submitting a background job?
    Regards,
    Raquel

    Read about Authorization object S_BTCH_JOB
    http://help.sap.com/saphelp_nw70/helpdata/en/86/f7f3393bef4604e10000000a11402f/content.htm
    Regards
    Juan

  • How to stop PO output when the indicators are updated with a prog. **URGENT

    Hi,
    I have developed a update prg which will update the Final invoice indicator and Goods reciept indicator in SRM as well as in R/3 only for 'ORDERED' PO's. This was done using BBP_PO_PD_UPDATE FM. Everything is working fine, all the indicators are getting updated as expected both in SRM and R/3.
    Only problem is that when the indicators are updated in SRM, PO Output is getting generated which should not happen.
    Do you have any idea how to stop the OUTPUT.
    This is very urgent.
    BR,
    Parvez.

    PO output
    PO Output problems
    disable PO output on po change in SRM

  • Submitted assignment updates not showing in Approvals

    Hi All,
    I have created a project, and put a bunch of tasks in that project which have all been assigned to resources.  The resources have now started updating those tasks.  Normally, I go to my "Approvals" page and accept the task updates if
    they are all ok.
    In this one instance, I have occidentally rejected the task updates.  In this case I have got the resource to resubmit those tasks, which triggers a notification email through saying that an assignment has been updated.  When I get these messages,
    I expect to be able to go to the approvals page and accept them.  In practice this does not happen.  I go to the approval page, and the task is not visible.
    Any ideas as to why this is the case?
    I'm running project 2013, which I don't think has been patched.

    If the project plan is checked out, then the application cannot process your request.
    Ensure the project is checked in.
    Open the Approvals -->History --> Status updates --> Ensure the rejected items are there with Published state
    Or you can delete that item if you don't want.
    Later open the tasks page, then just change the actual, save and submit for approval.
    Cheers. Happy troubleshooting !!! Sriram E - MSFT Enterprise Project Management

  • TS4009 since I updated my windows prog. to 8, all my contacts and Calendar have disappeared from outlook...?

    I downloaded a new version of Windows Outlook 8 - I can no longer access ICloud for  my Contacts, nor the Calendar from Outlook.

    solved problem, ran MS diagnostics on outlook which found and fixed one problem. Uninstalled iCloud and all associated files (calendar, contacts,) in Outlook (could not uninstall before problem was fixed - got an outlook error message). Reinstalled iCloud and synched contacts and calendars.  I'm back to where I was yesterday.

  • Submitting firmware update requests for the HAP-Z1ES?

    I was wondering if there is a link to where users can submit requests for future firmware upgrades.
    It would be great if in the Audio Settings menu of the HAP-Z1ES, there could be a feature that allows you to change the phase settings of the two d/a converts (from "normal" to "invertred", and vice versa).  Stereophile's latest issue reviews this player and mentions that the phase of the L/R channels is inverted.  
    This is something that you can changed via firmware, as the d/a chips in this unit have the feature of being software controlled and switching the phase is a feature of these chips.
    Thank you.
    Solved!
    Go to Solution.

    You can share your suggestion/s here. Thank you! 
    If my post answers your question, please mark it as "Accept as Solution"
    http://bit.ly/Win-4K

  • Problem in Submiting Background Job

    Hi,
    I am submitting a Program in Background  by using JOB_OPEN and SUBMIT Program and JOB_CLOSE.
    After submiting Job was terminated with following log.
    04/07/2009 11:34:05 Job started                                                                                00           516          S
    04/07/2009 11:34:05 Step 001 started (program YSDU_CUSTOMER_DUP_CHECK, variant &0000000000002, user ID JAGASEK)      00           550          S
    04/07/2009 11:34:05 Cannot perform frontend function in batch input mode                                             FES          002          E
    04/07/2009 11:34:05 Job cancelled after system exception ERROR_MESSAGE                                               00           564          A
    Please help me.
    Thanks,
    Sekhar.J

    Hi sekhar J,
    It looks to me like you may be calling a function from SFES (SAP FrontEnd Services) e.g. FM GUI_UPLOAD, these cannot be used in background mode for obvious reasons.  If the program is reading/writing a local file you will need to use a dataset on the application server instead.  If ths is the case there are plenty of posts cocerning datasets on sdn.
    Regards,
    Simon

  • Field not getting updated in BDC while running in background

    Hi Friends,
    I'm executing a BDC transaction to update the Alternate Tax Classification (VBAK_TAXK1) field in Sales Order. I'm passing value 1 to the field and then saving it directly. While running the BDC in background, the field is not getting updated. On the other hand i checked it running in foreground, the field got updated without any error message.
    Can anybody help me advicing why the field is not getting updated in background?
    Thanks,
    Bestin

    Hi ,
    Check the the log if you are using a session method and if call transaction then capture the messages for the same,
    Because in the foreground the BDC will update the records even if there is a warning message nut in background it will not update. So check the data which you are inserting and try avoid the warning messages also so that it can run smoothly in backfround.
    Thanks & Regards
    Jyo

Maybe you are looking for

  • Mail 2.1 re-downloads already downloaded POP mail!

    I recently installed Mac OS 10.4.9 on a new Mac Pro tower and my older 15" G4 Powerbook. The OS comes with Apple Mail 2.1. The problem I'm having is with Mail 2.1 regarding retrieving POP mail from the Yahoo server that has already been downloaded. S

  • Controlling a dynamic Table with a Checkbox (InstanceManager, moveInstance issue)

    Hello, I am having some problems in using InstanceManager (dynamic tables). I try to add and delete new rows by using checkboxes. If a checkbox gets clicked a new row, with a value given from the checkbox, appears. If a checkbox gets deactivated, the

  • Hey ADOBE admins am i correct...

    Okey Guys im so much in love with SPRY but day by day i find things .... Pls correct me if im wrong here Now what i wanted to do is the in the POST i did make a SOAP envelop and sent the data to a webservice and got the XML to a Sprydata set. ok... I

  • SMTP Protocol Returned a Permanent Error 553

    Hi all, i am facing this problem, From: [email protected] [SMTP:[email protected]] To: [email protected] Your message Subject: Yamaha Online e-shop product :Yamaha Clavinova CLP 120 with Bench was not delivered to: [email protected] because: Error tr

  • What the business workflow serves the purpose?

    Hi Guys, What the business workflow serves the purpose in SAP?Is its configuration is a part of functional or technical module Thanks Sur