Skip to Content

$metadata does not show custom field from appended Entity structure

I have added a custom field to the entity structure HCMFAB_S_EMPLOYEEDETAILS by appending a Z-structure.

I implemented the BADI HCMFAB_B_COMMON, more specific the following method where I can see the custom property I added in the entity: IF_EX_HCMFAB_COMMON~GET_EMPLOYEE_DETAILS

I executed /IWBEP/CACHE_CLEANUP and /IWFND/CACHE_CLEANUP, however the $metadata /iwfnd/gw_client is not showing the new property.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 07, 2018 at 07:49 PM

    Hi Pieter Janssens !

    I think that what Gregor Wolf mention is exactly what's missing. You modify the structure and the BAdI but didn't modify the Model Provider which it's defined on the OData service class. Sometimes you have service enhancements where you have a BAdI just to modify the MDP class but in this case doesn't seem like that. Check this other message:

    Also, here is a link where there was a BAdI to modify the MDP (check page: 15) : . (in case you want to see another example).

    Hope this helps!

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Pieter Janssens ,

      I see your point and I think that the "rule of thumb" here would be doing a quick checklist every time that you're going to deal with an OData service:

      From the Model Provider (metadata / service definition) point of view:

      1. Did I change the Structure used on the service?

      2. Did I update somehow the Service metadata? (whether is via Code with a BAdI or via SEGW and the subsequent generated code)

      From the Data Provider (business logic) point of view:

      1. Did I Updated the business logic? (redefining a method/service or adding code via BAdI)

      In my 6 years working with gateway I didn't find a "SAP Standard Dynamic Service" that by enhancing the structured used then the Model is automatically updated.
      I coded custom OData services like that in the HCM space because, as you know, there are many country specific Infotypes but there is a "down side to that" and is that every call is being done to the service the Constructor executes all your code increasing all the calls by a % (so performance wise it's not the best - you can pre-calculate things but it's not that simple straight forward).

      I think that checking those 3 questions that I mention you can avoid the "trial and error", just verify that the BAdI are or not in place and if not then you know what to do (redefine).

      Let me know what you think!

  • Mar 07, 2018 at 07:17 PM

    I would guess you have to create a SEGW project and redefine the SAP delivered standard service. There you should then be able to add your custom field to the Entity.

    Add comment
    10|10000 characters needed characters exceeded