Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member184739
Contributor
0 Kudos

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.

$.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 )

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 .

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

Labels in this area