Dear All,

This blog is about debugging Netweaver gateway and SAP ECC system during a server request made from a HTML5 web app.

Pre-requisite: We create a Function module that is remote enabled in ECC.

Add the authorization header in the AJAX call for the user we need. To find the authorization value for the users we can make use of REST clients such as POSTMAN etc or Gateway client tool.

Authorization header.png

$.ajax({

     type: “DELETE”,

     processData: false,

     contentType: “application/json”,

     processData: false,

     data: ”,

     dataType: “text”,

     headers: {

         “x-csrf-token”: token1,

         “Authorization”: “Basic ZjaDM=”

     },

     url: delete_path,

     success: function (resp) {

         error: function (resp) {

             alert(“unable to delete file”);

         }

     });

Add an external breakpoint for the desired user in gateway system.(may be a redefined method or a remote FM )

Gateway.png

Add an endless loop to code snippet in ECC system in your custom FM or a class as follows.

DATA:W_VAR TYPE I VALUE 5.

  DO.

    IF W_VAR < 5.

      EXIT.

    ENDIF.

    W_VAR = W_VAR + 1.

  ENDDO.

Now when run the application from browser we will see the ABAP debugger session will be opened in gateway server.  If we had an RFC call to backend

to fetch then we can notice an endlees loop running in ECC.

Goto transaction SM50, click on as shown below .

SM50.png

Once debugger opened please click on variable W_VAR and change the value to 4 dynamically. You will see the loop gets exited giving room to troubleshoot next set of code.

We are now successfully able to debug the systems and made sure the code is bug free.

There may be other methods/tricks to accomplish this tasks much easier than this.

I welcome feedback/concerns to improve the content.

Cheers

PrabaharanThaW_R

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply