cancel
Showing results for 
Search instead for 
Did you mean: 

Issues in Netweaver Gateway concepts.

Pavan_Golesar
Active Participant

Hello Gateway Gurus,

      I had been carrying out OData service activities in Netweaver Gateway, Facing issues in understanding the functionalities and concepts in it.. I hope this post will be helpful for getting all basics understanding cleared.


NOTE: Please consider doubts mentioned below as Independent of each other also these images are not related to each other.


1. I am bit puzzled in the properties section of the data model... as in what is the relevance of the checkboxes as shown below picture..  I have noticed these reflected in $metadata of the service as well).

2. Regarding the other confusion its related to cardinality..

When we do we go for Cardinality as "N" and when for Cardinality as "M"

3. I have used the following lines of code many times...

sharing the snapshot for the same.

but yesterday I was in worry about what the IO_EXPAND-> Compare_to mean as I didn't know its working..

also the use of lv_compare_result ???

like for example, if I have to specify two children , but Even If I specify 'SOItems' here , I get 'SOSchedules' as well  ...

Thanking you in advance,

Hope to get many helpful hit on this..

BEST REGARDS,

Pavan Golesar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pavan,

I'm confused about your third point as well. The io_expand class gets me all of the data when I specify SOItemSet even in case of a deep structure containing 6 independent sets SOHeaderSet, SOItemSet, SOScheduleSet, SOConditionSet, SOPartnerSet and SOAddressSet.

As for the first 2 points, You already have correct answers from experts.

Let us know if you stumble across a plausible explanation for the 3rd point.

Cheers,

-NK

Pavan_Golesar
Active Participant
0 Kudos

Thanks

Regards

Pavan G

EkanshCapgemini
Active Contributor
0 Kudos

Hi Pavan,

Can you please explain a bit more about the third point? Also please provide the URL that you are hitting, code of your GET_EXPANDED_ENTITY or GET_EXPANDED_ENTITYSET as a text file attachment. This can help in clarifying the things.

Let me try to explain from my side. Suppose there are 3 entitysets: SOHeaderSet, SOItemSet & SOSchdlineSet and there are two navigation properties defined: SOHeaderToItem, SOItemToSchdline. Now you try to hit these two URLs:

1. /sap/<MyService>/SOHeaderSet?$expand=SOHeaderToItem/SOItemToSchdline

2. /sap/<MyService>/SOHeaderSet?$expand=SOHeaderToItem


The 1st one would give you the complete list containing all 3 sets in response. But 2nd should give only SOHeaderSet and SOItemSet. Here comes the use of

io_expand->compare_to( '<navigationPropertyName>' ). By using this statement you can check which all navigation properties are asked in the request URL and then pass only those properties in the response.


Hope it clarifies the doubt at some extent.


Regards,

Ekansh

Pavan_Golesar
Active Participant
0 Kudos

Hello Ekansh,

As discussed.

Its Working fine now.

Thanks for inputs,

Cheers !!

Regards,

Pavan G

Answers (3)

Answers (3)

AshwinDutt
Active Contributor
0 Kudos

Hello Pavan,

According to me defining Cardinality depends on your scenarios having how you want entities to be associated with each other and how you would like to map back them as part of GW response.

Regards,

Ashwin

JyotiD
Active Participant
0 Kudos

HI Pavan,

Please check these

Defining Properties - SAP NetWeaver Gateway - SAP Library

Regards,

Tarun

Pavan_Golesar
Active Participant
0 Kudos

Hello Tarun Sharma

     This is an Awesome Link you shared..

Thanks alot.

Regards,

Pavan Golesar.

JyotiD
Active Participant
0 Kudos

Thanks Pavan,

Regarding your second query on Cardinality.

0 :-  0 to 1

1 :- 1 to 1

M :- 1 to n (one or more instance)

N :- 0 to n ( zero or more instance, instance may exist or not)

Regards,

Tarun

EkanshCapgemini
Active Contributor
0 Kudos

Hi Pavan,

Please check my reply on this thread for checkboxes. Entity Set - CheckBoxes of creatable updateable... | SCN

Regards,

Ekansh

Pavan_Golesar
Active Participant
0 Kudos

Hi Ekansh Saxena,

   Thanks for this quick reply..

So we can say that these are imp from view of UI DEVELOPER , and for MS- excel plugin:


These checkboxes are to well define the metadata document of your OData service. Checking or unchecking these checkboxes does not affect the functionality but in the metadata it shows that this entity is creatable or updatable etc. So a UI developer would easily understand the metadata document.

These checkboxes play an important role if you try to use Excel plugin of SAP Gateway for Microsoft . If you have not checked these checkboxes in the service, it will not  allow you to perform respective operation on that entity from within the excel sheet.


Thanks for this beautiful clarification of the same..


Can elaborate on other points as well..


Best Regards,

Pavan Golesar.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Pavan,

For defining cardinality and choice of using N/M, please check this link: Associations - SAP NetWeaver Gateway - SAP Library

It says:


  • Cardinality: specifies the relation between the specified principal entity type and the dependent entity type. Press F4 or click to select from the list. The multiplicity of the association can be as follows:

          0: 0..1 - Only one instance occurs, zero is also allowed.

          1:  - One-to-one relation. Exactly one instance occurs.

          M: 1..n - One-to-many relation. One or more instances can occur.

          N: 0..n - Zero-to-many relation. Zero or more instances can occur.

Many-to-many relation is not supported in the wizard.

If I explain it a bit clearly for your screenshot: There is a principal entity SOHeader which is associated with SOItem and you are using 1:N cardinality here that means that there is always 1 SOHeader present(1) which can be used to navigate to SOItems which may or may not be present(N). Ideally it should be 1:M in this case because there can not be a Sales Order without its items.

Regards,

Ekansh