• March 27, 2026
  • Kishore Thutaram
  • 0

Update Sales Order Schedule lines data during order creation by using Enhancement

Business Requirement: Update Sales Order Item Schedule Line Category based on the document type and movement type fields.

Steps: User Exit Include: MV45AFZZ

Form Routine: MOVE_FIELD_TO_VBEP


DATA:  lv_select type char1.
SELECT SINGLE bukrs FROM t001k INTO @data(lv_bukrs) WHERE
      bwkey = @vbap-werks.
    IF sy-subrc = 0 AND lv_bukrs NE vbak-bukrs_vf.
      clear: lv_select.
      CASE vbak-vbtyp.
        WHEN 'C'. "sales documents
         lv_select = 'X'.         
          vbep-ettyp = 'RP', "outbound      
        WHEN 'H'. "returns
          vbep-ettyp = 'RE', "returns
          lv_select = 'X'.
      ENDCASE.
      if lv_select ne space.
         select single bwart from tvep into vbep-bwart where
            ettyp = vbep-ettyp.
      endif.
endif.
   
    

Kishore Thutaram

SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture

https://fiowelt.com