Wednesday, 14 December 2011

BDC using CALL TRANSACTION method

By Kumar Saurabh, Yash Technologies
Objective: - Steps For implementing BDC using call transaction Method .
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
DYNPRO-        BDC Screen number
DYNBEGIN-    BDC screen start                                                          
FNAM-            Field name
FVAL-              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 demo purpose, we would be considering the file format.
(If you are using the same file for practice make sure you remove the above two heading rows.)
Define the internal table structure as per the above file structure.
DATA:
  
BEGIN OF fs_field,
    bsart 
TYPE eban-bsart,             ” Document Type.
    matnr 
TYPE eban-matnr,             " Material Number.
    menge 
TYPE eban-menge,             " Quantity Requested.
    werks 
TYPE eban-werks,             " Plant.
  
END OF fs_field.
Recoding is done using the Transaction – SHDB.
Here we have done Recording for the transaction- ME51.
The Recording which you get will be in following format.

No comments:

Post a Comment