How to customize the incompletion log ?
Simple customizations possible in incompletion log are given below.

For full fledged SAP SD Training or for other SAP Training please visit Magna Training.

  1. I wanted to make the submitted date and time (Additional data B-> MAHDT(date) and BSTZD(time)) mandatory only for Quotations (ZQT) and sales orgs (USXX/CAYY). This cannot be achieved through incompletion log configuration. The core piece of code is highlighted. The rest of it is validations.
    1. The basic structure for customizing incompletion log is XVBUV
    2. The code is as follows in the user exit USEREXIT_CHECK_VBAK
    3. IF ( vbak-mahdt IS INITIAL
      OR vbak-bstzd IS INITIAL ).

      IF ( vbak-vkorg = 'USXX'
      OR vbak-vkorg = 'CAYY' )
      AND vbak-auart = 'ZQT'
      AND sy-tcode = 'VA21'.

      IF vbak-mahdt IS INITIAL.

      read table xvbuv with key fdnam = 'MAHDT'.

      if sy-subrc <> 0.
      XVBUV-MANDT = SY-MANDT.
      XVBUV-VBELN = VBAK-VBELN.
      XVBUV-POSNR = '000000'.
      XVBUV-ETENR = '0000'.
      XVBUV-TBNAM = 'VBAK'.
      XVBUV-FDNAM = 'MAHDT'.
      if vbak-auart = 'ZQT'.
      XVBUV-FEHGR = '90'.
      endif.

      XVBUV-STATG = '01'.
      XVBUV-FCODE = 'KZKU'.
      XVBUV-SORTF = '9999'.
      XVBUV-LFDNR = '0000'.
      APPEND XVBUV.
      FORCE_UPDATE = 'X'.
      endif.

      else.
      read table xvbuv with key fdnam = 'MAHDT'.

      if sy-subrc = 0.
      delete xvbuv where fdnam = 'MAHDT'.
      endif.

      endif.

      clear xvbuv.


      IF vbak-bstzd IS INITIAL.

      read table xvbuv with key fdnam = 'BSTZD'.

      if sy-subrc <> 0.
      XVBUV-MANDT = SY-MANDT.
      XVBUV-VBELN = VBAK-VBELN.
      XVBUV-POSNR = '000000'.
      XVBUV-ETENR = '0000'.
      XVBUV-TBNAM = 'VBAK'.
      XVBUV-FDNAM = 'BSTZD'.
      if vbak-auart = 'ZQT'.
      XVBUV-FEHGR = '90'.
      endif.

      XVBUV-STATG = '01'.
      XVBUV-FCODE = 'KZKU'.
      XVBUV-SORTF = '9999'.
      XVBUV-LFDNR = '0000'.
      APPEND XVBUV.
      FORCE_UPDATE = 'X'.

      endif.

      else.
      read table xvbuv with key fdnam = 'BSTZD'.

      if sy-subrc = 0.
      delete xvbuv where fdnam = 'BSTZD'.
      endif.

      endif.

      clear xvbuv.

      ELSE.
      ENDIF.

      ENDIF

1 comment:

sonia said...

Hi,
Thank you for your post. It is nice to visit your site.
SAP SD Training in Hyderabad