Sunday, 9 July 2017

Remote ABAP debugging


Remote ABAP debugging: 

Scenario:  

When I initially started working on Integration tools like Business Connector/.Net connectors/XI, I always wondered how to debug the process in the backend SAP R/3 system when I make an RFC call. Because when we call any SAP RFC function module from any integration tool, it will be processed on any available application server in the backend, where a user breakpoint cannot be triggered to debug the ABAP code in the backend system. The situation becomes worst to the developers/testers when they want to test the scenarios like HTTP-XI-RFC, HTTP-XI-PROXY, and FTP-XI-RFC so on. But we have a simple solution to debug the ABAP code when we are working on Remote function calls.


PRE-REQUISITE:  
  • The backend SAP system should be ECC 6.0 with latest patch updates.
  • It is assumed that user has developed a simple scenario HTTP-XI-PROXY/HTTP-XI-RFC or any similar scenario where XI makes an RFC or Proxy call to SAP R/3 system. 
When developing the scenario, in the integration directory configuration, while creating the Receiver communication channel with RFC adapter or Proxy Adapter user has to use own SAP R/3 user id/password as authentication parameters with which user wants to login to the SAP system to debug the code. i.e. the same user id has to use to log in the sap system to set the breakpoint in the ABAP Code.

SOLUTION:
Log in to the sap system where RFC function module or Proxy class implemented.  
Open the Function module/ Proxy class and set a break-point. It is not mandatory that break-point has to set only at the initial line of the code; the user can set anywhere in the entire code, which will be executed on RFC call.  
Execute the transaction code “SRDEBUG” (Note: this tcode is available only in latest ECC 6.0 system)  

Click on the button Activate Debugging. A pop-up screen will be opened. Fill the User-ID with which break-point has been set. (The same user-id should be used as authentication data in the XI while creating RFC communication channel).  Select the radio buttons “all Appl. Servers” and “External break points already set”. Click on OK. 
Another pop-up will be opened with a message “End debugging?” Leave the pop-up as it is. (Don’t close the transaction).  

Now start sending a message from HTTP client. When the message arrives in SAP R/3 system, a debug session will be started from the point where the user kept the break-point in the step-2. From this point, the user can start debugging the code as usual.
Thus, concluding setup of Remote ABAP debugging.



SAP ABAP TIPS:

SAP ABAP TIPS:



There is a very interesting function module, with the help of which you can send the pop-up messages to the users/friends who are logged into the SAP system.
The interesting function module name is ‘TH_POPUP’.
For this, you and your friend should be logged on into the SAP system and you must know the SAP user id of your friend to whom you are going to send the message.
Please go through this and enjoy chatting with your friends while working on SAP system.

STEPS :
1.     Go to transaction SE37 and enter the function module name TH_POPUP.


2.     Pass the client, user name and the message which you want to send and execute the function module.


Output :
The pop up will appear to the user/friend’s SAP system.

Note - if the user has logged on multiple systems then the message will be sent to multiple systems.