Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD companiaset_create_entity.
- DATA:
- wa_nueva_compania TYPE ztca_companias_p,
- lv_id_nueva_compania TYPE ztca_companias_p-id_compania.
- io_data_provider->read_entry_data(
- IMPORTING
- es_data = er_entity
- ).
- MOVE-CORRESPONDING er_entity TO wa_nueva_compania.
- SELECT MAX( id_compania ) FROM ztca_companias_p
- INTO lv_id_nueva_compania.
- IF sy-subrc EQ 0.
- lv_id_nueva_compania = lv_id_nueva_compania + 1.
- ELSE.
- lv_id_nueva_compania = 1.
- ENDIF.
- wa_nueva_compania-id_compania = lv_id_nueva_compania.
- er_entity-id_compania = lv_id_nueva_compania.
- INSERT ztca_companias_p FROM wa_nueva_compania.
- IF sy-subrc NE 0.
- er_entity-id_compania = 0.
- ENDIF.
- ENDMETHOD.
Add Comment
Please, Sign In to add comment