Pages

Sunday, October 19, 2014

Table EVENTS in Table Maintenance Generator in SE11

Events can be created inside Table maintenence generator using Environment and modification.

Use TOTAL table which is available in the GLOBAL fields of the EVENTS routine to access all the existing data of the current ZTable.

*---------------------------------------------------------------------*
* Handle Table events to restrict user from entering wrong SH and     *
* In-Transit location if 1 entry is already maintained in the table   *
*---------------------------------------------------------------------*
*  P R O G R A M   C H A N G E   H I S T O R Y                        *
*---------------------------------------------------------------------*
* ##) Correction  Date......  SAP User ID.  Description.............. *
*---------------------------------------------------------------------*
  DATAls_currrent_entry TYPE zfi_pri_gethub,
        ls_existing_entry TYPE zfi_pri_gethub.

  MOVE zfi_pri_gethub TO ls_currrent_entry.

  LOOP AT total INTO ls_existing_entry.
    IF ls_existing_entry-ship_to EQ ls_currrent_entry-ship_to.
      IF ls_existing_entry-in_transit_sloc EQ ls_currrent_entry-in_transit_sloc.
        MESSAGE '1 Ship-to can have only 1 In-transit Location' TYPE 'E'.
      ENDIF.
    ENDIF.
  ENDLOOP.

ENDFORM.                    "new_entry