SAP MDG · UTILITIES

How do I read SAP MDG change request header data and enrich it with status text, type text, and creator email?

Use a small reusable ABAP reader on `USMD120C` and enrich it with status text from `USMD130T`, type text from `USMD110T`, and the creator’s email via `USR21` and `ADR6`. The supplied class `ZCL_CR_HEADER_READER` shows the exact pattern.

Use a small reusable ABAP reader on `USMD120C` and enrich it with status text from `USMD130T`, type text from `USMD110T`, and the creator’s email via `USR21` and `ADR6`. The supplied class `ZCL_CR_HEADER_READER` shows the exact pattern.

A reusable MDG change request header reader typically starts from `USMD120C` and then adds user-friendly texts and email details. In the provided pattern, `ZCL_CR_HEADER_READER=>FETCH_CR_DETAILS` reads the CR by `USMD_CREQUEST`, copies the header fields into an output structure, fetches `TXTMI` descriptions for status and type, and resolves the creator’s email from the user master and address tables.

Process flow

  1. 1. Read the CR header from `USMD120C` using `USMD_CREQUEST`.
  2. 2. Move matching header fields into the output structure.
  3. 3. Read the status description from `USMD130T` using `USMD_CREQ_STATUS` and `SY-LANGU`.
  4. 4. Read the type description from `USMD110T` using `USMD_CREQ_TYPE` and `SY-LANGU`.
  5. 5. Resolve the creator user from `USR21` using `BNAME = USMD_CREATED_BY`.
  6. 6. Read the creator email from `ADR6` using `PERSNUMBER`.
  7. 7. Return the enriched structure to the caller for display in a dashboard or popup.

Referenced tables

ObjectPurpose
USMD120CMDG change request header table used as the base source for the CR number and header fields.
USMD130TLanguage-dependent change request status text table.
USMD110TLanguage-dependent change request type text table.
USR21Maps SAP user name to person number for the change request creator.
ADR6Stores email address data used to derive the creator email.

ILLUSTRATIVE ABAP SAMPLE

Reusable CR header enrichment reader

Source-supported pattern from the provided reusable utility class. Use this as a public helper in dashboards, quick views, or monitoring screens.

1CLASS zcl_cr_header_reader DEFINITION PUBLIC FINAL CREATE PUBLIC. 2 PUBLIC SECTION. 3 TYPES: BEGIN OF ty_cr_details, 4 INCLUDE TYPE usmd120c, 5 cr_status_des TYPE txt80, 6 cr_type_des TYPE txt80, 7 user_email TYPE txt80, 8 END OF ty_cr_details. 9 10 CLASS-METHODS fetch_cr_details 11 IMPORTING iv_cr TYPE usmd_crequest 12 EXPORTING es_cr_details TYPE ty_cr_details. 13ENDCLASS. 14 15CLASS zcl_cr_header_reader IMPLEMENTATION. 16 METHOD fetch_cr_details. 17 SELECT SINGLE * FROM usmd120c INTO @DATA(ls_cr_data) 18 WHERE usmd_crequest = @iv_cr. 19 20 MOVE-CORRESPONDING ls_cr_data TO es_cr_details. 21 22 SELECT SINGLE txtmi INTO @es_cr_details-cr_status_des 23 FROM usmd130t 24 WHERE usmd_creq_status = @es_cr_details-usmd_creq_status 25 AND langu = @sy-langu. 26 27 SELECT SINGLE txtmi INTO @es_cr_details-cr_type_des 28 FROM usmd110t 29 WHERE usmd_creq_type = @es_cr_details-usmd_creq_type 30 AND langu = @sy-langu. 31 32 SELECT SINGLE persnumber INTO @DATA(lv_persnumber) 33 FROM usr21 34 WHERE bname = @es_cr_details-usmd_created_by. 35 36 IF sy-subrc = 0. 37 SELECT SINGLE smtp_addr INTO @es_cr_details-user_email 38 FROM adr6 39 WHERE persnumber = @lv_persnumber. 40 ENDIF. 41 ENDMETHOD. 42ENDCLASS.

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

Related questions and keywords

Alternative questions

  • How can I fetch MDG change request details with descriptive texts?
  • Which tables are used to enrich an MDG change request header?
  • How do I build a reusable ABAP reader for MDG CR header information?

Possible questions

  • How do I read SAP MDG change request header data and enrich it with status text, type text, and creator email?
  • How can I fetch MDG change request details with descriptive texts?
  • Which tables are used to enrich an MDG change request header?
  • How do I build a reusable ABAP reader for MDG CR header information?
  • How do I display the requestor email for an MDG change request?

Keywords

SAP MDGchange requestUSMD120CUSMD130TUSMD110TUSR21ADR6ABAPheader enrichmentcreator emailstatus texttype text