2008 Mar 07 9:52 PM
What is the difference between BAPIs and BDCs...why BAPIs are preferred...? i know you might have gone through this question a zillion times....but the thing that bugs me the most is the fact that...if BAPIs are a better choise to transfer data as compared to BDCs...then where on earth are the field validations done in BAPIs.? ...how is data integrity maintained if data is transferred through BAPIs? ( since data is not passed through screens...no validations are done)
2008 Mar 07 9:55 PM
Please do not cross or duplicate post - it makes it difficult for responders to help if the question is answered in the other one.
See my answer in your other post.
Rob
2008 Mar 07 10:04 PM
2008 Mar 07 10:14 PM
Not to worry.
If you find that you haven't gotten a good answer after a while, instead of creating a new thread, you can edit your original one and it will go to the top of the heap.
Rob
2008 Mar 10 10:42 PM
I much prefer BAPIs over BDCs because they are much faster for me to develop and use. You never have to worry about screen numbers/screen flow/subscreens changing on you.
And if you have to save data to a table control, you just pass a table in the BAPI at the tables parameter.
One of my favorite features is that most BAPIs let you run them in "TEST" mode - you pass an "X" to the NOCOMMIT importing parameter and it will return a success or error message without committing the changes to the database.
I've used BAPIs on the HR side so I can speak to that. When you call a BAPI, such as BAPI_BEN_BUS3029_CREATE_PLANS to enroll an employee in Benefits, deep down you will find it performs a sort-of BDC session afterall.
In my case, you will eventually get to the following which updates employee master data
CALL DIALOG 'HR_MAINTAIN_MASTER_DATA' USING *BDCDATA* MODE *l_mode*
EXPORTING
PSPAR
PROPOSED_VALUES
LUW_MODE
PS
PSINFO
PREFTAB
IMPORTING
PS
PSINFO
PREFTAB
PSPAR
PROPOSED_VALUES
MODIFIED_KEYS.
Notice that it's using the same BDCDATA table and MODE as a BDC program would. If I set a break-point at the above Call statement and change L_MODE to '1'(Display all screens, I believe), you will be taken through each GUI screen.
You should pick out a BAPI that does something you are already familiar with and try it out. I think you'll find it much easier to work with compared to BDCs.
Validations take place all over - you just have to debug to find them.