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
421

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

View Entire Topic
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?