Skip to content

Instantly share code, notes, and snippets.

@jasper07
Created August 19, 2012 15:10
Show Gist options
  • Save jasper07/3395428 to your computer and use it in GitHub Desktop.
Save jasper07/3395428 to your computer and use it in GitHub Desktop.
abap_contacts_create_entity
METHOD contacts_create_entity.
CONSTANTS:
co_folder TYPE string VALUE '/SAP/PUBLIC/ATCONTACTS'.
*--- get the values passed in
io_data_provider->read_entry_data( IMPORTING es_data = er_entity ).
*--- set handle to first 3 letters of firstname and first letter of last name
er_entity-handle = |{ er_entity-firstname(3) }{ er_entity-lastname(1) }|.
CONDENSE er_entity-handle.
er_entity-handle = to_upper( er_entity-handle ).
*--- assume there is an avatar image and create url
er_entity-avatar = |{ co_folder }/{ iv_entity_set_name }/{ er_entity-handle }.gif|.
GET TIME STAMP FIELD er_entity-updated.
INSERT INTO zat_contacts VALUES er_entity.
COMMIT WORK.
ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment