Hello everyone,
I person the pursuing problem: I created a signaling of my study utilizing the SHDB transaction. Based connected this, I created a study that, simply put, saves the corresponding records erstwhile changes are made (e.g., the statement is changed), clicks the backmost button, and processes the adjacent grounds that was entered successful the enactment screen.
Now, the study works rather well, but erstwhile the archetypal grounds is processed and it moves to the adjacent grounds by clicking the backmost button, I person the error: "Error: 'LEAVE TO TRANSACTION' is not allowed successful Batch Input." I person tried galore things, but thing has brought the desired success. My extremity is to beryllium capable to tally the report, which creates a batch input session, successful the background. Unfortunately, this is presently failing.
Here is the codification of my report:
REPORT z_autosave. TABLES: /opl09/anl_sts, /opl09/fa_vorrat. CONSTANTS: lc_transaction TYPE tstc-tcode VALUE '/OPL09/INVENTUR'. DATA: BEGIN OF bdcdata OCCURS 1000. INCLUDE STRUCTURE bdcdata. DATA: END OF bdcdata. DATA: ls_bdcdata TYPE bdcdata. SELECT-OPTIONS: s_melnr FOR /opl09/fa_vorrat-melnr, s_satza FOR /opl09/fa_vorrat-satza, s_datum FOR /opl09/fa_vorrat-datum, s_bukrs FOR /opl09/fa_vorrat-bukrs OBLIGATORY, s_anln1 FOR /opl09/fa_vorrat-anln1, s_anln2 FOR /opl09/fa_vorrat-anln2, s_icon FOR /opl09/fa_vorrat-icon OBLIGATORY DEFAULT '@09@', "@08@ = green, @ = yellow, @0A@ = red s_frgsts FOR /opl09/anl_sts-frg_sts OBLIGATORY DEFAULT 'NRE'. "NRE = not applicable (for workflow) PARAMETERS: p_group TYPE apqi-groupid DEFAULT 'OPAL_AUTO'. START-OF-SELECTION. AUTHORITY-CHECK OBJECT 'F_BKPF_BUK' ID 'BUKRS' DUMMY "FIELD p_bukrs <----- TO BE CHANGED LATER ID 'ACTVT' FIELD '01'. IF sy-subrc NE 0. MESSAGE e112(fg). "WITH p_bukrs. <----- TO BE CHANGED LATER ENDIF. SELECT v~melnr, v~anln1, v~anln2 FROM /opl09/fa_vorrat AS v JOIN /opl09/anl_sts AS s ON v~melnr = s~melnr AND s~frg_step IS INITIAL AND s~frg_def IS INITIAL WHERE v~melnr IN @s_melnr AND v~satza IN @s_satza AND v~datum IN @s_datum AND v~bukrs IN @s_bukrs AND v~anln1 IN @s_anln1 AND v~anln2 IN @s_anln2 AND v~icon IN @s_icon AND s~frg_sts IN @s_frgsts INTO TABLE (lt_items). DATA: lv_count TYPE one VALUE 0. ** Öffnen der Arbeitsmappe CALL FUNCTION 'BDC_OPEN_GROUP' EXPORTING lawsuit = sy-mandt radical = p_group idiosyncratic = sy-uname support = 'X'. LOOP AT lt_items ASSIGNING FIELD-SYMBOL(<fs_item>). " Zähler erhöhen lv_count = lv_count + 1. "Choose Process enactment database connected main screen PERFORM bdc_dynpro USING '/OPL09/FA_INVENTUR' '1000'. PERFORM bdc_field USING 'BDC_OKCODE' '=ARBVO'. " capable enactment surface for process enactment list PERFORM bdc_dynpro USING '/OPL09/FA_ANLAGEN_ARBVOR' '1000'. PERFORM bdc_field USING 'S_MELNR-LOW' <fs_item>-melnr. " Registration number PERFORM bdc_field USING 'BDC_OKCODE' '=ONLI'. " click connected save PERFORM bdc_dynpro USING '/OPL09/FA_ANLAGEN_ARBVOR' '0100'. * PERFORM bdc_field USING 'S_ANLN1' <fs_item>-anln1. * PERFORM bdc_field USING 'S_ANLN2' <fs_item>-anln2. PERFORM bdc_field USING 'BDC_OKCODE' '=SAVE'. " corroborate popup PERFORM bdc_dynpro USING 'SAPLSPO1' '0500'. PERFORM bdc_field USING 'BDC_OKCODE' '=YES'. PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLSPO1 0501SUBSCREEN'. * " Additional pop-up confirmations tin beryllium added here * " Example for different pop-up * PERFORM bdc_dynpro USING 'SAPLSPO1' '0500'. * PERFORM bdc_field USING 'BDC_OKCODE' '=YES'. * PERFORM bdc_dynpro USING '/OPL09/FA_ANLAGEN_ARBVOR' '0100'. * PERFORM bdc_field USING 'BDC_OKCODE' * '=/EBACK'. CALL FUNCTION 'BDC_INSERT' EXPORTING tcode = lc_transaction TABLES dynprotab = bdcdata. CLEAR bdcdata[]. ENDLOOP. ** Schließen der Arbeitsmappe CALL FUNCTION 'BDC_CLOSE_GROUP' EXCEPTIONS not_open = 1 queue_error = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE 'closing batch input league failed' TYPE 'E'. ENDIF. CLEAR bdcdata[]. " Ausgabe der Anzahl der verarbeiteten Datensätze WRITE: / 'Number of processed records:', lv_count. WRITE: / 'Batch input league successfully created.'. *--------------------------------------------------------------------* * FORMS * * ----- * *--------------------------------------------------------------------* *&--------------------------------------------------------------------* *& Form BDC_DYNPRO * *&--------------------------------------------------------------------* *& Hilfsroutine zum Anlegen der Dynprobefehle * *&--------------------------------------------------------------------* *& --> programme = Programmanme des Dynpro * *& --> dynpro = Dynpronummer * *&--------------------------------------------------------------------* FORM bdc_dynpro USING programme dynpro. CLEAR ls_bdcdata. ls_bdcdata-program = program. ls_bdcdata-dynpro = dynpro. ls_bdcdata-dynbegin = 'X'. APPEND ls_bdcdata TO bdcdata. ENDFORM. "bdc_dynpro *&--------------------------------------------------------------------* *& Form BDC_FIELD * *&--------------------------------------------------------------------* *& Hilfsroutine zum Anlegen der Dynprobefehle * *&--------------------------------------------------------------------* *& --> fnam = Feldname * *& --> fval = Feldwert * *&--------------------------------------------------------------------* FORM bdc_field USING fnam fval. CLEAR ls_bdcdata. ls_bdcdata-fnam = fnam. ls_bdcdata-fval = fval. APPEND ls_bdcdata TO bdcdata. ENDFORM.Here is the signaling of my report.
I would truly admit your help, arsenic I americium getting a spot frustrated.
Best regards,
Alex