Error Logs
For trouble shooting purposes there are a number of error logging options that can be used to troubleshoot system errors at various levels. The logging levels can take place at the K2 Server level, the K2 connect level, and at the ERPConnect level which is used by K2 connect.
K2 Five console logging: This level of logging shows what is taking place on the K2 server side. The console listing should enable the developer to view when the SmartObject call is executed (and any errors if any).
SmartObject Logging: This option helps to view the data being passed in at the SmartObject level to the K2 connect service broker. The input output results of the data packages are also visible. This can be very useful in a certain cases where a specific data set is expected to be returned from a BAPI call but different data results are being returned. It will also enable the developer to view the structure of the data ie an array of records opposed to a single column for example.
Protocol Logging: This shows what BAPI calls are being made and also statistics about them. This can be enabled on the K2 connect Administration Tools under Settings. Enable the Protocol Logging option and click OK. After this is done, restart the K2 connect service. You will see the BAPI calls being called in the Protocol console in the same Administration tool panel (click Protocol).
RFC exception: This log gets created if there is an exception at the RFC layer. This is quite useful if the SmartObject calls fails with a connection error message (and the K2 connect service is running). This is a good place to check if all the previous logging options don't give any clues on the failures. You can find this text log in C:\Windows\System32\dev_rfc.trc.
The extension seems to indicate a SQL profiler trace file but it isn't. Use Notepad or a similar editor to view it.
ABAP Debugging: If the SAP GUI is installed on the designer machine, try turning on ABAP debugging (reference ABAP - Debugging). This logging option enabled the developer to step into the BAPI call to see what is happening on the SAP side. This will enable the developer to view whether the call is being executed properly and also whether it returned any results.
Testing with ERPConnect code: At times unexplained or unexpected errors may be generate with certain BAPI calls. This also be the result even when the Test Cockpit is used. This might indicate an issue on the ERPConnect layer (which K2 connect uses). To verify, a simple ERPConnect application can be written to do the call and see if it works. Sample code can be found at Start > Program Files > ERPConnect > Samples. The code samples enable the developer to determine if the error is related to K2 connect or the ERPConnect layer.
Errors are returned in multiple ways.
- A BAPI normally returns error messages as part of the RETURN structure. These can be read in the same way as a normal property.
- Connectivity, Authentication and other errors are usually returned by the ERPConnect layer as Service Instance exceptions.