cancel
Showing results for 
Search instead for 
Did you mean: 

External Debugging a sap gateway service

Former Member
0 Kudos

Hi

I have created a y object based on below pfd

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d92637-3d0d-2f10-ebb2-efc1f40a8...

i am able to execute and getting result for query operation but I kept an external debugpoint in ECC system ,while executing URL in gateway,debugging point i snot triggering. and i have another requirment i nee to call an function module in create_deep_entity method.How to do it.

Thanks

Vamsi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ashwin/Malik

My requirement is ,i have developed a function module in ECC having export parameter lt_return-contains message.In this  i am using BAPI_PO_CHANGE .This fm must be exposed to outer world through gateway,As bapi do update in ekko,ekpo tables,Normal way of query operation(create mapping) is not working.I can to know,we should do like in above pdf. The same i have did,create_deep_entity is for deep insert/update etc,So i think it is mandatory(in pdf bapi was called in this method-i was not sure).In pdf for query and read operations,GET_ENTITY & GET_ENTITY_SET methods needs to implemented.I was thinking BAPI_PO_CHANGE also needs to be called in this methods but not sure in which method i need to call).Kindly can you pls check the pdf once and give me an idea.

Thanks

Vamsi

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

In that case you need to implement Create Deep Entity to achieve deep insert operations.

Please have a look at the below document which will explain every single details describing CRUD operations including Create Deep Operation as well.

This will give you an idea how you can model your GW Service to handle deep operations.

Use SEGW ( GW Service Builder ).

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin

In the pdf which i gave,states that create_deep_entity is for creation,but for query & read operations

need to implement get_entity and get_entity_set methods in data provider class along with header  and item provider class.I was thinking i need to call my fm in this methods.

Thanks

Vamsi

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

We need to implement methods respectively based on our CRUD operations in GW level.

Below are the basic operations :

Create_Entity -> Create Operation for flat structures

Create_Deep_Entity -> Deep Insert Operations

Get_Entity -> Read operation which works on Key as inputs ( Response will have single record )

Get_Entity_Set -> Query operation which works on filters as inputs ( response will have multiple records )

Delete_Entity -> Delete operation

Update_Entity -> Update a particular entry.

I suggest you to go through that to get better understanding.

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin

So you mean to say i need to declare functional output parameter(lt_return) in create_entity and call my function module in create_deep_entity and implement get_entity_set method

am I correct Ashwin?

Thanks

Vamsi

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

No. Its not like that.

Can you please share screen shot of your RFC input, output ? so that based on that we can model the GW service.

Regards,

Ashwin

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

1. If Single Sign On ( SSO ) is configured between ECC and GW system , then in ECC you can stop with the same user which you have logged in GW system to consume the service.

Say USER1 is the user and if SSO is configured between ECC and GW system, then you can stop in ECC with user USER1.

USER1 should have debugging authorizations.

You need to maintain as below in ECC:

Go the line where you want to stop and put the break point with the same user as below.

2. If Single Sign On is not configured ( User and Password are maintained in RFC destination i.e., is System User is maintained ) in that case you need to use that user which is maintained in RFC destination to debug in ECC level and should have debugging authorizations.

Say USER2 is the system user which is maintained in RFC Destination as below :

In ECC maintain as below :

Please check the above and you should be able to resolve the issue.

The below are for your reference  Sample examples :

Calling RFC with Destination :

CALL FUNCTION 'ZFM_GET_DATA' DESTINATION  'DEVCLNT210'

      EXPORTING

        uname        = user

        date            = sy-datum

      IMPORTING

        sysid          = tmp_sysid

      TABLES

        int_tmp1     = int_tmp2

      EXCEPTIONS

        update_error = 1

        OTHERS       = 2.

    IF sy-subrc <> 0.

   ENDIF.

CALL FUNCTION ... DESTINATION (synchronous RFC)

Calling FM without destination :

CALL FUNCTION 'ZFM_GET_DATA'.

      EXPORTING

        uname        = user

        date            = sy-datum

      IMPORTING

        sysid          = tmp_sysid

      TABLES

        int_tmp1     = int_tmp2

      EXCEPTIONS

        update_error = 1

        OTHERS       = 2.

    IF sy-subrc <> 0.

   ENDIF.

Hope this helps.

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin

Thanks for the answer

I am logged with the same user name in ECC and Gateway system as well.

for another services i can able to debug(those services are not using this complex entities classes)

Thanks

Vamsi

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

Which class you have put break point ? DPC_EXT class ? DPC class ?

Which method ?

If the Call from GW is reaching to ECC, then irrespective if its a Service with Complex Entities or a Service with normal Entities you should be able to stop with a breakpoint.

I would suggest you to check if call is going to ECC or not at the very first place.

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin

I have kept an external break point in DATA class ,at BAPI_PO_CHANGE. which is in create_deep_entity method.

when i click on execute,it is showing output with code 200.

below are the classes used ,(in PDFservice done for  it for vbak,vbap table(instead of bapi_salesorder used PO_change ,i did for ekko,ekpo tables)

Y_SERVICE_MODEL_DATA_ITEM

Y_SERVICE_MODEL_DATA_HDR

Y_SERVICE_MODEL_DATA

Y_SERVICE_MODEL

Thanks

Vamsi

AshwinDutt
Active Contributor
0 Kudos

Hello Mohan,

Create operation response will be 201 not 200,

I suspect that you are not putting the break point at the correct place.

The response 200 which you are getting is for READ operation not for Create.

First let me know are you using SEGW transaction to build the service ? or manually creating classes in se24 by inheriting the model and data provider classes ?

I would suggest you to use SEGW as below for :

Regards,

Ashwin

former_member184867
Active Contributor
0 Kudos

One common mistake may be not putting the break point at the correct method of the DPC class.

Another common reason of not stopping at the break point is not using the correct client  in the Gateway call. You can influence the client by specifying sap-client=<CLIENT NUMBER> in the OData URI.

If you are not stopping at the break point and do not know what is happening you may start debugging from the class /IWFND/CL_SODATA_HTTP_HANDLER method HANDLE_REQUEST. There is the first class to be called from the Gateway HUB. However this can be tedious job.