Professional Documents
Culture Documents
com
Presentation Overview
Duration
90 minutes Getting the clear concept of BDC How to use BDC effectively? To know the significance of BDC
Objectives
Pre-Requisites
Knowledge of Dialog Programming Little Functional overview Introduction to BDC. Method of Batch Input. Batch Data Procedures. Writing BDC programs. Creating Batch input Session. Batch Input Recording. File Transfer and File Handling 30 minutes
Contents
Demo
Introduction
Method of transferring data into the System from other SAP and non-SAP Systems. Work by carrying out normal SAP transactions just as a user would. Execute the transaction automatically. Suitable for entering large amount of data. No manual interaction .
You should process batch input sessions in the foreground or using the error display if you want to test the data transfer. If you want to execute the data transfer or test its performance, you should process the sessions in the background.
ABAP/4 program uses CALL TRANSACTION USING statement to run an SAP transaction. Entire batch input process takes place online in the program
Format of BDC_OPEN_GROUP
CALL FUNCTION BDC_OPEN_GROUP EXPORTING CLIENT = <client> GROUP = <session name> HOLDATA = <lock data> KEEP = <deletion indicator> USER = <batch user name> EXCEPTIONS RUNNING QUEUE_ERROR = 1 CLIENT_INVALID = 2 GROUP_INVALID = 3 .
T eB tc In u R c rd r (1 h a h pt eo e )
C a C s m r: F In l S re n re te u to e .I. itia c e
C s m r E it G to E tra E v n e t S s m H lp u to e d o x s n iro m n y te e
R c rd gN m e o in a e C s mr u to e C m a yc d o pn oe A c u tg u c o n ro p T m la e p te C s mr u to e C m a yc d o pn oe
Z te -In rn 00 01
F ldc n n ie o te ts Z te -In rn 00 01 KN UA
S PA A G
BDC Program
report zbdc05 . tables: ztrg_em05. data: begin of itab occurs 0, emplno(6), empl_name like ztrg_em05-empl_name, deptno(3), end of itab. data: bdctab like bdcdata occurs 0 with header line. call function 'WS_UPLOAD' exporting filename = 'C:\DEMO.TXT' filetype = 'DAT' tables data_tab = itab exceptions ---call function 'BDC_OPEN_GROUP' exporting client = sy-mandt group = 'TEST' user = sy-uname exceptions
BDC Program
loop at itab. refresh bdctab. clear bdctab. perform bdcfill using : 'X' '9000' 'SAPMZ705', ' ' 'BDC_OKCODE' '/5', 'X' '9000' 'SAPMZ705', ' ' 'ZTRG_EM05-EMPLNO' itab-emplno, ' ' 'ZTRG_EM05-EMPL_NAME' itab-empl_ ' ' 'ZTRG_EM05-DEPTNO' itab-deptno, 'X' '9000' 'SAPMZ705', ' ' 'BDC_OKCODE' '/11'. call function 'BDC_INSERT' exporting tcode = 'Z705' tables dynprotab = bdctab exceptions ---write 'BDC inserted'. endloop. call function 'BDC_CLOSE_GROUP' exceptions
----
Transfers the field f (usually a field string) to the sequential file specified in dsn (this may be a literal or a field).