Anda di halaman 1dari 75

SAP note number 865926

________________________________________________________________________
Number
Version
Status
Set on

865926
2 vom 14.02.2006
Released for Customer
,14.02.2006

Language
Mastersprache
Short text

EN
DE
COOIS: Additional list with XSteps

Responsible
Component

Dirk Giebel
PP-SFC-IS
Information System
________________________________________________________________________
Long text
Symptom
You want to display an additional list in the information system.
Other terms
COOIS, COHV, COOISPI, COHVPI
Reason and Prerequisites
This note gives an example of how you can use the WORKORDER_INFOSYSTEM
BADI and the CL_COIS_ADD_LIST class (or the CL_COIS_DEMO_LIST class in
Release 5.0) to add additional lists.
This is demonstrated in the example of an additional XSteps list. The
example is not intended to be complete or functionally correct. XSteps
must be active in your system.
Take the authorization concept of your company into account. If
necessary, implement additional authorization checks to display data and
to execute actions and functions.
After you have implemented this example, you select the additional
individual "XSteps" list (PPIOZ001). Since, in the object overview, you
cannot specify whether an additional list should be displayed, in this
example, the additional "XSteps" list is always displayed when the
profile for the object overview starts with ADD001.
In this way, you can add as many lists as required (PPIOZ001, PPIOZ002
...).
Solution
1. Extend the value range of the PPIO_LISTTYPE domain to include an
entry for the additional list:
PPIOZ001 XSteps
2. Create a structure and a table type for the data to be displayed:
a) In Transaction SE11, create the following data elements in a Z
package (such as ZCOIS) and activate them:
ZCOIS_XSTEPS_LIGHTS, domain: ICON TEXT, name all field labels:
Status icon
b) Use Transaction SE11 to create the ZCOIS_S_XSTEPS structure:

Name: XSteps for information system


Component/Component type:

.INCLUDE/COCH
STATUSTEXT/STATUSTEXT
LIGHTS/ZCOIS_XSTEPS_LIGHTS
INDEX_NODE/TABIX_D
For the COCH include, copy all fields of this include to the
structure: Menu -> Edit -> Include -> Copy Components.
For the BID component, change the type to AUFNR.
Save it in the same Z package and select the structure as
enhanceable.
Activate the structure.
c) Use Transaction SE11 to create the ZCOIS_T_XSTEPS table type:
Name: XSteps for information system
Line type: ZCOIS_T_XSTEPS
Activate it in the same Z package.
3. Create the new class for the additional list:
Use Transaction SE38 to create the ZPI_SHEET_SHOW help report of the
type "Executable program" in the same Z package and implement the
source code from the correction instructions.
Use Transaction SE24 to create the ZCL_COIS_XSTEPS class in the same
Z package:
a) Under 'Properties', enter the CL_COIS_ADD_LIST super class (enter
CL_COIS_DEMO_LIST for Release 5.0).
b) Save your entry.
c) Create the private instance methods PROTOCOL_DISPLAY, SEND,
DELETE and AUTHORITY_CHECK.
Redefine the HANDLE_TOOLBAR and HANDLE_USER_COMMAND methods.
Implement the source code from the correction instructions in
these six methods.
d) Add the following text elements with the specified length:
B01 Refresh list (Length 30)

B02 Log (Length 30)


B03 Send (Length 30)
B04 Delete (Length 30)

B05 PI sheet (Length 30)


B06 Display PI sheet (Length 30)
B07 Change PI sheet (Length 30)
P01 Do you want to display the next (Length 49)
P02 log? (Length 37)
P03 Display logs (Length 54)
P10 Do you want to delete the selected (Length 51)
P11 control recipe(s)? (Length 37)
P12 Delete control recipe (Length 20)
T01 Control recipe monitor: Display log (Length 50)
e) Activate the class.
4. Create an implementation for the WORKORDER_INFOSYSTEM BAdI:
Use Transaction SE19 to create the ZCOIS_XSTEPS implementation for
the WORKORDER_INFOSYSTEM BADI in the same Z package. Double-click to
go to the maintenance of the implementing class and carry out the
following changes:
a) Create the following attributes:
ST_XSTEPS Static Attribute Private Type ZCOIS_T_XSTEPS
ST_DETAIL_LIST Static Attribute Private Type COIS_T_DETAIL_LIST
b) Create the following text elements with the length 40 and
activate them:
001 created
002 sent
003 canceled
004 executed
020 deleted

021 rejected
c) Implement the source code that is contained in the correction
instructions in methods TABLES_MODIFY_LAY, DETAIL_LIST_LAY and
OVERVIEW_TREE_LAY.
d) Activate the implementing class and the BAdI implementation.
________________________________________________________________________

Valid releases
Software component
SAP_APPL

Release
from

to

SAP Application
600
500

- 600
- 500

________________________________________________________________________
References to related notes
Number
Short text
____________________________________________________________
865546
COOIS: Preparation for additional lists
363327
COOIS/CO26/CO28: Change list of fields that can be displayed
________________________________________________________________________

Assigned correction instructions


________________________________________________________________________
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst.
0120031469 0000404322
$*
*$--------------------------------------------------------------------$*
*$ Valid for
:
$*
*$ Software Component SAP_APPL SAP Application
$*
*$ Release 500
All Support Package Levels
$*
*$--------------------------------------------------------------------$*
*$ Changes/Objects Not Contained in Standard SAP System
$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS
*&
IF_EX_WORKORDER_INFOSYSTEM~TABLES_MODIFY_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD if_ex_workorder_infosystem~tables_modify_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.

*>>>> END OF DELETION <<<<<<<


*>>>> START OF INSERTION <<<<
DATA:
lv_object
lv_list_count
ls_detail_list
FIELD-SYMBOLS:
<ls_detail_list>
<ls_tcoa>
<ls_sc1100>

TYPE ppio_listtype,
TYPE sytabix,
TYPE cois_s_detail_list.
TYPE cois_s_detail_list,
TYPE tcoa,
TYPE ppio_entry_sc1100.

* check if additional list should be displayed


* ============================================
CHECK
iv_calling_application = if_cois_con=>appl_overview
OR iv_calling_application = if_cois_con=>appl_detail_list
OR iv_calling_application = if_cois_con=>appl_external_ov.
IF

iv_calling_application = if_cois_con=>appl_overview
OR iv_calling_application = if_cois_con=>appl_external_ov.
ASSIGN ('(SAPLCOISOUTPUT)GS_TCOA') TO <ls_tcoa>.
CHECK sy-subrc = 0.
CHECK <ls_tcoa>-profid(3) = 'ADD'.
lv_object = 'PPIOZ'.
lv_object+5 = <ls_tcoa>-profid+3(3).
ENDIF.
IF iv_calling_application = if_cois_con=>appl_detail_list.
ASSIGN ('(PPIO_ENTRY)P_SC1100') TO <ls_sc1100>.
CHECK sy-subrc = 0.
CHECK <ls_sc1100>-ppio_listtyp(5) = 'PPIOZ'.
lv_object = <ls_sc1100>-ppio_listtyp.
ENDIF.
CHECK NOT lv_object IS INITIAL.
* get order numbers (no planned orders!)

* =================
DATA:
lt_order
TYPE
FIELD-SYMBOLS:
<lr_order>
TYPE
<ls_order>
TYPE
<ls_ioheader> LIKE

TABLE OF aufnr.
range_t_aufnr,
LINE OF range_t_aufnr,
LINE OF ct_ioheader.

IF iv_calling_application = if_cois_con=>appl_detail_list.
get order numbers from selection routine
ASSIGN ('(SAPLCOISSELECT)AUFNR_RANGE[]') TO <lr_order>.
CHECK sy-subrc = 0.
LOOP AT <lr_order> ASSIGNING <ls_order>.
APPEND <ls_order>-low TO lt_order.
ENDLOOP.
ELSE.
* object overview always has IOHEADER_TAB filled
LOOP AT ct_ioheader ASSIGNING <ls_ioheader>
WHERE autyp = '10'
*

OR autyp = '40'.
APPEND <ls_ioheader>-aufnr TO lt_order.
ENDLOOP.
ENDIF.
* add additional list
* ===================
CASE lv_object.
*
*

*
*

WHEN 'PPIOZ001'.
PPIOZ001 => add XSteps list
===============
READ TABLE st_detail_list WITH KEY object = lv_object
ASSIGNING <ls_detail_list>.
IF sy-subrc = 0.
table already there => refresh mode
IF NOT <ls_detail_list>-list IS INITIAL.
refresh data
CLEAR st_xstep.
<ls_detail_list>-list->refresh( ).
ENDIF.
ELSE.
first selection create entry in ST_DETAIL_LIST
ls_detail_list-position = 99.
ls_detail_list-object
= lv_object.
ls_detail_list-grid_title = 'XSteps'.
ls_detail_list-tabname
= 'ZCOIS_S_XSTEPS'.
GET REFERENCE OF st_xstep INTO ls_detail_list-table.
ls_detail_list-list_class = 'ZCL_COIS_XSTEPS'.
APPEND ls_detail_list TO st_detail_list.
READ TABLE st_detail_list WITH KEY object = lv_object
ASSIGNING <ls_detail_list>.
ENDIF.
CHECK <ls_detail_list> IS ASSIGNED.

determine XSteps for orders


FIELD-SYMBOLS:
<ls_xstep>
LIKE LINE OF st_xstep.

fill data table ST_DATA_TABLE


CHECK NOT lt_order IS INITIAL.
SELECT * FROM coch
INTO CORRESPONDING FIELDS OF TABLE st_xstep
FOR ALL ENTRIES IN lt_order
WHERE bid = lt_order-table_line.
SORT st_xstep BY bid.
LOOP AT st_xstep ASSIGNING <ls_xstep>.

fill additional fields


CASE <ls_xstep>-crstat.
WHEN '00001'. "crst_creat.

<ls_xstep>-statustext = text-001.
<ls_xstep>-lights = '@09@'.
"yellow light
CONCATENATE '@09\Q' text-001 '@' INTO <ls_xstep>-lights.

WHEN '00003'. "crst_downl


<ls_xstep>-statustext = text-002.
<ls_xstep>-lights = '@09@'.
"yellow light
CONCATENATE '@09\Q' text-002 '@' INTO <ls_xstep>-lights.

WHEN '00004'. "crst_abort


<ls_xstep>-statustext = text-003.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-003 '@' INTO <ls_xstep>-lights.

WHEN '00005'. "crst_fini


<ls_xstep>-statustext = text-004.
<ls_xstep>-lights = '@08@'. "green light
CONCATENATE '@08\Q' text-004 '@' INTO <ls_xstep>-lights.

WHEN '00007'. "crst_cancl


<ls_xstep>-statustext = text-021.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-021 '@' INTO <ls_xstep>-lights.

WHEN 'X'. "crst_dele


<ls_xstep>-statustext = text-020.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-020 '@' INTO <ls_xstep>-lights.
ENDCASE.
ENDLOOP.

*
*

WHEN 'PPIOZ002'.
PPIOZ002 => add xyz list
....
ENDCASE.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<

...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS
*&
IF_EX_WORKORDER_INFOSYSTEM~OVERVIEW_TREE_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD if_ex_workorder_infosystem~overview_tree_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<

* fill field INDEX_NODE in additional tables


* PPIOZ001: XSteps
* ================
FIELD-SYMBOLS:
<ls_xstep>
LIKE LINE OF st_xstep,
<ls_ioheader> LIKE LINE OF ct_ioheader.
LOOP AT st_xstep ASSIGNING <ls_xstep>.
fill INDEX_NODE (use same as in CT_IOHEADER)
READ TABLE ct_ioheader WITH KEY aufnr = <ls_xstep>-bid
ASSIGNING <ls_ioheader> BINARY SEARCH.
IF sy-subrc = 0.
<ls_xstep>-index_node = <ls_ioheader>-index_node.
ENDIF.
ENDLOOP.

**
**
*
*
*
*

PPIOZ002: xyz
================
READ TABLE st_detail_list WITH KEY object = 'PPIOZ002'
INTO ls_detail_list.
CHECK sy-subrc = 0.
...

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS
*&
IF_EX_WORKORDER_INFOSYSTEM~DETAIL_LIST_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD if_ex_workorder_infosystem~detail_list_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
APPEND LINES OF st_detail_list TO ct_detail_list.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<

...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
HANDLE_TOOLBAR
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD handle_toolbar.
*>>>> START OF DELETION <<<<<

ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* call super method
super->handle_toolbar( e_object
= e_object
e_interactive = e_interactive ).
DATA:
lt_toolbar LIKE e_object->mt_toolbar,
ls_toolbar LIKE LINE OF e_object->mt_toolbar.
* create list of own toolbar buttons
* refresh
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'REFRESH'.
ls_toolbar-icon = icon_refresh.
ls_toolbar-quickinfo = text-b01.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* delete
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'DELETE'.
ls_toolbar-icon = icon_delete.
ls_toolbar-quickinfo = text-b04.
ls_toolbar-text = text-b04.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* protocol
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'PROTOCOL'.
ls_toolbar-icon = icon_information.
ls_toolbar-quickinfo = text-b02.
ls_toolbar-text = text-b02.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* send
CLEAR ls_toolbar.

