Skip to Content

Problem Submit Via Job in BADI

Hello All

I am using SUBMIT VIA JOB in BADI "work order update" and but no job is created....also sy-subrc is 0.

Here is the code

call function 'JOB_OPEN'

exporting

jobname = name

importing

jobcount = number

exceptions

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

others = 4.

if sy-subrc = 0.

submit z_idoc_create_process_order and return

via job name number number

with p_aufnr = it_header1-aufnr

with p_werks = it_header1-werks

with p_autyp = c_autyp

with p_auart = it_header1-auart

with p_dispo = it_header1-dispo

with p_opt = c_opt

with p_mestyp = c_mestyp.

if sy-subrc = 0.

call function 'JOB_CLOSE'

exporting

jobcount = number

jobname = name

strtimmed = 'X'

exceptions

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

others = 8.

if sy-subrc <> 0.

endif.

Any reason why job is not created?

Thanks in advance.

regads

VInit

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 08, 2012 at 03:22 PM

    Hi Vinit

    this might be helpful to you :

    <link to blocked site removed by moderator>

    Have just discovered this myself in relation similar issue, but haven't used yet.

    This may help tell you status of Job and give you more info:

    CALL FUNCTION 'SHOW_JOBSTATE'

    EXPORTING

    jobcount = v_jobcount

    jobname = v_jobnam

    • IMPORTING

    • ABORTED =

    • FINISHED =

    • PRELIMINARY =

    • READY =

    • running =

    • SCHEDULED =

    EXCEPTIONS

    jobcount_missing = 1

    jobname_missing = 2

    job_notex = 3

    OTHERS = 4.

    Regards,

    David

    Edited by: Thomas Zloch on Feb 9, 2012 10:59 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi guys,

      I tried this

      SUBMIT z_idoc_create_process_order USER creator using selection-set lv_variant TO SAP-SPOOL

      SPOOL PARAMETERS print_parameters

      WITHOUT SPOOL DYNPRO

      WITH p_aufnr EQ it_header1-aufnr

      WITH p_werks EQ it_header1-werks

      WITH p_autyp EQ c_autyp

      WITH p_auart EQ it_header1-auart

      WITH p_dispo EQ it_header1-dispo

      WITH p_opt EQ c_opt

      WITH p_mestyp EQ c_mestyp

      VIA JOB name NUMBER number

      AND RETURN.

      Now the job is getting created but my Variant has no values

      How to pass values to variant? below values are not getting tranferred.

      WITH p_aufnr EQ it_header1-aufnr

      WITH p_werks EQ it_header1-werks

      WITH p_autyp EQ c_autyp

      WITH p_auart EQ it_header1-auart

      WITH p_dispo EQ it_header1-dispo

      WITH p_opt EQ c_opt

      WITH p_mestyp EQ c_mestyp

  • Posted on Feb 09, 2012 at 07:27 PM

    I solved it..was strange AUTH issue.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.