Code: Alles auswählen.
function Z_KLAT_ANLEGEN.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(I_NBEW) TYPE NBEW
*" REFERENCE(I_PLNOE) TYPE N1PLNOE
*"----------------------------------------------------------------------
data:
LA_RC type ISH_METHOD_RC,
LT_OBJECT type ISH_OBJECTLIST,
LT_PARAMETER type ISHMED_T_PARAMETER,
LO_NBEW type ref to CL_ISHMED_NONE_OO_NBEW,
LO_ERRORHANDLER type ref to CL_ISHMED_ERRORHANDLING,
LO_ENVIRONMENT type ref to CL_ISH_ENVIRONMENT,
LO_LOCK type ref to CL_ISHMED_LOCK.
field-symbols:
<FS_PARAMETER> type RN1PARAMETER,
<FS_OBJECT> type ISH_OBJECT.
clear LA_RC.
CL_ISHMED_FUNCTIONS=>GET_ENVIRONMENT( exporting I_CALLER = 'Z_KLAT_ANLEGEN'
importing E_RC = LA_RC
changing C_ERRORHANDLER = LO_ERRORHANDLER
C_ENVIRONMENT = LO_ENVIRONMENT ).
if LA_RC is initial.
create object LO_LOCK.
CL_ISHMED_NONE_OO_NBEW=>LOAD( exporting I_READ_DB = ABAP_FALSE
I_NBEW = I_NBEW
importing E_INSTANCE = LO_NBEW
E_RC = LA_RC
changing C_ERRORHANDLER = LO_ERRORHANDLER ).
if LA_RC is initial and LO_NBEW is bound and LO_LOCK is bound.
append initial line to LT_OBJECT assigning <FS_OBJECT>.
<FS_OBJECT>-OBJECT = LO_NBEW.
append initial line to LT_PARAMETER assigning <FS_PARAMETER>.
<FS_PARAMETER>-TYPE = '005'.
<FS_PARAMETER>-VALUE = I_PLNOE.
CL_ISHMED_FUNCTIONS=>CALL_CLINICAL_ORDER( exporting I_FCODE = 'CORDI'
I_EINRI = I_NBEW-EINRI
I_CALLER = 'Z_KLAT_ANLEGEN'
I_SAVE = ABAP_TRUE
I_COMMIT = ABAP_TRUE
I_ENQUEUE = ABAP_TRUE
I_DEQUEUE = ABAP_TRUE
IT_OBJECTS = LT_OBJECT
IT_PARAMETER = LT_PARAMETER
importing E_RC = LA_RC
changing C_ERRORHANDLER = LO_ERRORHANDLER
C_ENVIRONMENT = LO_ENVIRONMENT
C_LOCK = LO_LOCK ).
endif.
endif.
endfunction.