ls_toolbar-butn_type = 0.
ls_toolbar-function = 'SEND'.
ls_toolbar-icon = icon_mail.
ls_toolbar-quickinfo = text-b03.
ls_toolbar-text = text-b03.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.

* append a separator to toolbar


CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* display contorl recipe
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'SHOW'.
ls_toolbar-icon = icon_display.
ls_toolbar-quickinfo = text-b06.
ls_toolbar-text = text-b05.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* change control recipe
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'EDIT'.
ls_toolbar-icon = icon_change.
ls_toolbar-quickinfo = text-b07.
ls_toolbar-text = text-b05.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* add own toolbar buttons
READ TABLE e_object->mt_toolbar WITH KEY function = 'DISPLAY_TOGGLE'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
INSERT LINES OF lt_toolbar INTO e_object->mt_toolbar INDEX sy-tabix.
ELSE.
APPEND LINES OF lt_toolbar TO e_object->mt_toolbar.
ENDIF.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
HANDLE_USER_COMMAND
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD handle_user_command.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CASE e_ucomm.
WHEN 'REFRESH'.

refresh list: pass ok-code to calling screen


cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
WHEN 'PROTOCOL'.

display protocols
protocol_display( ).

WHEN 'SEND'.
send
send( ).
mo_grid->refresh_table_display( ).

WHEN 'DELETE'.
delete
delete( ).
mo_grid->refresh_table_display( ).

*
*

*
*

WHEN 'SHOW'
OR 'EDIT'.
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
lv_display_mode TYPE char1.
FIELD-SYMBOLS:
<table>
TYPE zcois_t_xsteps,
<ls_data>
TYPE zcois_s_xsteps.
get data table from reference
ASSIGN md_data->* TO <table>.
get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
IF lt_row_alv IS INITIAL.
no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.
DESCRIBE TABLE lt_row_alv LINES sy-dbcnt.
IF sy-dbcnt > 1.
MESSAGE i752(c0).
EXIT.
ELSE.
IF e_ucomm = 'SHOW'.
lv_display_mode = 'X'.
ELSE.
CLEAR lv_display_mode.
ENDIF.
loop over selected rows (only 1)
LOOP AT lt_row_alv INTO ls_row_alv.
read marked data table entry
READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.
SUBMIT zpi_sheet_show
WITH p_crid = <ls_data>-crid
WITH p_mode = lv_display_mode
AND RETURN.

ENDLOOP.

ENDIF.
WHEN OTHERS.
super->handle_user_command( e_ucomm ).
ENDCASE.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
PROTOCOL_DISPLAY
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD protocol_display.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
**********************************************************************
* macro to simplify creation of field catalog entry
**********************************************************************
DATA:
ls_fcat
TYPE bal_s_fcat,
ls_bal_profile TYPE bal_s_prof.
DEFINE macro_add_fields.
clear ls_fcat.
ls_fcat-ref_table = 'BAL_S_SHOW'.
if &2 = 0.
ls_fcat-no_out
= 'X'.
else.
ls_fcat-col_pos = &2.
endif.
ls_fcat-is_treecol = &3.
ls_fcat-ref_field = &4.
ls_fcat-outputlen = &5.
ls_fcat-cltxt_add = &6.
ls_fcat-colddictxt = &7.
append ls_fcat to ls_bal_profile-&1_fcat.
END-OF-DEFINITION.
DATA:
ls_baldisp
lv_log_extnum
lv_answer
lv_num_prot
lt_row_alv
ls_row_alv

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

baldisp VALUE '2 2221122


balhdr-extnumber,
char1,
sydbcnt,
lvc_t_roid,
lvc_s_roid.

FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.
* get data table from reference

',

ASSIGN md_data->* TO <table>.


* get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
* loop over selected rows
LOOP AT lt_row_alv INTO ls_row_alv.
IF sy-tabix > 1.
*
shw protocol for next xsteps
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'J'
textline1
= text-p01
textline2
= text-p02
titel
= text-p03
IMPORTING
answer
= lv_answer.
IF lv_answer <> 'J'.
EXIT.
ENDIF.
ENDIF.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.
lv_log_extnum = <ls_data>-crid.

Get standard profile


CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
IMPORTING
e_s_display_profile = ls_bal_profile.

define fields in tree and list


REFRESH ls_bal_profile-mess_fcat.
macro_add_fields:
Level Column InList FieldName
Length
lev1
lev1 0
' '
'LOG_HANDLE' 0
lev1 1
' '
'ALDATE'
10
lev1 2
' '
'ALTIME'
10
lev1 3
' '
'ALUSER'
10
lev1 4
'X'
'EXTNUMBER' 15
lev1 5
'X'
'T_OBJECT' 20
lev1 6
'X'
'T_SUBOBJ' 20
lev1 7
'X'
'ALTCODE'
30
lev1 8
'X'
'ALPROG'
20
lev1 9
'X'
'T_ALMODE' 20
lev2
lev2 0
' '
'PROBCLASS' 0
lev2 1
' '
'T_PROBCLSS' 0
mess
mess 0
' '
'LOGNUMBER' 0
mess 0
' '
'MSGNUMBER' 0

*
*

*
*

AddColumnText DDIC-Text
' '
' '
' '
' '
' '
' '
' '
' '
' '
' '

' ',
' ',
' ',
' ',
'R',
'R',
'R',
'R',
' ',
' ',

' '
'X'

' ',
'R',

' '
' '

' ',
' ',

mess
mess
mess
mess
mess
mess
mess
mess

2
0
0
0
0
0
0
0

'
'
'
'
'
'
'
'

'
'
'
'
'
'
'
'

'T_MSG'
'MSGTY'
'MSGID'
'MSGNO'
'DETLEVEL'
'T_PROBCLSS'
'ALSORT'
'MSG_COUNT'

80
0
0
0
0
0
0
0

'
'
'
'
'
'
'
'

'
'
'
'
'
'
'
'

'
'
'
'
'
'
'
'

',
',
',
',
',
',
',
'.

* define some standard parameters


ls_bal_profile-exp_level
= 0.
ls_bal_profile-tree_ontop = 'X'.
ls_bal_profile-tree_adjst = 'X'.
* ls_bal_profile-tree_size
= 12.
ls_bal_profile-head_size = 55.
ls_bal_profile-start_col = 1.
ls_bal_profile-start_row = 1.
ls_bal_profile-end_col
= 95.
ls_bal_profile-end_row
= 24.
* ls_bal_profile-cwidth_opt = 'X'.
ls_bal_profile-use_grid = 'X'.
ls_bal_profile-not_empty = 'X'.
ls_bal_profile-show_all = 'X'.
ls_bal_profile-pop_adjst = ' '.
*

Aufruf Protokollanzeige
CALL FUNCTION 'APPL_LOG_DISPLAY'
EXPORTING
object
= 'COCR'
subobject
= ' '
external_number
= lv_log_extnum
object_attribute
= 2
subobject_attribute
= 2
external_number_attribute = 2
date_from
= '00000000'
time_from
= '000000'
date_to
= '00000000'
time_to
= '000000'
title_selection_screen
= text-t01
title_list_screen
= text-t01
column_selection
= ls_baldisp
suppress_selection_dialog = 'X'
i_s_display_profile
= ls_bal_profile
IMPORTING
number_of_protocols
= lv_num_prot
EXCEPTIONS
no_authority
= 01.
IF sy-subrc = 01.
MESSAGE e080(cb).
*
Keine Berechtigung zur Protokollanzeige
ELSEIF lv_num_prot = 0.
MESSAGE i806(cb).
ENDIF.
ENDLOOP.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...

*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
SEND
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD send.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
ls_coch
TYPE coch,
lt_coch
TYPE TABLE OF coch.
FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.
* get data table from reference
ASSIGN md_data->* TO <table>.
* get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
*

IF lt_row_alv IS INITIAL.
no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.

* loop over selected rows


LOOP AT lt_row_alv INTO ls_row_alv.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.

check if not deleted yet


IF <ls_data>-errkz = 'X'. "crst_dele.
MESSAGE i073(cb) WITH <ls_data>-crid.
CONTINUE.
ENDIF.

check authority

IF 0 <> authority_check( iv_plant = <ls_data>-werk


iv_actvt = '01' ). "ACT_CREAT
MESSAGE i078(cb) WITH 'CREATE' <ls_data>-werk.
CONTINUE.
ENDIF.

lock object
CALL FUNCTION 'ENQUEUE_ECOCB_COCH'
EXPORTING
crid
= <ls_data>-crid
_scope
= '1'
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
CASE sy-subrc.
WHEN 01.
MESSAGE i072(cb) WITH <ls_data>-crid. " wird bereits bearb.
CONTINUE.
WHEN 02.
MESSAGE a015(cb) WITH <ls_data>-crid." Systemfehler
ENDCASE.

check if delete in the meantime


SELECT SINGLE * FROM coch INTO ls_coch
WHERE crid = <ls_data>-crid.
IF sy-subrc <> 0.
MESSAGE i077(cb) WITH <ls_data>-crid <ls_data>-bid.
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = <ls_data>-crid
_scope = '1'.
CONTINUE.
ENDIF.

*
*

*
*
*

check status
IF ls_coch-crstat <> '00001'. "crst_creat
MESSAGE i082(cb) WITH ls_coch-crid. " alread send.
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid
_scope = '1'.
CONTINUE.
ENDIF.
type of communication interface
IF ls_coch-cotyp = '3'. "comty_pull: RFC-Download
control recipe & of type 3. sending not possible.
MESSAGE i088(cb) WITH ls_coch-crid.
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid
_scope = '1'.
CONTINUE.

ENDIF.
*

update displayed data


MOVE-CORRESPONDING ls_coch TO <ls_data>.
APPEND ls_coch TO lt_coch.
ENDLOOP.
IF NOT lt_coch IS INITIAL.

send xsteps online


CALL FUNCTION 'COCB_CONTROL_RECIPE_DISPATCH'
TABLES
icoch = lt_coch.
MESSAGE s086(cb). "control recipes send
ELSE.
MESSAGE s087(cb). " no control recipes send
ENDIF.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
DELETE
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD delete.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
lv_answer
TYPE char1,
ls_coch
TYPE coch,
lt_coch
TYPE TABLE OF coch,
lt_coft
TYPE TABLE OF coft,
lt_cofv
TYPE TABLE OF cofv,
lt_cocoa
TYPE TABLE OF cocoa,
lv_log_extnum TYPE balhdr-extnumber.
FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.
* confirm deletion
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'N'
textline1
= text-p10
textline2
= text-p11
titel
= text-p12
IMPORTING

answer

= lv_answer.

* check answer
CHECK lv_answer = 'J'.
* get data table from reference
ASSIGN md_data->* TO <table>.
* get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING

et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
*

IF lt_row_alv IS INITIAL.
no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.

* loop over selected rows


LOOP AT lt_row_alv INTO ls_row_alv.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.

check if not deleted yet


IF <ls_data>-errkz = 'X'. "crst_dele.
MESSAGE i073(cb) WITH <ls_data>-crid.
CONTINUE.
ENDIF.

check authority
IF 0 <> authority_check( iv_plant = <ls_data>-werk
iv_actvt = '06' ). "ACT_DELE
MESSAGE i078(cb) WITH 'DELETE' <ls_data>-werk.
CONTINUE.
ENDIF.

checks before deleting


IF
<ls_data>-crstat <> '00005' "crst_fini
AND <ls_data>-crstat <> '00004' "crst_abort
AND <ls_data>-crstat <> '00007' "crst_cancl
AND <ls_data>-tstkz = space.
control recipe not executed yet => no deletion
MESSAGE i085(cb) WITH <ls_data>-crid.
CONTINUE.
ENDIF.

lock
CALL FUNCTION 'ENQUEUE_ECOCB_COCH'
EXPORTING
crid
= <ls_data>-crid

EXCEPTIONS
foreign_lock =
system_failure =
CASE sy-subrc.
WHEN 01.
MESSAGE i072(cb)
CONTINUE.
WHEN 02.
MESSAGE a015(cb)
ENDCASE.
*

01
02.
WITH <ls_data>-crid.
WITH <ls_data>-crid.

check if control recipe has changed in the meantime


SELECT SINGLE * FROM coch INTO ls_coch
WHERE crid = <ls_data>-crid.

IF sy-subrc <> 0.
control recipe already deleted
MESSAGE i073(cb) WITH <ls_data>-crid.
*
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = <ls_data>-crid.
CONTINUE.
ELSE.
IF ls_coch-crstat <> <ls_data>-crstat.
MESSAGE i074(cb) WITH <ls_data>-crid.
*
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = <ls_data>-crid.
CONTINUE.
ENDIF.
ENDIF.
APPEND ls_coch TO lt_coch.
* update display list and set delete flag
MOVE-CORRESPONDING ls_coch TO <ls_data>.
<ls_data>-errkz = 'X'. "crst_dele.
ENDLOOP.
*

IF lt_coch IS INITIAL.
nothing deleted
MESSAGE s075(cb).
EXIT.
ENDIF.

* delete protocols
LOOP AT lt_coch INTO ls_coch.
lv_log_extnum = ls_coch-crid.
CALL FUNCTION 'APPL_LOG_DELETE'
EXPORTING
object
= 'COCR'
subobject
= ' '
external_number = lv_log_extnum
date_to
= sy-datlo
time_to
= sy-timlo
log_class
= '1'

EXCEPTIONS
no_authority
= 01.
IF sy-subrc = 01.
*
no authority to delete protocols
MESSAGE e079(cb).
ENDIF.
ENDLOOP.
* read objects to a message
SELECT * FROM coft INTO TABLE lt_coft FOR ALL ENTRIES IN lt_coch
WHERE crid = lt_coch-crid.
SELECT * FROM cofv INTO TABLE lt_cofv FOR ALL ENTRIES IN lt_coch
WHERE crid = lt_coch-crid.
SELECT * FROM cocoa INTO TABLE lt_cocoa FOR ALL ENTRIES IN lt_coch

WHERE crid = lt_coch-crid.


* delete
DELETE
DELETE
DELETE
DELETE

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
coch FROM TABLE lt_coch.
coft FROM TABLE lt_coft.
cofv FROM TABLE lt_cofv.
cocoa FROM TABLE lt_cocoa.

* delete control recipe long text


CALL FUNCTION 'CONTROL_RECIPE_LONGTEXT_DELETE'
EXPORTING
savemode_direct = 'X'
TABLES
acofv
= lt_cofv.
* dequeue
LOOP AT lt_coch INTO ls_coch.
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid.
ENDLOOP.
* success message
MESSAGE s076(cb).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
AUTHORITY_CHECK
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD authority_check.
*>>>> START OF DELETION <<<<<
ENDMETHOD.

*>>>> END OF DELETION <<<<<<<


*>>>> START OF INSERTION <<<<
* Berechtigungsprfung
AUTHORITY-CHECK OBJECT 'C_CREC_WRK'
ID 'ACTVT' FIELD iv_actvt
ID 'WERKS' FIELD iv_plant.
rv_subrc = sy-subrc.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS ZPI_SHEET_SHOW
*& Object Header PROG ZPI_SHEET_SHOW
*&--------------------------------------------------------------------*
*& REPORT ZPI_SHEET_SHOW
*&--------------------------------------------------------------------*

*>>>> START OF DELETION <<<<<


REPORT zpi_sheet_show.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
REPORT zpi_sheet_show.
PARAMETERS:
p_crid TYPE co_crid,
p_mode TYPE flag DEFAULT 'X'.
CALL FUNCTION 'PI_SHEET_SHOW'
EXPORTING
cntrl_recipe_id = p_crid
display_mode
= p_mode.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*

*$*$----------------------------------------------------------------$*$*
*$ Correction Inst.
0120061532 0000783195
$*
*$--------------------------------------------------------------------$*
*$ Valid for
:
$*
*$ Software Component SAP_APPL SAP Application
$*
*$ Release 600
All Support Package Levels
$*
*$--------------------------------------------------------------------$*
*$ Changes/Objects Not Contained in Standard SAP System
$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS
*&
IF_EX_WORKORDER_INFOSYSTEM~TABLES_MODIFY_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS

*&--------------------------------------------------------------------*
...
METHOD if_ex_workorder_infosystem~tables_modify_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lv_object
lv_list_count
ls_detail_list
FIELD-SYMBOLS:
<ls_detail_list>
<ls_tcoa>
<ls_sc1100>

TYPE ppio_listtype,
TYPE sytabix,
TYPE cois_s_detail_list.
TYPE cois_s_detail_list,
TYPE tcoa,
TYPE ppio_entry_sc1100.

* check if additional list should be displayed


* ============================================
CHECK
iv_calling_application = cl_cois_c=>appl_overview
OR iv_calling_application = cl_cois_c=>appl_detail_list
OR iv_calling_application = cl_cois_c=>appl_external_ov.
IF

iv_calling_application = cl_cois_c=>appl_overview
OR iv_calling_application = cl_cois_c=>appl_external_ov.
ASSIGN ('(SAPLCOISOUTPUT)GS_TCOA') TO <ls_tcoa>.
CHECK sy-subrc = 0.
CHECK <ls_tcoa>-profid(3) = 'ADD'.
lv_object = 'PPIOZ'.
lv_object+5 = <ls_tcoa>-profid+3(3).
ENDIF.
IF iv_calling_application = cl_cois_c=>appl_detail_list.
ASSIGN ('(PPIO_ENTRY)P_SC1100') TO <ls_sc1100>.
CHECK sy-subrc = 0.
CHECK <ls_sc1100>-ppio_listtyp(5) = 'PPIOZ'.
lv_object = <ls_sc1100>-ppio_listtyp.
ENDIF.
CHECK NOT lv_object IS INITIAL.
* get order numbers (no planned orders!)
* =================
DATA:
lt_order
TYPE TABLE OF aufnr.
FIELD-SYMBOLS:

<lr_order>
TYPE range_t_aufnr,
<ls_order>
TYPE LINE OF range_t_aufnr,
<ls_ioheader> LIKE LINE OF ct_ioheader.
*

IF iv_calling_application = cl_cois_c=>appl_detail_list.
get order numbers from selection routine
ASSIGN ('(SAPLCOISSELECT)AUFNR_RANGE[]') TO <lr_order>.
CHECK sy-subrc = 0.
LOOP AT <lr_order> ASSIGNING <ls_order>.
APPEND <ls_order>-low TO lt_order.

ENDLOOP.
ELSE.
* object overview always has IOHEADER_TAB filled
LOOP AT ct_ioheader ASSIGNING <ls_ioheader>
WHERE autyp = '10'
OR autyp = '40'.
APPEND <ls_ioheader>-aufnr TO lt_order.
ENDLOOP.
ENDIF.
* add additional list
* ===================
CASE lv_object.
*
*

*
*

WHEN 'PPIOZ001'.
PPIOZ001 => add XSteps list
===============
READ TABLE st_detail_list WITH KEY object = lv_object
ASSIGNING <ls_detail_list>.
IF sy-subrc = 0.
table already there => refresh mode
IF NOT <ls_detail_list>-list IS INITIAL.
refresh data
CLEAR st_xstep.
<ls_detail_list>-list->refresh( ).
ENDIF.
ELSE.
first selection create entry in ST_DETAIL_LIST
ls_detail_list-position = 99.
ls_detail_list-object
= lv_object.
ls_detail_list-grid_title = 'XSteps'.
ls_detail_list-tabname
= 'ZCOIS_S_XSTEPS'.
GET REFERENCE OF st_xstep INTO ls_detail_list-table.
ls_detail_list-list_class = 'ZCL_COIS_XSTEPS'.
APPEND ls_detail_list TO st_detail_list.
READ TABLE st_detail_list WITH KEY object = lv_object
ASSIGNING <ls_detail_list>.
ENDIF.
CHECK <ls_detail_list> IS ASSIGNED.

determine XSteps for orders


FIELD-SYMBOLS:
<ls_xstep>
LIKE LINE OF st_xstep.

fill data table ST_DATA_TABLE


CHECK NOT lt_order IS INITIAL.
SELECT * FROM coch

INTO CORRESPONDING FIELDS OF TABLE st_xstep


FOR ALL ENTRIES IN lt_order
WHERE bid = lt_order-table_line.
SORT st_xstep BY bid.
LOOP AT st_xstep ASSIGNING <ls_xstep>.

fill additional fields


CASE <ls_xstep>-crstat.

WHEN '00001'. "crst_creat.


<ls_xstep>-statustext = text-001.
<ls_xstep>-lights = '@09@'.
"yellow light
CONCATENATE '@09\Q' text-001 '@' INTO <ls_xstep>-lights.

WHEN '00003'. "crst_downl


<ls_xstep>-statustext = text-002.
<ls_xstep>-lights = '@09@'.
"yellow light
CONCATENATE '@09\Q' text-002 '@' INTO <ls_xstep>-lights.

WHEN '00004'. "crst_abort


<ls_xstep>-statustext = text-003.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-003 '@' INTO <ls_xstep>-lights.

WHEN '00005'. "crst_fini


<ls_xstep>-statustext = text-004.
<ls_xstep>-lights = '@08@'. "green light
CONCATENATE '@08\Q' text-004 '@' INTO <ls_xstep>-lights.

WHEN '00007'. "crst_cancl


<ls_xstep>-statustext = text-021.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-021 '@' INTO <ls_xstep>-lights.

WHEN 'X'. "crst_dele


<ls_xstep>-statustext = text-020.
<ls_xstep>-lights = '@0A@'. "red light
CONCATENATE '@0A\Q' text-020 '@' INTO <ls_xstep>-lights.
ENDCASE.
ENDLOOP.

*
*

WHEN 'PPIOZ002'.
PPIOZ002 => add xyz list
....
ENDCASE.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS

*&
IF_EX_WORKORDER_INFOSYSTEM~OVERVIEW_TREE_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS
*&--------------------------------------------------------------------*
...

METHOD if_ex_workorder_infosystem~overview_tree_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* fill field INDEX_NODE in additional tables
* PPIOZ001: XSteps
* ================
FIELD-SYMBOLS:
<ls_xstep>
LIKE LINE OF st_xstep,
<ls_ioheader> LIKE LINE OF ct_ioheader.
LOOP AT st_xstep ASSIGNING <ls_xstep>.
fill INDEX_NODE (use same as in CT_IOHEADER)
READ TABLE ct_ioheader WITH KEY aufnr = <ls_xstep>-bid
ASSIGNING <ls_ioheader> BINARY SEARCH.
IF sy-subrc = 0.
<ls_xstep>-index_node = <ls_ioheader>-index_node.
ENDIF.
ENDLOOP.

**
**
*
*
*
*

PPIOZ002: xyz
================
READ TABLE st_detail_list WITH KEY object = 'PPIOZ002'
INTO ls_detail_list.
CHECK sy-subrc = 0.
...

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_IM_COIS_XSTEPS
*&
IF_EX_WORKORDER_INFOSYSTEM~DETAIL_LIST_LAY
*& Object Header CLAS ZCL_IM_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD if_ex_workorder_infosystem~detail_list_lay.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
APPEND LINES OF st_detail_list TO ct_detail_list.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS

*&

HANDLE_TOOLBAR

*& Object Header CLAS ZCL_COIS_XSTEPS


*&--------------------------------------------------------------------*
...
METHOD handle_toolbar.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* call super method
super->handle_toolbar( e_object
= e_object
e_interactive = e_interactive ).
DATA:
lt_toolbar LIKE e_object->mt_toolbar,
ls_toolbar LIKE LINE OF e_object->mt_toolbar.
* create list of own toolbar buttons
* refresh
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'REFRESH'.
ls_toolbar-icon = icon_refresh.
ls_toolbar-quickinfo = text-b01.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* delete
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'DELETE'.
ls_toolbar-icon = icon_delete.
ls_toolbar-quickinfo = text-b04.
ls_toolbar-text = text-b04.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* protocol
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'PROTOCOL'.
ls_toolbar-icon = icon_information.
ls_toolbar-quickinfo = text-b02.
ls_toolbar-text = text-b02.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* send
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'SEND'.
ls_toolbar-icon = icon_mail.
ls_toolbar-quickinfo = text-b03.

ls_toolbar-text = text-b03.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO lt_toolbar.
* display contorl recipe
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'SHOW'.
ls_toolbar-icon = icon_display.
ls_toolbar-quickinfo = text-b06.
ls_toolbar-text = text-b05.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* change control recipe
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'EDIT'.
ls_toolbar-icon = icon_change.
ls_toolbar-quickinfo = text-b07.
ls_toolbar-text = text-b05.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO lt_toolbar.
* add own toolbar buttons
READ TABLE e_object->mt_toolbar WITH KEY function = 'DISPLAY_TOGGLE'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
INSERT LINES OF lt_toolbar INTO e_object->mt_toolbar INDEX sy-tabix.
ELSE.
APPEND LINES OF lt_toolbar TO e_object->mt_toolbar.
ENDIF.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
HANDLE_USER_COMMAND
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD handle_user_command.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CASE e_ucomm.
*

WHEN 'REFRESH'.
refresh list: pass ok-code to calling screen
cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
WHEN 'PROTOCOL'.

display protocols
protocol_display( ).

WHEN 'SEND'.
send
send( ).
mo_grid->refresh_table_display( ).

WHEN 'DELETE'.
delete
delete( ).
mo_grid->refresh_table_display( ).

*
*

*
*

WHEN 'SHOW'
OR 'EDIT'.
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
lv_display_mode TYPE char1.
FIELD-SYMBOLS:
<table>
TYPE zcois_t_xsteps,
<ls_data>
TYPE zcois_s_xsteps.
get data table from reference
ASSIGN md_data->* TO <table>.
get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
IF lt_row_alv IS INITIAL.
no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.
DESCRIBE TABLE lt_row_alv LINES sy-dbcnt.
IF sy-dbcnt > 1.
MESSAGE i752(c0).
EXIT.
ELSE.
IF e_ucomm = 'SHOW'.
lv_display_mode = 'X'.
ELSE.
CLEAR lv_display_mode.
ENDIF.
loop over selected rows (only 1)
LOOP AT lt_row_alv INTO ls_row_alv.
read marked data table entry
READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.
SUBMIT zpi_sheet_show
WITH p_crid = <ls_data>-crid
WITH p_mode = lv_display_mode
AND RETURN.
ENDLOOP.

