SAP MDG · UTILITIES

How do I implement a reusable note-building method in SAP MDG for a change request using an action, reason code, and additional comment?

Implement BUILD_NOTE by reading the reason text from ZMDG_RECALL_REAS with the reason code, then concatenating the action and additional comment into one note string. If you also need to persist the note on the change request, use the companion ADD_CREQUEST_NOTE pattern to insert a row into USMD1210 with SAP_WFRT as creator.

Implement BUILD_NOTE by reading the reason text from ZMDG_RECALL_REAS with the reason code, then concatenating the action and additional comment into one note string. If you also need to persist the note on the change request, use the companion ADD_CREQUEST_NOTE pattern to insert a row into USMD1210 with SAP_WFRT as creator.

A reusable SAP MDG note-building method can be implemented by reading the reason text from ZMDG_RECALL_REAS using the supplied reason code and concatenating it with the action and any additional comment. In the related MDG utility pattern, the generated text is then written to the change request note table USMD1210 with technical user SAP_WFRT.

Process flow

  1. Clear the output note variable.
  2. Read `REASON_TEXT` from `ZMDG_RECALL_REAS` using `REASON_ID = iv_reason_code`.
  3. Check `sy-subrc` to confirm the lookup succeeded.
  4. Concatenate `iv_action`, the reason text, and `iv_additional` into `ev_note`.
  5. If required, call the note persistence routine to store the generated note in `USMD1210`.
  6. Use `SAP_WFRT` as the technical creator when writing the note row.

Referenced tables

ObjectPurpose
ZMDG_RECALL_REASCustom reason text table used by `BUILD_NOTE` to retrieve the human-readable reason text by reason ID.
USMD1210Change request note table used by `ADD_CREQUEST_NOTE` to store the generated audit note.

ILLUSTRATIVE ABAP SAMPLE

ABAP method: BUILD_NOTE

Source-supported note builder pattern from the MDG change request utility.

1METHOD build_note. 2 CLEAR ev_note. 3 4 SELECT SINGLE reason_text 5 FROM zmdg_recall_reas 6 INTO @DATA(lv_reason_text) 7 WHERE reason_id = @iv_reason_code. 8 9 IF sy-subrc = 0. 10 ev_note = |{ iv_action }, { lv_reason_text } Additional Comment: { iv_additional }|. 11 ENDIF. 12ENDMETHOD.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How can I create a standardized CR note in SAP MDG from a reason text table?
  • How do I concatenate action, reason, and comment into an MDG change request note?
  • What is the ABAP logic for BUILD_NOTE in SAP MDG change request processing?

Possible questions

  • How do I implement a reusable note-building method in SAP MDG for a change request using an action, reason code, and additional comment?
  • How can I write a CR note into USMD1210 after building the text?
  • What table stores the reason text used by the note builder?
  • How do I combine BUILD_NOTE and ADD_CREQUEST_NOTE in MDG?
  • What is the ABAP sample for note creation in change request utilities?

Keywords

SAP MDGABAPchange requestnote builderUSMD1210ZMDG_RECALL_REASBUILD_NOTESAP_WFRTaudit noteBRF+workflow