Extending the dialogue handling unit with user-defined fields
Customer-spezific fields should be displayed in the handling unit dialog, e.g. a customer enhancement of table VEKP. The following section shows how you can display customer-specific fields in the “Additional Data” view in the Handling Unit dialog.
To realize this requirement, the implementation of a Business AddIn is necessary.
Objective
In the HU dialog, a customer-specific field is to be integrated on the “Additional data” tab. In our case, it is the field “packing place id”.
Extending table VEKP
Table VEKP is extended by a customer-specific field.
Implementing of the Business AddIn
Implementing the Business-Addins in customizing.
Implementing method DEFINITION_SUBSCREEN.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
METHOD if_ex_badi_hu_dialog~definition_subscreen. IF if_detail = 'X' AND is_v51g-tabstrip_fcode = 'DETZUS'. * cf_program = 'SAPLV51G'. * cf_screen = '6130'. * cf_activetab = 'DETZUS'. cf_program = 'SAPLZLE_SUBSCR_HU_HEAD'. cf_screen = '9100'. cf_activetab = 'DETZUS'. CALL FUNCTION 'Z_LE_DATA_TO_HU_SUBSCR' EXPORTING is_vekpvb = cs_vekp. ENDIF. ENDMETHOD. |
Creating a function moduke
The dynpro is implemented in the function moduke.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
FUNCTION Z_LE_DATA_TO_HU_SUBSCR. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(IS_VEKPVB) TYPE VEKPVB OPTIONAL *"---------------------------------------------------------------------- move-corresponding is_vekpvb to vekpvb. ENDFUNCTION. PROCESS BEFORE OUTPUT. * MODULE STATUS_9100. CALL SUBSCREEN sub_area INCLUDING 'SAPLV51G' '6130'. MODULE loop_at_screen. PROCESS AFTER INPUT. CHAIN. FIELD: vekpvb-zzpackplatz. MODULE pai_9100. ENDCHAIN. * MODULE USER_COMMAND_9100. ***INCLUDE LZLE_SUBSCR_DLV_HEADO01. *----------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Module LOOP_AT_SCREEN OUTPUT *&---------------------------------------------------------------------* MODULE loop_at_screen OUTPUT. LOOP AT SCREEN. IF screen-name = 'VEKPVB-ZZPACKPLATZ'. IF sy-tcode CS '03'. "Anzeigen screen-input = 0. MODIFY SCREEN. ENDIF. ENDIF. ENDLOOP. ENDMODULE. *----------------------------------------------------------------------* ***INCLUDE LZLE_SUBSCR_HU_HEADI01. *----------------------------------------------------------------------* *&---------------------------------------------------------------------* MODULE pai_9100 INPUT. DATA: ls_changed_cust TYPE v51p_changed, lv_text_gsvekp(40) TYPE c, lv_text_vekp(40) TYPE c, lv_text_changed(40) TYPE c, ls_gsvekp TYPE vekp, ls_vekp TYPE vekp, lt_changed TYPE TABLE OF v51p_changed, lwa_changed TYPE v51p_changed. FIELD-SYMBOLS: <fs_gsvekp> TYPE any, <fs_vekp> TYPE any, <fs_changed> TYPE ANY TABLE. lv_text_gsvekp = '(SAPLV51G)GS_VEKP'. ASSIGN (lv_text_gsvekp) TO <fs_gsvekp>. IF sy-subrc = 0. ls_gsvekp = <fs_gsvekp>. ENDIF. lv_text_changed = '(SAPLV51G)GT_CHANGED[]'. ASSIGN (lv_text_changed) TO <fs_changed>. IF sy-subrc = 0. lt_changed[] = <fs_changed>. ENDIF. IF vekpvb-zzpackplatz NE ls_gsvekp-zzpackplatz. ls_gsvekp-zzpackplatz = vekpvb-zzpackplatz. lwa_changed-changed_f = 'ZZPACKPLATZ'. lwa_changed-f_value = vekpvb-zzpackplatz. APPEND lwa_changed TO lt_changed. ENDIF. <fs_changed> = lt_changed[]. <fs_gsvekp> = ls_gsvekp. ENDMODULE. |
Further informations