ENDIF.
WHEN OTHERS.

super->handle_user_command( e_ucomm ).
ENDCASE.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
PROTOCOL_DISPLAY
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD protocol_display.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
**********************************************************************
* macro to simplify creation of field catalog entry
**********************************************************************
DATA:
ls_fcat
TYPE bal_s_fcat,
ls_bal_profile TYPE bal_s_prof.
DEFINE macro_add_fields.
clear ls_fcat.
ls_fcat-ref_table = 'BAL_S_SHOW'.
if &2 = 0.
ls_fcat-no_out
= 'X'.
else.
ls_fcat-col_pos = &2.
endif.
ls_fcat-is_treecol = &3.
ls_fcat-ref_field = &4.
ls_fcat-outputlen = &5.
ls_fcat-cltxt_add = &6.
ls_fcat-colddictxt = &7.
append ls_fcat to ls_bal_profile-&1_fcat.
END-OF-DEFINITION.
DATA:
ls_baldisp
lv_log_extnum
lv_answer
lv_num_prot
lt_row_alv
ls_row_alv

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

baldisp VALUE '2 2221122


balhdr-extnumber,
char1,
sydbcnt,
lvc_t_roid,
lvc_s_roid.

FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.

',

* get data table from reference


ASSIGN md_data->* TO <table>.
* get selected rows
CALL METHOD mo_grid->get_selected_rows

IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
* loop over selected rows
LOOP AT lt_row_alv INTO ls_row_alv.
IF sy-tabix > 1.
*
shw protocol for next xsteps
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'J'
textline1
= text-p01
textline2
= text-p02
titel
= text-p03
IMPORTING
answer
= lv_answer.
IF lv_answer <> 'J'.
EXIT.
ENDIF.
ENDIF.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.
lv_log_extnum = <ls_data>-crid.

Get standard profile


CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
IMPORTING
e_s_display_profile = ls_bal_profile.

define fields in tree and list


REFRESH ls_bal_profile-mess_fcat.
macro_add_fields:
Level Column InList FieldName
Length
lev1
lev1 0
' '
'LOG_HANDLE' 0
lev1 1
' '
'ALDATE'
10
lev1 2
' '
'ALTIME'
10
lev1 3
' '
'ALUSER'
10
lev1 4
'X'
'EXTNUMBER' 15
lev1 5
'X'
'T_OBJECT' 20
lev1 6
'X'
'T_SUBOBJ' 20
lev1 7
'X'
'ALTCODE'
30
lev1 8
'X'
'ALPROG'
20
lev1 9
'X'
'T_ALMODE' 20
lev2

*
*

AddColumnText DDIC-Text
' '
' '
' '
' '
' '
' '
' '
' '
' '
' '

' ',
' ',
' ',
' ',
'R',
'R',
'R',
'R',
' ',
' ',

lev2
lev2
mess
mess
mess
mess
mess
mess
mess

0
1

' '
' '

'PROBCLASS' 0
'T_PROBCLSS' 0

' '
'X'

' ',
'R',

0
0
2
0
0
0

'
'
'
'
'
'

'
'
'
'
'
'

'LOGNUMBER'
'MSGNUMBER'
'T_MSG'
'MSGTY'
'MSGID'
'MSGNO'

0
0
80
0
0
0

'
'
'
'
'
'

'
'
'
'
'
'

'
'
'
'
'
'

',
',
',
',
',
',

mess
mess
mess
mess

0
0
0
0

'
'
'
'

'
'
'
'

'DETLEVEL'
'T_PROBCLSS'
'ALSORT'
'MSG_COUNT'

0
0
0
0

'
'
'
'

'
'
'
'

'
'
'
'

',
',
',
'.

* define some standard parameters


ls_bal_profile-exp_level
= 0.
ls_bal_profile-tree_ontop = 'X'.
ls_bal_profile-tree_adjst = 'X'.
* ls_bal_profile-tree_size
= 12.
ls_bal_profile-head_size = 55.
ls_bal_profile-start_col = 1.
ls_bal_profile-start_row = 1.
ls_bal_profile-end_col
= 95.
ls_bal_profile-end_row
= 24.
* ls_bal_profile-cwidth_opt = 'X'.
ls_bal_profile-use_grid = 'X'.
ls_bal_profile-not_empty = 'X'.
ls_bal_profile-show_all = 'X'.
ls_bal_profile-pop_adjst = ' '.
*

Aufruf Protokollanzeige
CALL FUNCTION 'APPL_LOG_DISPLAY'
EXPORTING
object
= 'COCR'
subobject
= ' '
external_number
= lv_log_extnum
object_attribute
= 2
subobject_attribute
= 2
external_number_attribute = 2
date_from
= '00000000'
time_from
= '000000'
date_to
= '00000000'
time_to
= '000000'
title_selection_screen
= text-t01
title_list_screen
= text-t01
column_selection
= ls_baldisp
suppress_selection_dialog = 'X'
i_s_display_profile
= ls_bal_profile
IMPORTING
number_of_protocols
= lv_num_prot
EXCEPTIONS
no_authority
= 01.
IF sy-subrc = 01.
MESSAGE e080(cb).
Keine Berechtigung zur Protokollanzeige

ELSEIF lv_num_prot = 0.
MESSAGE i806(cb).
ENDIF.
ENDLOOP.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
SEND

*& Object Header CLAS ZCL_COIS_XSTEPS


*&--------------------------------------------------------------------*
...
METHOD send.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
ls_coch
TYPE coch,
lt_coch
TYPE TABLE OF coch.
FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.
* get data table from reference
ASSIGN md_data->* TO <table>.
* get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
*

IF lt_row_alv IS INITIAL.
no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.

* loop over selected rows


LOOP AT lt_row_alv INTO ls_row_alv.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.

check if not deleted yet


IF <ls_data>-errkz = 'X'. "crst_dele.

MESSAGE i073(cb) WITH <ls_data>-crid.


CONTINUE.
ENDIF.
*

check authority
IF 0 <> authority_check( iv_plant = <ls_data>-werk
iv_actvt = '01' ). "ACT_CREAT
MESSAGE i078(cb) WITH 'CREATE' <ls_data>-werk.
CONTINUE.
ENDIF.

lock object
CALL FUNCTION 'ENQUEUE_ECOCB_COCH'
EXPORTING
crid
= <ls_data>-crid

_scope
=
EXCEPTIONS
foreign_lock =
system_failure =
CASE sy-subrc.
WHEN 01.
MESSAGE i072(cb)
CONTINUE.
WHEN 02.
MESSAGE a015(cb)
ENDCASE.
*

*
*

*
*

'1'
01
02.
WITH <ls_data>-crid.

" wird bereits bearb.

WITH <ls_data>-crid." Systemfehler

check if delete in the meantime


SELECT SINGLE * FROM coch INTO ls_coch
WHERE crid = <ls_data>-crid.
IF sy-subrc <> 0.
MESSAGE i077(cb) WITH <ls_data>-crid <ls_data>-bid.
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = <ls_data>-crid
_scope = '1'.
CONTINUE.
ENDIF.
check status
IF ls_coch-crstat <> '00001'. "crst_creat
MESSAGE i082(cb) WITH ls_coch-crid. " alread send.
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid
_scope = '1'.
CONTINUE.
ENDIF.
type of communication interface
IF ls_coch-cotyp = '3'. "comty_pull: RFC-Download
control recipe & of type 3. sending not possible.
MESSAGE i088(cb) WITH ls_coch-crid.

dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid
_scope = '1'.
CONTINUE.
ENDIF.
update displayed data
MOVE-CORRESPONDING ls_coch TO <ls_data>.
APPEND ls_coch TO lt_coch.
ENDLOOP.
IF NOT lt_coch IS INITIAL.
send xsteps online
CALL FUNCTION 'COCB_CONTROL_RECIPE_DISPATCH'
TABLES
icoch = lt_coch.

MESSAGE s086(cb). "control recipes send


ELSE.
MESSAGE s087(cb). " no control recipes send
ENDIF.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
DELETE
*& Object Header CLAS ZCL_COIS_XSTEPS
*&--------------------------------------------------------------------*
...
METHOD delete.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lt_row_alv
TYPE lvc_t_roid,
ls_row_alv
TYPE lvc_s_roid,
lv_answer
TYPE char1,
ls_coch
TYPE coch,
lt_coch
TYPE TABLE OF coch,
lt_coft
TYPE TABLE OF coft,
lt_cofv
TYPE TABLE OF cofv,
lt_cocoa
TYPE TABLE OF cocoa,
lv_log_extnum TYPE balhdr-extnumber.
FIELD-SYMBOLS:
<table> TYPE zcois_t_xsteps,
<ls_data> TYPE zcois_s_xsteps.
* confirm deletion
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'

EXPORTING
defaultoption
textline1
textline2
titel
IMPORTING
answer

=
=
=
=

'N'
text-p10
text-p11
text-p12

= lv_answer.

* check answer
CHECK lv_answer = 'J'.
* get data table from reference
ASSIGN md_data->* TO <table>.
* get selected rows
CALL METHOD mo_grid->get_selected_rows
IMPORTING
et_row_no = lt_row_alv.
cl_gui_cfw=>flush( ).
IF lt_row_alv IS INITIAL.

no entries selected
MESSAGE i081(cb).
EXIT.
ENDIF.

* loop over selected rows


LOOP AT lt_row_alv INTO ls_row_alv.
*

read marked data table entry


READ TABLE <table> INDEX ls_row_alv-row_id
ASSIGNING <ls_data>.
CHECK sy-subrc = 0.

check if not deleted yet


IF <ls_data>-errkz = 'X'. "crst_dele.
MESSAGE i073(cb) WITH <ls_data>-crid.
CONTINUE.
ENDIF.

check authority
IF 0 <> authority_check( iv_plant = <ls_data>-werk
iv_actvt = '06' ). "ACT_DELE
MESSAGE i078(cb) WITH 'DELETE' <ls_data>-werk.
CONTINUE.
ENDIF.

checks before deleting


IF
<ls_data>-crstat <> '00005' "crst_fini
AND <ls_data>-crstat <> '00004' "crst_abort
AND <ls_data>-crstat <> '00007' "crst_cancl
AND <ls_data>-tstkz = space.
control recipe not executed yet => no deletion
MESSAGE i085(cb) WITH <ls_data>-crid.
CONTINUE.

ENDIF.
*

lock
CALL FUNCTION 'ENQUEUE_ECOCB_COCH'
EXPORTING
crid
= <ls_data>-crid
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
CASE sy-subrc.
WHEN 01.
MESSAGE i072(cb) WITH <ls_data>-crid.
CONTINUE.
WHEN 02.
MESSAGE a015(cb) WITH <ls_data>-crid.
ENDCASE.

check if control recipe has changed in the meantime


SELECT SINGLE * FROM coch INTO ls_coch
WHERE crid = <ls_data>-crid.
IF sy-subrc <> 0.
control recipe already deleted
MESSAGE i073(cb) WITH <ls_data>-crid.
dequeue

*
*

CALL FUNCTION 'DEQUEUE_ECOCB_COCH'


EXPORTING
crid = <ls_data>-crid.
CONTINUE.
ELSE.
IF ls_coch-crstat <> <ls_data>-crstat.
MESSAGE i074(cb) WITH <ls_data>-crid.
*
dequeue
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = <ls_data>-crid.
CONTINUE.
ENDIF.
ENDIF.
APPEND ls_coch TO lt_coch.
* update display list and set delete flag
MOVE-CORRESPONDING ls_coch TO <ls_data>.
<ls_data>-errkz = 'X'. "crst_dele.
ENDLOOP.
*

IF lt_coch IS INITIAL.
nothing deleted
MESSAGE s075(cb).
EXIT.
ENDIF.

* delete protocols
LOOP AT lt_coch INTO ls_coch.
lv_log_extnum = ls_coch-crid.
CALL FUNCTION 'APPL_LOG_DELETE'
EXPORTING

object
= 'COCR'
subobject
= ' '
external_number = lv_log_extnum
date_to
= sy-datlo
time_to
= sy-timlo
log_class
= '1'
EXCEPTIONS
no_authority
= 01.
IF sy-subrc = 01.
*
no authority to delete protocols
MESSAGE e079(cb).
ENDIF.
ENDLOOP.
* read objects to a message
SELECT * FROM coft INTO TABLE lt_coft FOR ALL ENTRIES IN lt_coch
WHERE crid = lt_coch-crid.
SELECT * FROM cofv INTO TABLE lt_cofv FOR ALL ENTRIES IN lt_coch
WHERE crid = lt_coch-crid.
SELECT * FROM cocoa INTO TABLE lt_cocoa FOR ALL ENTRIES IN lt_coch
WHERE crid = lt_coch-crid.
* delete <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
DELETE coch FROM TABLE lt_coch.

DELETE coft FROM TABLE lt_coft.


DELETE cofv FROM TABLE lt_cofv.
DELETE cocoa FROM TABLE lt_cocoa.
* delete control recipe long text
CALL FUNCTION 'CONTROL_RECIPE_LONGTEXT_DELETE'
EXPORTING
savemode_direct = 'X'
TABLES
acofv
= lt_cofv.
* dequeue
LOOP AT lt_coch INTO ls_coch.
CALL FUNCTION 'DEQUEUE_ECOCB_COCH'
EXPORTING
crid = ls_coch-crid.
ENDLOOP.
* success message
MESSAGE s076(cb).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH ZCL_COIS_XSTEPS
*&
AUTHORITY_CHECK

*& Object Header CLAS ZCL_COIS_XSTEPS


*&--------------------------------------------------------------------*
...
METHOD authority_check.
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* Berechtigungsprfung
AUTHORITY-CHECK OBJECT 'C_CREC_WRK'
ID 'ACTVT' FIELD iv_actvt
ID 'WERKS' FIELD iv_plant.
rv_subrc = sy-subrc.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS ZPI_SHEET_SHOW
*& Object Header PROG ZPI_SHEET_SHOW
*&--------------------------------------------------------------------*
*& REPORT ZPI_SHEET_SHOW
*&--------------------------------------------------------------------*
*>>>> START OF DELETION <<<<<
REPORT zpi_sheet_show.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<

REPORT zpi_sheet_show.
PARAMETERS:
p_crid TYPE co_crid,
p_mode TYPE flag DEFAULT 'X'.
CALL FUNCTION 'PI_SHEET_SHOW'
EXPORTING
cntrl_recipe_id = p_crid
display_mode
= p_mode.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*

SAP note number 363327


________________________________________________________________________
Number
Version
Status
Set on
Language

363327
12 vom 18.02.2003
Released for Customer
,18.02.2003
EN

Mastersprache
Short text
displayed

DE
COOIS/CO26/CO28: Change list of fields that can be

Responsible
Component

Dirk Giebel
PP-SFC-IS
Information System
________________________________________________________________________
Long text
Symptom
This note is an addition to other notes and combines work instructions
that are identical in these notes.
SAP does not accept any responsibility for the fact that additionally
displayed fields are filled or filled correctly in the standard (in
general, fields are marked as non-displayable if correct contents are
not ensured).
Other terms
Reason and Prerequisites
You can find the field string and Include name in the note that refers
to this note.
Solution
Report RCOTX000
With this report, the system determines for the respective field string
(table name) which fields can be displayed, with which width they are
displayed and with which texts.
- Execute report RCOTX000 using Transaction SE38 (F8)
Name of the field string: ... (see referring note)
Maintenance language:
Order type:

Logon language

10

- Choose 'Execute' (F8)


- You can now set the following for the individual fields:
column 3: 'X' or ' '
column 5: Number
column 7 to 10: Texts
- Make a note of the table name and all field names that were
changed
- Save

Now this change already applies to all clients of the system in which it
was carried out.If you do not want to carry out this change separately
in each of your systems, you can also transport it.To do this, you must

include the changes in the correction task manually (Transaction SE09,


double-click on the request!, change to the change mode).You must create
one or two separate entries for every field that was changed, depending
on the change made for each field:
- for change column 3:
PgmID Obj Object name
R3TR TABU TCOTK (key fields: Table name Field name)*.
- for change column 7 to 10:
PgmID Obj Object name
R3TR TABU TCOTX (key fields: Table name Field name)*.
Report RCNCT000
With this report, the system determines according to which fields in
this field string can be summed up (GesKZ, not relevant for new display
with ALV-GRID) and grouped together (GrpKZ).Furthermore, it generates an
Include for this field string which is needed for the export to
MS-Excel.
- Execute report RCNCT000 using Transaction SE38 (F8)
Name of the field string:

... (see referring note)

Name of the additional field string:


Include name:

... (see referring note)

- Choose 'Execute' (F8)


- You can now set the following for the individual fields:
CoInd: 'X' or ' ' or check box
GpInd: 'X' or ' ' or check box
- Make a note of the field string and all field names that were
changed
- Generate includes/Save table entries (Shift+F4)
Now this change already applies to all clients of the system in which it
was carried out.If you do not want to carry out this change separately
in each of your systems, you can also transport it.As of Release 4.5A,
the system displays a dialog box for this report in which you can select
a corresponding change request.In systems with a release earlier than
Release 4.5A, you must include the changes in the correction task
manually (Transaction SE09 -> Request/task -> Object list -> Change
object list):

PgmID Obj Object name

R3TR TABU TMC73 (key fields: Field string Field name)*


LIMU REPS Include name (see referring note)
* For entering the key fields, double-click in the object list on the
line just edited.
Change the profiles of the fields to be displayed
- In Transaction COIS, select the first entry and click on
'Detail'
- Under objects double-click the profile for the required object
- Now double-click any object profile
- Under 'Settings object detail list' double-click 'Profile
displayed fields'
- Now select the required profile and double-click 'Field
selection field profile'
- Switch to change mode and click on 'Change field sel.'
- Now change the field selection (try not to change the standard
profiles)
- Save
________________________________________________________________________
Valid releases
Software component
SAP_APPL

Release
from

to

SAP Application
46C
46A
45A
40A
31I

46C
46B
45B
40B
31I

________________________________________________________________________

References to related notes


Number
Short text
____________________________________________________________
1351956 Missing part list- Unit is not displayed
597098
COOIS: Field 'Special procurement key' always initial
540779
FAQ: Information system
520429
COOIS: Field 'Actual start time' is duplicate
519925
COOIS, CO26: Fields for delay are not displayed
493381
Displaying maximum ATP quantity on missing parts list

436134
434123
397998
395258
379073

CO28, CO27: Dump CONVT_NO_NUMBER during Excel export


Filling and displaying own fields in information system
COOIS, CO28: confirmed service
CO28, COOIS: The Long Text Language field is not filled
CO26/CO28: Formatting of WBS element

________________________________________________________________________

SAP note number 865546


________________________________________________________________________
Number
Version
Status
Set on
Language
Mastersprache
Short text

865546
1 vom 27.07.2005
Released for Customer
,11.08.2005
EN
DE
COOIS: Preparation for additional lists

Responsible
Component

Dirk Giebel
PP-SFC-IS
Information System
________________________________________________________________________
Long text
Symptom
This note contains the necessary prerequisites to be able to display
additional customer-defined lists in the information system. For an
example, see Note 865926.
Other terms
COOIS, COHV, COOISPI, COHVPI
Reason and Prerequisites
Solution
1. Use Transaction SE24 to create the CL_COIS_ADD_LIST class.
Package: COIS
Name: Template for additional list in information system
Instantiation: Abstract
Add the IF_COIS_DISP_LIST interface.
Create the following text elements:
a) 001 (restricted) (Length 20)
b) 007 Full screen on/off (Length 30)
c) 008 Close (Length 30)
Create the following attributes:
d) MO_GRID Instance Attribute Protected Type Ref To CL_GUI_ALV_GRID

e) MD_DATA Instance Attribute Protected Type Ref To DATA


f) MD_DATA_SAVE Instance Attribute Protected Type Ref To DATA
g) MD_NODE_MAX_EX Instance AttributeProtected Type Ref To
COIS_T_NODE_MAX_EX
h) MD_LAYOUT Instance Attribute Protected Type Ref To DATA

i) MV_FILTER_SET Instance Attribute Protected Type FLAG


j) MV_CATEGORY Instance Attribute Protected Type AUFTYP
k) MV_OBJECT Instance Attribute Protected Type REPID
l) MV_TABNAME Instance Attribute Protected Type TABNAME
m) MV_TITLE Instance Attribute Protected Type LVC_TITLE
n) MV_CALLING_APPL Instance attributes Protected Type
COIS_CALLING_APPLICATION
o) MT_FIELDCAT Instance Attribute Protected Type LVC_T_FCAT
p) MT_SORTCAT Instance Attribute Protected Type LVC_T_SORT
q) MV_SHORTCUTS Instance Attribute Protected Type FLAG
r) Instance MO_NAVIGATION_PROFILE attributes Protected Type Ref To
IF_NAVP (only for Release ECC 600)
s) MV_TOOLBAR_ALV Instance Attribute Protected Type FLAG (only for
Release ECC 500)
Create the following methods:
t) HANDLE_CONTEXT_MENU as event handler for
CL_GUI_ALV_GRID/CONTEXT_MENU_REQUEST
Copy the event parameters.
u) HANDLE_DOUBLE_CLICK as event handler for
CL_GUI_ALV_GRID/DOUBLE_CLICK
Copy the event parameters.
v) HANDLE_MENU_BUTTON as event handler for
CL_GUI_ALV_GRID/MENU_BUTTON
Copy the event parameters.
w) HANDLE_TOOLBAR as event handler for CL_GUI_ALV_GRID/TOOLBAR
Copy the event parameters.

x) HANDLE_USER_COMMAND as event handler for


CL_GUI_ALV_GRID/USER_COMMAND
Copy the event parameters.
y) FIELD_SELECTION_GROUPS_CREATE (only for Release ECC 500)
Parameter:
CT_FIELD_GROUPS Changing Type LVC_T_SGRP

CT_FIELDCAT Changing Type LVC_T_FCAT


Only for Release ECC 500: Create the following text elements:
z) 010 Standard list functions ON (Length 40)
) 011 Standard list functions OFF (Length 40)
2. Implement the source code corrections contained in the correction
instructions.
________________________________________________________________________
Valid releases
Software component
SAP_APPL

Release
from

to

SAP Application
600
500

- 600
- 500

Other components
PP-PI-POR
Process Order
________________________________________________________________________
References to related notes
Number
Short text
____________________________________________________________
865926
COOIS: Additional list with XSteps
________________________________________________________________________
References to Support Packages
Software component
Release
Package name
________________________________________________________________________
SAP Application
500
SAPKH50010
600
SAPKH60001

________________________________________________________________________

Assigned correction instructions


________________________________________________________________________
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst.
0120031469 0000404121
$*
*$--------------------------------------------------------------------$*
*$ Valid for
:
$*
*$ Software Component SAP_APPL SAP Application
$*
*$ Release 600
w/o Support Packages
$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& Object
FUNC COIS_F4_PPIO_LISTTYP
*& Object Header FUGR COIS
*&--------------------------------------------------------------------*
*& FUNCTION COIS_F4_PPIO_LISTTYP
*&--------------------------------------------------------------------*
...
FUNCTION cois_f4_ppio_listtyp.
*"---------------------------------------------------------------------*"*"Lokale Schnittstelle:
*" IMPORTING
*"
REFERENCE(DOMNAME) LIKE DD01V-DOMNAME DEFAULT SPACE
*" TABLES
*"
SHLP_TAB TYPE SHLP_DESCR_TAB_T
*"
RECORD_TAB STRUCTURE SEAHLPRES OPTIONAL
*"
DD07V_TAB STRUCTURE DD07V OPTIONAL
*" CHANGING
*"
REFERENCE(SHLP) TYPE SHLP_DESCR_T
*"
REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL
*"
STRUCTURE DDSHF4CTRL
*" EXCEPTIONS
*"
NO_F4_HLP
*"---------------------------------------------------------------------DATA:
*>>>> START OF DELETION <<<<<
ls_interface LIKE LINE OF shlp-interface,
lt_values
LIKE dd07v_tab OCCURS 0 WITH HEADER LINE.
CHECK callcontrol-step = 'SELECT'.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
ls_interface LIKE LINE OF shlp-interface.
CHECK callcontrol-step = 'SELECT'.
*>>>> END OF INSERTION <<<<<<
...
CALL FUNCTION 'F4UT_DOMAHLP_EXECUTE'
EXPORTING
domname
= domname
TABLES
shlp_tab
= shlp_tab
record_tab = record_tab

dd07v_tab = dd07v_tab
CHANGING
shlp
= shlp
callcontrol = callcontrol

EXCEPTIONS
no_f4_hlp = 1
OTHERS
= 2.
*>>>> START OF DELETION <<<<<
READ TABLE shlp-interface[] INTO ls_interface INDEX 1.
* delete domain values according to restrictions
CASE ls_interface-valfield.
WHEN 'PPIO_LISTTYP'.
IF gt_list_type IS INITIAL.
lt_values[] = dd07v_tab[].
lt_values = dd07v_tab.
ELSE.
*
take only entries from dd07v_tab, which are specified in
*gt_list_type
LOOP AT dd07v_tab.
READ TABLE gt_list_type
WITH KEY domvalue_l = dd07v_tab-domvalue_l
TRANSPORTING NO FIELDS.
CHECK sy-subrc = 0 .
lt_values = dd07v_tab.
APPEND lt_values.
ENDLOOP.
ENDIF.
SORT dd07v_tab BY ddtext.
WHEN OTHERS.
lt_values[] = dd07v_tab[].
ENDCASE.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* delete domain values according to restrictions
READ TABLE shlp-interface[] INTO ls_interface INDEX 1.
IF ls_interface-valfield = 'PPIO_LISTTYP'.
IF NOT gt_list_type IS INITIAL.
*
take only entries from dd07v_tab, which are specified in
*gt_list_type
dd07v_tab[] = gt_list_type.
ENDIF.
SORT dd07v_tab BY ddtext.
ENDIF.
*>>>> END OF INSERTION <<<<<<
...
CALL FUNCTION 'F4UT_DOMAHLP_EXECUTE'
EXPORTING
domname
= domname
TABLES
shlp_tab
= shlp_tab
record_tab = record_tab
*>>>> START OF DELETION <<<<<
dd07v_tab = lt_values

