Error Analysis and Restart Capability
Unlike "classical" batch input processing using sessions, CALL TRANSACTION USING processing does not provide any special handling for incorrect transactions. There is no restart capability for transactions that contain errors or produce update failures.
You can handle incorrect transactions by using update mode S (synchronous updating) and checking the return code from CALL TRANSACTION USING. If the return code is anything other than 0, then you should do the following:
write out or save the message table
use the BDCDATA table that you generated for the CALL TRANSACTION USING to generate a batch input session for the faulty transaction. You can then analyze the faulty transaction and correct the error using the tools provided in the batch input management facility.
20) USING CALL DIALOG WITH BATCH INPUT:
A program that uses CALL DIALOG to submit batch input should perform the following steps:
1. For the screens you want processed, fill all desired fields.
2. Use a CALL DIALOG statement to call the dialog module and to pass it to the BDCDATA table.
The MODE parameter in the CALL statement is explained in Using CALL TRANSACTION USING for Batch Input(19).
Example
CALL DIALOG 'DIALOG1' USING BDCDATA MODE 'E'.
(21) DIRECT INPUT:
To enhance the batch input procedure, the system offers the direct input technique, especially for transferring large amounts of data. In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not process screens.
To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechnism, direct input programs must be executed in the background only.
To maintain and start these programs, use program RBMVSHOW or the transaction BMV0.
Examples for direct input programs are:
Program Application
RFBIBL00 FI
RMDATIND MM
RVAFSS00 SD
RAALTD11 AM
RKEVEXT0 CO-PA
For more information, see the respective program documentation.
22) SAMPLE BATCH INPUT PROGRAM:
The following program demonstrates both the creation of sessions, and the use of CALL TRANSACTION USING.
REPORT RJBDC200 LINE-SIZE 120.
*----------------------------------------------------------------*
* Add a line in a report *
*----------------------------------------------------------------*
PARAMETERS : BDCTYPE TYPE C DEFAULT 'M',
" M = Create batch input session
" T = Call transaction
"---------------------------------------------------*
" Only used for batch input sessions *
"---------------------------------------------------*
GROUP(12) TYPE C DEFAULT 'BDCTEST',
" group name of session
USER(12) TYPE C DEFAULT SY-UNAME,
" user name for starting the
" session in background
KEEP(1) TYPE C,
" ' ' = delete session after processing
" 'X' = keep session after successful
" processing
HOLDDATE LIKE SY-DATUM,
"---------------------------------------------------*
" Only used for call transaction *
"---------------------------------------------------*
DMODE TYPE C DEFAULT 'A'.
" Display mode
" 'A' = display all screens
" 'E' = display only errors
" 'N' = display nothing
*----------------------------------------------------------------*
* Batch input data for a single transaction *
*----------------------------------------------------------------*
DATA: BEGIN OF BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
*----------------------------------------------------------------*
* Generate batch input *
* *
*----------------------------------------------------------------*
CASE BDCTYPE.
WHEN 'M'.
PERFORM CREATE_GROUP.
EXIT.
WHEN 'T'.
PERFORM CALL_TRANSACTION.
EXIT.
ENDCASE.
*----------------------------------------------------------------*
* *
* Create batch input session *
* *
*----------------------------------------------------------------*
FORM CREATE_GROUP.
WRITE: / 'Create group'.
"------------------------------------------------------------*
" Open batch input group *
"------------------------------------------------------------*
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
USER = USER
KEEP = KEEP
HOLDDATE = HOLDDATE.
WRITE: / 'BDC_OPEN_GROUP rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Insert first transaction *
"------------------------------------------------------------*
PERFORM GEN_BDC_DATA.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE38'
TABLES
DYNPROTAB = BDCDATA.
WRITE: / 'BDC_INSERT rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Insert second transaction *
"------------------------------------------------------------*
PERFORM GEN_BDC_DATA.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE38'
TABLES
DYNPROTAB = BDCDATA.
WRITE: / 'BDC_INSERT rc ='(999), SY-SUBRC.
"------------------------------------------------------------*
" Close batch input group *
"------------------------------------------------------------*
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: / 'BDC_CLOSE_GROUP rc ='(999), SY-SUBRC.
ENDFORM. " End CREATE_GROUP
*----------------------------------------------------------------*
* *
* Call Transaction Using *
* *
*----------------------------------------------------------------*
FORM CALL_TRANSACTION.
WRITE: / 'Call Transaction RC ='(999).
PERFORM GEN_BDC_DATA.
CALL TRANSACTION 'SE38' USING BDCDATA MODE DMODE MESSAGES INTO
MESSTAB.
WRITE: SY-SUBRC, SY-MSGTY, SY-MSGID, SY-MSGNO, SY-MSGV1.
WRITE: / ' ', SY-MSGV2.
WRITE: / ' ', SY-MSGV3.
WRITE: / ' ', SY-MSGV4.
ENDFORM. " End CALL_TRANSACTION
*----------------------------------------------------------------*
* *
* Create batch input data for *
* transaction SE38 *
* *
*----------------------------------------------------------------*
FORM GEN_BDC_DATA.
DATA: LINE LIKE BDCDATA-FVAL.
REFRESH BDCDATA.
*------------------------------------------------------------*
* First screen of transaction *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMS38M' '0100'.
PERFORM BDC_FIELD USING 'RS38M-PROGRAMM' 'RJBDC999'.
PERFORM BDC_FIELD USING 'bdc_cursor' 'chap'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.
*------------------------------------------------------------*
* In editor, go to bottom of report *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDCOMMLINE' 'BOT'.
*------------------------------------------------------------*
* Insert line into report *
*----------------------------------------------------- ------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDLINECOM(17)' 'I'.
*------------------------------------------------------------*
* Go to bottom of report again *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'RSTXP-TDCOMMLINE' 'BOT'.
*------------------------------------------------------------*
* Modify line in report and save report *
* (Enter f11 in ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
LINE = 'Batchinput'.
LINE+20 = SY-DATUM.
LINE+30 = SY-UZEIT.
PERFORM BDC_FIELD USING 'RSTXP-TDLINE(17)' LINE.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/11'.
*------------------------------------------------------------*
* Leave the editor (enter f3 in ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMSEDT' '2310'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/3'.
*------------------------------------------------------------*
* Leave transaction se38 (enter f15 in *
* ok-code) *
*------------------------------------------------------------*
PERFORM BDC_DYNPRO USING 'SAPMS38M' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '/15'.
ENDFORM. "End GEN_BDC_DATA
*----------------------------------------------------------------*
* *
* In the batch input data, start a new screen *
* *
*----------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "End BDC_DYNPRO
*----------------------------------------------------------------*
* *
* In the batch input data, insert a field *
* *
*----------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM.
------------------------------------------------------------------------------------------------
RELATED POSTS
Subscribe to:
Post Comments (Atom)
Content
-
▼
2009
(120)
-
▼
March
(87)
- WORK FLOW SCENARIOS IN SD SAP II
- WORK FLOW SCENARIOS IN SD SAP I
- WORK FLOW SAP IV
- WORK FLOW SAP III
- WORK FLOW SAP II
- WORK FLOW SAP I
- BDC SAP X
- BDC SAP IX
- BDC SAP VIII
- BDC SAP VII
- BDC SAP VI
- BDC SAP V
- BDC SAP IV
- BDC SAP III
- BDC SAP II
- BDC SAP I
- BADI SAP III
- BADI SAP II
- BADI SAP I
- BAPI SAP IV
- BAPI SAP III
- BAPI SAP II
- BAPI SAP I
- TABLE CONTROL IN BDC
- USER EXITS IN DETAIL
- BDC AND LSMW COMPARISION
- MODIFICAITONS EXITEDED 57
- SAP MODIDICAITONS 56
- BUSINESS ADD INS 55
- BUSINESS TRANSACTION EVENTS 53
- ENHANCEMENTS USING COSTMER EXITS 54
- ENHANCEMENTS TO DICTIONERY ELEMENTS 52
- CHANGING THE SAP STANDARD 51
- AUTHORISATION CHECKS 50
- COMPLEX LUW PROCESSING 49
- ORGANIZING DATA BASE UPDATES 48
- SAP LOCK CONCEPT 47
- LUW’S AND CLIENT/SERVER ARCHITECHERE 46
- OVERVIEW OF DATABAE UPDATES XXXXV
- LISTS IN SCREEN PROGRAMMING XXXXIV
- CONTEXT MENUS ON SCREENS XXXXIII
- SCREEN ELEMENTS ANDTABLE CONTROLS XXXXII
- SUBSCREEN TABSTRIPS XXXXI
- SCREEN ELEMENTS FOR INPUT AND OUTPUT XXXX
- SCREEN ELEMENTS FOR OUTPUT XXXIX
- IDOC AND BAPI
- DIFFERENCE BETWEEN CONVERSION AND INTERFACE
- INTRODUCITON TO SCREEN PROGRAMMING XXXVIII
- INTERACTIVE LIST TECHNIQUES XXXVII
- SAP LANDSCAPE
- PROGRAM INTERFACE XXXVI
- BASICS OF INTERACTIVE REPORTS XXXV
- ALV GRID CONTROL XXXIV
- SAVING LISTS AND BACK GROUND PROCESSING XXXIII
- DATA FORMATTING AND CONTROL LEVEL PROCESSING XXXII
- SAP QUARY ADMINSTRATION XXXI
- PROGRAMMING DATA RETRIVAL XXX
- LOGICAL DATA BASES XXVIII
- SELECTION SCREENS ABAP REPORT XXIX
- ALV DOCUMENTATION COMPLETE
- FAQ'S ON ABAP CROSS APPLICATIONS
- TECHNIQUES FOR LIST CREATION AND SAP QUARY XXVI
- CALLING PROGRAM AND PASSING DATA XXV
- FUNCTION MODULES AND GROUPS OF ABAP XXIV
- SUB ROUTIENS IN ABAP XXIII
- INTERNAL TABLES IN ABAP XXII
- ABAP STATEMENTS XXI
- DATA TYPES AND DATA OBJECT XX
- ABAP RUN TIME ENVIRONMENT XIX
- SEARCH HELP XVIII
- VIEWS IN ABAP XVII
- CHANGES TO DATA BASE TABLES XVI
- DEPENDENCIES OF DICTIONARY OBJECTS XV
- CONSITENCEY THROUGH INPUT CHECKS XIV
- PERFORMANCE DURING TABLE ACCESS XIII
- ABAP DICTIONARY XII
- ABAP PROJECT OVERVIEW - XI
- REUSE COMPONENTS - X
- DIALOGS AND SCREENS - IX
- USER DIALOGS AND SELECTION SCREEN - VIII
- USER DIALOGS-LISTS - VII
- INTERNAL PROGRAM MODULARIZATION - VI
- DATA BASE DIALOG - V
- ABAP DATA OBJECTS AND STATEMENTS - IV
- ABAP WORK BENCH AND TOOLS - III
- SAP ARCHETECHERE AND DESIGN - II
- SAP NAVIGATION - I
-
▼
March
(87)
Privacy Policy
The articles are copyrighted to Technical Information and can only
be reproduced given the author's permission.Information furnished
in the blog is collected from various Resources.This blog does not
host any files on its server. Please report any broken links in
comment.
If u have any queries contact me at
technicalinformation.websites@gmail.com
0 comments:
Post a Comment