1

I have implemented the get_entity of the parent and it works for me but when I want to implement the get_entity of the child it doesn't work and I don't know why?

It gives me error

404

but what I want to consult is in the data table.

This is the parent's get_entity method (it works):

  method ORGANIZADOREVENT_GET_ENTITY.
    CHECK line_exists( it_key_tab[ name = 'IdOrgevento' ] ).

    DATA(lv_id) = it_key_tab[ name = 'IdOrgevento' ]-value.

    SELECT SINGLE *
      FROM ZGAVAZ_ORGEVENTO
      WHERE ID_ORGEVENTO EQ @lv_id
      INTO CORRESPONDING FIELDS OF @er_entity.
  endmethod.

This is the get_entity method of the child (it doesn't work, it gives me a 404 error)

 method EVENTOSET_GET_ENTITY.
    CHECK line_exists( it_key_tab[ name = 'IdEvento' ] ).
    CHECK line_exists( it_key_tab[ name = 'IdOrgevento' ] ).

    DATA(lv_id) = it_key_tab[ name = 'IdEvento' ]-value.
    DATA(lv_id_eve) = it_key_tab[ name = 'IdOrgevento' ]-value.

    SELECT SINGLE *
      FROM ZGAVAZ_EVENTO
      WHERE ID_EVENTO EQ @lv_id  AND
            ID_ORGEVENTO EQ @lv_id_eve
      INTO CORRESPONDING FIELDS OF @er_entity.
  endmethod.

Table columns:

SE11 table columns

OData entity:

x

Table contents:

SE16 table contents

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • Did you try to set a debugger breakpoint to confirm that the method you wrote even gets executed? – Philipp Jul 31 '23 at 08:48
  • And by the way, you misspelled the client field when you created your table. The standard convention is `MANDT`, not `MADNT`. But that's probably not related to the problem. – Philipp Jul 31 '23 at 08:50

0 Answers0