0% found this document useful (0 votes)
11 views36 pages

PM Dap I Functions Summary

The document provides an overview of the i.s.h.med® Parameterized Medical Documentation API, detailing various API methods and their functionalities. It includes sections on user-exit variables, editing fields, and handling messages and errors. The document serves as a comprehensive guide for developers working with the API in healthcare applications.

Uploaded by

Iman Katergi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views36 pages

PM Dap I Functions Summary

The document provides an overview of the i.s.h.med® Parameterized Medical Documentation API, detailing various API methods and their functionalities. It includes sections on user-exit variables, editing fields, and handling messages and errors. The document serves as a comprehensive guide for developers working with the API in healthcare applications.

Uploaded by

Iman Katergi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

i.s.h.

med®

Parameterized Medical Documentation


Summary API-Functions

Health care is too important to stay the same.TM


Content
Overview of API methods .............................................................. 3
Variables in user-exits.................................................................... 6
Usage of API methods in user exits ............................................... 8
Editing fields................................................................................. 12
Access contextual information ..................................................... 13
Editing multiple structures ............................................................ 14
Status of the document ................................................................ 16
Work with the screen ................................................................... 18
Processing mode ......................................................................... 19
Function codes............................................................................. 20
Alter the save logic ...................................................................... 21
Checks ......................................................................................... 22
General message handling. ......................................................... 23
Error messages............................................................................ 24
Status message ........................................................................... 25
Control printing............................................................................. 26
Print output................................................................................... 27
Generic programming .................................................................. 28
API Instance handling .................................................................. 30
Important data structures ............................................................. 31
Important functional modules ..........................................................34

Please also note the documentation of the class


CL_ISHMED_PMD_SERVICES.

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

Element related conditional variables (read-only)


<pub__this_definition> Element description
<pub__this_alias> Alias
<pub__this_line> Row number in multiple structures
<pub__this_label> Screen label

Element related content and properties (changeable)


<pub__this_value> Value (simple field)
<pub__this_text> Value (long text field)
<pub__field_input>
Screen modification: field ready for
input
<pub__field_visible> Screen modification: field visible
<pub__field_icon>
Screen modification: icon name
(ICON_…)
<pub__field_icon_text> Screen modification: Text for an icon
<pub__field_icon_qinfo>
Screen modification: Quick info text for
an icon
<pub__label_intense>
Screen modification: highlight the
screen label

Control form printing


<pub__print_ask_params> Show popup for printing parameters
<pub__print_destination> Used printer
<pub__print_copies> Number of copies
<pub__print_formular>
Name of the form (SAPscript or Adobe
Forms)
Using the standard (=X) or custom
<pub__print_open>
(=SPACE) print method

Screen modification of multiple structures

Multiple structures can be set to non-visible via screen


modification user exit only, if the flag Not Configurable is set in
the documentation category definition

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.

CALL METHOD <pub__service>->api__get_value


EXPORTING i_alias = 'ALIAS'
i_occ = ROW
IMPORTING e_value = y_value
e_vdecoded = y_valdec.

Returned value in y_valdec matches the fixed value text of the


corresponding domain.

Change content of a field


api__set_value 4.72
CALL METHOD <pub__service>->api__set_value
EXPORTING i_alias = 'ALIAS'
i_occ = ROW
i_value = NEW VALUE.

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).

Delete content of a field


api__clear_value 4.72
CALL METHOD <pub__service>->api__clear_value
EXPORTING i_alias = 'ALIAS'
i_occ = ROW.

If the alias points on a multiple structure, the marked row is completely


deleted. If a row is stated, the content of the whole table will be deleted.

Check whether a field has its initial content


api__value_is_initial 4.72
IF <pub__service>->api__value_is_initial(
i_alias = 'ALIAS'
i_occ = ROW ) = true.
* ...
ENDIF
.

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( ).

Read document header record - NDOC (single)


api__get_ndoc 4.72
DATA y_ndoc TYPE ndoc.

y_ndoc = <pub__service>->api__get_ndoc( ).

