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

Problem Running a Batch Input!

Former Member
0 Likes
563

Good Morning My Friends!

Let me explain how I work today.

I am running an RFC.

This RFC executes a JOB.

JOB executes a Batch Input BACK GROUND.

My problem is this.

If I only run the batch input it works, but when I call the RFC and it creates the job, the Batch Input does not work.

Following is the code that creates the JOB.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>

CALL FUNCTION 'JOB_OPEN'

EXPORTING

delanfrep = ' '

jobgroup = ' '

jobname = jobname

sdlstrtdt = sy-datum

sdlstrttm = sy-uzeit

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc EQ 0.

SUBMIT zgpm_bat_inpl

WITH nome_per = nome

WITH descri = 'Descricao'

USER sy-uname

VIA JOB jobname NUMBER number

AND RETURN.

exdate = sy-datum.

extime = sy-uzeit.

ADD 30 TO extime.

DATA start_imediato LIKE btch0000-char1 VALUE 'X'.

  • Define o start do job.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobname = jobname

jobcount = jobcount

  • sdlstrtdt = exdate

  • sdlstrttm = extime

strtimmed = start_imediato

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

invalid_target = 8

OTHERS = 9.

IF sy-subrc <> 0.

ENDIF.

ENDIF.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<

Following is the code that runs the Batch Input.

program : zgpm_bat_inpl

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>

opt_ctu_params-dismode = 'N'.

opt_ctu_params-updmode = 'S'.

opt_ctu_params-cattmode = ''.

opt_ctu_params-defsize = ''.

opt_ctu_params-racommit = 'X'.

opt_ctu_params-nobinpt = ''.

opt_ctu_params-nobiend = ''.

CALL TRANSACTION (name_tran) USING it_bdcdata

OPTIONS FROM opt_ctu_params

MESSAGES INTO it_msg.

IF sy-subrc <> 0.

LOOP AT it_msg .

WRITE: /, it_msg-dyname,

it_msg-dynumb,

it_msg-msgv1,

it_msg-msgv2,

it_msg-msgv3,

it_msg-msgv4.

ENDLOOP.

endif.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<

Att:

Deivison BR

4 REPLIES 4
Read only

Former Member
0 Likes
530

What transaction are you running?

Rob

Read only

0 Likes
530

PFCG

Read only

0 Likes
530

See note 311440. I think you can only run this in the foreground.

Rob

Read only

0 Likes
530

I read the note, but I had imagined.

: (