Ansicht
Dokumentation

ISH_CASELIST_CASEFLD - BAdI: Add Case Level User Field to Case List

ISH_CASELIST_CASEFLD - BAdI: Add Case Level User Field to Case List

CPI1466 during Backup   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

The Business Add-In (BAdI) IS-H: Add Case Level User Field to Case List (ISH_CASELIST_CASEFLD) lets you add your own field to each case on the case list and a title for your field in the case list heading.

The BAdI method GET_CASE_FIELD adds your field to the case list. The system calls this BAdI method for each case displayed on the case list. The system also calls the BAdI method for each case displayed on the case list when the case list is refreshed.

The BAdI method GET_CASE_FIELD_TITLE adds your title to the case list display heading. The system calls this BAdI method only the first time the case list is displayed. The system does not call this BAdI method when you refresh the case list.

Note: The field you have added using the BAdI will only appear in the case list if you have added it to the case list layout.

For more information, refer to the interface documentation and the method documentation of the BAdI.

Method GET_CASE_FIELD

Import Parameters

The import interface consists of the patient data, case data, and movement data:

  • P_PATIENT_DATA
This table contains the patient data.
  • P_CASE_DATA
This table contains the case data.
  • P_MVMT_DATA table parameter
This table contains the movement data for all movements of the case. To process the table data, use a local parameter of the table type NBEWTAB or a local parameter of TYPE TABLE of NBEW. If you need a work area, declare a local variable with structure type NBEW. See the example for more information.

Exporting Parameters

  • P_USER_CASE_FIELD
Use this parameter to return the case field that you want to display in the case list.

Further Notes

The case level field returned by this BAdI method (P_USER_CASE_FIELD) can be up to 30 characters in length.

BAdI Method Call

The BAdI method GET_CASE_FIELD is called from the PAI module LIST_FALL (function group N00P).

Method GET_CASE_FIELD_TITLE

Import Parameters

The import interface consists of the patient data, case data, and movement data.

  • P_PATIENT_DATA
This table contains the patient's master data.
  • P_CASE_DATA
This table contains the case data for all cases on the case list. To process the table data, use a local parameter of the table type ISH_T_NFAL or a local parameter of TYPE TABLE NFAL. If you need a work area, declare a local variable with structure type NFAL. See the example for more information.
  • P_MVMT_DATA table parameter
This table contains the movement data for all movements on the case list. To process the table data, use a local parameter of the table type NBEWTAB or a local parameter of TYPE TABLE NBEW. If you need a work area, declare a local variable with structure type NBEW. See the example for more information.

Exporting Parameters

  • P_USER_CASE_FIELD
Use this parameter to return the case field title that you want to display in the case list heading.

Further Notes

The case field title returned by this BAdI method (P_USER_CASE_FIELD_TITLE) can be up to 30 characters in length.

BAdI Method Call

The BAdI method GET_CASE_FIELD_TITLE is called from the form FILL_FIELDCAT_FAL (function group N00P).

You have to implement the BAdI. To do this, proceed as follows:

  1. Perform the IMG activity BAdI: Add Case Level User Field to Case List.
  2. Create an implementation of the BAdI in the customer namespace.
Note: This implementation does not yet have any program code for the method.
  1. The interface of your implementation contains the methods GET_CASE_FIELD and GET_CASE_FIELD_TITLE. Double-clicking on each method takes you into the code editor, where you can put your own code that satisfies your particular requirements.
  2. Once you have completed your modifications, you still have to activate the implementation so that these modifications can also be executed by the application programs.
Note that only one implementation can be active at a time.

METHOD IF_EX_ISH_CASELIST_CASEFLD~GET_CASE_FIELD .

* ...

*----------------------------------------------------------------------*

* Method to add a user field to the cases displayed on the case list.

* Available interface:

* P_PATIENT_DATA : patient master data

* P_CASE_DATA : case data

* P_MVMT_DATA : movement data for all movements of the case

* P_USER_CASE_FIELD : user field (to be returned)

