销售订单增强

来源:互联网 发布:win10优化工具 推荐 编辑:程序博客网 时间:2024/05/01 18:26
 ***INCLUDE MV45AFZZ .

************************************************************************
*                                                                      *
* This include is reserved for user modifications                      *
*                                                                      *
* Forms for sales document processing                                  *
*                                                                      *
* The name of modification modules should begin with 'ZZ'.             *
*                                                                      *
************************************************************************

*---------------------------------------------------------------------*
*       FORM ZZEXAMPLE                                                *
*---------------------------------------------------------------------*
*       text......................................                    *
*---------------------------------------------------------------------*
*FORM ZZEXAMPLE.

*  ...

*ENDFORM.

*eject
*---------------------------------------------------------------------*
*       FORM USEREXIT_DELETE_DOCUMENT                                 *
*---------------------------------------------------------------------*
*       This userexit can be used to delete data in additional tables *
*       when a sales document is deleted.                             *
*                                                                     *
*      This form is called in dialog at the end of form BELEG_LOESCHEN*
*      just before form BELEG_SICHERN is performed to delete the      *
*      datas on the database.                                         *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_delete_document.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_FIELD_MODIFICATION                              *
*---------------------------------------------------------------------*
*       This userexit can be used to modify the attributes of         *
*       screen fields.                                                *
*       This form is processed for each field in the screen.          *
*                                                                     *
*       The use of the fields screen-group1 to screen-group4 is:      *
*                                                                     *
*       Screen-group1: Automatic modification contolles by transaction*
*                      MFAW.                                          *
*       Screen-group2: Contents 'LOO' for steploop-fields.            *
*       Screen-group3: Used for modififaction, which are dependent on *
*                      control tables or other fix information.       *
*       Screen-group4: Unused                                         *
*                                                                     *
*       For field mofifications, which are dependent on the document  *
*       status, you can use the status field in the workareas         *
*       XVBAP for item status and XVBUK for header status.            *
*                                                                     *
*       This form is called from module FELDAUSWAHL.                  *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_field_modification.

* CASE SCREEN-GROUP3.
*   WHEN '900'.
*     IF VBAK-VBTYP NE 'A'.
*       SCREEN-ACTIVE = 0.
*     ENDIF.
* ENDCASE.

* CASE SCREEN-NAME.
*   WHEN 'VBAK-VBELN'.
*     SCREEN-ACTIVE = 0.
* ENDCASE.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_MOVE_FIELD_TO_VBAK                              *
*---------------------------------------------------------------------*
*       This userexit can be used to move some fields into the sales  *
*       dokument header workaerea VBAK.                               *
*                                                                     *
*       SVBAK-TABIX = 0:  Create header                               *
*       SVBAK-TABIX > 0:  Change header                               *
*                                                                     *
*       This form is called at the end of form VBAK_FUELLEN.          *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_move_field_to_vbak.

*  vbak-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_MOVE_FIELD_TO_VBAP                              *
*---------------------------------------------------------------------*
*       This userexit can be used to move some fields into the sales  *
*       dokument item workaerea VBAP                                  *
*                                                                     *
*       SVBAP-TABIX = 0:  Create item                                 *
*       SVBAP-TABIX > 0:  Change item                                 *
*                                                                     *
*       This form is called at the end of form VBAP_FUELLEN.          *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_move_field_to_vbap.

*{   INSERT         HGDK900122                                        1
if sy-tcode cs 'VA'.
  vbap-zzcshu = cvbap-zzcshu  .
  vbap-zzghfw = cvbap-zzghfw  .
  vbap-zzsjfs = cvbap-zzsjfs  .
  vbap-zzxxjs = cvbap-zzxxjs  .
  vbap-zztbsj = cvbap-zztbsj  .
  vbap-zzwjsx = cvbap-zzwjsx  .
  vbap-zzwjqd = cvbap-zzwjqd  .
  vbap-zzwjjh = cvbap-zzwjjh  .
  vbap-zzjhsj = cvbap-zzjhsj  .
  vbap-zzyqfk = cvbap-zzyqfk  .
  vbap-zzjsfk = cvbap-zzjsfk  .
  vbap-zzgyfk = cvbap-zzgyfk  .
  vbap-zzxmmc = cvbap-zzxmmc  .
  vbap-zztblx = cvbap-zztblx  .
  vbap-zzcjrq = cvbap-zzcjrq  .
  vbap-zzhsrq = cvbap-zzhsrq  .
  vbap-zzcbdx = cvbap-zzcbdx  .
  vbap-zzkjdh = cvbap-zzkjdh  .
  vbap-zzhtyj = cvbap-zzhtyj  .
  vbap-zzhtqd = cvbap-zzhtqd  .
  vbap-zzxypg = cvbap-zzxypg  .
  vbap-zzbhcj = cvbap-zzbhcj  .
  vbap-zzbhsh = cvbap-zzbhsh  .
  vbap-zzhtsx = cvbap-zzhtsx  .
  vbap-zzsxlx = cvbap-zzsxlx  .
  vbap-zzjhq  = cvbap-zzjhq .
*  VBAP-ZZJHQ_H  = CVBAP-ZZJHQ_H  .
  vbap-zzzbq  = cvbap-zzzbq  .
  vbap-zzychl = cvbap-zzychl  .
  vbap-zzyxrq = cvbap-zzyxrq  .
  vbap-zzcgzz = cvbap-zzcgzz  .
  vbap-zzwbsz = cvbap-zzwbsz .
  vbap-zzsmaz = cvbap-zzsmaz .
  vbap-zzcgdd = cvbap-zzcgdd .
  vbap-zztype = cvbap-zztype .
  vbap-zzyfbh = cvbap-zzyfbh .
endif.

*}   INSERT
*  VBAP-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_MOVE_FIELD_TO_VBEP                              *
*---------------------------------------------------------------------*
*       This userexit can be used to move some fields into the sales  *
*       dokument schedule line workaerea VBEP                         *
*                                                                     *
*       SVBEP-TABIX = 0:  Create schedule line                        *
*       SVBEP-TABIX > 0:  Change schedule line                        *
*                                                                     *
*       This form is called at the end of form VBEP_FUELLEN.          *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_move_field_to_vbep.

