10-21-2010 9:46 AM
While the BDC is running, I'd like to from within the transaction that is being called (determine if the transaction was called from a BDC and then) conditionally break out of the BDC. Is this possible? I know in foreground you can type /BEND, but no variation of this works from within the ABAP coding. I also tried the many different formats of the LEAVE command, but none of them work for exiting the BDC either. If you have a possible workaround, also this will be pretty useful. Thank you.
10-21-2010 10:08 AM
This will work
perform bdc_dynpro using 'SAPMF02K' '0107'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RF02K-LIFNR' '519076'.
perform bdc_field using 'RF02K-EKORG' 'TL01'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_OKCODE' '/NBEND'. "<---
perform bdc_transaction using 'MK01'.
10-22-2010 1:18 PM
Did you try issuing messages of type A or X, are they just skipping to the next transaction as well? Type X is supposed to throw a short dump, so this might be too harsh for your purposes.
Thomas
10-22-2010 1:26 PM
Look for a userexit where you can program your check and throw the E or A message when needed.
10-22-2010 2:20 PM
Hello Adrian,
You may want to consider using memory variables (export to memory) or parameters (set / get parameter). From the BDC driver program set / export a memory variable/parameter and read it from your transaction which is being run by BDC. You can do so in your transaction through a user exit/enhancement spot (assuming it is a Std SAP program) or directly. Make sure that this parameter/memory variable is set only through your BDC driver program. On identifying the BDC call, as others mentioned, you can raise a message (say type E) to break out of the BDC call. You can capture this message in the message table of the BDC call.
Hope this helps.
Regards,
Jinesh
Edited by: Jinesh Parakulangara on Oct 22, 2010 6:51 PM
01-31-2011 11:42 AM
We changed the approach from trying to manipulated the BDC to running validations from Function Group BTCH e.g. BP_JOBLOG_READ, BP_JOBLOG, BP_JOB_ABORT, BP_JOB_DELETE etc.