Chapter 04 - Batch Input Methods
Chapter 04 - Batch Input Methods
March-2005
Objectives
The participants will be able to:
Research a transaction for the BDC purpose.
Describe the contents of a BDC table. Declare a BDC table and how to fill the BDC table.
March-2005
Overview
External System
SAP System
Data
Batch Input
March-2005
External
Data X SAP Checks & Validations Database Table
External Data
March-2005
Online Program
To check and validate the external data, user dialogue is simulated through an SAP transaction (i.e., an online program). Vendor Company Code X Address TEST1
Computers, Inc.
Philadelphia
March-2005
BDCDATA Structure
To simulate user dialogue, you must know the following information: (1) (2) (3) (4) online program name, screen numbers, field names, and field values.
ABAP Dictionary
BDCDATA
The BDCDATA ABAP Dictionary structure is used in a batch input program to collect this information for an entire transaction.
FVAL
6 Data Interfaces | 7.04 March-2005
Vendor Company Code X For our example, we will use the Change Vendor transaction (FK02) to add a street address to an already existing vendor. Name Street City Address
TEST1
Philadelphia
March-2005
Use System > Status menu path to determine online program name (SAPMF02K), screen number (0106), and transaction code (FK02).
Step #3 Determine how to proceed in the transaction (go to the next screen by pressing the Enter key).
Step #3
Determine how to proceed in the transaction (save the record by clicking on the Save pushbutton or pressing the CTRL+S key).
March-2005
Step #3
Determine how to proceed in the transaction (save the record by clicking on the Save pushbutton or pressing the CTRL+S key).
10
March-2005
PROGRAM
DYNPRO
DYNBEGIN
FNAM
FVAL
SAPMF02K
0106
RF02K-LIFNR
RF02K-D0110 BDC_OKCODE SAPMF02K 0110 X LFA1-STARS
TEST1
X /00 123 Maim St..
BDC_OKCODE =UPDA
11
March-2005
DATA:
BDC_TAB LIKE STANDARD TABLE OF BDCDATA INITIAL SIZE 6 WITH HEADER LINE.
The internal table used to collect the transactions information must be declared LIKE BDCDATA.
12
March-2005
REFRESH BDC_TAB.
CLEAR BDC_TAB. BDC_TAB-PROGRAM = SAPMF02K. BDC_TAB-DYNPRO = 0106. BDC_TAB-DYNBEGIN = X. APPEND BDC_TAB. CLEAR BDC_TAB. BDC_TAB-FNAM = RF02K-LIFNR. BDC_TAB-FVAL = TEST1. APPEND BDC_TAB. CLEAR BDC_TAB. BDC_TAB-FNAM = RF02K-D0110. BDC_TAB-FVAL = X. APPEND BDC_TAB.
13
March-2005
REFRESH BDC_TAB.
CLEAR BDC_TAB. BDC_TAB-PROGRAM = SAPMF02K. BDC_TAB-DYNPRO = 0106. BDC_TAB-DYNBEGIN = X. APPEND BDC_TAB. CLEAR BDC_TAB. BDC_TAB-FNAM = RF02K-LIFNR. BDC_TAB-FVAL = TEST1. APPEND BDC_TAB. CLEAR BDC_TAB. BDC_TAB-FNAM = RF02K-D0110. BDC_TAB-FVAL = X. APPEND BDC_TAB.
14
March-2005
This two-subroutine method to fill the BDC table is preferable because the POPULATE_BDC_TAB subroutine is reusable throughout all batch input programs.
15 Data Interfaces | 7.04 March-2005
This two-subroutine method to fill the BDC table is preferable because the POPULATE_BDC_TAB subroutine is reusable throughout all batch input programs.
16 Data Interfaces | 7.04 March-2005
Method #1
Method #2
17
March-2005
Demonstration
Creation of a custom BDC program using call transaction method for transaction XD02 (Change Customer).
18
March-2005
Practice
Creation of a custom BDC program using call transaction method for transaction XD02 (Change Customer).
19
March-2005
Summary
The <bdc table> must be declared LIKE BDCDATA.
To fill the BDC table delete all entries first with the REFRESH statement
Initialize the header line with CLEAR statement. Fill the header line (or staging area) with the appropriate information.For a new screen entry, fill the PROGRAM, DYNPRO, and and DYNBEGIN fields.For a field entry, fill the FNAM and FVAL fields
20
March-2005
Questions
What are the fields present in the BDC table ?
21
March-2005