cancel
Showing results for 
Search instead for 
Did you mean: 

Please Clarify on $filter, $expand, $Read $Query

vijaybhaskarraju_vegesana
Active Participant
0 Kudos


Hello Every One,

I have a requirement of passing multiple inputs and getting output as multiple structures.

Suppose like, if i am giving cust no, company code, credit control area as input and in the output i am getting results in two structures in my custom RFC, till here it is working fine.......the same output how can we replicate in gateway service builder

i know that we cannot do query operation as it allows only single input or filter can be applied on the same input.

I assume that this can be done using Read and Expand operations. Please guide me how to proceed further, or any othe possible ways to achieve this.

Passing multiple inputs and getting multiple structures as output using SEGW?

Thanks,

Vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Vijav,

you have to think about the structure of your OData model.

You could have two entity sets that are related with each other via a navigatin property.

By implementing your own method for expand you would be able to populate the response in that method.

You could than retrieve the data via a $expand call.

Best Regards,

Andre

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Andre,

Thanks for the quick reply, i tried but could not able to achieve this one.

Suppose if have cust no, company code, credit control area, date as input and all these are key in my entityset and  if i want to navigate to first entity set output all these should be checked as key?


Can you please guide me by seeing below screen shots,


My First EntitSet, performed Read operation

Second EntitySet Read  operationn

Association Property for these above 2

Can you please throw some light on the above and guide me accordingly whether i am doing correct way or not..here can you please guide me how to do mapping for the date in both entity sets..

can you please provide me sample URI's for doing expand operation..for the above..

Thanks,

Vijay

jibin_joy
Contributor
0 Kudos

Hi Vijay,

  I recommend to use custom code implementation than direct RFC mapping   to achieve this case .

can u provide more information about ur scenario . It will great if u provide block diagram or RFC Signature Itself.  

Regards,

Jibin Joy

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Jibin,

Thanks for your response,

Please see the RFC signatures as below

Thanks,

Vijay

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Jibin,

Thanks for your response,

Please see the RFC signatures as below

Import Parameters:

First Output Structure

Second Output Structure

RFC Input1: According to below inputs first output structure will be filled.

RFC Input2: According to below inputs second output structure will be filled.

Please guide me...how to proceed further in gateway service builder for reading multiple output structures in one shot..

Thanks,

Vijay

arunchembra1
Participant
0 Kudos

Hi Vijay,

1. If CC_INVOICELIST and CC_ORDLIST have any relationship like Sales Order and Item you can go for Navigation property, if that is the case you can add Input Fields(CUST_NUM,COMP_Code...etc)  in both the out put table CC_INVOICELIST and CC_ORDLIST so you will be able to make navigation property.

2.If both CC_INVOICELIST and CC_ORDLIST doesn't have relationship you can merge tables CC_INVOICELIST and CC_ORDLIST.

Thanks,

Arun

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Thanks Arun, i included all the input fields both structures.

Can you please send sample URI to write expand query with multiple inputs like company code, credit control..etc..

Thanks,

Vijay

jibin_joy
Contributor
0 Kudos

Hi ,

  One more clarification ,In above two case it is getting either  Invoice List or Order List .

Is any case where both Invoice as well as Order list is fetched .

Regards,

Jibin Joy

arunchembra1
Participant
0 Kudos

Can you try like this Service(COMNYCODE='1100',CREDIT_CNTRL='002',SPRAS='EN')/?$expand=QMNUM

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

no jibin, there is always a flag, i did every thing..

In my input there is a time stamp, in my first output structure also i have taken keydate as input,

and remaining all dates i have set to nullable, but i dont undestand still i am getting the error,

In the context of Data Services an unknown internal server error occured


most of the times i solved this by changing date to nullable...but this time coul not resolve..


anyy guessess..


Thanks,

Vijay

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Arun,

Thanks for the sample URI, first time when i pass this query it is triggering backend RFC and fetching Timestamp and the data in the debugging, again it is hitting the same RFC(due to expand i think so) but timestamp is zero, can u guide me here how to proceed...

Thanks,

Vijay

jibin_joy
Contributor
0 Kudos

Hi Vijay,

  If both list is not fetch at a time then i suggest to make two different entity. One for Invoice and other for Order then u can add input field in both entity as Arun mentioned or else use custom operation for both entity .

For date issue . please go to TCode /iwfnd/error_logs and if possible send me the screen shot for this issue .

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Jibin,

i am doing spearatley for two different entity.  in my parent entity keydate is importing parameter and checked as key, so i did not checked it as nullable as it is key(in backend RFC data is getting populated from the URI) and even in my child entity it is checked as Key so i did not checked it as nullable( when it is hitting the RFC second time due to expand query keydate is zero).

how tp avoid overcome this kind of situation..

Thanks,

Vijay

jibin_joy
Contributor
0 Kudos

Hi Arun ,

  It is better to provide  null to date field even it is primary key .  I think this issue has been solved in SP8 .

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

No Jibin, it will not allow you to check null, when you are taking it as primary key..

Thanks,

Vijay