Creating a BDC program.
Upload vendor master using BDCs.
1. Create the text file (use tab button between values to keep uniform distance)
210 0001 0001 0001 Mr. Dallas dl
Lord Krishna Bank IN 950000
2. Goto Tcode SHDB.
3. Click on new recording
4. enter tcode XK01
6. create a dummy record
9. select the recording
10. click on program
11. enter program and enter
12. enter short description
13. click on source code
14. double click on BDCREXX1.
15. click on display
16. copy all
18. Change program name to include ZTEXT_BDCREX
19. Double click on that
20. Paste code which was copied earlier
22. come back
23. comment all data set statements
( one has to comment a lot performs and datasets, that depends on type of transaction being recorded)
24. Make record to be an internal table writing occurs 0.
DATA: BEGINF OF RECORD OCCURS 0.
After include, write following:
PARAMETERES: P_FILE TYPE RLGRP-FILENAME.
DATA V_FILE TYPE STRING.
AT SELECTION-SCREEN ON VALUE REQUEST FOR P_FILE.
CALL FUNCTION ‘F4_FILENAME’.
PROGRAM_NAME = SYST_CPROG
DYNPRO_NUMBER = SYST_DYNNR
FIELD_NAME = ‘P_FILE’
FILENAME = P_FILE
25. After START-OF-SELECTION:
V_FILE = P_FILE.
And call the function ‘gui_upload’.
CALL FUNCTION ‘GUI_UPLOAD.
EXPORTING FILENAME = V_FILE
FILETYPE = ‘ASC’.
HAS_FIELD_SEPERATOR = ‘X’.
DATA_TAB = RECORD.
26. comment DO and write LOOP at record.
27. comment ENDDO and write ENDLOOP.
28. Execute the program.
29. select call transaction radio button
30. enter processing mode as A
31. in the file name, enter the file path
Running Bdc Program Through Session Method
1. Execute the program
2. select “Generate Session’ radio button
3. enter session name
4. tick mark “Keep Session”
5. Enter the filename
7. goto SM35
8. Select the session click on process
9. Select background
11. Analysing the background session
13. Click on own jobs.
Scheduling Background Program
2. enter the jobname
3. click on step
4. enter the program name and variant name
5. check and save and come back
6. click immediate
7. start condition.save.check.
Steps to write a BDC program
1. Identify the fields
Press F1 on field, click on technical info.
2. Fill BDCDATA internal table.
BDC data structure
3. Call the transaction
Processing mode in call transaction:
- A = Display all screens
- E= Display error.
- N = Background processing
4. Update Mode
a. L = Dialog work process will update the data
b. S = Synchronous update (update work processor will update)
If 1-100 records are updated and error is in 50th record, then 1-49 will be updated.In synchronous update the sy-subrc is set to 0 only when the particular transaction is executed and also the changes have done to the database,
c. A = asynchronous update work process will update. Incase error is 50th record, then 1-49 records will be updated and 50th will logged as an error. In asynchronous update the sy-subrc is set to 0 if Â the transaction is executed without any fail, not the database changes.
Difference between Call Transaction and session method.
Call Transaction Session Method
i. Synchronous Asynchronous
ii. Error needs to be handled Automatically
iii. Used for relatively less records More records
iv. No function modules are called Multiple transactions called
and used to update one transaction.
v. No session is created. Session is created.
The function modules called are: