on 03-28-2006 10:45 PM
Hi Friends,
I want to know how to trigger an report after the completion of processing the session.
Thanks,
Raj
what session, batch input session?
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guy
I think a little problem can occur: the program RSBDCSUB creates a new job runs the bdc session, so the submit for RSBDCSUB doesn't mean the BDC session is elaborated, but the job for it is scheduled.
So you make sure that job has ended, RSBDCSUB usually creates a job with the same name of BDC session.
After calling RSBDCSUB you should check the status of job.
Max
I'm pretty sure that it just initiates the BDC and then quits. We had this issue when we went live years ago and never resolved it.
I suppuse you could write a program that would run after RSBDCSUB finishes that examines the session log and tries to determine if the session is running and checks every so often to see if it's done, but I don't know if it would be worth it.
Rob
Hi
----
SELECTION-SCREEN *
----
PARAMETERS: p_name LIKE apqi-groupid,
p_datum LIKE apqi-credate,
p_time LIKE apqi-cretime,
p_event LIKE tbtco-eventid.
----
DATA *
----
DATA: fl_job_ok TYPE c,
fl_event TYPE c,
cont_sysubrc_6 TYPE i.
DATA: start_time LIKE sy-uzeit,
start_date LIKE sy-datum,
time LIKE sy-uzeit,
delta_time TYPE i.
DATA: apqitab LIKE STANDARD TABLE OF apqi WITH HEADER LINE.
DATA:
btc_running LIKE tbtco-status VALUE 'R',
btc_ready LIKE tbtco-status VALUE 'Y',
btc_scheduled LIKE tbtco-status VALUE 'P',
btc_released LIKE tbtco-status VALUE 'S',
btc_aborted LIKE tbtco-status VALUE 'A',
btc_finished LIKE tbtco-status VALUE 'F',
btc_put_active LIKE tbtco-status VALUE 'Z',
btc_unknown_state LIKE tbtco-status VALUE 'X'.
______________________________________________________________________
START-OF-SELECTION *
______________________________________________________________________
START-OF-SELECTION.
DATA: a VALUE '1', b.
Controllo esistenza job:
start_time = sy-uzeit.
start_date = sy-datum.
DO.
apqitab-creator = sy-uname.
CALL FUNCTION 'BDC_OBJECT_SELECT'
EXPORTING
name = p_name
datatype = 'BDC'
CLIENT = SY-MANDT
date_from = p_datum
DATE_TO =
time_from = p_time
TIME_TO =
QSTATE = 'F'
session_creator = apqitab-creator
TABLES
apqitab = apqitab
EXCEPTIONS
invalid_datatype = 1
OTHERS = 2.
IF sy-subrc <> 0.
fl_job_ok = space.
ELSE.
LOOP AT apqitab.
CASE apqitab-qstate.
WHEN 'F'. fl_job_ok = 'X'. EXIT.
WHEN 'E'. fl_job_ok = 'E'. EXIT.
WHEN OTHERS. fl_job_ok = space.
ENDCASE.
ENDLOOP.
IF fl_job_ok = 'X' OR fl_job_ok = 'E'.
EXIT.
ENDIF.
ENDIF.
IF start_date <> sy-datum.
start_time = sy-uzeit.
ENDIF.
time = sy-uzeit.
delta_time = time - start_time.
IF delta_time > 1800.
EXIT.
ENDIF.
REFRESH apqitab.
ENDDO.
IF fl_job_ok = 'X'. " Trovato JOB
fl_event = 'X'.
IF fl_event = 'X'.
Attiva evento
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
eventid = p_event
EXCEPTIONS
bad_eventid = 1
eventid_does_not_exist = 2
eventid_missing = 3
raise_failed = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e999(zfagm) WITH p_event 'is not actived'(002).
ELSE.
MESSAGE i999(zfagm) WITH p_event 'is successfully actived'(002).
ENDIF.
ELSE.
MESSAGE e999(zfagm) WITH p_event 'is not actived'(002).
ENDIF.
ELSE.
IF fl_job_ok = space.
MESSAGE e999(zfagm) WITH p_event 'is successfully actived'(002).
ELSE.
MESSAGE e999(zfagm) WITH p_event 'is successfully actived'(002).
ENDIF.
ENDIF.
Max
Yes it is.
Just I said, the report RSBDCSUB create a job with the name of the session, so you can find and check a job has the same name of the session and it's created after the session was created (you should know the date and the time of your session).
In my example I used a validation to force the exit from loop DO/ENDO because I was afraid my job (Z-REPORTC) could work infinitely.
Max
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.