Read document header record – NDOC (table)


api__get_ndoc_tab 4.72
DATA y_ndocs TYPE ishmed_t_ndoc.

y_ndocs = <pub__service>->api__get_ndoc_tab( ).

Read patient data


api__get_npat 4.72
DATA y_npat TYPE npat.

y_npat = <pub__service>->api__get_npat( ).

Read patient’s case data


api__get_nfal 4.72
DATA y_nfal TYPE nfal.

y_nfal = <pub__service>->api__get_nfal( ).

Without case relation an intial NFAL-structure is returned.

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.

y_count = <pub__service>->api__mark_tabline( i_alias = 'ALIAS'


i_occ = ROW ) .

If a parameter i_occ = 0 is supplied, all rows of the table will be selected.


The method returns the number of rows selected additionally.

Deselect rows
api__unmark_tabline 6.00
DATA y_count TYPE i.

y_count = <pub__service>->api__unmark_tabline( i_alias = 'ALIAS'


i_occ = ROW ) .

If a parameter i_occ 0 is commited, all rows of the table will be


unmarked. The method provides the amount of unmarked rows.

Determine whether a row is selected


api__tabline_is_marked 6.00
IF <pub__service>->api__tabline_is_marked(
i_alias = 'ALIAS'
i_occ = ROW ) = true.
* ...
ENDIF
.

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.

At least one parameter set has to be supplied. Function is not supported,


if an external data module is used in the multiple structure.

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.

Determine next statuses possible


api__get_next_statuses 6.00
DATA yt_statuses TYPE ishmed_t_bapi_doc_tdws.

yt_statuses = <pub__service>->api__get_next_statuses(
i_status = ‘IA’ ).

If parameter i_status is not supplied, the actual status of the document is


used.

Set status of the document


api__set_next_status 4.72
DATA y_released TYPE ish_true_false.
DATA y_worst TYPE bapi_mtype.
DATA y_messages TYPE ishmed_t_messages.

CALL METHOD <pub__service>->api__set_next_status


EXPORTING i_status = ‘ST’
IMPORTING e_released = y_released
e_worsttype = y_worst
e_messages = y_messages.

Parameter i_status can be omitted, if just one next status exists. On


status change the document is saved automatically.

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.

CALL METHOD <pub__service>->api__release_with_commit


IMPORTING e_released = y_released
e_worsttype = y_worst
e_messages = y_messages.

In case of an error related messages are not be shown automatically,


moreover you have to utilize corresponding API functions.

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.

CALL METHOD <pub__service>->api__get_focus


IMPORTING e_alias = y_alias
e_occ = y_occ.

Clicking a push button does move the focus to the button pressed, the
element on which the cursor was set previously cannot be identified.

Set screen cursor on element


api__set_focus 4.72
CALL METHOD <pub__service>->api__set_focus
EXPORTING i_alias = 'ALIAS'
i_occ = ROW.

Setting the cursor on a radio button is not supported.

Add a push button


api__add_button 6.00
DATA y_released TYPE ish_true_false.
DATA y_worst TYPE bapi_mtype.
DATA y_messages TYPE ishmed_t_messages.

CALL METHOD <pub__service>->api__add_button


EXPORTING i_function = ‘ZOKCODE’ “ Y... or Z...!
i_icon = ‘ICON_GREEN_LIGHT’
i_iconquick = ‘QUICK-INFO-TEXT’
i_text = ‘ICON TEXT’
i_routine = 'ZMYFORM’.

The declaration of the routine is optional, even if a PAI-processing is


possible.

