• February 13, 2026
  • Kishore Thutaram
  • 0

Map Material Master custom fields to sales billing document for Intercompany – STO

Business Scenario:

“In some cases, example STO, need to create an intercompany billing with reference to PO and delivery. No sales order involved, hence copy control routine mapping from sales order to billing doesn’t work. in this case, explicit enhancement needs to be implemented to populate the billing extra fields.”

Steps: User Exit Include: RV60AFZC

Form routine : FORM USEREXIT_FILL_VBRK_VBRP.

Implement the Below code 


IF vbrp-aubel IS NOT INITIAL.
SELECT SINGLE sddocumentcategory FROM i_salesdocument INTO @DATA(lv_doc_cat) WHERE salesdocument = @vbrp-aubel.
ENDIF.
—” Fetch only for STO, if it is sales document reference, no need to fetch, data copies from Transfer routine
IF vbrp-aubel IS INITIAL OR lv_doc_cat NE ‘C’. “Ref doc. – Order
SELECT SINGLE product,
zzcompany,
zzproducttype,
zzprodsubgrp
FROM i_product INTO @DATA(ls_vbrp_cust)
WHERE product = @vbrp-matnr.
IF sy-subrc EQ 0.
vbrp-zzproducttype = ls_vbrp_cust-zzproducttype. “Company
vbrp-zzproducttype = ls_vbrp_cust-zzproducttype. “product type
vbrp-zzprodsubgrp = ls_vbrp_cust-zzprodsubgrp. “Product subgroup
ENDIF.
ENDIF.
   
    

Kishore Thutaram

"SAP solution architect with a strong problem-solving mindset, sharing practical SAP S/4HANA and ABAP insights from real-world projects."

https://fiowelt.com