‎2007 Dec 18 1:26 PM
Hi All,
If you are given functional specs for a BDC program and you need to decide whether to write a method call transaction or a session. How u will decide?and if we use session method ,after running a BDC program in background, next day morning when you see the results, few records are not updated (error records). What will you do then?
Shall we need to again process the same input file,if so what about the records which are already processed....and so on.....please explain me these type of situations which occurs in real time with the session method.
Thanks,
Rakesh.
‎2007 Dec 18 1:39 PM
Hi
I think if you read a data from a file it's better to create a BDC sessions, in this way all records of the files are elaborated at the same times (when the session is run): so or you elaborate all or nothing.
If there's some error you need to elaborate the session manually (without to read the file again).
If you need to run the session immediately you can submit the program RSBDCSUB.
Anyway you can also create a program using CALL TRANSACTION method and create a BDC session only if the trx fails.
Max
‎2007 Dec 18 2:22 PM
Hi Max,
Could you please explain it in brief.I mean how we will decide the method and in case of errors for some records than we will again execute the session after removing the records which are successfully uploaded or what??how we will proceed in such cases?
‎2007 Dec 19 5:51 AM
Call transction is used when you want the generated document number to be back in the program. Means you want to do some processing after your document is being generated by Call transaction.... and relevently small data.. because if you have large data, you will have problem of getting TIME_OUT...
Session is used when you are not sure when you will run the BDC... may be you can schedule a job to run in the night... This is used for large numer of transaction update...
http://www.saptechnical.com/Tips/ABAP/DiffSessionCALLTRANSC.htm
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the CALL TRANSACTION USING statement. - No batch input processing log is generated.
The most important aspects of the session method interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel
hope this might helps you.
‎2007 Dec 19 5:59 AM
You can use BDC, LSMW for the transfer of data from non SAP to SAP systems.
The BDC Methods are:
CALL TRANSACTION:
Single transaction can be processed always.
Synchronous Processing - means Transfers data for a single transaction.
Asynchronous and Synchronous Database Update is possible.
No Session Log is created
Faster as it Asynchronous Update is possible.
Returns the SY-SUBRC value.
SESSION METHOD:
Multiple Transactions can be Processed through the same session.
Asynchronous processing - means Transfers data for multiple transactions.
Synchronous updates only possible - means no transaction is started until the previous transaction has been written to the database.
Session log is created.
Slower as it is Synchronous Update only.
Doesn't return the SY-SUBRC value.
Direct Input method:
Check the following links
http://www.sap-img.com/sap-data-migration.htm
http://www.sapgenie.com/saptech/lsmw.htm
http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
Reward Points if helpful
‎2007 Dec 19 6:11 AM
hi,
Regarding the error handling in call transaction.
The BDCMSGCOLL does not have the messages text. It has only the message type, number and message parameters.
You have to read the message text. (recall that the database table T100 stores all the messages.)
There are more than one method of doing this.
Following is the psuedocode for one of the methods.
LOOP for the internal table IT1 which has data value from flat file.
call transcation using....
if SY-SUBRC <> 0.
Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL.
(also use the condition T100-SPRAS = SY-LANGU (the log on language. This is because you need only the message texts in English if the user is logged in English language)
IF message type is E , then, transfer the contents of this particular error record to file x. (TRANSFER......)
( Ignore all other messages. Only consider type 'E' messages. Ignore other types of messages.)
(You can also store the message text from T100 and the error record in another internal table IT2)
.....
....
ENDLOOP.
You can also use Std Function module 'FORMAT_MESSAGE' , for error handling.
If you are using CALL Transaction you need to maintain the log of errors by reading the messages from BDCMSGCOLL.
Repair the errors and rerun your program again.
If you are using BDC session method and an error occurs, a session is created in SM35. You can rerun the session in foreground from transaction SM35 after correcting the error.
Hope this is helpful, Do reward.
Edited by: Runal Singh on Dec 19, 2007 11:42 AM