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.

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

Table VEKP is extended by a customer-specific field.

Implementing the Business-Addins in customizing.

Implementing method  DEFINITION_SUBSCREEN.

  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.

The dynpro is implemented in the function moduke.

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

Special topics on SAP forms

Fixed price SAP forms

SAP form development