PM Dap I Functions Summary
PM Dap I Functions Summary
med®
2
Overview of API methods
Rel SP
Method Description
EhP
API__ADD_BUTTON Add a push button 6.00 18
API__CHECK Check the document 4.72 22
API__CLEAR_MESSAGES Clear the message list 4.72 23
API__CLEAR_VALUE Delete content of a field 4.72 12
API__CLOSE Close API instance 4.72 30
API__DATA_CHANGED Check whether the 4.72 22
document was changed
API__DELETE_DUPLICATES Delete duplicated rows in 6.06
multiple structures
API__DIALOG_IS_VISIBLE Check whether the screen is 6.04
shown
API__DISABLE_FUNCTION Disable a function 6.00 18
API__GET_ACTIVE_CARD Determine the current tab 6.00
API__GET_CARDSCREEN Determine program id and 6.00
screen of a tab page
API__GET_CHECKMODE Determine the actual type of 4.72 22
checks
API__GET_CONTROL_INSTANCE Determine control instance of 4.72 29
a link module
API__GET_DOC_KEY Read business key of the 4.72 13
document
API__GET_ELEMENT Get the definition of an 4.72 28
element
API__GET_ELEMENTS Get definitions of all 4.72 28
elements (list)
API__GET_FOCUS Get element with screen 6.00 18
cursor
API__GET_FUNCTION Get the function code (OK- 4.72 20
Code)
API__GET_NDOC Read document header 4.72 13
record - NDOC (single)
API__GET_NDOC_TAB Read document header 4.72 13
record – NDOC (table)
API__GET_NEXT_STATUSES Determine next statuses 6.00 16
possible
API__GET_NFAL Read patient’s case data 4.72 13
API__GET_NPAT Read patient data 4.72 13
3
Rel SP
Method Description
EhP
API__GET_PRINTPARAMS Determine printing 6.00 27
parameters
API__GET_PROCMODE Determine the processing 4.72 19
mode
API__GET_SERVICE Get stored API instance 6.00 30
API__GET_STATUS Determine the actual status 6.00 16
of the document
API__GET_TYPENAME Determine data type of an 4.72 29
element
API__GET_VALUE Get content of a field 4.72 12
API__LEAVE_PROCESS Cancel processing 4.72 21
API__LIST_ERROR_NUMBER Add an error message 4.72 24
(message number)
API__LIST_ERROR_TEXT Add an error message (Free 4.72 24
text)
API__LIST_MESSAGE_NUMBER Add a message of any type 6.00 23
(message number)
API__LIST_MESSAGE_TEXT Add a message of any type 6.00 23
(free text)
API__MARK_TABLINE Select rows 6.00 14
API__MAX_OCCURRENCE Determine number of rows in 4.72 14
a multiple structure
API__OPEN Create an API instance 4.72 30
API__PREVIEW Show print preview 4.72 26
API__PRINT Print the document 4.72 26
API__PRINT_DIRECT Print the document without 4.72 26
popup
API__RELEASE_WITH_COMMIT Release a document 4.72 17
API__SAVE_WITH_COMMIT Save document 4.72 21
API__SET_FOCUS Set screen cursor on 4.72 18
element
API__SET_FUNCTION Set the function code (OK- 4.72 20
Code)
API__SET_NEXT_STATUS Set status of the document 4.72 16
API__SET_PROCMODE_DISPLAY Toggle to display mode 4.72 19
API__SET_PROCMODE_UPDATE Toggle to edit 6.00 19
API__SET_SERVICE Store an API instance 6.00 30
API__SET_VALUE Change content of a field 4.72 12
API__SHOW_MESSAGES Display the message list 4.72 23
4
Rel SP
Method Description
EhP
API__SHOW_SUCCESS_NUMBER Display status message 4.72 25
(message number)
API__SHOW_SUCCESS_TEXT Display status message (free 4.72 25
text)
API__SORT Sort rows of a multiple 6.00 15
structure
API__TABLINE_IS_MARKED Determine whether a row is 6.00 14
selected
API__UNDO Undo changes 6.00 21
API__UNMARK_TABLINE Deselect rows 6.00 14
API__VALUE_IS_INITIAL Check whether a field has its 4.72 12
initial content
API__WRITE_ELEMENTS Write element value to print 6.00 27
output
API__WRITEABLE_ELEMENTS Build a list with all printable 6.00 27
elements
5
Variables in user-exits
General variables
<pub__service>
Instance of the current document API
class
<pub__my> Instance of additional data
6
Availability of variables
Print Output
in document-related
Print start
Print End
user-exits
Create
Check
Save
PBO
Start
End
PAI
<pub__service>
<pub__this_definition>
<pub__this_alias>
<pub__this_line>
<pub__this_label>
<pub__this_value>
<pub__this_text>
<pub__field_input>
<pub__field_visible>
<pub__field_icon>
<pub__field_icon_text>
<pub__field_icon_qinfo>
<pub__print_ask_params>
<pub__print_destination>
<pub__print_copies>
Availability of variables
Function
F4-Help
ScrMod
Display
in element-related user-
Check
exits
<pub__service>
<pub__this_definition>
<pub__this_alias>
<pub__this_line>
<pub__this_label>
<pub__this_value>
<pub__this_text>
<pub__field_input>
<pub__field_visible>
<pub__field_icon>
<pub__field_icon_text>
<pub__field_icon_qinfo>
<pub__print_ask_params>
<pub__print_destination>
<pub__print_copies>
7
Usage of API methods in user
exits
Availability of methods in
Print Output
document-related user
Print start
Print End
exits
Create
Check
Save
PBO
Start
End
PAI
API__ADD_BUTTON
API__CHECK
API__CLEAR_MESSAGES
API__CLEAR_VALUE
API__DATA_CHANGED
API__DELETE_DUPLICATES
API__DIALOG_IS_VISIBLE
API__DISABLE_FUNCTION
API__GET_ACTIVE_CARD
API__GET_CARDSCREEN
API__GET_CHECKMODE
API__GET_DOC_KEY
API__GET_ELEMENT
API__GET_ELEMENTS
API__GET_FOCUS
API__GET_FUNCTION
API__GET_NDOC
API__GET_NDOC_TAB
API__GET_NEXT_STATUSES
API__GET_NFAL
API__GET_NPAT
API__GET_PROCMODE
API__GET_STATUS
API__GET_TYPENAME
API__GET_VALUE
API__LEAVE_PROCESS
API__LIST_ERROR_NUMBER
API__LIST_ERROR_TEXT
API__LIST_MESSAGE_NUMBER
API__LIST_MESSAGE_TEXT
API__MARK_TABLINE
API__MAX_OCCURRENCE
8
Availability of methods in
Print Output
document-related user
Print start
Print End
exits
Create
Check
Save
PBO
Start
End
PAI
API__PREVIEW
API__PRINT
API__PRINT_DIRECT
API__RELEASE_WITH_COMMIT
API__SAVE_WITH_COMMIT
API__SET_FOCUS
API__SET_FUNCTION
API__SET_NEXT_STATUS
API__SET_PROCMODE_DISPLAY
API__SET_PROCMODE_UPDATE
API__SET_SERVICE
API__SET_VALUE
API__SHOW_MESSAGES
API__SHOW_SUCCESS_NUMBER
API__SHOW_SUCCESS_TEXT
API__SORT
API__TABLINE_IS_MARKED
API__UNDO
API__UNMARK_TABLINE
API__VALUE_IS_INITIAL
API__WRITE_ELEMENTS
API__WRITEABLE_ELEMENTS
9
Availability of methods in
Function
F4-Help
ScrMod
Display
element-related user
Check
exits
API__ADD_BUTTON
API__CHECK
API__CLEAR_MESSAGES
API__CLEAR_VALUE
API__DATA_CHANGED
API__DELETE_DUPLICATES
API__DIALOG_IS_VISIBLE
API__DISABLE_FUNCTION
API__GET_ACTIVE_CARD
API__GET_CARDSCREEN
API__GET_CHECKMODE
API__GET_DOC_KEY
API__GET_ELEMENT
API__GET_ELEMENTS
API__GET_FOCUS
API__GET_FUNCTION
API__GET_NDOC
API__GET_NDOC_TAB
API__GET_NEXT_STATUSES
API__GET_NFAL
API__GET_NPAT
API__GET_PROCMODE
API__GET_STATUS
API__GET_TYPENAME
API__GET_VALUE
API__LEAVE_PROCESS
API__LIST_ERROR_NUMBER
API__LIST_ERROR_TEXT
API__LIST_MESSAGE_NUMBER
API__LIST_MESSAGE_TEXT
API__MARK_TABLINE
API__MAX_OCCURRENCE
API__PREVIEW
API__PRINT
API__PRINT_DIRECT
API__RELEASE_WITH_COMMIT
API__SAVE_WITH_COMMIT
API__SET_FOCUS
10
Availability of methods in
Function
F4-Help
ScrMod
Display
element-related user
Check
exits
API__SET_FUNCTION
API__SET_NEXT_STATUS
API__SET_PROCMODE_DISPLAY
API__SET_PROCMODE_UPDATE
API__SET_SERVICE
API__SET_VALUE
API__SHOW_MESSAGES
API__SHOW_SUCCESS_NUMBER
API__SHOW_SUCCESS_TEXT
API__SORT
API__TABLINE_IS_MARKED
API__UNDO
API__UNMARK_TABLINE
API__VALUE_IS_INITIAL
API__WRITE_ELEMENTS
API__WRITEABLE_ELEMENTS
11
Editing fields
Get content of a field
api__get_value 4.72
DATA y_value TYPE datatype.
DATA y_valdec TYPE string.
Changing fields is also available in the display mode (but then it’s not
possible to save the changes). It’s also possible to change a field that
doesn’t accept input (e.g. value help).
12
Access contextual information
Read business key of the document
api__get_doc_key 4.72
DATA y_key TYPE rn2doc_key.
y_key = <pub__service>->api__get_doc_key( ).
y_ndoc = <pub__service>->api__get_ndoc( ).
y_ndocs = <pub__service>->api__get_ndoc_tab( ).
y_npat = <pub__service>->api__get_npat( ).
y_nfal = <pub__service>->api__get_nfal( ).
13
Editing multiple structures
Determine number of rows in a multiple structure
api__max_occurrence 4.72
count = <pub__service>->api__max_occurrence( 'ALIAS' ).
Select rows
api__mark_tabline 6.00
DATA y_count TYPE i.
Deselect rows
api__unmark_tabline 6.00
DATA y_count TYPE i.
14
Sort rows of a multiple structure
api__sort 6.00
CALL METHOD <pub__service>->api__sort
EXPORTING i_col_1 = 'ALIAS1'
i_asc_1 = true
i_col_2 = 'ALIAS2'
i_asc_2 = false
i_col_3 = 'ALIAS3'
i_asc_3 = true.
15
Status of the document
Determine the actual status of the document
api__get_status 6.00
DATA y_status TYPE bapi_doc_tdws.
y_status = <pub__service>->api__get_status( ).
The initial status is set, when the document is saved for the first time.
The structure BAPI_DOC_TDWS is shown on page 31.
yt_statuses = <pub__service>->api__get_next_statuses(
i_status = ‘IA’ ).
16
Release a document
api__release_with_commit 4.72
DATA y_released TYPE ish_true_false.
DATA y_worst TYPE bapi_mtype.
DATA y_messages TYPE ishmed_t_messages.
17
Work with the screen
Get element with screen cursor
api__get_focus 6.00
DATA y_alias TYPE n2alias.
DATA y_occ TYPE i.
Clicking a push button does move the focus to the button pressed, the
element on which the cursor was set previously cannot be identified.
Disable a function
api__disable_function 6.00
CALL METHOD <pub service>->api disable_function( 'DIUP’ ).
18
Processing mode
Determine the processing mode
api__get_procmode 4.72
CASE <pub__service>->api__get_procmode( ).
WHEN n2f_meth_insert.
* Create a document
WHEN n2f_meth_copy.
* Create a document version
WHEN n2f_meth_update.
* Change a dcoument
WHEN n2f_meth_display.
* Display a document
WHEN n2f_meth_print.
* Print a document
ENDCASE.
19
Function codes
Get the function code (OK-Code)
api__get_function 4.72
DATA: y_func TYPE syucomm.
y_func = <pub__service>->api__get_function( ).
20
Alter the save logic
Cancel processing
api__leave_process 4.72
CALL METHOD <pub__service>->api__leave_process.
Save document
api__save_with_commit 4.72
DATA y_saved TYPE ish_true_false.
DATA y_worst TYPE bapi_mtype.
DATA y_messages TYPE ishmed_t_messages.
Undo changes
api__undo 6.00
CALL METHOD <pub__service>->api__undo
EXPORTING i_alias = ‘ALIAS’
i_occ = ROW.
21
Checks
Check whether the document was changed
api__data_changed 4.72
IF <pub__service>->api__data_changed( ) = true.
* ...
ENDIF
.
22
General message handling
Clear the message list
api__clear_messages 4.72
CALL METHOD <pub__service>->api__clear_messages.
23
Error messages
Add an error message (message number)
api__list_error_number 4.72
CALL METHOD <pub__service>->api__list_error_number
EXPORTING i_alias = 'ALIAS'
i_occ = ROW
i_id = 'MESSAGE CLASS'
i_no = NUMBER
i_v1 = VARIABLE1
i_v2 = VARIABLE2
i_v3 = VARIABLE3
i_v4 = VARIABLE4.
24
Status message
Display status message (message number)
api__show_success_number 4.72
CALL METHOD <pub__service>->api__show_success_number
EXPORTING i_id = 'MESSAGE CLASS'
i_no = NUMBER
i_v1 = VARIABLE1
i_v2 = VARIABLE2
i_v3 = VARIABLE3
i_v4 = VARIABLE4.
25
Control printing
Show print preview
api__preview 4.72
CALL METHOD <pub__service>->api__preview.
26
Print output
Determine printing parameters
api__get_printparams 6.00
DATA y_params TYPE itcpo.
DATA y_sform TYPE funcname.
yt_aliases = <pub__service>->api__writeable_elements( ).
27
Generic programming
Get the definition of an element
api__get_element 4.72
DATA y_element TYPE n2pmdelemdef.
yt_elements = <pub__service>->api__get_elements( ).
28
Determine data type of an element
api__get_typename 4.72
DATA y_type TYPE STRING.
DATA y_ref_data TYPE REF TO DATA.
For long texts is type N2_STEXT_TAB returned. The sample shown above
does not work for this type.
29
API Instance handling
Create an API instance
api__open 4.72
DATA y_other_service TYPE REF TO cl_ishmed_pmd_services.
DATA y_other_key TYPE rn2doc_key.
y_other_service = cl_ishmed_pmd_services=>api__open(
y_other_key ).
* ... use the PMD API
API instances created by the user have to be closed. Before using the
API you have to set the processing mode by methods
set_procmode_....
yr_service = cl_ishmed_pmd_services=>api__get_service( ).
30
Important data structures
Document key (RN2DOC_KEY)
Field DataElem Type Length Description
DOKAR DOKAR CHAR 3 Document
category
DOKNR DOKNR CHAR 25 Document number
DOKVR DOKVR CHAR 2 Document version
DOKTL DOKTL_D CHAR 3 Document part
TLINE)
Long text table (N2_STEXT_TAB
Field DataElem Type Length Description
TDFORMAT TDFORMAT CHAR 2 Format column
TDLINE TDLINE CHAR 132 Text row
31
Element definition (N2PMDELEMDEF)
32
Field TYPE of the element definition can be as follows:
33
Important functional modules
Retrieval of document key and header data
function ish_n2_meddoc_getlist.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(IM_APICONTROL) TYPE RN2DOC_APICONTROL OPTIONAL
*" REFERENCE(FILTER_LOEKZ) LIKE NDOC-LOEKZ DEFAULT SPACE
*" REFERENCE(IM_MAXROW) TYPE TBMAXSEL DEFAULT 200
*" REFERENCE(IM_WITH_ALL_VERSIONS) TYPE ISH_ON_OFF OPTIONAL
*" REFERENCE(IM_WITH_ALL_PARTS) TYPE ISH_ON_OFF DEFAULT 'X'
*" REFERENCE(IM_WITHOUT_SELECT) TYPE ISH_ON_OFF OPTIONAL
*" REFERENCE(IM_GET_DKTXT) TYPE ISH_ON_OFF DEFAULT 'X'
*" REFERENCE(IM_GET_PROTF) TYPE ISH_ON_OFF DEFAULT SPACE
*" EXPORTING
*" REFERENCE(EX_WORST_MSGTY) TYPE ISH_BAPIRETMAXTY
*" REFERENCE(EX_MAXROW_FOUND) TYPE ISH_ON_OFF
*" REFERENCE(EX_NUMBER_OF_DOCUMENTS) TYPE SY-TFILL
*" REFERENCE(ET_DOCUMENTS_2) TYPE ISHMED_T_DOCADMIN
*" REFERENCE(ET_DOCUMENTS_PART_2) TYPE ISHMED_T_DOCADMIN
*" REFERENCE(ET_DOCUMENTS_OLD_VERSIONS_2) TYPE ISHMED_T_DOCADMIN
*" TABLES
*" IMT_SEL_DOCS STRUCTURE N_2VDOCDRA OPTIONAL
*" EXT_RETURN STRUCTURE BAPIRET2 OPTIONAL
*" FILTER_EINRI STRUCTURE RN2RANGE_EINRI OPTIONAL
*" FILTER_PATNR STRUCTURE RNRANGEPATNR OPTIONAL
*" FILTER_FALNR STRUCTURE RNRANGEFALNR OPTIONAL
*" FILTER_ORGDO STRUCTURE RN2RANGE_OE OPTIONAL
*" FILTER_MITARB STRUCTURE RN2RANGE_MITARB OPTIONAL
*" FILTER_DTID STRUCTURE RN2RANGE_DTID OPTIONAL
*" FILTER_DTVERS STRUCTURE RN2RANGE_DTVERS OPTIONAL
*" FILTER_DOKAR STRUCTURE CV100_RANGESDOKAR OPTIONAL
*" FILTER_DOKNR STRUCTURE CV100_RANGESDOKNR OPTIONAL
*" FILTER_DOKTL STRUCTURE CV100_RANGESDOKTL OPTIONAL
*" FILTER_DOKVR STRUCTURE CV100_RANGESDOKVR OPTIONAL
*" FILTER_DOKST STRUCTURE RN2RANGE_STATUSINTERN OPTIONAL
*" FILTER_BEZEB STRUCTURE RN2RANGE_BEZEB OPTIONAL
*" FILTER_PCODE STRUCTURE RN2RANGE_PCODE OPTIONAL
*" FILTER_DODAT STRUCTURE RNRDATE OPTIONAL
*" FILTER_UPDAT STRUCTURE RNRDATE OPTIONAL
*" FILTER_ERDAT STRUCTURE RNRDATE OPTIONAL
*" FILTER_UPUSR STRUCTURE RN2RANGE_UNAME OPTIONAL
*" FILTER_ERUSR STRUCTURE RN2RANGE_UNAME OPTIONAL
*" FILTER_LFDBEW STRUCTURE RNRANGELFDBEW OPTIONAL
*" FILTER_ORGFA STRUCTURE RN2RANGE_OE OPTIONAL
*" FILTER_ORGPF STRUCTURE RN2RANGE_OE OPTIONAL
*" FILTER_LNRLS STRUCTURE RNRANGELNRLS OPTIONAL
*" FILTER_LEIST STRUCTURE RNRANGELEIST OPTIONAL
*" FILTER_ORGLE STRUCTURE RN2RANGE_OE OPTIONAL
*" FILTER_ANFID STRUCTURE RN1ANFRNG OPTIONAL
*" FILTER_ORGLA STRUCTURE RN2RANGE_OE OPTIONAL
*" FILTER_MEDOK STRUCTURE RN2RANGE_MEDOK OPTIONAL
*" EXT_DOCUMENTS STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCUMENTS_PART STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCUMENTS_OLD_VERSIONS STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCUMENTS_MOVEMENTS STRUCTURE RN2DOCDATA_MOVE OPTIONAL
*" EXT_DOCUMENTS_SERVICES STRUCTURE RN2DOCDATA_SERV OPTIONAL
*" EXT_DOCUMENTS_REQUESTS STRUCTURE RN2DOCDATA_REQ OPTIONAL
*"----------------------------------------------------------------------
34
Read additional header of a document
FUNCTION ish_n2_meddoc_getadmindata.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(IM_APICONTROL) TYPE RN2DOC_APICONTROL OPTIONAL
*" VALUE(IM_DOCUMENT_KEY) TYPE RN2DOC_KEY
*" VALUE(IM_AUTHORITY_CHECK) TYPE ISH_ON_OFF DEFAULT SPACE
*" EXPORTING
*" VALUE(EX_WORST_MSGTY) TYPE ISH_BAPIRETMAXTY
*" VALUE(EX_DOCDATA) TYPE RN2DOCDATA
*" VALUE(EX_DOCDATA_OUT) TYPE RN2DOCDATA_OUT
*" VALUE(EX_DRAW) TYPE DRAW
*" TABLES
*" EXT_RETURN STRUCTURE BAPIRET2 OPTIONAL
*" EXT_DOCUMENT_VERS STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCUMENT_PART STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCUMENT_PARTVERS STRUCTURE RN2DOCDATA OPTIONAL
*" EXT_DOCDATA_MOVE STRUCTURE RN2DOCDATA_MOVE OPTIONAL
*" EXT_DOCDATA_SERV STRUCTURE RN2DOCDATA_SERV OPTIONAL
*" EXT_DOCDATA_REQ STRUCTURE RN2DOCDATA_REQ OPTIONAL
*" EXT_DOCDATA_MOVE_OUT STRUCTURE RN2DOCDATA_MOVE_OUT OPTIONAL
*" EXT_DOCDATA_SERV_OUT STRUCTURE RN2DOCDATA_SERV_OUT OPTIONAL
*" EXT_DOCDATA_REQ_OUT STRUCTURE RN2DOCDATA_REQ_OUT OPTIONAL
*" EXT_NDOC STRUCTURE NDOC OPTIONAL
*"----------------------------------------------------------------------
35
The information in this document contains general technical
About Cerner
descriptions of specifications and options as well as standard and
We’re continuously building on
optional features which do not always have to be present in our foundation of intelligent
individual cases. Thus all requested specifications and options are solutions for the health care
to be defined individually in the contract. industry. Our technologies
connect people and systems
and our wide range of services
SAP and other SAP products and services mentioned herein as support the clinical, financial,
well as their respective logos are trademarks or registered and operational needs of
organizations of every size.
trademarks of SAP SE in Germany and in several other countries.
The outcomes achieved by the Cerner customers described herein Cerner Health Services
were achieved in the customers’ unique setting. Thus, there can Deutschland GmbH
Karl-Zucker-Straße 18
be no guarantee that others will achieve the same results.
91052 Erlangen
Germany
www.cerner.com