*>>>> END OF DELETION <<<<<<<


*>>>> START OF INSERTION <<<<
dd07v_tab = dd07v_tab
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*

*& Object
REPS PPIO_ENTRY_1100_I01
*& Object Header PROG PPIO_ENTRY_1100_I01
*&--------------------------------------------------------------------*
*& MODULE CHECK_PROFID_LAYOUT INPUT
*&--------------------------------------------------------------------*
...
g_var_saved = con_x.
ELSE.
PERFORM get_layout CHANGING ppio_entry_sc1100.
* The list was not just changed and no layout found
*
=> user must enter layout or profile
*>>>> START OF DELETION <<<<<
IF ppio_entry_sc1100-profid = con_no_profile AND
ppio_entry_sc1100-alv_variant IS INITIAL AND
sy-ucomm <> con_fc_list_select.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
IF
ppio_entry_sc1100-profid
= con_no_profile
AND ppio_entry_sc1100-alv_variant
IS INITIAL
AND ppio_entry_sc1100-ppio_listtyp(5) <> 'PPIOZ'
AND sy-ucomm <> con_fc_list_select.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS PPIO_ENTRY_F_START_OF_SEL
*& Object Header PROG PPIO_ENTRY_F_START_OF_SEL
*&--------------------------------------------------------------------*
*& FORM START_OF_SELECTION
*&--------------------------------------------------------------------*
...
tracebackground_2
'start_of_selection - before submit; Profile: ' <l_profid>. "#EC NOTEXT
* use
*
*>>>>
IF
*>>>>
*>>>>
*
IF

new output: - for document links, overview (when set in profile)


or parameter p_alv_x is set
START OF DELETION <<<<<
p_sc1100-ppio_listtyp = report_docl
END OF DELETION <<<<<<<
START OF INSERTION <<<<
or for additional lists (PPIOZ...)
p_sc1100-ppio_listtyp = report_docl
OR p_sc1100-ppio_listtyp(5) = 'PPIOZ'
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS PPIO_ENTRY_GET_TAB_REPORT

*& Object Header PROG PPIO_ENTRY_GET_TAB_REPORT


*&--------------------------------------------------------------------*
*& FORM GET_TABLE_FOR_REPORT
*&--------------------------------------------------------------------*
...
WHEN report_pord.
"'PPIOT000'
c_tablename = con_iooppord.
"'IOOPPORD'
WHEN report_docl.
"'PPIOV000'
c_tablename = con_iodocl.
"'IODOCL'
WHEN OTHERS.

*>>>> START OF DELETION <<<<<


