Vous êtes sur la page 1sur 3

Tutorial To Create BDC using CALL TRANSACTION BDC (Batch Data Communication) using CALL TRANSACTION

Business Scenario: Create BDC for Biometric manual entry upload in which Employee check in/out details are recorded to calculate the time in and out and fluctuations (breaks) which are used for checking employees planned working hours and compensation off. When SAP is implemented we need Data to migrate from non-SAP system i.e. Legacy system to SAP system. One way of doing this is BDC (Batch Data Communication). Requirement: - For Developing BDC using CALL TRANSACTION method we need to do the recording of the corresponding transaction & flat file in which data is stored. Flat file can be Text file or Excel File. In CALL TRANSACTION we also have to create the Error Log file. In BDC we use structure BDCDATA for Batch Input, which has following components. PROGRAM - BDC module pool DYNPROBDC Screen number

DYNBEGIN- BDC screen start FNAMFVALField name BDC field value

A BDCDATA structure can contain the batch input data for only a single run of a transaction In CALL TRANSACTION method, we need to create Log for the Error Message, for this we use structure BDCMSGCOLL. For our purpose we are using the file in the following format (Personnel no, Date, Time, Time Event Type) as:

Recoding is done using the Transaction SHDB. Here we have done Recording for the transaction- PA30. 1. Enter t-code SHDB. Create New Recording and pass the T-code as PA30 and click Start Recording. You will receive your PA30 (Maintain HR Master Data) in which you can enter the data and click Save and return to previous screen. The Recording which you get will be in following format:

TRUSPEQ Technologies Pte Ltd

Page | 1

Tutorial To Create BDC using CALL TRANSACTION

2. Declare Structure for Error message. 3. Provide the Input File path for your Excel file as well as Error message and Mode in SELECTION SCREEN.

TRUSPEQ Technologies Pte Ltd

Page | 2

Tutorial To Create BDC using CALL TRANSACTION


4. Declare your Structure according to the Excel sheet and Create Internal Table for the same. 5. Declare Structure and Internal table of type BDCDATA. 6. Create Event AT SELECTION-SCREEN. To check for Mode and provide validation. * Mode 'A' = Foreground mode * Mode 'N' = Background mode 7. Opening window for path selection using: CALL FUNCTION 'F4_FILENAME' 8. Upload the Excel file using: CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP' 9. In START-OF-SELECTION. Populate BDCDATA with: PROGRAM - BDC module pool DYNPROBDC Screen number DYNBEGIN- BDC screen start FNAMField name FVALBDC field value 10. Call the PA30 Transaction:
CALL TRANSACTION 'PA30' USING t_bdcdata MODE w_mode UPDATE 'S' MESSAGES INTO t_msg.

11. If Sy-subrc <> 0. Then pass the error message Through GUI_DOWNLOAD to the Text File. 12. The Report Program is as in the attached file:

TRUSPEQ Technologies Pte Ltd

Page | 3

Vous aimerez peut-être aussi