on 05-04-2016 10:46 AM
Is it possible to get the CR number to a material change document which was created from SAP MDG.
If we look at the change documents of an existing material in the active area (transaction MM04) we can see a couple of change documents from the classical MM-transactions (MM01, MM02) and couple from MDG (transaction MM01MDG, MM02MDG).
Is it possible to get at least the CR number to those change documents from MDG programmatically ?
For example via a function module which provides all CR numbers relating to a material number.
Kind regards, Matthias
Change your logic accordingly, below logic is for BP model.
DATA : LR_MODEL TYPE REF TO IF_USMD_MODEL,
LT_ENT TYPE USMD_T_VALUE,
LS_ENT TYPE USMD_S_VALUE,
LO_USMD_CHG_DOC TYPE REF TO CL_USMD_MDF_CHANGE_DOCUMENT.
CALL METHOD CL_USMD_MODEL=>GET_INSTANCE
EXPORTING
I_USMD_MODEL = 'BP'
IMPORTING
EO_INSTANCE = LR_MODEL
ET_MESSAGE = DATA(LT_MSG).
CALL METHOD CL_USMD_MDF_CHANGE_DOCUMENT=>GET_INSTANCE
RECEIVING
EO_INSTANCE = LO_USMD_CHG_DOC.
LS_ENT-FIELDNAME = 'BP_HEADER'.
LS_ENT-VALUE = '23'.
APPEND LS_ENT TO LT_ENT.
CALL METHOD LO_USMD_CHG_DOC->READ_DOCUMENT_HEADER
EXPORTING
* IT_CREQUEST =
I_ENTITY = 'BP_HEADER'
IT_ENTITY_VALUE = LT_ENT
IO_MODEL = LR_MODEL
IMPORTING
ET_DOCUMENT_HEADER = DATA(LT_HEADER).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
To get CR numbers relating to a material number , you could check table usmd1213 table.
You could look at this class CL_USMD_MDF_CHANGE_DOCUMENT as well for your requirements
Regards,
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuram,
the usmd1213 contains only the technical key. How to get the corresponding material number?
The generated staging tables seems to contain only the materials which are still part of a pending CR.
But we are especially interested in those changes which are already activated.
Kind regards, Matthias
Hi Matthias,
I guess not straight forward.
Get the Technical Key (USMDKMMMATERIAL) from your Generated table (Staging Table) for Material by passing your Material number(/1MD/MMMATERIAL).
Then pass this Technical Key to Change Document Header table CDHDR as shown below:
Object value holds CR number as marked below:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.