Disable a function
api__disable_function 6.00
CALL METHOD <pub service>->api disable_function( 'DIUP’ ).

A push button can only be disabled in screen modification.

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.

Toggle to display mode


api__set_procmode_display 4.72
IF y_other_doc->api__set_procmode_display( ) = true.
* ...
ENDIF
.
Can be used for the actual document in Release 6.00 or higher.
Amendments in the document are discarded without further information!

Toggle to edit mode


api__set_procmode_update 6.00
IF y_other_doc->api__set_procmode_update( ) = true.
* ...
ENDIF
.

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( ).

Set the function code (OK-Code)


api__set_function 4.72
CALL METHOD <pub__service>->api__set_function
EXPORTING i_function = 'CODE'.

20
Alter the save logic
Cancel processing
api__leave_process 4.72
CALL METHOD <pub__service>->api__leave_process.

Calling in user exits create, start and print-start screen processing or


printing is aborted without invoking other user exits. In function user exit
processing is aborted without inquiry, but the end user exit is executed.

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.

CALL METHOD <pub__service>->api__save_with_commit


IMPORTING e_saved = y_saved
e_worsttype = y_worst
e_messages = y_messages.

In case of an error related messages are not be shown automatically,


moreover you have to utilize corresponding API functions.

Undo changes
api__undo 6.00
CALL METHOD <pub__service>->api__undo
EXPORTING i_alias = ‘ALIAS’
i_occ = ROW.

Supplying method parameters is optional. All fields are reverted, if no


parameter is supplied, otherwise the specified field. All rows of a multiple
structure are reverted, if row = 0 is supplied.

21
Checks
Check whether the document was changed
api__data_changed 4.72
IF <pub__service>->api__data_changed( ) = true.
* ...
ENDIF
.

Check the document


api__check 4.72
DATA y_worst TYPE c.
DATA y_messages TYPE ishmed_t_messages.

CALL METHOD <pub__service>->api__check


EXPORTING i_checkmode = CHECKMODE
IMPORTING e_worsttype = y_worst
e_messages = y_messages.

Value of parameter i_checkmode is set to n2f_checkmode_save or


n2f_checkmode_release

Determine the actual type of checks


api__get_checkmode 4.72
CASE <pub__service>->api__get_checkmode( ).
WHEN n2f_checkmode_save.
* Checks before saving a document
WHEN n2f_checkmode_release.
* Checks before releasing a document
ENDCASE.

22
General message handling
Clear the message list
api__clear_messages 4.72
CALL METHOD <pub__service>->api__clear_messages.

Executing functions check document, save document, release document


and method api__check reset the error list automatically.

Display the message list


api__show_messages 4.72
DATA y_messages TYPE ishmed_t_messages.

CALL METHOD <pub__service>->api__show_messages


EXPORTING i_messages = y_messages.

Add a message of any type (message number)


api__list_message_number 6.00
CALL METHOD <pub__service>->api__list_message_number
EXPORTING i_alias = 'ALIAS'
i_occ = ROW
i_type = 'E’ " oder I, S, W
i_id = 'MESSAGE CLASS'
i_no = MESSAGE NUMBER
i_v1 = VARIABLE1
i_v2 = VARIABLE2
i_v3 = VARIABLE3
i_v4 = VARIABLE4.

Add a message of any type (free text)


api__list_message_text 6.00
CALL METHOD <pub__service>->api__list_message_text
EXPORTING i_alias = 'ALIAS'
i_occ = ROW
i_type = 'E’ " or I, S, W
i_text = 'YOUR MESSAGE…'.

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.

Add an error message (Free text)


api__list_error_text 4.72
CALL METHOD <pub__service>->api__list_error_text
EXPORTING i_alias = 'ALIAS'
i_occ = ROW
i_text = 'YOUR MESSAGE…'.

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.

Display status message (free text)


api__show_success_text 4.72
CALL METHOD <pub__service>->api__show_success_text
EXPORTING i_text = 'YOUR MESSAGE…'.

25
Control printing
Show print preview
api__preview 4.72
CALL METHOD <pub__service>->api__preview.

Print the document


api__print 4.72
CALL METHOD <pub__service>->api__print.

Print the document without popup


api__print_direct 4.72
CALL METHOD <pub__service>->api__print_direct.

Print parameters are evaluated in the following order:


1. User exit print start
2. IS-H work organizer
3. Last printing based on SPA/GPA parameter
4. Settings from SAP user master data

26
Print output
Determine printing parameters
api__get_printparams 6.00
DATA y_params TYPE itcpo.
DATA y_sform TYPE funcname.

CALL METHOD <pub__service>->api__get_printparams


IMPORTING e_parameters = y_params
e_smartform_module = y_sform.

This function is not released for use in custom development!

Build a list with all printable elements


api__writeable_elements 6.00
DATA yt_aliases TYPE n2_alias_tab.

yt_aliases = <pub__service>->api__writeable_elements( ).

A form has to be assigned to the document category. Items of the form’s


main window are considered only.

Write element value to print output


api__write_elements 6.00
DATA yt_aliases TYPE n2_alias_tab.

CALL METHOD <pub__service>->api__write_elements(


i_aliases = yt_aliases ).

Without parameters supplied all elements are printed. Elements of


multiple structures are not applicable.

27
Generic programming
Get the definition of an element
api__get_element 4.72
DATA y_element TYPE n2pmdelemdef.

y_element = <pub__service>->api__get_element( i_alias = ‘ALIAS’ ).

Structure N2PMDELEMDEF is described on page 32.

Get definitions of all elements (list)


api__get_elements 4.72
DATA yt_elements TYPE n2pmdelemdefs.

yt_elements = <pub__service>->api__get_elements( ).

Structure N2PMDELEMDEF is described on page 32.

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.

FIELD-SYMBOLS <y_data> TYPE ANY.

y_type = y_other_service->api__get_typename( 'alias' ).

CREATE DATA y_ref_data TYPE (y_type).


ASSIGN y_ref_data->* TO <y_data>.

CALL METHOD y_other_service->api__get_value


EXPORTING i_alias = 'alias'
IMPORTING e_value = <y_data>.

For long texts is type N2_STEXT_TAB returned. The sample shown above
does not work for this type.

Determine control instance of a link module


api__get_control_instance 4.72
DATA yr_control TYPE REF TO object.

CALL METHOD <pub__service>->api__get_control_instance


EXPORTING i_alias = ‘ALIAS’
i_occ = ROW
IMPORTING e_instance = yr_control

In release 4.72 it’s possible to determine a control instance within the


generated program only.
This function is not released for use in custom development!

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.

* ... set document key ...

y_other_service = cl_ishmed_pmd_services=>api__open(
y_other_key ).
* ... use the PMD API

CALL METHOD y_other_service->api__close.

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_....

Close API instance


api__close 4.72

Refer method api__open.

Store an API instance


api__set_service 6.00
CALL METHOD <pub__service>->api__set_service.

Every call of this method does overwrite an instance stored previously.

Get stored API instance


api__get_service 6.00
DATA: yr_service TYPE REF TO cl_ishmed_pmd_services.

yr_service = cl_ishmed_pmd_services=>api__get_service( ).

The latest stored reference is returned only. Due to definition as static


class method, the instance can be obtained from external programs in
the same internal session (e.g. external data modules).

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

Details on status (BAPI_DOC_TDWS)


Field DataElem Type Length Description
DOCUMENTTYPE DOKAR CHAR 3 Document
category
STATUSINTERN DOKST CHAR 2 Document status
STATUSEXTERN STABK CHAR 2 Language
dependent status
DESCRIPTION DOSTX CHAR 16 Description
FIELDSELECTION PRFAW CHAR 1 Field selection for
protocol fields
STATUSTYPE DOSAR CHAR 1 Status type
Document
OBJECTCHECK OBJPK CHAR 1 Flag object
checking
RELEASEFLAG FRKNZ CHAR 1 Flag Released
PRESTATUS1 SVOR1 CHAR 2 Previous status 1
PRESTATUS2 SVOR2 CHAR 2 Previous status 2
PRESTATUS3 SVOR3 CHAR 2 Previous status 3
PRESTATUS4 SVOR4 CHAR 2 Previous status 4
PRESTATUS5 SVOR5 CHAR 2 Previous status 5
PRESTATUS6 SVOR6 CHAR 2 Previous status 6
CMCOMPLETE FRTAE CHAR 1 Completion
message for
changing service

31
Element definition (N2PMDELEMDEF)

Field DataElem Type Length Description

ALIAS_ME N2ALIAS CHAR 12 Alias name


ALIAS_MULT N2ALIAS_MULT CHAR 12 Superior multiple
structure
ALIAS_CARD N2ALIAS_CARD CHAR 12 Alias of tab page
ALIAS_REG N2ALIAS_REG CHAR 12 Alias of the tab
ELEMLEVEL N2_PFLEVEL NUMC 2 Element level
TYP N2ELEMTYP CHAR 1 Element type
DDIC_TYPE ROLLNAME CHAR 30 Data element
GROUPING N2_GROUPING CHAR 20 Grouping
elements
DIALOG_LABEL N2_TEXT CHAR 80 Screen label
SCREENFIELD SCRFNAME CHAR 13 Name on screen
OBLIG N2_OBLIG CHAR 21
Field is mandatory
FD_QPARAM N2_PARAMST CHAR 65 Query parameter
of external data
module
FD_MODULE N2_FDBSID CHAR 10 External data
module Link
LINK_MODULE N2_LABSID CHAR 30 module
ELEM_ID N2_DEID CHAR 10 Document element
Id
SUPPRESS_EMP N2_PW1SUPR CHAR 1 Suppress label in
TY_PRINT print if empty

Italic written elements are only available since Release 6.00.

32
Field TYPE of the element definition can be as follows:

N2f_simple_structure Simple structure


N2f_multiple_structure Multiple structure
N2f_master_structure Master element
N2f_register Tab
N2f_card Tab page
N2f_simple_field Simple field
N2f_combobox_field Combo box
N2f_long_text Long text
N2f_fix_string Fixed text
N2f_sapscript_text SAPscript text
N2f_pushbutton Push button
N2f_link Link element
N2f_selection_field List box or radio button
N2f_true_false_field Checkbox
N2f_display_field Display field
n2f_extended_text Extended text

Field OBLIG of the element definition can be as follows:

n2f_oblig_no Not an mandatory field


n2f_oblig_on_save Mandatory when saving
n2f_oblig_on_rel Mandatory when releasing

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
*"----------------------------------------------------------------------

Read status of a document


FUNCTION ish_n2_meddoc_getstatus.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(IM_APICONTROL) TYPE RN2DOC_APICONTROL OPTIONAL
*" REFERENCE(IM_DOCUMENT_KEY) TYPE RN2DOC_KEY
*" REFERENCE(IM_GET_STATUSLOG) TYPE ISH_ON_OFF OPTIONAL
*" EXPORTING
*" REFERENCE(EX_WORST_MSGTY) TYPE ISH_BAPIRETMAXTY
*" REFERENCE(EX_STATUSEXTERN) TYPE STABK
*" REFERENCE(EX_STATUSINTERN) TYPE DOKST
*" REFERENCE(EX_STATUSDESCRIPTION) TYPE DOSTX
*" REFERENCE(EX_RELEASEFLAG) TYPE FRKNZ
*" REFERENCE(EX_LOGGED) TYPE ISH_ON_OFF
*" REFERENCE(EX_STATUSDATA) TYPE BAPI_DOC_TDWS
*" TABLES
*" EXT_RETURN STRUCTURE BAPIRET2 OPTIONAL
*" EXT_STATUSLOG STRUCTURE BAPI_DOC_DRAP OPTIONAL
*"----------------------------------------------------------------------

Please also note other function modules in function group N2DOC_API.

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.

Documentation supplied to Cerner by third parties and included


with this documentation is not warranted for accuracy or
Contact
completeness.

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

Cerner Corporation / 2800 Rockcreek Pkwy / Kansas City, MO 64117 / USA

This document contains Cerner confidential and/or proprietary information belonging to


Cerner Corporation and/or its related affiliates which may not be reproduced or transmitted
in any form or by any means without the express written consent of Cerner. All Cerner
trademarks and logos are owned by Cerner, Corp. All other brand or product names are
trademarks or registered marks of their respective owners.

You might also like