Professional Documents
Culture Documents
Communication
BY ----Arjun
Overview
It is the process of transferring the data from flat file into SAP by
calling a transaction through a series of sequence of steps.
Properties:
This method is used for transferring less amount of data(<10,000
records).
This method uses Synchronous and Asynchronous updates.
This method will update the DB immediately.
We need to handle the errors and the success messages by
declaring an internal table of type BDCMSGCOLL.
This method is very fast.
UPDATE <A/S>
MODE <A/E/N>
BDC Data:
In simple words, it holds all the screen related information and field
information to be transferred into corresponding SAP transaction.
SAPLGMM 0060 X
RMMG1-MATNR 1011
RMMG1-MBRSH FOOD
RMMG1-MTART FERT
SAPLGMM 0070 X
RZSEL X
- - - - -
- - - - -
Please note down the program name, screen number, screen field
name.
In this type the call transaction screens will communicate with the
update work process to update the data into database.
___________________________________________________________
MODE DESCRIPTION
___________________________________________________________
MSGID Message ID
RECORDING METHOD:
Go to MM01
Click on save.
Go to SHDB
Click on save
Click on back
Press enter
RMMG1-MRART.
Clear BDCDATA.
BDCDATA-program = program.
BDCDATA-dynpro = dynpro.
BDCDATA-dynbegin = x.
Append BDCDATA.
ENDFORM.
Clear BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
Append BDCDATA.
ENDFORM.
Upload the data from flat file into the internal table using
GUI_UPLOAD
Using BDCDATA
Update A/S
Mode A/E/N
If SY-SUBRC = 0.
Else
Endif.
Endform.
Form display_error_rec.
..
Endloop.
Endform.
SAP AG 2001, Smart Forms - the Form Printing Solution,
Claudia Binder / Jens Stumpe 28
Example program on Call transaction
*****************************************************************
EXPORTING
FILENAME = 'C:\MARADATA.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_FILE.
'RMMG1-MTART'.
'=AUSW'.
WA_FILE-MBRSH.
WA_FILE-MTART.
REFRESH BDCDATA.
CLEAR BDCDATA.
REFRESH MESSTAB .
CLEAR MESSTAB.
ENDLOOP .
*----------------------------------------------------------------------*
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Go to XK01
Press enter
Go to XD01
Click on save.
SESSION METHOD:
client no = client no
Keep = X
Just call the function module and provide the above parameters.
Just call the function module and provide the transaction code name
and BDCDATA internal table name.
BDC_CLOSEGROUP:
Go to SM35
CLEAR WA_FILE .
REFRESH BDCDATA.
CLEAR BDCDATA.
ENDLOOP .
UNIT TESTING :
These are standard SAP programs which are used to update / upload
the data from flat file into SAP
It is a SAP tool which is used to transfer the data fro legacy system
to SAP.
recording method
BAPI method
ALE/IDOC method.
LSMW is a more user friendly tool, through which one can do the
same work as the BDC. One just has to follow the 14 steps.
CLOSE DATASET<filename>
INPUT : means, the file is opened for reading the data from file
OUTPUT : means, the file is opened for writing the data into file.
DIR_HOME,DIR_TEMP,DIR_NAME .
we use the below statement to read the data from application server
file.
We use the below statement for writing the data into application
server file.
End of ty_mara.
From mara
Up to 10 rows.
Open data set fnaame for output in text mode encoding default.
If SY-SUBRC <> 0.
ELSE.
Endloop.
Fname = mara.txt.
If SY-SUBRC <> 0.
ELSE.
DO.
EXIT.
ELSE.
Write : / v_str.
ENDIF.
ENDDO.
ENDIF.