MESSAGE w000(c+).
* Interner Fehler. Verstndigen Sie Ihre Systemverwaltung
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CLEAR c_tablename.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCDEF
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* use this source file for any type declarations (class
*"* definitions, interfaces or data types) you need for method
*"* implementation or private method's signature
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCIMP
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* local class implementation for public class
*"* use this source file for the implementation part of
*"* local helper classes
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCMAC
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* use this source file for any macro definitions you need
*"* in the implementation part of the class
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*

*& Object
FUNC COIS_OUTPUT_FROM_IOC
*& Object Header FUGR COISOUTPUT
*&--------------------------------------------------------------------*
*& FUNCTION COIS_OUTPUT_FROM_IOC
*&--------------------------------------------------------------------*
...
CALL FUNCTION 'COIS_SELECT_PL_ORDERS_READ'
EXPORTING
iv_read_components
= gs_tcoa-opcomp_sel
ir_planned_order_type = lr_paart
CHANGING
ct_ioheader
= lt_ioheader
ct_ioopcomp
= lt_ioopcomp.

*>>>>

*>>>>
*>>>>

IF NOT lt_ioheader IS INITIAL.


APPEND LINES OF lt_ioheader TO ioheader_tab[].
START OF DELETION <<<<<
ENDIF.
IF NOT lt_ioopcomp IS INITIAL.
INSERT lines of lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.
END OF DELETION <<<<<<<
START OF INSERTION <<<<
CLEAR lt_ioheader[].
ENDIF.
IF NOT lt_ioopcomp IS INITIAL.
INSERT lines of lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.
CLEAR lt_ioopcomp[].
END OF INSERTION <<<<<<

*>>>>
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_CONTEXT_MENU
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD HANDLE_CONTEXT_MENU .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* add own functions to context menu
* ...
* add navigation profile functions to context menu
mo_navigation_profile->context_menu_setup( e_object ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_DOUBLE_CLICK
*& Object Header CLAS CL_COIS_ADD_LIST

*&--------------------------------------------------------------------*
...
METHOD HANDLE_DOUBLE_CLICK .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* don't do anything on summation rows
CHECK e_row-rowtype IS INITIAL.
* ...
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...

*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_MENU_BUTTON
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD HANDLE_MENU_BUTTON .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* ...
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_TOOLBAR
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD HANDLE_TOOLBAR .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
ls_toolbar LIKE LINE OF e_object->mt_toolbar.
* add own toolbar buttons
* ...
* add navigation profile function codes to toolbar
mo_navigation_profile->toolbar_setup(

CHANGING
ct_toolbar = e_object->mt_toolbar ).
* only for object overview
IF
mv_calling_appl = cl_cois_c=>appl_overview
OR mv_calling_appl = cl_cois_c=>appl_retrieval_ov
OR mv_calling_appl = cl_cois_c=>appl_external_ov.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO e_object->mt_toolbar.
*

append full screen


CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = cl_cois_c=>fc_display_toggle.
ls_toolbar-icon = icon_toggle_display.
ls_toolbar-quickinfo = text-007.
ls_toolbar-disabled = space.

APPEND ls_toolbar TO e_object->mt_toolbar.


*

append close screen


CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = cl_cois_c=>fc_display_close.
ls_toolbar-icon = icon_close.
ls_toolbar-quickinfo = text-008.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_USER_COMMAND
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD HANDLE_USER_COMMAND .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
if_cois_disp_list~user_command( e_ucomm ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*

*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~FREE
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~FREE .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
FIELD-SYMBOLS:
<lt_data>
<lt_data_save>

TYPE table,
TYPE table.

CLEAR mv_filter_set.
* restore original data in data table and free temporary table
IF NOT md_data_save IS INITIAL.
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data> = <lt_data_save>.

FREE md_data_save.
ENDIF.
* free ALV grid
IF NOT mo_grid IS INITIAL.
mo_grid->free( ).
FREE mo_grid.
ENDIF.
endmethod.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~REFRESH
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~REFRESH .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* free reduced data
IF NOT md_data_save IS INITIAL.
FREE md_data_save.
ENDIF.
* update ALV output
CHECK NOT mo_grid IS INITIAL.
mo_grid->set_gridtitle( mv_title ).

mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~RESET_FILTER_BY_NODE_MAX_EX
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~RESET_FILTER_BY_NODE_MAX_EX .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
FIELD-SYMBOLS:
<lt_data>
<lt_data_save>
*

TYPE table,
TYPE table.

IF NOT md_data_save IS INITIAL.


restore original data
ASSIGN md_data->* TO <lt_data>.

ASSIGN md_data_save->* TO <lt_data_save>.


<lt_data> = <lt_data_save>.
FREE md_data_save.
ENDIF.
* update ALV output
CHECK NOT mo_grid IS INITIAL.
mo_grid->set_gridtitle( mv_title ).
mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_FILTER_BY_NODE_MAX_EX
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~SET_FILTER_BY_NODE_MAX_EX .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
lv_counter_total TYPE sytabix,
lv_counter_save TYPE sytabix,
lv_title
TYPE lvc_title.

FIELD-SYMBOLS:
<lt_data>
<lt_data_save>
<ls_data>
<lv_node_index>
<ls_node_max_ex>

TYPE
TYPE
TYPE
TYPE
TYPE

table,
table,
ANY,
tabix_d,
cois_s_node_max_ex.

* set flag, that filter should be set, maybe it can not be set now,
* the it will be set, when MO_GRID is created again
mv_filter_set = 'X'.
CHECK NOT mo_grid IS INITIAL.
CLEAR mv_filter_set.
IF md_data_save IS INITIAL.
save original data
CREATE DATA md_data_save TYPE TABLE OF (mv_tabname).
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data_save> = <lt_data>.
ELSE.
* restore original data
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data> = <lt_data_save>.
ENDIF.
*

LOOP AT <lt_data> ASSIGNING <ls_data>.


ASSIGN COMPONENT 'INDEX_NODE' OF STRUCTURE <ls_data>
TO <lv_node_index>.
CHECK sy-subrc = 0.
READ TABLE md_node_max_ex->* INDEX <lv_node_index>
ASSIGNING <ls_node_max_ex>.
CHECK sy-subrc = 0.
CHECK <ls_node_max_ex>-filt <> 'X'.
DELETE <lt_data>.
ENDLOOP.
DESCRIBE TABLE <lt_data> LINES lv_counter_total.
DESCRIBE TABLE <lt_data_save> LINES lv_counter_save.
IF lv_counter_total = lv_counter_save.
lv_title = mv_title.
mo_grid->set_gridtitle( lv_title ).
FREE md_data_save.
ELSE.
CONCATENATE mv_title text-001 INTO lv_title.
mo_grid->set_gridtitle( lv_title ).
ENDIF.
mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*

*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_INITIAL_DATA
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~SET_INITIAL_DATA .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* set instance attributes
GET REFERENCE OF ct_data
INTO md_data.
GET REFERENCE OF it_node_max_ex INTO md_node_max_ex.
mv_object
= iv_object.
mv_tabname
= iv_tabname.
mv_title
= iv_title.
mv_calling_appl = iv_calling_appl.
mv_category
= iv_category.
IF

mv_calling_appl = cl_cois_c=>appl_detail_list
OR mv_calling_appl = cl_cois_c=>appl_external.
* in single list display and for header in overview
* activate keyboard shortcuts
MV_SHORTCUTS = 'X'.
ENDIF.
*

IF cv_layout IS INITIAL.
get layout

CALL METHOD cl_cois_layout=>get_default


EXPORTING
iv_list_type = iv_object
iv_category = iv_category
IMPORTING
ev_layout
= cv_layout.
ENDIF.
GET REFERENCE OF cv_layout INTO md_layout.
* get fieldcatalog
CALL METHOD cl_cois_fieldcat=>get
EXPORTING
iv_tabname
= mv_tabname
iv_category
= iv_category
IMPORTING
et_fieldcat_alv = mt_fieldcat.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_TABLE_FOR_FIRST_DISPLAY
*& Object Header CLAS CL_COIS_ADD_LIST

*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~SET_TABLE_FOR_FIRST_DISPLAY .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
ls_print
l_save
lt_field_groups
ls_variant
ls_layout
lt_tooltip

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

lvc_s_prnt,
char1,
lvc_t_sgrp,
disvariant,
lvc_s_layo,
lvc_t_qinf.

FIELD-SYMBOLS:
<table> TYPE table,
<layout> TYPE slis_vari.
* get data table from reference
ASSIGN md_data->* TO <table>.
* create and initialize ALV display
CREATE OBJECT mo_grid
EXPORTING
i_parent = io_container
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* set event handler


SET HANDLER:
handle_user_command
handle_toolbar
handle_menu_button
handle_double_click
handle_context_menu

FOR
FOR
FOR
FOR
FOR

* set print parameters


ls_print-prntselinf = 'X'.
ls_print-grpchgedit = 'X'.
ls_print-prntlstinf = 'X'.
* set variant parameters
ASSIGN md_layout->* TO <layout>.
ls_variant-variant = <layout>.
ls_variant-report = mv_object.
* set layout parameters
ls_layout-smalltitle = 'X'.
IF md_data_save IS INITIAL.

mo_grid,
mo_grid,
mo_grid,
mo_grid,
mo_grid.

ls_layout-grid_title = mv_title.
ELSE.
CONCATENATE mv_title text-001 INTO ls_layout-grid_title.
ENDIF.
* selection of all entries is possible
ls_layout-sel_mode = 'A'.
* set save mode
l_save = 'A'.

" save user and user-independent variants

cl_cois_fieldcat=>field_selection_groups_create(
CHANGING
ct_field_groups = lt_field_groups
ct_fieldcat
= mt_fieldcat ).
* add navigation profile
mo_navigation_profile = cl_navp_factory=>factory(
io_alv
= mo_grid
is_profile_key
= ls_variant
iv_default
= if_navp=>default_auto
iv_save_mode
= l_save
it_table
= <table>
iv_trigger_toolbar_setup
= 'X'
iv_trigger_context_menu_setup = 'X' ).
*
IT_OKCODE
= IT_OKCODE
mo_grid->set_table_for_first_display(
EXPORTING
is_variant
= ls_variant
i_save
= l_save
i_default
= 'N'
is_layout
= ls_layout
is_print
= ls_print
it_special_groups
= lt_field_groups
it_except_qinfo
= lt_tooltip
CHANGING

it_outtab
=
it_fieldcatalog
=
it_sort
=
EXCEPTIONS
invalid_parameter_combination =
program_error
=
OTHERS
=
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty
WITH sy-msgv1 sy-msgv2
ENDIF.

<table>
mt_fieldcat
mt_sortcat
1
2
3 ).
NUMBER sy-msgno
sy-msgv3 sy-msgv4.

* if filter could not be set before MO_GRID was created, it has to be


* set now
IF NOT mv_filter_set IS INITIAL.
if_cois_disp_list~set_filter_by_node_max_ex( ).
ENDIF.
ENDMETHOD.

*>>>> END OF INSERTION <<<<<<


...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~USER_COMMAND
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
...
METHOD IF_COIS_DISP_LIST~USER_COMMAND .
*>>>> START OF DELETION <<<<<
ENDMETHOD.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CASE iv_ucomm.
*

WHEN cl_cois_c=>fc_display_toggle.
full screen on/off
CALL FUNCTION 'COIS_OUTPUT_DISPLAY_FULLSCREEN'
EXPORTING
io_list = me.
cl_gui_cfw=>set_new_ok_code( iv_ucomm ).
WHEN cl_cois_c=>fc_display_close.
close screen
CALL FUNCTION 'COIS_OUTPUT_DISPLAY_CLOSE'
EXPORTING
io_grid = me.
cl_gui_cfw=>set_new_ok_code( iv_ucomm ).
ENDCASE.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS LCOISOUTPUTF06

*& Object Header FUGR COISOUTPUT


*&--------------------------------------------------------------------*
*& FORM REFRESH_ALL
*&--------------------------------------------------------------------*
...
INSERT lines of lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.
ENDIF.
ENDIF.
ENDIF.
*>>>> START OF DELETION <<<<<
* refresh overview tree
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* pass tables to badi
PERFORM badi_tables_modify_lay_call USING gv_calling_application

gv_category
gs_tcoa.
* refresh overview tree
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*

*$*$----------------------------------------------------------------$*$*
*$ Correction Inst.
0120031469 0000404122
$*
*$ Req. Corr. Instructions 0120061532 0000698657 Note 0000789978
$*
*$
0120061532 0000728687 Note 0000848330
$*
*$--------------------------------------------------------------------$*
*$ Valid for
:
$*
*$ Software Component SAP_APPL SAP Application
$*
*$ Release 500
To SAPKH50009
$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& Object
FUNC COIS_F4_PPIO_LISTTYP
*& Object Header FUGR COIS
*&--------------------------------------------------------------------*
*& FUNCTION COIS_F4_PPIO_LISTTYP
*&--------------------------------------------------------------------*
...
FUNCTION cois_f4_ppio_listtyp.
*"---------------------------------------------------------------------*"*"Lokale Schnittstelle:
*" IMPORTING
*"
REFERENCE(DOMNAME) LIKE DD01V-DOMNAME DEFAULT SPACE
*" TABLES
*"
SHLP_TAB TYPE SHLP_DESCR_TAB_T
*"
RECORD_TAB STRUCTURE SEAHLPRES OPTIONAL
*"
DD07V_TAB STRUCTURE DD07V OPTIONAL
*" CHANGING
*"
REFERENCE(SHLP) TYPE SHLP_DESCR_T
*"
REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL
*"
STRUCTURE DDSHF4CTRL
*" EXCEPTIONS
*"
NO_F4_HLP
*"---------------------------------------------------------------------DATA:
*>>>> START OF DELETION <<<<<
ls_interface LIKE LINE OF shlp-interface,
lt_values
LIKE dd07v_tab OCCURS 0 WITH HEADER LINE.
CHECK callcontrol-step = 'SELECT'.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
ls_interface LIKE LINE OF shlp-interface.
CHECK callcontrol-step = 'SELECT'.
*>>>> END OF INSERTION <<<<<<
...
CALL FUNCTION 'F4UT_DOMAHLP_EXECUTE'
EXPORTING

domname
TABLES
shlp_tab
record_tab
dd07v_tab
CHANGING
shlp
callcontrol
EXCEPTIONS
no_f4_hlp

= domname
= shlp_tab
= record_tab
= dd07v_tab
= shlp
= callcontrol
= 1

OTHERS
= 2.
*>>>> START OF DELETION <<<<<
READ TABLE shlp-interface[] INTO ls_interface INDEX 1.
* delete domain values according to restrictions
CASE ls_interface-valfield.
WHEN 'PPIO_LISTTYP'.
IF gt_list_type IS INITIAL.
lt_values[] = dd07v_tab[].
lt_values = dd07v_tab.
ELSE.
*
take only entries from dd07v_tab, which are specified in
*gt_list_type
LOOP AT dd07v_tab.
READ TABLE gt_list_type
WITH KEY domvalue_l = dd07v_tab-domvalue_l
TRANSPORTING NO FIELDS.
CHECK sy-subrc = 0 .
lt_values = dd07v_tab.
APPEND lt_values.
ENDLOOP.
ENDIF.
SORT dd07v_tab BY ddtext.
WHEN OTHERS.
lt_values[] = dd07v_tab[].
ENDCASE.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* delete domain values according to restrictions
READ TABLE shlp-interface[] INTO ls_interface INDEX 1.
IF ls_interface-valfield = 'PPIO_LISTTYP'.
IF NOT gt_list_type IS INITIAL.
*
take only entries from dd07v_tab, which are specified in
*gt_list_type
dd07v_tab[] = gt_list_type.
ENDIF.
SORT dd07v_tab BY ddtext.
ENDIF.
*>>>> END OF INSERTION <<<<<<
...
CALL FUNCTION 'F4UT_DOMAHLP_EXECUTE'
EXPORTING
domname
= domname
TABLES

*>>>>
*>>>>
*>>>>

shlp_tab
= shlp_tab
record_tab = record_tab
START OF DELETION <<<<<
dd07v_tab = lt_values
END OF DELETION <<<<<<<
START OF INSERTION <<<<
dd07v_tab = dd07v_tab
END OF INSERTION <<<<<<

*>>>>
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS PPIO_ENTRY_1100_I01
*& Object Header PROG PPIO_ENTRY_1100_I01

*&--------------------------------------------------------------------*
*& MODULE CHECK_PROFID_LAYOUT INPUT
*&--------------------------------------------------------------------*
...
g_var_saved = con_x.
ELSE.
PERFORM get_layout CHANGING ppio_entry_sc1100.
* The list was not just changed and no layout found
*
=> user must enter layout or profile
*>>>> START OF DELETION <<<<<
IF ppio_entry_sc1100-profid = con_no_profile AND
ppio_entry_sc1100-alv_variant IS INITIAL AND
sy-ucomm <> con_fc_list_select.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
IF
ppio_entry_sc1100-profid
= con_no_profile
AND ppio_entry_sc1100-alv_variant
IS INITIAL
AND ppio_entry_sc1100-ppio_listtyp(5) <> 'PPIOZ'
AND sy-ucomm <> con_fc_list_select.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS PPIO_ENTRY_F_START_OF_SEL
*& Object Header PROG PPIO_ENTRY_F_START_OF_SEL
*&--------------------------------------------------------------------*
*& FORM START_OF_SELECTION
*&--------------------------------------------------------------------*
...
ENDIF.
tracebackground_2
'start_of_selection - before submit; Profile: ' <l_profid>. "#EC NOTEXT
IF
p_sc1100-ppio_listtyp = report_docl
*>>>> START OF DELETION <<<<<
OR (
p_tcoaov-flg_alvtr = cowrk_c_x
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
OR p_sc1100-ppio_listtyp(5) = 'PPIOZ'
OR (
p_tcoaov-flg_alvtr = cowrk_c_x
*>>>> END OF INSERTION <<<<<<

...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS PPIO_ENTRY_GET_TAB_REPORT
*& Object Header PROG PPIO_ENTRY_GET_TAB_REPORT
*&--------------------------------------------------------------------*
*& FORM GET_TABLE_FOR_REPORT
*&--------------------------------------------------------------------*
...
when report_pord.
"'PPIOT000'
c_tablename = con_iooppord.
"'IOOPPORD'
WHEN report_docl.
"'PPIOV000'
c_tablename = con_iodocl.
"'IODOCL'
WHEN OTHERS.
*>>>> START OF DELETION <<<<<
MESSAGE w000(c+).

* Interner Fehler. Verstndigen Sie Ihre Systemverwaltung


*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CLEAR c_tablename.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCDEF
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* use this source file for any type declarations (class
*"* definitions, interfaces or data types) you need for method
*"* implementation or private method's signature
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCIMP
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* local class implementation for public class
*"* use this source file for the implementation part of
*"* local helper classes
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
CINC CL_COIS_ADD_LIST==============CCMAC
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*"* use this source file for any macro definitions you need
*"* in the implementation part of the class

*>>>> END OF INSERTION <<<<<<


...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
FUNC COIS_OUTPUT_DISPLAY_CLOSE
*& Object Header FUGR COISOUTPUT
*&--------------------------------------------------------------------*
*& FUNCTION COIS_OUTPUT_DISPLAY_CLOSE
*&--------------------------------------------------------------------*
...
FUNCTION cois_output_display_close.
*"---------------------------------------------------------------------*"*"Lokale Schnittstelle:
*" IMPORTING
*>>>> START OF DELETION <<<<<
*"
REFERENCE(IO_GRID) TYPE REF TO CL_COIS_DISP_LIST
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
*"
REFERENCE(IO_GRID) TYPE REF TO IF_COIS_DISP_LIST

*>>>> END OF INSERTION <<<<<<


...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
FUNC COIS_OUTPUT_DISPLAY_FULLSCREEN
*& Object Header FUGR COISOUTPUT
*&--------------------------------------------------------------------*
*& FUNCTION COIS_OUTPUT_DISPLAY_FULLSCREEN
*&--------------------------------------------------------------------*
...
FUNCTION cois_output_display_fullscreen.
*"---------------------------------------------------------------------*"*"Lokale Schnittstelle:
*" IMPORTING
*>>>> START OF DELETION <<<<<
*"
REFERENCE(IO_LIST) TYPE REF TO CL_COIS_DISP_LIST OPTIONAL
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
*"
REFERENCE(IO_LIST) TYPE REF TO IF_COIS_DISP_LIST OPTIONAL
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
FUNC COIS_OUTPUT_FROM_IOC
*& Object Header FUGR COISOUTPUT
*&--------------------------------------------------------------------*
*& FUNCTION COIS_OUTPUT_FROM_IOC
*&--------------------------------------------------------------------*
...
CALL FUNCTION 'COIS_SELECT_PL_ORDERS_READ'
EXPORTING
iv_read_components = gs_tcoa-opcomp_sel
CHANGING
ct_ioheader
= lt_ioheader
ct_ioopcomp
= lt_ioopcomp.
IF NOT lt_ioheader IS INITIAL.

APPEND LINES OF lt_ioheader TO ioheader_tab[].


*>>>> START OF DELETION <<<<<
ENDIF.
IF NOT lt_ioopcomp IS INITIAL.
INSERT LINES OF lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
CLEAR lt_ioheader[].
ENDIF.
IF NOT lt_ioopcomp IS INITIAL.
INSERT LINES OF lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.
CLEAR lt_ioopcomp[].
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
FIELD_SELECTION_GROUPS_CREATE
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD FIELD_SELECTION_GROUPS_CREATE .

DATA:
ls_field_group LIKE LINE OF ct_field_groups,
ls_fieldcat
LIKE LINE OF ct_fieldcat.
*@@@
* STATICS:
*
lt_dd07v LIKE dd07v OCCURS 0 WITH HEADER LINE.
DATA:
lt_dd07v TYPE TABLE OF dd07v,
ls_dd07v TYPE dd07v.
* Gruppen-Tabelle fllen
* Gruppen lesen
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name
= 'FD_GROUP' " Definition of Groups
*
STATE
= 'A'
langu
= sy-langu
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
OTHERS
= 0.
* Gruppen-Tabelle mit DDIC-Werten fllen
LOOP AT lt_dd07v INTO ls_dd07v..
ls_field_group-sp_group = ls_dd07v-domvalue_l.
ls_field_group-text = ls_dd07v-ddtext.
APPEND ls_field_group TO ct_field_groups.
ENDLOOP.
* doppelte Eintrge entfernen (externe Gruppe hat Vorang)
SORT ct_field_groups BY sp_group.

DELETE ADJACENT DUPLICATES FROM ct_field_groups COMPARING sp_group.


SORT ct_field_groups AS TEXT BY text.
* 'All fields' is in the list by default (ALV) --> delete
READ TABLE ct_field_groups
INTO ls_field_group
WITH KEY sp_group = '
'.
IF sy-subrc IS INITIAL.
DELETE ct_field_groups INDEX sy-tabix.
ENDIF.
* 'Others' shall be the last entry
DESCRIBE TABLE ct_field_groups LINES sy-tfill.
READ TABLE ct_field_groups
INTO ls_field_group
WITH KEY sp_group = 'OTHR'.
IF sy-subrc IS INITIAL AND
sy-tabix <> sy-tfill.
DELETE ct_field_groups INDEX sy-tabix.
APPEND ls_field_group TO ct_field_groups.
ENDIF.
* update the field catalog with group names
* set and check the field group
LOOP AT ct_fieldcat INTO ls_fieldcat.

*
*
*
*
*
*
*

IF ls_fieldcat-sp_group IS INITIAL.
only change initial groups
IF ls_fieldcat-domname = 'XFELD'.
ls_fieldcat-sp_group = 'FLAG'.
ELSEIF ls_fieldcat-datatype = 'CHAR'.
IF ls_fieldcat-lowercase = con_yes.
ls_fieldcat-sp_group = 'TEXT'.
ELSE.
ls_fieldcat-sp_group = 'ASGN'.
ENDIF.
ELSE.
ls_fieldcat-sp_group = ls_fieldcat-datatype.
ENDIF.
ENDIF.
check, if group is allowed
READ TABLE ct_field_groups
WITH KEY sp_group = ls_fieldcat-sp_group
TRANSPORTING NO FIELDS.
IF NOT sy-subrc IS INITIAL.
group is not known -> set to group 'Others'
ls_fieldcat-sp_group = 'OTHR'.
ENDIF.
MODIFY ct_fieldcat FROM ls_fieldcat.
ENDLOOP.

* removed unused groups


LOOP AT ct_field_groups
INTO ls_field_group

WHERE NOT sp_group IS INITIAL.


READ TABLE ct_fieldcat
WITH KEY sp_group = ls_field_group-sp_group
TRANSPORTING NO FIELDS.
IF NOT sy-subrc IS INITIAL.
*
no field with the group is in the field catalog
*
the group is not needed!
DELETE TABLE ct_field_groups FROM ls_field_group.
ENDIF.
ENDLOOP.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_CONTEXT_MENU
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD HANDLE_CONTEXT_MENU .
* add own functions to context menu
* ...
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<

...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_DOUBLE_CLICK
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD HANDLE_DOUBLE_CLICK .
* don't do anything on summation rows
CHECK e_row-rowtype IS INITIAL.
* ...
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_MENU_BUTTON
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD HANDLE_MENU_BUTTON .

* ...
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_TOOLBAR
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD HANDLE_TOOLBAR .
DATA:
ls_toolbar LIKE LINE OF e_object->mt_toolbar.
IF mv_toolbar_alv = space.
no display of standard ALV buttons
DELETE e_object->mt_toolbar WHERE function(1) = '&'.
* append EXPAND button for ALV functions
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'TOOLBAR_EXPAND'.
ls_toolbar-icon = icon_column_right.
ls_toolbar-quickinfo = text-010.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO e_object->mt_toolbar.
ELSE.
* insert COLLAPSE button for ALV functions
CLEAR ls_toolbar.
*

ls_toolbar-butn_type = 0.
ls_toolbar-function = 'TOOLBAR_COLLAPSE'.
ls_toolbar-icon = icon_column_left.
ls_toolbar-quickinfo = text-011.
ls_toolbar-disabled = space.
INSERT ls_toolbar INTO e_object->mt_toolbar INDEX 1.
* insert a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
INSERT ls_toolbar INTO e_object->mt_toolbar INDEX 2.
ENDIF.
* append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO e_object->mt_toolbar.
* add own toolbar buttons
* ...
* only for object overview
IF
mv_calling_appl = if_cois_con=>appl_overview
OR mv_calling_appl = if_cois_con=>appl_retrieval_ov

OR mv_calling_appl = if_cois_con=>appl_external_ov.
append a separator to toolbar
CLEAR ls_toolbar.
ls_toolbar-butn_type = 3.
APPEND ls_toolbar TO e_object->mt_toolbar.

append full screen


CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'DISPLAY_TOGGLE'.
ls_toolbar-icon = icon_toggle_display.
ls_toolbar-quickinfo = text-007.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO e_object->mt_toolbar.

append close screen


CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'DISPLAY_CLOSE'.
ls_toolbar-icon = icon_close.
ls_toolbar-quickinfo = text-008.
ls_toolbar-disabled = space.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
HANDLE_USER_COMMAND
*& Object Header CLAS CL_COIS_ADD_LIST

*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD HANDLE_USER_COMMAND .
CASE e_ucomm.
*

WHEN 'DISPLAY_TOGGLE'.
full screen on/off
CALL FUNCTION 'COIS_OUTPUT_DISPLAY_FULLSCREEN'
EXPORTING
io_list = me.
cl_gui_cfw=>set_new_ok_code( new_code = e_ucomm ).
WHEN 'DISPLAY_CLOSE'.
close screen
CALL FUNCTION 'COIS_OUTPUT_DISPLAY_CLOSE'
EXPORTING
io_grid = me.
cl_gui_cfw=>set_new_ok_code( new_code = e_ucomm ).
WHEN 'TOOLBAR_COLLAPSE' .

collapse ALV buttons


mv_toolbar_alv = space.
CALL METHOD mo_grid->set_toolbar_interactive.
WHEN 'TOOLBAR_EXPAND'.
expand ALV buttons
mv_toolbar_alv = 'X'.
CALL METHOD mo_grid->set_toolbar_interactive.
ENDCASE.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~FREE_ALV_GRID
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~FREE_ALV_GRID .
IF NOT mo_grid IS INITIAL.
mo_grid->free( ).
FREE mo_grid.
ENDIF.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~FREE_DATA
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*

*>>>> START OF INSERTION <<<<


METHOD IF_COIS_DISP_LIST~FREE_DATA .
FIELD-SYMBOLS:
<lt_data>
<lt_data_save>
*

TYPE table,
TYPE table.

IF NOT md_data_save IS INITIAL.


restore original data
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data> = <lt_data_save>.
FREE md_data_save.
ENDIF.

ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...

*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~REFRESH
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~REFRESH .
* free reduced data
IF NOT md_data_save IS INITIAL.
FREE md_data_save.
ENDIF.
* update ALV output
CHECK NOT mo_grid IS INITIAL.
mo_grid->set_gridtitle( mv_title ).
mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~RESET_FILTER_BY_NODE_MAX_EX
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~RESET_FILTER_BY_NODE_MAX_EX .
FIELD-SYMBOLS:
<lt_data>
<lt_data_save>
*

TYPE table,
TYPE table.

IF NOT md_data_save IS INITIAL.


restore original data
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data> = <lt_data_save>.

FREE md_data_save.
ENDIF.
* update ALV output
CHECK NOT mo_grid IS INITIAL.
mo_grid->set_gridtitle( mv_title ).
mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_FILTER_BY_NODE_MAX_EX

*& Object Header CLAS CL_COIS_ADD_LIST


*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~SET_FILTER_BY_NODE_MAX_EX .
DATA:
lv_counter_total
lv_counter_save
lv_title
FIELD-SYMBOLS:
<lt_data>
<lt_data_save>
<ls_data>
<lv_node_index>
<ls_node_max_ex>

TYPE sytabix,
TYPE sytabix,
TYPE lvc_title.
TYPE
TYPE
TYPE
TYPE
TYPE

table,
table,
ANY,
tabix_d,
cois_s_node_max_ex.

* set flag, that filter should be set, maybe it can not be set now,
* the it will be set, when MO_GRID is created again
mv_filter_set = 'X'.
CHECK NOT mo_grid IS INITIAL.
CLEAR mv_filter_set.
IF md_data_save IS INITIAL.
save original data
CREATE DATA md_data_save TYPE TABLE OF (mv_tabname).
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data_save> = <lt_data>.
ELSE.
* restore original data
ASSIGN md_data->* TO <lt_data>.
ASSIGN md_data_save->* TO <lt_data_save>.
<lt_data> = <lt_data_save>.
ENDIF.
*

LOOP AT <lt_data> ASSIGNING <ls_data>.


ASSIGN COMPONENT 'INDEX_NODE' OF STRUCTURE <ls_data>
TO <lv_node_index>.
CHECK sy-subrc = 0.
READ TABLE md_node_max_ex->* INDEX <lv_node_index>
ASSIGNING <ls_node_max_ex>.

CHECK sy-subrc = 0.
CHECK <ls_node_max_ex>-filt <> 'X'.
DELETE <lt_data>.
ENDLOOP.
DESCRIBE TABLE <lt_data> LINES lv_counter_total.
DESCRIBE TABLE <lt_data_save> LINES lv_counter_save.
IF lv_counter_total = lv_counter_save.
lv_title = mv_title.
mo_grid->set_gridtitle( lv_title ).
FREE md_data_save.
ELSE.

CONCATENATE mv_title text-001 INTO lv_title.


mo_grid->set_gridtitle( lv_title ).
ENDIF.
mo_grid->refresh_table_display( ).
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_INITIAL_DATA
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~SET_INITIAL_DATA .
* set instance attributes
GET REFERENCE OF ct_data
INTO md_data.
GET REFERENCE OF it_node_max_ex INTO md_node_max_ex.
mv_object
= iv_object.
mv_tabname
= iv_tabname.
mv_title
= iv_title.
mv_calling_appl = iv_calling_appl.
mv_category
= iv_category.
IF

mv_calling_appl = if_cois_con=>appl_detail_list
OR mv_calling_appl = if_cois_con=>appl_external.
* in single list display and for header in overview
* activate keyboard shortcuts
MV_SHORTCUTS = 'X'.
ENDIF.
IF NOT iv_layout IS INITIAL.
mv_layout = iv_layout.
ELSE.
* get layout
CALL FUNCTION 'COIS_DISP_DEFAULT_LAYOUT_GET'
EXPORTING
iv_list_type = iv_object
iv_autyp
= iv_category
IMPORTING
ev_layout
= mv_layout.
ENDIF.

* get fieldcatalog
* CALL METHOD cl_cois_fieldcat=>get
*
EXPORTING
*
iv_tabname
= mv_tabname
*
iv_category
= iv_category
*
IMPORTING
*
et_fieldcat_alv = mt_fieldcat.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<

...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
METH CL_COIS_ADD_LIST
*&
IF_COIS_DISP_LIST~SET_TABLE_FOR_FIRST_DISPLAY
*& Object Header CLAS CL_COIS_ADD_LIST
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
METHOD IF_COIS_DISP_LIST~SET_TABLE_FOR_FIRST_DISPLAY .
DATA:
ls_print
l_save
lt_field_groups
ls_variant
ls_layout
lt_tooltip

TYPE
TYPE
TYPE
TYPE
TYPE
TYPE

lvc_s_prnt,
char1,
lvc_t_sgrp,
disvariant,
lvc_s_layo,
lvc_t_qinf.

FIELD-SYMBOLS:
<table> TYPE table,
<layout> TYPE slis_vari.
* get data table from reference
ASSIGN md_data->* TO <table>.
* create and initialize ALV display
CREATE OBJECT mo_grid
EXPORTING
i_parent = io_container
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* set event handler
SET HANDLER:
handle_user_command
handle_toolbar
handle_menu_button
handle_double_click
handle_context_menu

FOR
FOR
FOR
FOR
FOR

* set print parameters


ls_print-prntselinf = 'X'.
ls_print-grpchgedit = 'X'.
ls_print-prntlstinf = 'X'.

* set variant parameters


ls_variant-variant = mv_layout.
ls_variant-report = mv_object.
* set layout parameters
ls_layout-smalltitle = 'X'.

mo_grid,
mo_grid,
mo_grid,
mo_grid,
mo_grid.

IF md_data_save IS INITIAL.
ls_layout-grid_title = mv_title.
ELSE.
CONCATENATE mv_title text-001 INTO ls_layout-grid_title.
ENDIF.
* selection of all entries is possible
ls_layout-sel_mode = 'A'.
* set save mode
l_save = 'A'.

" save user and user-independent variants

* field_selection_groups_create(
*
CHANGING
*
ct_field_groups = lt_field_groups
*
ct_fieldcat
= mt_fieldcat ).
mo_grid->set_table_for_first_display(
EXPORTING
I_STRUCTURE_NAME
= mv_tabname
is_variant
= ls_variant
i_save
= l_save
i_default
= 'N'
is_layout
= ls_layout
is_print
= ls_print
*
it_special_groups
= lt_field_groups
CHANGING
it_outtab
= <table>
it_fieldcatalog
= mt_fieldcat
it_sort
= mt_sortcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error
= 2
OTHERS
= 3 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* if filter could not be set before MO_GRID was created, it has to be
* set now
IF NOT mv_filter_set IS INITIAL.
if_cois_disp_list~set_filter_by_node_max_ex( ).
ENDIF.
ENDMETHOD.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& Object
REPS LCOISOUTPUTF06
*& Object Header FUGR COISOUTPUT

*&--------------------------------------------------------------------*
*& FORM REFRESH_ALL
*&--------------------------------------------------------------------*
...

INSERT LINES OF lt_ioopcomp INTO ioopcomp_tab[] INDEX 1.


ENDIF.
ENDIF.
ENDIF.
*>>>> START OF DELETION <<<<<
* refresh overview tree
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
* pass tables to badi
PERFORM badi_tables_modify_lay_call.
* refresh overview tree
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*

Anda mungkin juga menyukai