*----------------------------------------------------------------------*

* The coding below is only an example. Refer to the BAdI documentation

* for more information.

*----------------------------------------------------------------------*

* The sample code performs the following steps:

* 1) Assign data from parameters to local data objects.

* - use the data types shown to process the import parameter

* data.

*

* 2) Loop through the movements to count the transfers and absences.

* - you can process the data in the movement list by looping through * the movements.

* - you can use the data from patient master data, the case, and the

* movements.

*

* 3) Set the user field to display the number of transfers, absences,

* and movements.

*

*----------------------------------------------------------------------*

DATA: l_count_movements(4) TYPE c,

l_count_transfers(4) TYPE c,

l_count_absences(4) TYPE c,

s_patient TYPE npat,

s_case TYPE nfal,

s_movement TYPE nbew,

t_movement TYPE nbewtab,

t_another_movement TYPE TABLE OF nbew.

l_count_movements = 0.

l_count_transfers = 0.

l_count_absences = 0.

* local structures to process patient data and case data

s_patient = p_patient_data.

s_case = p_case_data.

* local tables to process movement data

t_movement = p_mvmt_data.

t_another_movement = t_movement.

DESCRIBE TABLE t_movement LINES l_count_movements.

* count the number of movements for the case

LOOP AT t_another_movement INTO s_movement.

CASE s_movement-bewty.

WHEN '3'.

l_count_transfers = l_count_transfers + 1.

WHEN '6'.

l_count_absences = l_count_absences + 1.

WHEN OTHERS.

ENDCASE.

ENDLOOP.

CONCATENATE l_count_transfers ' Txf, ' l_count_absences ' Abs, '

l_count_movements ' Mvmts' INTO p_user_case_field.

ENDMETHOD.

METHOD IF_EX_ISH_CASELIST_CASEFLD~GET_CASE_FIELD_TITLE .

* ...

*----------------------------------------------------------------------*

* Method to add a user case field title to the case list.

* Available interface:

* P_PATIENT_DATA : patient master data

* P_CASE_DATA : case data for all cases displayed on the

* case list

* P_MVMT_DATA : movement data for all movements displayed

* on the case list

* P_USER_CASE_FIELD_TITLE : user field (to be returned)

*----------------------------------------------------------------------*

* The coding below is only an example. Refer to the BAdI documentation

* for more information.

*----------------------------------------------------------------------*

* Attention: This method is only called the first time the case list is

* displayed.

* This method is not called when the case list is refreshed.

*----------------------------------------------------------------------*

* The sample code performs the following steps:

* 1) Assign data from parameters to local data objects.

* - use the data types shown to process the import parameter

* data.

* - you can process the data in the movement list by looping through * the movements.

* - you can process the data in the case list by looping through

* the cases.

* - you can use the data from patient master data, the cases, and

* the movements.

*

* 2) Set the user field title using the patient's last name.

*

*----------------------------------------------------------------------*

DATA: l_count_movements(4) TYPE c,

l_count_cases(4) TYPE c,

s_patient TYPE npat,

s_case TYPE nfal,

s_movement TYPE nbew,

t_case TYPE TABLE OF NFAL,

t_movement TYPE TABLE OF nbew.

l_count_movements = 0.

l_count_cases = 0.

* local structure to process patient data

s_patient = p_patient_data.

* local tables to process movement data and case data

t_case = p_case_data.

t_movement = p_mvmt_data.

* count the number of cases displayed in the case list

LOOP AT t_case INTO s_case.

l_count_cases = l_count_cases + 1.

ENDLOOP.

* count the number of movements displayed in the case list

LOOP AT t_movement INTO s_movement.

l_count_movements = l_count_movements + 1.

ENDLOOP.

CONCATENATE 'Mvmt Summary' s_patient-nnams(17)

INTO p_user_case_field_title

SEPARATED BY SPACE.

ENDMETHOD.






BAL Application Log Documentation   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 11352 Date: 20240523 Time: 212249     sap01-206 ( 122 ms )