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.
--------------------------------------------------------------------------
Saturday, May 10, 2008
BDC 9, Error Analysis and Restart Capability, USING CALL DIALOG WITH BATCH INPUT, DIRECT INPUT etc
Subscribe to:
Post Comments (Atom)
New Document
!doctype>
Blog Archive
-
▼
2008
(62)
-
▼
May
(61)
- BDC program for Purchase Info Records
- Schedule Agreement Data Uploading
- Upload Material Master - Finish Goods
- Upload the Pricing Condtion Records for Materials
- Program Loads the Material Assignment of Routings
- Program Loads the Bill of Material
- Vendor Master Upload Program
- ABAP Interactive reporting + BDC (RM Creation)
- Difference Between Batch Input and Call Transactio...
- Diff. Between Batch Input and Call Transaction in BDC
- Delimiter for BDC Program
- Example how Views are dealt in BDC
- BDC to Check Views Maintained For A Material Master
- Determine number of lines on screen for programmin...
- Execute BDC immediately replacing include BDCRECX1
- BDC Example: Using Table Control in BDC
- Retreive Error Message from BDC
- System Crash During BDC Update
- How to get Sales Order No on Status Bar in BDC
- Learning BDC Programming
- Question About BDC Program
- Interview Question on BDC
- Download Step by Step: How to Create BDC Program
- FAQ ON SCRIPTS 1
- FAQ ON SCRIPTS 2
- FAQ ON SCRIPTS 3
- TABLE TYPES IN SAP
- TYPES OF VIEWS IN SAP
- ABAP DATA BASE UPDATES COMPLETE
- SAP LOCK CONCEPT
- ORGANIZING DATABASE UPDATES
- ENHANCEMENTS TO DICTIONERY ELEMENTS IN SAP
- LESSON 5 DATA BASE DIALOG
- LESSON 12 ABAP DICTIONARY
- LESSON 13 PERFORMANCE DURING TABLE ACCESS
- LESSON 15 DEPENDENCIES OF DICTIONARY OBJECTS
- LESSON 16 CHANGES TO DATA BASE TABLES
- LESSON17 VIEWS IN ABAP
- LESSON 18 SEARCH HELP
- BDC 7, CREATING BATCH INPUT SESSIONS, CREATING A S...
- BDC 8, PROCESSING BATCH INPUT SESSIONS, USING CALL...
- BDC 9, Error Analysis and Restart Capability, USIN...
- BDC 10, BATCH INPUT RECORDING FOR TRANSACTION RUNS...
- ABAP BDC TABLE CONTROL
- ALV DOCUMENTATION COMPLETE
- LESSON 34 ALV GRID CONTROL
- ALV IN BRIEF
- ALV REPORT SAMPLE CODE CONTACT RENEWAL DETIALS
- REPLACE COMMENTARY IN ALV
- ALV WITH POV SAMPLE CODE
- ALV HIRACHICAL REPORT SAMPLE CODE
- ALV LIST DISPLAY SAMPLE CODE
- ALV LAYOUT DISPLAY SAMPLE CODE
- ALV BLOCK SAMPLE REPORT
- ALV CHECK BOXES SAMPLE CODE
- ALV INTERACTIVE REPORT SAMPLE CODE
- ALV DOUBLE CLICK SAMPLE CODE
- ALV SIMPLE SAMPLE CODE
- ALV COLURING SAMPLE CODE
- ALV LIST USING OO STYLE SAMPLE CODE
- ALV Programs
-
▼
May
(61)


No comments:
Post a Comment