ABAP – Modify RFQ item data during SAVE

There’s a user exit EXIT_SAPMM06E_012 (include ZXM06U43) you can use to perform various user checks before an RFQ is saved in Tx ME41/ME42. But what if you need to modify the line item data?

Becasue I was tired (or rather lazy) to google for any other possible user exit which would allow me to modify item data in RFQ, I made a little “hack” in the user exit mentioned above (EXIT_SAPMM06E_012).

FIELD-SYMBOLS  TYPE mmpur_bekpo.
* We have to modify data in the outside program SAPMM06E
* because this user exit does not allow to modify EKPO data
  ASSIGN ('(SAPMM06E)POT[]') TO <lt_bekpo>.
  
* Set custom description for configurable materials
* (cuobj IS NOT INITIAL)
  IF sy-subrc = 0.
    LOOP AT <lt_bekpo> ASSIGNING FIELD-SYMBOL(<ls_bekpo>)
      WHERE cuobj IS NOT INITIAL.

      <ls_bekpo>-txz01 = |{ <ls_bekpo>-txz01 } (CONFIGURABLE)|.
    ENDLOOP.
  ENDIF.

The core of the “magic” is hidden in the line where I’m accessing a variable from an outside program:

 ASSIGN ('(SAPMM06E)POT[]') TO <lt_bekpo>.

Leave a Reply