I am using the SAP program RSBDCBTC to submit a BDC session from within my program that is running in the foreground. So I am submitting the program with following syntax: 
SUBMIT rsbdcbtc WITH queue-id = qid AND RETURN. 
 
This SUBMIT works fine. That is, the BDC session is executed BUT the problem I have is that the program control DOES NOT return back to my calling program after the session is submitted/executed. I get the pop-up window "processing of batch input session completed" and when I click on either of the buttons "Session Overview" or "Exit batch input", the program ends. I need to get back to my calling program. Granted if I ran this program in the background, this informational pop-up screen would be ignored but I need to run my program in the foreground ... 
Anyways so I thought I would modify/write my own version of RSBDCBTC but I came across a CALL that I am unfamiliar with. That is, the syntax makes no sense to me. In RSBDCBTC there is the following call: 
CALL 'BDC_START_GROUP' ID 'GROUP' FIELD WA_MTAB-GROUPID 
ID 'QUID' FIELD WA_MTAB-QID 
ID 'DISPLAY' FIELD MODUS 
ID 'LOG' FIELD LOGALL. "all message 
But I can’t find the code behind 'BDC_START_GROUP' ! What is it ??? It's not a function or a form or a report ... what is it ?? Where can I find the code behind BDC_START_GROUP ? 
As a side note, if someone can tell me how to get back to my calling program after I submit RSBDCBTC, that would be good to. 
---
CALL 'BDC_START_GROUP' is a C-routine and you cannot find the code behind it as it is C-code. 
I have already used this and when you are giving the option Return, it should return to the calling program. 
---
Submit with RSBDCSUB like follows, 
submit rsbdcsub using selection-set selection_set and return. 
You should have to create a variant on RSBDCSUB with the session name. 
---
You can use this piece of code: 
DATA SUBREPORT(12) TYPE C VALUE 'RSBDCBTC_SUB'. " Submit Batch 
move groupid to jname. 
CALL FUNCTION 'JOB_OPEN' 
EXPORTING 
     JOBGROUP = BI 
     JOBNAME = JNAME 
IMPORTING 
     JOBCOUNT = JNUMB 
EXCEPTIONS 
     CANT_CREATE_JOB = 1 
     INVALID_JOB_DATA = 2 
     JOBNAME_MISSING = 3 
     OTHERS = 99. 

IF SY-SUBRC EQ 0. "Job_open OK 

SUBMIT (SUBREPORT) 
   USER SY-UNAME 
   VIA JOB JNAME 
   NUMBER JNUMB 
   WITH QUEUE_ID EQ QID 
   WITH MAPPE EQ GROUPID 
   WITH MODUS EQ 'N' 
   WITH LOGALL EQ LMODUS 
AND RETURN. 

  IF SY-SUBRC EQ 0. "submit OK 
  CALL FUNCTION 'JOB_CLOSE' 
  EXPORTING 
     JOBCOUNT = JNUMB 
     JOBNAME = JNAME 
     STRTIMMED = X 
  IMPORTING 
     JOB_WAS_RELEASED = JOBRELE 
  EXCEPTIONS 
     CANT_START_IMMEDIATE = 1 
     INVALID_STARTDATE = 2 
     JOBNAME_MISSING = 3 
     JOB_CLOSE_FAILED = 4 
     JOB_NOSTEPS = 5 
     JOB_NOTEX = 6 
     LOCK_FAILED = 7 
     OTHERS = 99. 
  IF SY-SUBRC EQ 0. "Job_close is OK 
     IF JOBRELE EQ X. "job is release/ 
     ENDIF. 
  ENDIF. 
 ENDIF. 
ENDIF. 


Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com