Académique Documents
Professionnel Documents
Culture Documents
March-2005
Objectives
The participants will be able to:
Create the Batch Input part of an Inbound Interface.
Describe the Batch Input Session Method for Batch Input.
March-2005
Overview
BDC Program The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program.
External Data
March-2005
BDC_OPEN_GROUP
BDC_INSERT is called for each transaction entered into the batch input session.
BDC_OPEN_GROUP
EXPORTING
CLIENT GROUP HOLDDATE = <client> = <session name> = <lock session until date>
...
OTHERS = 11.
March-2005
BDC_INSERT
CALL FUNCTION BDC_INSERT EXPORTING TCODE TABLES DYNPROTAB EXCEPTIONS INTERNAL_ERROR ... OTHERS = 5. =1
CHECK SY-SUBRC
= <transaction code>
March-2005
BDC_INSERT (Contd.)
CALL FUNCTION BDC_INSERT EXPORTING TCODE TABLES DYNPROTAB EXCEPTIONS INTERNAL_ERROR ... OTHERS = 5. =1
CHECK SY-SUBRC
= <transaction code>
March-2005
BDC_CLOSE_GROUP
March-2005
Hold Date
Keep or Delete Batch Input Session
Data Section
Transaction Data
March-2005
In this example, we will create a batch input session to add a street address to an already existing vendor (TEST1).
ABAPXX-002
Computers, Inc.
Buyer, Inc.1
Philadelphia
City
10
March-2005
REPORT YDIXX5_2. DATA: BDC_TAB LIKE STANDARD TABLE OF BDCDATA INITIAL SIZE 6 WITH HEADER LINE, SESSION LIKE APQI-GROUPID VALUE 'DEMO#8'.
Step #1
11
March-2005
Step #2
Step #3 Step #4
Step #5
Example #1 - Subroutines
FORM FILL_BDC_TAB. REFRESH BDC_TAB. FORM POPULATE_BDC_TAB USING FLAG TYPE C VAR1 TYPE C VAR2 TYPE C. CLEAR BDC_TAB. IF FLAG = 1. BDC_TAB-PROGRAM = VAR1. BDC_TAB-DYNPRO = VAR2. BDC_TAB-DYNBEGIN = X. ELSE. BDC_TAB-FNAM = VAR1. BDC_TAB-FVAL = VAR2. ENDIF. APPEND BDC_TAB. ENDFORM. ENDFORM.
13
March-2005
TEST1
TEST2
Address
Address
Philadelphia
Data Interfaces | 7.05
March-2005
123 Main St. 10 Walnut St. 32 Chestnut St. 30 Market St. 17 S. 30th St. The sequential file we will read is set up in records. Each record has two fields with the following formats:
15
March-2005
Step #1
Step #6
Step #7 Step #8
Example #2 - Subroutines
FORM FILL_BDC_TAB. REFRESH BDC_TAB. PERFORM POPULATE_BDC_TAB USING: 1 SAPMF02K RF02K-LIFNR RF02K-D0110 1 SAPMF02K LFA1-STRAS BDC_OKCODE 0106, INREC-VENDNUM, X, 0110, INREC-STREET, =UPDA. FORM POPULATE_BDC_TAB USING FLAG TYPE C VAR1 TYPE C VAR2 TYPE C. CLEAR BDC_TAB. IF FLAG = 1. BDC_TAB-PROGRAM = VAR1. BDC_TAB-DYNPRO = VAR2. BDC_TAB-DYNBEGIN = X. ELSE. BDC_TAB-FNAM = VAR1. BDC_TAB-FVAL = VAR2. ENDIF. APPEND BDC_TAB. ENDFORM.
ENDFORM.
Notice that the vendor number and street values are coming from the files records read into the INREC structure.
18 Data Interfaces | 7.05 March-2005
Demonstration
Creation of a custom batch input session program for transaction XD02 (Change Customer).
19
March-2005
Practice
Creation of a custom batch input session program for transaction XD02 (Change Customer).
20
March-2005
Summary
Research Transaction
21
March-2005
Questions
What are the function modules required to create a batch input session ?
22
March-2005