Skip to Content

Issue with FM output SWL_GET_PROTOCOL_EXTERN in get_enitytset method

Hi Experts,

I have to fetch records from RFC "SWL_GET_PROTOCOL_EXTERN" where i will provide wi_id as my input and the output table parameters as "steps" & "actions" which is defined as complex type.

wi_id is of type numc length 12. when i created as property with the same

it throw below error as

so i have changed into string type as shown in green color in the above image.

now i have generated the objects and i have change my mpc class like below since i have my output as complex structures.

when i execute my code i could see my output in et_entityset with values filled

when i click f8 the data is empty except wi_id(input) as per below snap

My code:

Is it conversion problem causing is issue or what the problem is please help me to fix this issue

input.jpg (132.7 kB)
error.jpg (102.6 kB)
string.jpg (128.5 kB)
mpc.jpg (88.9 kB)
et-set.jpg (30.9 kB)
output1.jpg (118.3 kB)
output2.jpg (117.2 kB)
code.jpg (93.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 22, 2017 at 05:35 PM

    Complex types are used when you want to club certain properties together but they don't necessarily have a key. As example - Personal details of anyone like age, gender, etc. A complex type still represents a structure and not a table.

    Your use case is you need to expose multiple tables. In this scenario, you need to create navigations/associations. Something like a sales order header with multiple sales order items. Sample approach can be seen - https://blogs.sap.com/2017/09/18/generic-expanded-entity-implementation/

    Add comment
    10|10000 characters needed characters exceeded

    • Importing RFC/BOR/GENIL etc. are all ways of getting the backend data via standard SAP methods...you still need to create the semantically correct OData service entities and create relationship/association between them known as navigation properties. Please check above blog.