cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ODATA GATEWAY SERVICE

Former Member
0 Kudos

Hi experts

I want to create odata service to read individual and corporate account, for this I have created one remote enabled FM but where i used import parameter an Partner number and in export i hav created custom structure with multiple fields and again structure. But in service builder it showing error 'deep structure is not allowd' how can i resolve this error.

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Faseeh,

Your FM has 2 different output structures is it ? or 2 different output tables ?

You can implement following ways :

1. If your FM has only 2 different output structures then you can make use of ComplexTypes.

2. If your FM has 2 different output tables then use Expand_Entity/Expand_Entity_Set accordingly as per your needs ( Association & Navigation i.e., $expand )

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

My fm have one output table type which have again line type structure in this structure i defined different field related to  account but for multiple access of phone,fax and email field again I have given table type this i can access by looping table.This is successfully giving me output in se37 but its giving me trouble in service builder.

Thanks In advance.

AshwinDutt
Active Contributor
0 Kudos

Hello Faseeh,

Could you please put a screen shot of your FM ? i mean your output tables/structures of your FM.

Regards,

Ashwin

Former Member
0 Kudos

Z81_details_t  :- table type for this I assign  line type below

AshwinDutt
Active Contributor
0 Kudos

Hello Faseeh,

As per the screen shot its a nested structure.

I would suggest the below way of implementation as per best of my understanding :

For an instance lets assume you are sending Business_Partner Number say 10000 as input to get all the details of that particular Business_Partner which u have shared in the screen shot.

1. Create Parent Entity say BP_NUM which has the input Business_Partner Number.

2. Create Child Entity say BP_DETAIL which has got all the fields apart from PHONE , FAX & EMAIL tables.

3. Create Child Entity say PH_DETAIL which has got all the fields related for PHONE details of BP only.

4. Create Child Entity say FAX_DETAIL which has got all the fields related for FAX details of BP only .

5. Create Child Entity say EMAIL_DETAIL which has got all the fields related for EMAIL details of BP only.

Now Create Association and Navigation as follows :

BP_NUM to BP_DETAIL - 1 to 1

( assuming response of your FM will have one business partner as output and corresponding details for FAX, PHONE & EMAIL tables )

BP_NUM to PH_DETAIL - 1 to N

BP_NUM to FAX_DETAIL - 1 to N

BP_NUM to EMAIL_DETAIL - 1 to N

Implement Expand_Entity and pass BP Number as key ( assuming your FM will take a particular BP Number and returns all the details which u have shared in the screen shot ).

Refer the below for technical details.

Create a deep structure and as a response return the corresponding tables accordingly by sending back navigation properties correctly to the expand clause.

Regards,

Ashwin

Former Member
0 Kudos

Thanks alot

Answers (1)

Answers (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

This is correct as the structure must be flat instead of nested.


Guidelines for output parameters

  • The output parameter must be a table.The fields in the table must be flattened and mapped to the root DATA object.
  • The output table must contain the input fields.
  • Only one table can be mapped as an output table.
  • Nested tables are not allowed.

Reference - https://help.sap.com/saphelp_gateway20sp06/helpdata/en/98/0d7b12e6db4d1581fd5fdfb05f129e/content.htm

But there are ways you can achieve the functionality by association, navigation etc.

Regards,

Chandra

Former Member
0 Kudos

Thanks for ur reply...