• January 8, 2026
  • Admin
  • 0

Steps :

Go to VOFM Transaction

Select Requirements -> Output Control

Create a new requirement routine by selecting new entries in change mode.

Ex : 901 – recommended with 9 series

Assign newly created routine in output determination procedure – Activity by functional

Logic inside the routine

FIELD-SYMBOLS : <lf_yvbap> TYPE tab_xyvbap,
  <lf_xvbap> TYPE tab_xyvbap,

"Control output and send only when  rejection reason is added to item.
      ASSIGN ('(SAPMV45A)YVBAP[]') TO <lf_yvbap>. "Changes only
      ASSIGN ('(SAPMV45A)XVBAP[]') TO <lf_xvbap>.  "All current

      "check if rejection reason is added.
      LOOP AT <lf_xvbap> ASSIGNING FIELD-SYMBOL(<lfs_xvbap>) WHERE abgru IS NOT INITIAL.
        IF <lf_yvbap> IS ASSIGNED AND <lf_yvbap> IS NOT INITIAL.
          DATA(ls_yvbap) = VALUE #( <lf_yvbap>[ posnr = <lfs_xvbap>-posnr ] OPTIONAL ).
          IF ls_yvbap-abgru IS INITIAL.
            "if rejection reason is added, check completion status
            IF komkbv1-uvall = 'C' AND komkbv1-uvals = 'C'.
              sy-subrc = 0.
              RETURN.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.

 sy-subrc = 4.

Leave a Reply

Your email address will not be published. Required fields are marked *