cancel
Showing results for 
Search instead for 
Did you mean: 

Call a copied Service (specific) seems to unactivate original one (standard) and vice versa

bertrand_delvallee
Active Participant
0 Kudos

Hello,

Context :

My goal is to give to some users the possibility to choose between several payslip output formats (impact which form will be used in RPECEDTxx). But, I wanted to keep the original standard awake because it already works good in productive portal for general cases.

What I have done so far :

In SEGW I created project ZHCM_MY_PAYSTUBS by copying HCM_MY_PAYSTUBS. I changed and activate its service PDFPaystubs (to add 1 more parameter). Other herited services ConcurrentEmploymentSet and Paystubs are unactivated. The new specific service ZHCM_MY_PAYSTUBS/PDFPaystubs works as wanted when tested alone.

But, we observe a strange behavior :

1) If we call a service from HCM_MY_PAYSTUBS (for example HCM_MY_PAYSTUBS/Paystubs) with success then we have an error when call ZHCM_MY_PAYSTUBS/PDFPaystubs :

"The request URI contains an invalid key predicate."

=> So it seems the gateway try to call original HCM_MY_PAYSTUBS/PDFPaystubs (which can't read the new specific parameter)

Now this is when it becomes really strange to me :

2) If before calling ZHCM_MY_PAYSTUBS/PDFPaystubs we request its root ZHCM_MY_PAYSTUBS/ then the service answer is good

3) And vice versa : if we don't call the root HCM_MY_PAYSTUBS/ after calling ZHCM_MY_PAYSTUBS/PDFPaystubs (with success) then we have an error "Resource not found for the segment 'Paystubs'" when we request HCM_MY_PAYSTUBS/PDFPaystubs

=> So it seems the gateway swap to the good project only when we call the wanted one's root. Like the gateway don't read the URL to choose between ZHCM_MY_PAYSTUBS or HCM_MY_PAYSTUBS : it just stay and try with the last "PDFPaystubs project" used.

Question :

Do you have a clue about what is going on?

Note that my specific service and the original one use method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM (if it may have consequences) and I properly use /$value in my requests when needed.

Many thanks!

Bertrand

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Bertrand,

I did some tests with redefining a service but I wasn't able to product to model references in SEGW.

I have no explanation for the behavior you observed so far.

You can check the service registration using Transaction /IWBEP/REG_SERVICE.

This will tell you if your service ZHCM_MY_PAYSTUBS_SRV is configured as an extension for HCM_MY_PAYSTUBS_SRV.

But in this case you wouldn't be able to Access the source Service anymore but would call the Service implementation of your service ZHCM_MY_PAYSTUBS_SRV when calling the URL of your service HCM_MY_PAYSTUBS_SRV.

Are you using a separate SAP Gateway Hub and have potentially registered the service for several backends where in one system the service is extended and in the other one not?

Have you checked the error log (/iwfnd/error_log) and the call stack?

Regards,

Andre

bertrand_delvallee
Active Participant
0 Kudos

Hi Andre,

As you mentioned my model references seem weird I did a new copy with a more different name. This time taking care at each step and I even changed the name of entities before generation. But same things are happening with this guy (no more model references tho) : Standard and specific can't be called one after the other without calling "service root" in between.

I'm busy on other subjects so I had to give up on analysing root causes of this behavior.

I just created a new project from scratch and copied/pasted manually what I needed (around 80% 😞 everything works well in this case.

Notes : no separated SAP Gateway Hub involved. The error log doesn't give more clue to me that what I wrote in my first message.

I thank you much for your time. If I can analyze further I will write here my results.

Best regards

Bertrand

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Bertrand,

if you just have copied the Service Builder Project you would just create a new Project have the same OData Model but without any implementation. Did you do that and have copied the service implementation in the data provider extension class manually?

Or have you chosen the option to redefine an SAP Gateway OData Service?

Best Regards,

Andre

bertrand_delvallee
Active Participant
0 Kudos

Hi Andre,

I thank you for your quick answer and your help.

My copy does use a model reference that extend the original (as far as I understand) using the same structure HCM_S_PDFPAYSTUB. As I wanted to keep standard functionalities I did a structure append into HCM_S_PDFPAYSTUB to add my new specific parameter.

In runtime artifacts there are "Z*" objects having standard ones as superclasses. For example ZCL_ZHCM_MY_PAYSTUBS_DPC_EXT extend ZCL_ZHCM_MY_PAYSTUBS_DPC that extend CL_HCM_MY_PAYSTUBS_DPC_EXT that extend CL_HCM_MY_PAYSTUBS_DPC that extend /IWBEP/CL_MGW_PUSH_ABS_DATA.

And I just redefined method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM of ZCL_ZHCM_MY_PAYSTUBS_DPC_EXT.

You can see in this screenshot my 2 projects.

Do you understand what can go wrong with my approach?