Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SUBMIT statement doesnt work

Former Member
0 Likes
1,429

hi

I want to execute program RIMODGEN ( CFM1 transaction ) with some values filled in MA_MATNR

But this program is not able to execute the program with SUBMIT statement and return & close the job, please tell me whats the problem with this....

Points for all helpful answers


* Job open
  call function 'JOB_OPEN'
       exporting
            delanfrep        = ' '
            jobgroup         = ' '
            jobname          = jobname
            sdlstrtdt        = sy-datum
            sdlstrttm        = sy-uzeit
       importing
            jobcount         = jobcount
       exceptions
            cant_create_job  = 01
            invalid_job_data = 02
            jobname_missing  = 03.
  if sy-subrc ne 0.
                                       "error processing
  endif.

* Insert process into job
 
* CALL TRANSACTION 
 
 SUBMIT cfm1  with MA_MATNR in MA_MATNR
                  WITH I_MODID  = 'TEST_RAJ'
                  WITH I_LOGSYS = 'D41030'
                  with I_APPL   = 'TEST_RAJ'
                  user sy-uname
                  via job jobname
                  number jobcount
                  and RETURN.
  if sy-subrc > 0.
      message e200(zz) with 'RIMODGEN call failed'. "error processing
  endif.

* Close job
  starttime-sdlstrtdt = sy-datum + 1.
  starttime-sdlstrttm = '220000'.
  call function 'JOB_CLOSE'
       exporting
            event_id             = starttime-eventid
            event_param          = starttime-eventparm
            event_periodic       = starttime-periodic
            jobcount             = jobcount
            jobname              = jobname
            laststrtdt           = starttime-laststrtdt
            laststrttm           = starttime-laststrttm
            prddays              = 1
            prdhours             = 0
            prdmins              = 0
            prdmonths            = 0
            prdweeks             = 0
            sdlstrtdt            = starttime-sdlstrtdt
            sdlstrttm            = starttime-sdlstrttm
            strtimmed            = starttimeimmediate
            targetsystem         = host
       exceptions
            cant_start_immediate = 01
            invalid_startdate    = 02
            jobname_missing      = 03
            job_close_failed     = 04
            job_nosteps          = 05
            job_notex            = 06
            lock_failed          = 07
            others               = 99.
  if sy-subrc eq 0.
     MESSAGE i200(zz) with 'Done !!'.    "error processing
     stop.
  endif.

8 REPLIES 8
Read only

Former Member
0 Likes
957

Try:

 SUBMIT RIMODGEN with MA_MATNR in MA_MATNR   "<=====
                  WITH I_MODID  = 'TEST_RAJ'
                  WITH I_LOGSYS = 'D41030'
                  with I_APPL   = 'TEST_RAJ'
                  user sy-uname
                  via job jobname
                  number jobcount
                  and RETURN.
 

Rob

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
957

One problem is that you are using the transaction code in your SUBMIT statement, this is not right, you should be using the corresponding program name in the SUBMIT Statment.

SUBMIT RIMODGEN with MA_MATNR in MA_MATNR
                  WITH I_MODID  = 'TEST_RAJ'
                  WITH I_LOGSYS = 'D41030'
                  with I_APPL   = 'TEST_RAJ'
                  user sy-uname
                  via job jobname
                  number jobcount
                  and RETURN.

Regards,

Rich Heilman

Read only

0 Likes
957

hi Rich

RIMODGEN is not the transaction.. its the program of transaction CFM1.

The present program just executes the current program and freezes at the selection screen of RIMODGEN..

please let me know what the problem

Read only

0 Likes
957

Rob and I were pointing out that you have the transaction name in the SUBMIT statement in your code that you posted above, so if you are not currently using the program name in your program, make sure that you are. Also, you may want to use the extension " to sap-spool without spool dynpro" of the SUBMIT statement, the ouput will then go to the spool. Here is an example program where I am creating a background job .

report zrich_0004 .

data:   sdate type sy-datum,
        stime type sy-uzeit,
        l_valid,
        ls_params like pri_params,
        l_jobcount like tbtcjob-jobcount,
        l_jobname  like tbtcjob-jobname.

start-of-selection.

* Get Print Parameters
  call function 'GET_PRINT_PARAMETERS'
       exporting
            no_dialog      = 'X'
       importing
            valid          = l_valid
            out_parameters = ls_params.

* Open Job
  l_jobname = 'ZRICH_0005'.
  call function 'JOB_OPEN'
       exporting
            jobname  = l_jobname
       importing
            jobcount = l_jobcount.

* Submit report to job
  submit zrich_0005
       via job     l_jobname
           number  l_jobcount
       to sap-spool without spool dynpro
           spool parameters ls_params
              and return.

* Kick job off 30 seconds from now.
  sdate = sy-datum.
  stime = sy-uzeit + 30.

* Schedule and close job.
  call function 'JOB_CLOSE'
       exporting
            jobcount  = l_jobcount
            jobname   = l_jobname
            sdlstrtdt = sdate
            sdlstrttm = stime
*            strtimmed = 'X'

Regards,

Rich Heilman .

Read only

0 Likes
957

Sorry I posted it as CFM1 incorrectly, its RIMODGEN..

I did it right earlier but then I was trying out with CFM1 and didnt edit it before posting(syntax error)

Even then it freezes at selection screen

Shall I do this using BDC's ??

Read only

0 Likes
957

I see what you mean. I get the same results too. It may have something to do with the call to JOB_OPEN.

Rob

Read only

0 Likes
957

Something odd with the selection screen here.

Did you try setting up a variant and then submitting it like:

SUBMIT rimodgen WITH SELECTION-SET your_variant   "<=====
                USER sy-uname
                VIA JOB jobname
                NUMBER jobcount
                AND RETURN.

Rob

Read only

Former Member
0 Likes
957

i forgot to append the select-options.. sorry