06-29-2006 4:50 PM
Hi!
I have a program that creates two bdc sessions and executes them.
The user wants the program to run the first bdc and waits for its processing. If the execution was successful, then run the next one.
Is it possible to check the status of bdc session in a program?
Thanks in advance,
Cristian
06-29-2006 4:56 PM
I don't think that would be possible with the BDC session method. You can use the CALL TRANSACTION method for the first one and then for second the session method depending on the success of the first one.
Regards,
Ravi
Note : Please mark the helpful answers
06-29-2006 4:56 PM
I don't think that would be possible with the BDC session method. You can use the CALL TRANSACTION method for the first one and then for second the session method depending on the success of the first one.
Regards,
Ravi
Note : Please mark the helpful answers
09-26-2006 6:34 AM
HI,
I have a requirement to call 2 Tcodes in BCD pgrogram using session method.
(1) Do i need to create 2 session Id'd i mean 2 group Id's for each Tcode ?
(2) eg: if a record in flat file is '1' then it sd go to TCODE1 else if '2' it sd got TCODE2 n update .
plz help me on the same.
Thanks
06-29-2006 5:01 PM
Pass the session name to the function module job_submit tfor processing .
If it return a sy-subrc = 6, "JOB_SUBMIT_FAILED
then its a failure.
Regards,
ravi
06-29-2006 5:02 PM
Hi
It's not easy to check the status,because the std RBDCSUB create a job to run the session, when the job is finished doesn't mean the session is correctly ended, but only the job is finished, so:
- u should check the job is finished
- u should check the session status in the table APQI.
Max
06-29-2006 5:03 PM
Hi Cristian,
Its not possible to check the status of BDC program before calling the transaction. You can do this only after calling the transaction and then proceed with the next transaction.
Consider this sample code.
DATA: bdcdata_1 TYPE TABLE OF bdcdata,
bdcdata_2 TYPE TABLE OF bdcdata.
DATA: itab_1 TYPE TABLE OF bdcmsgcoll,
itab_2 TYPE TABLE OF bdcmsgcoll.
CALL TRANSACTION 'VA21' USING bdcdata_1
MODE 'N'
UPDATE 'S'
MESSAGES INTO itab_1.
COMMIT WORK AND WAIT.
or
<i>We can use Ravi's suggestion</i>
CALL FUNCTION <b>'JOB_SUBMIT'</b>
EXPORTING
authcknam =
jobcount =
jobname =
language = sy-langu
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 EQ 0.
CALL TRANSACTION 'VA22' USING bdcdata_1
MODE 'N'
UPDATE 'S'
MESSAGES INTO itab_2.
ENDIF.
Regards,
Arun Sambargi.
Message was edited by: Arun Sambargi
Message was edited by: Arun Sambargi
Message was edited by: Arun Sambargi
06-29-2006 6:30 PM
Use function module BDC_RUNNING to find out if the the session is still active. Based on that you can run the second one.
06-30-2006 1:17 PM
07-01-2006 11:15 AM
Hi,
please use (SM36), then press on "start condition" and select your 2nd BDC to be executed after the 1st event. But please be advise that the 2nd BDC, will start regardless of any error in the 1st BDC. Hope this will help you to solve your BDC issue.
Regards,
Saeed
Message was edited by: Saeed ALi