Batch job with 2 conditions

Hi,
We have a program that will create a batch job and then we need to go to SM35 to run that batch job manually. We want to avoid this manual step and what we want to do is to as soon as our program runs it will create a batch job and then batch job should kick off automatically.
One of the solution that came to my mind is to schedule a batch job with two conditions:
1. in first condition it will run our main program
2. and in 2nd step it will look out for the batch job that created in SM35 and will kick off that, but I am not sure how can i do this using Sm36.
I was also wondering if there is another way so that we can just avoid the batch run for the second step?
So can you please help me with this.
Thanks,
Rajeev

SM35 -> batch sessions, so I assume you are talking about these.
You can start sessions under program control by submitting program RSBDCSUB after creation of the session.
Thomas

Similar Messages

  • Batch job with user name

    Hi,
    Is it possible to create a batch job with another user name using JOB_OPEN?
    and what is the use of JOB_GROUP option??
    Thx in advance.
    PRa

    use:
    CALL FUNCTION 'JOB_OPEN'...
    *--create Step
        SUBMIT RFBIBL00 AND RETURN
               USER SY-UNAME VIA JOB JOBNAME NUMBER JOBCOUNT
               WITH DS_NAME = FILE
               WITH CALLMODE = 'B'.
    greetings

  • Sftp batch job with password?

    Hi folks.
    We're trying to develop scripts to automate the transfer of files from various Windows machines to a Linux server.  Because the job involves moving multiple files to multiple directories, I wanted to use sftp's -B batchfile option to transfer the files instead of having to reauthenticate every time we transfer files to a different location.  However, the man page says:
    Batch mode. Reads commands from a file instead of standard input. Since this mode is intended for scripts, SFTP2 will not try to interact with the user, which means that only passwordless authentication methods will work.
    I would love to use keys to get this done but unfortunately, the type of authentication on the server is out of our control and not likely to change (it's straight password).  So, is there any way I can do this in batch mode with password authentication?  I thought about using scp but, as far as I can tell, it doesn't have great support for delivering multiple local files (in different locations) to multiple remote locations.  One would have to re-authenticate for every scp command, right?
    Any help would be appreciated.  Thanks.

    Thanks for the recommendation, Endperform, but after reading up on expect and autoexpect, I realized I'd rather not have usernames and passwords hard coded into the script.
    After much research, I think I've found a solution.  It's a little odd but the Maverick Ant library does exactly what I need it to do.  It can actually read an ssh profile, perform multiple transfers without having to re-authenticate and execute multiple remote commands without having to reauthenticate.  The native Ant libraries can't do this.  There is no sftp Ant task and the scp and sshexec tasks are lacking to say the least.
    If anyone else runs into a similar situation, I highly recommend the Maverick tool.

  • Creating batch job with 5 classes

    Hi All,
    I have a requirement in which I have to do five different operations at different time instances.
    1.Generate a report at morning 11.00 AM.
    2.update a table with more than 6000 rows at night 12.30 AM
    3.Generate a second report querying from the database at 10.00 AM Everyday.
    4.Generate an automail at 11.30 Am Everyday
    All these are plain Java classes and not web components. How could I effectively design the batch job so that it doesnot take nmuch memory and design classes so that they must be reusable like DB connection,Getting a db field value frequently etc.
    Can any one help me on this.

    http://www.google.com/search?q=job+schedule+in+java&client=netscape-pp&rls=com.netscape:en-US

  • Scheduling jobs with condition-after job programatically

    Hi,
    Could anybody please tell me how can we schedule jobs from programs(prgramatically) with condition-start after job(after a particular job completed) like we have the same option in sm36.
    Thanks,
    Rahul.

    Hello Rahul,
    Check the following Link Page Number 41.
    "Sample Program: Wait for Predecessor Job with
    JOB_CLOSE"
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBLIB/BCDWBLIB.pdf
    Regards,
    Abhishek Jolly

  • Query on batch jobs with overlapping time during execution time

    Dear experts,
    This post is related to a task in SAP SCM EM module and currently I am working on an archival activity that comprises of two tasks to be done through 2 different programs (scheduled through batch jobs)
    Job 1 is created to deactivate particular Event Handler records (changing a status field on the EH record)
    Job 2 (archival job) runs daily and writes deactivated EHs to a local file and subsequently deletes this from SAP server.
    Archival job takes an average of 30 hrs to complete .
    Therefore my query is on how to schedule Job1, as these seem to be dependent and might impact each other in unexpected manner.
    Please advise.
    Thanks & regards,
    Mohan

    Hi Mohan,
    You can try as Daniel suggested. Delay Archieving job or can run after deactivating Event Handler records job is finished. Check any parallel processing is available or not.
    It can stop your overlapping issue and can increase your performance.
    Thanks,
    Bala.

  • Batch jobs with status "active" but aren't really active

    We have 4 jobs that show up in SM37 with a status of "active", but they aren't really active.
    They are from 1998, and the client & server listed no longer exist. The PIDs listed do not exist on any servers.
    We have tried to cancel, delete, check status, nothing works.
    Is there some way to get rid of these jobs from the system?
    RSBTCDEL / RSBTCDEL2 will not work, because the jobs are active.
    Thank you.

    When I try to cancel the "active" job, I get message "Error occured determining batch work process information" (Message BT241).
    When I do a Check Status, it just says "1 jobs were checked and 0 jobs were corrected"
    When I try to delete, it says "Job xxxx is active. The selected function cannot be performed"
    We have jobs SAP_REORG_JOBS and SAP_REORG_JOBSTATISTIC running. I cannot find a standard job SAP_REORG_JOBSSTATUS mentioned in Yves reply. If this existst, can you tell me what program is being executed by the job?
    We shut down / restarted one of the systems that has some of the old jobs yesterday, and the problem still exists.
    We are at Basis release 702, SP 12.
    I will take a look at the BP_JOB* function modules

  • Batch determination with condition next inspection date is =10

    Hi,
    I want to configure the batch determination in such a way that if next inspection date is <=10 then the batch should not consider in the batch determination at the time of creation of process order, only those batchs should conside whose next inspection date is more 10 days.
    can anyone suggest ,any solution on this .
    Thanks
    HS

    Hi Shaymal & VRMP
    I have checked the system, the only problem I am facing is that the system does not show next inspection date dialog box at the time of UD where I can see the next inspection date being set by the system
    Say, I use QA07 (Triggered Manually) on 19.jan.08. The Next inspection date was 26.jan.08 and Initial Run in Days was 10 (days), the system created inspection lot on 19.jan.08 successfully. At the time of UD it automatically set 29.jan.08 as the next inspection date (i.e. 19.jan.08 + 10 days)  istead of 06. Feb.08 (i.e. 26.jan.08 + 10 days) without showing dialog box / suggesting next inspectino date. 
    regards
    Mobashir
    Edited by: Muhammad Mobashir on Jan 19, 2009 7:11 AM

  • How to get all AD User accounts, associated with any application/MSA/Batch Job running in a Local or Remote machine using Script (PowerShell)

    Dear Scripting Guys,
    I am working in an AD migration project (Migration from old legacy AD domains to single AD domain) and in the transition phase. Our infrastructure contains lots
    of Users, Servers and Workstations. Authentication is being done through AD only. Many UNIX and LINUX based box are being authenticated through AD bridge to AD. 
    We have lot of applications in our environment. Many applications are configured to use Managed Service Accounts. Many Workstations and servers are running batch
    jobs with AD user credentials. Many applications are using AD user accounts to carry out their processes. 
    We need to find out all those AD Users, which are configured as MSA, Which are configured for batch jobs and which are being used for different applications on
    our network (Need to find out for every machine on network).
    These identified AD Users will be migrated to the new Domain with top priority. I get stuck with this requirement and your support will be deeply appreciated.
    I hope a well designed PS script can achieve this. 
    Thanks in advance...
    Thanks & Regards Bedanta S Mishra

    Hey Satyajit,
    Thank you for your valuable reply. It is really a great notion to enable account logon audit and collect those events for the analysis. But you know it is also a tedious job when thousand of Users come in to picture. You can imagine how complex it will be
    for this analysis, where more than 200000 users getting logged in through AD. It is the fact that when a batch / MS or an application uses a Domain Users credential with successful process, automatically a successful logon event will be triggered in associated
    DC. But there are also too many users which are not part of these accounts like MSA/Batch jobs or not linked to any application. In that case we have to get through unwanted events. 
    Recently jrv, provided me a beautiful script to find out all MSA from a machine or from a list of machines in an AD environment. (Covers MSA part.)
    $Report= 'Audit_Report.html'
    $Computers= Get-ADComputer -Filter 'Enabled -eq $True' | Select -Expand Name
    $head=@'
    <title>Non-Standard Service Accounts</title>
    <style>
    BODY{background-color :#FFFFF}
    TABLE{Border-width:thin;border-style: solid;border-color:Black;border-collapse: collapse;}
    TH{border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color: ThreeDShadow}
    TD{border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color: Transparent}
    </style>
    $sections=@()
    foreach($computer in $Computers){
    $sections+=Get-WmiObject -ComputerName $Computer -class Win32_Service -ErrorAction SilentlyContinue |
    Select-Object -Property StartName,Name,DisplayName |
    ConvertTo-Html -PreContent "<H2>Non-Standard Service Accounts on '$Computer'</H2>" -Fragment
    $body=$sections | out-string
    ConvertTo-Html -Body $body -Head $head | Out-File $report
    Invoke-Item $report
    A script can be designed to get all scheduled back ground batch jobs in a machine, from which the author / the Owner of that scheduled job can be extracted. like below one...
    Function Get-ScheduledTasks
    Param
    [Alias("Computer","ComputerName")]
    [Parameter(Position=1,ValuefromPipeline=$true,ValuefromPipelineByPropertyName=$true)]
    [string[]]$Name = $env:COMPUTERNAME
    [switch]$RootOnly = $false
    Begin
    $tasks = @()
    $schedule = New-Object -ComObject "Schedule.Service"
    Process
    Function Get-Tasks
    Param($path)
    $out = @()
    $schedule.GetFolder($path).GetTasks(0) | % {
    $xml = [xml]$_.xml
    $out += New-Object psobject -Property @{
    "ComputerName" = $Computer
    "Name" = $_.Name
    "Path" = $_.Path
    "LastRunTime" = $_.LastRunTime
    "NextRunTime" = $_.NextRunTime
    "Actions" = ($xml.Task.Actions.Exec | % { "$($_.Command) $($_.Arguments)" }) -join "`n"
    "Triggers" = $(If($xml.task.triggers){ForEach($task in ($xml.task.triggers | gm | Where{$_.membertype -eq "Property"})){$xml.task.triggers.$($task.name)}})
    "Enabled" = $xml.task.settings.enabled
    "Author" = $xml.task.principals.Principal.UserID
    "Description" = $xml.task.registrationInfo.Description
    "LastTaskResult" = $_.LastTaskResult
    "RunAs" = $xml.task.principals.principal.userid
    If(!$RootOnly)
    $schedule.GetFolder($path).GetFolders(0) | % {
    $out += get-Tasks($_.Path)
    $out
    ForEach($Computer in $Name)
    If(Test-Connection $computer -count 1 -quiet)
    $schedule.connect($Computer)
    $tasks += Get-Tasks "\"
    Else
    Write-Error "Cannot connect to $Computer. Please check it's network connectivity."
    Break
    $tasks
    End
    [System.Runtime.Interopservices.Marshal]::ReleaseComObject($schedule) | Out-Null
    Remove-Variable schedule
    Get-ScheduledTasks -RootOnly | Format-Table -Wrap -Autosize -Property RunAs,ComputerName,Actions
    So I think, can a PS script be designed to get the report of all running applications which use domain accounts for their authentication to carry out their process. So from that result we can filter out the AD accounts being used for those
    applications. After that these three individual modules can be compacted in to a single script to provide the desired output as per the requirement in a single report.
    Thanks & Regards Bedanta S Mishra

  • Parallel process define for batch job

    Hi,
    I would like to run a batch job with a few processes run parallel together. May I know where can i define it ? T-code ?
    Regards
    Lauran

    Hi Lauren,
    First of all there is no transaction code as such.
    First of all the report that  needs to be run in background should enable you to do parrallel processing. For that code has to be written accordingly.
    Check this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm
    It gives details of function modules needed for this purpose.
    After this you need to create a variant for the report and schedule it to run in background using either SE38 (dirrectly) or by creating a job explicitily- SM36.
    A standard report that has parallel processing feature available is RBDAPP01.
    Also check transactions like BD18. They also make use of parallel processing.
    Regards.
    Ruchit.

  • Dynamic Variant -Current date  in selection screen - for batch jobs

    Hi Experts,
    My report runs in batch job with a variant, daily.
    One of the filed in selction screen should hv CURRENT DATE, with out providing as input explicitly by user.
    So, How Can I get it done?
    Its some thing with Dynamic variants + Selection Variables +  date selection, but, I forgot the navigation etc.
    pl. let me know
    thanq

    thanq.
    and pls. let me further clarify that,
    programitically am populating the date as current date minus 1 in the field of my_date in the selection screen.
    now, they wanna to run the report in back ground, daily.
    now, I followed ur tip/link and saved with_date_variant, fine.
    so, pls. let me know that,
    1) if the report runs in back ground tomorrow with with_date_variant(which is i created by seeing ur link), Is the selection screen my_date(prog. populates as June 5th) will be override with current date(i.e. June 6th)?
    In broad, Is the selection criteria wuld be over writes with the Dynamic varints?
    thanq

  • How to stop sending spool list of a particular step in a batch job to the Distribution list

    Hi  All
    I have a Batch job  with three steps ( Three programs) which will be sending Spool list for all the 3 steps to the assigned distribution list
    My user requirement is he want only the spool list for the 3rd step only (Exclude 1st and 2nd)

    Hi,
    you can consult your Basis consultant and also check few settings in T.code-SPAD

  • Siebel EDQ batch job performance

    Hi there,
    We are using Siebel Public Sector 8.2.2.4 with EDQ 11.1.1.7 version to clean up existing contact records and also set up real-time deduplication for ongoing contacts.  We didn't tune any parameters both from Siebel and EDQ side till now.
    We observed that the process is taking 45-50 minutes to process 6000 records. We noticed that the process is taking more time while inserting the records from Siebel to staging database.  The EDQ contact deduplication is just fine and it it taking around 8-14 minutes based on number of records to process.
    Is there a way we can tune anything from Siebel side to improve the performance while loading the data into staging database. May be Batch max number of records or number of DB connections or sessions etc to improve the performance?
    Also, can you suggest if we could run the jobs from Siebel ( by splitting into multiple batches) in parallel? I am not sure if this is an option as the parallel tasks uses the same sharing database and it might have an conflict.
    Please suggest.
    Regards
    Siva Sonti

    Hi,
    So to understand correctly, these are true batch jobs with the data being handed over using the staging tables.
    It seems like the problem here - which we have seen before - is the performance of the candidate selection query in Siebel for incremental batch jobs - the piece where the candidate records for the selected batch of records to match are selected. How long does a Full Batch job take to run (as this does not need to make this query)?
    Also, is this Siebel CRM or UCM? If UCM, you can use the 'UCM Batch' workflow which although it calls EDQ in real-time can be scaled using as many tasks in Siebel as the system can handle; customers have been able to load up to 9000 records/minute with this method.
    The nature of the shared staging database means it only supports a single job for data from a single business component (e.g. Contact) at any one time, as you suspected.
    If you are really 'loading records' into Siebel, you may be better of loading them using the EIM interface - perhaps with EDQ pre-matching the data and directly writing to the EIM tables.
    Regards,
    Mike

  • 2 alv-lists in one batch job

    How can I create 2 ALV-lists in one batch job
    with fm REUSE_ALV_LIST_DISPLAY ?
    kind regards
    Andreas

    Try this...
    * In SELECTION-SCREEN area, define type of email and recepient.
    PARAMETERS: p_email  TYPE somlreci1-receiver,   "Name of Shared Distribution List
                p_rectyp TYPE so_escape.    "Type C for Shared Distribution List
    * In body of program, call 1st alv grid, send the spool to the recepient, call 2nd alv grid, send the spool to the recepient.
        PERFORM 03display_data.
        PERFORM send_spool_2_user USING sy-spono.
        PERFORM 04display_data.
        PERFORM send_spool_2_user USING sy-spono.
    * Form to sent the spool to the recepient.
    FORM send_spool_2_user  USING    p_spono.
      spool_number = p_spono.
      IF sy-batch = x AND spool_number IS NOT INITIAL.
        IF p_email IS NOT INITIAL
        AND p_rectyp IS NOT INITIAL.
    *PARAMETERS: p_email  TYPE somlreci1-receiver DEFAULT 'ZDALLEN',
    *            p_rectyp type so_escape  DEFAULT 'C'.
          PERFORM set_spool_title_name.
          PERFORM build_txt_data_table.
          PERFORM populate_email_message_body.
    * Send file by email as .txt speadsheet
          PERFORM send_file_as_email_attachment
            TABLES it_message
                   it_attach
            USING p_email
                  v_spl_title                         "Title of Email
                  'ALI'                                             "File Format (ALI=List)
                  v_spl_name                  "File Name (Can't see how this is used)
                  v_spl_name                  "Description on Attachment max 12 characters
            CHANGING gd_error
                  gd_reciever.
    * Instructs mail send program for SAPCONNECT to send email(rsconn01)
          PERFORM initiate_mail_execute_program.
        ENDIF.
      ENDIF.
    ENDFORM.                    " send_spool_2_user
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    * Send email
    FORM send_file_as_email_attachment TABLES pit_message
    pit_attach
    USING p_email
    p_mtitle
    p_format
    p_filename
    p_attdescription
    p_sender_address
    p_sender_addres_type
    CHANGING p_error
    p_reciever.
      DATA: ld_error TYPE sy-subrc,
      ld_reciever TYPE sy-subrc,
      ld_mtitle LIKE sodocchgi1-obj_descr,
      ld_email LIKE somlreci1-receiver,
      ld_format TYPE so_obj_tp ,
      ld_attdescription TYPE so_obj_nam ,
      ld_attfilename TYPE so_obj_des ,
      ld_sender_address LIKE soextreci1-receiver,
      ld_sender_address_type LIKE soextreci1-adr_typ,
      ld_receiver LIKE sy-subrc.
      ld_email = p_email.
      ld_mtitle = p_mtitle.
      ld_format = p_format.
      ld_attdescription = p_attdescription.
      ld_attfilename = p_filename.
      ld_sender_address = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type = ld_format.
      t_packing_list-obj_descr = ld_attdescription.
      t_packing_list-obj_name = ld_attfilename.
      t_packing_list-doc_size = t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'C'.
      t_receivers-com_type = '   '.
      t_receivers-notif_del = ' '.
      t_receivers-notif_ndel = ' '.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = w_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = w_sent_all
        TABLES
          packing_list               = t_packing_list
          contents_bin               = t_attachment
          contents_txt               = it_message
          receivers                  = t_receivers
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
    * Populate zerror return code
      ld_error = sy-subrc.
    * Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    "SEND_FILE_AS_EMAIL_ATTACHMENT
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    * Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
      WITH output = 'X'
      AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    Edited by: Deborah Allen on May 11, 2010 12:36 AM

  • Invoice creation in batch jobas are not in sequence

    Hello ,
    I schedule two batch job with diffrent variant at the same time. When invoices are created in batch job there numbers are not in sequence. If I check creation time then Invoice creation time of Invoice  number 2 is latter than invoice creation time of number5.
    As per number range concept Invoice 2 should create before Invoice 5.
    Why this is happening?
    Regards
    RDC

    >
    > Thanks for the soon reply but here my legacy system is File it is having the fields like INV details and country key and customer details these details i want to send it to Target Ecc system based on the country .
    Use File Adapter in sender side to read the data from Legacy System ,if the legacy system data format not XML then use File content conversion in Sender comuniction channel to convert in to XML.
    > for exp: If the country is Us then create the vendor invoice in the Ecc system , if the country is IND then check whether the existed customer in the ECC system or not if Existed then those details update into one more legacy system .
    >
      You have to perfrom RFC Lookup in mapping level if the coiuntry is IND,anyway you are on PI7.11 so you can perform RFC llok to check the it is existed customer or not. search in sdn for RFC look up.
    Finally use enhanced Receiver determination to determin receiver.
    search in sdn you will get it hot to determine dthe receiver...everything..
    the requirement not complex..
    Regards,
    Raj

Maybe you are looking for