*  VBEP-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_MOVE_FIELD_TO_VBKD                              *
*---------------------------------------------------------------------*
*       This userexit can be used to move some fields into the sales  *
*       dokument business data workaerea VBKD                         *
*                                                                     *
*       SVBKD-TABIX = 0:  Create data                                 *
*       SVBKD-TABIX > 0:  Change data                                 *
*                                                                     *
*       This form is called at the end of form VBKD_FUELLEN.          *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_move_field_to_vbkd.

*  VBKD-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_NUMBER_RANGE                                    *
*---------------------------------------------------------------------*
*       This userexit can be used to determine the numberranges for   *
*       the internal document number.                                 *
*                                                                     *
*       US_RANGE_INTERN - internal number range                       *
*                                                                     *
*       This form is called from form BELEG_SICHERN                   *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_number_range using us_range_intern.

* Example: Numer range from TVAK like in standard
* US_RANGE_INTERN = TVAK-NUMKI.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_PRICING_PREPARE_TKOMK                           *
*---------------------------------------------------------------------*
*       This userexit can be used to move additional fields into the  *
*       communication table which is used for pricing:                *
*                                                                     *
*       TKOMK for header fields                                       *
*                                                                     *
*       This form is called from form PREISFINDUNG_VORBEREITEN.       *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_pricing_prepare_tkomk.

*  TKOMK-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_PRICING_PREPARE_TKOMP                           *
*---------------------------------------------------------------------*
*       This userexit can be used to move additional fields into the  *
*       communication table which is used for pricing:                *
*                                                                     *
*       TKOMP for item fields                                         *
*                                                                     *
*       This form is called from form PREISFINDUNG_VORBEREITEN.       *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_pricing_prepare_tkomp.

*  TKOMP-zzfield = xxxx-zzfield2.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_READ_DOCUMENT                                   *
*---------------------------------------------------------------------*
*       This userexit can be used to read data in additional tables   *
*       when the program reads a sales document.                      *
*                                                                     *
*       This form is called at the end of form BELEG_LESEN.           *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_read_document.

endform.
*eject

*---------------------------------------------------------------------*
*       FORM USEREXIT_SAVE_DOCUMENT                                   *
*---------------------------------------------------------------------*
*       This userexit can be used to save data in additional tables   *
*       when a document is saved.                                     *
*                                                                     *
*       If field T180-TRTYP contents 'H', the document will be        *
*       created, else it will be changed.                             *
*                                                                     *
*       This form is called at from form BELEG_SICHERN, before COMMIT *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_save_document.

* Example:
* CALL FUNCTION 'ZZ_EXAMPLE'
*      IN UPDATE TASK
*      EXPORTING
*           ZZTAB = ZZTAB.
*{   INSERT         HGDK900122                                        1

data: lt_vbap type ccrctt_vbap,
      ls_vbap type vbap.

  loop at xvbap into ls_vbap.
    append ls_vbap to lt_vbap.
  endloop.

call function 'ZMM_SOCREATEPO'
  exporting
    is_vbap       = vbap
    is_vbak       = vbak
    is_vbep       = vbep
    it_vbap       = lt_vbap.


*}   INSERT

endform.
*eject
*---------------------------------------------------------------------*
*       FORM USEREXIT_SAVE_DOCUMENT_PREPARE                           *
*---------------------------------------------------------------------*
*       This userexit can be used for changes or checks, before a     *
*       document is saved.                                            *
*                                                                     *
*       If field T180-TRTYP contents 'H', the document will be        *
*       created, else it will be changed.                             *
*                                                                     *
*       This form is called at the beginning of form BELEG_SICHERN    *
*                                                                     *
*---------------------------------------------------------------------*
form userexit_save_document_prepare.
*{   INSERT         HGDK900122                                        1
  if vbak-auart = 'Z009'.
    if syst-tcode = 'VA01'.
      if vbap-zzcgzz = '' or vbap-zzsmaz = ''.
        message '附加数据B中有必输项未填' type 'E'.
      endif.
    endif.
  endif.
*}   INSERT


endform.
*eject
原创粉丝点击