‎2011 Apr 04 11:40 AM
Hello,
We have a requirement where we need to scehule 1 program in APO and as soon as it is finished need to scehdule another job in ECC system for program 'RMMRP000'.
What I have done:
1. Create a RFC function module in ECC system which will create job for program 'RMMRP000'.
2. Call this RFC in APO system in a report and schedule the same as next step of the APO job.
Problem: When RFC is getting called from APO in ECC i m getting error 'CALL_FUNCTION_REMOTE_ERROR' because of SYSTEM FAILURE exception.
Up on more analysis I could find that this happened as there was a warning message while program execution in ECC, which has caused the problem. As per the functional this warning message cannot be suppressed.
Could some one please suggest if my approach is correct or there needs to be some logic implemented to override the warning message?
Thank you!
Arvind
‎2011 Apr 04 7:45 PM
Error occured for me because of Submit report used. Below code worked correctly:
Open for background job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_jobname
sdlstrtdt = sy-datum
sdlstrttm = lv_time
IMPORTING
jobcount = lv_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4. .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = lv_jobcount
jobname = lv_jobname
report = 'XXXXXXXX'
variant = iv_variant
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
Close Job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = lv_jobname
jobcount = lv_jobcount
strtimmed = 'X'
EXCEPTIONS
invalid_startdate = 1
jobname_missing = 2
job_close_failed = 3
job_nosteps = 4
job_notex = 5
lock_failed = 6
OTHERS = 99.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.