2012 May 21 2:03 PM
Hi gurus!
We added some custom fields to MARA. Now when we run MM12 I need to populate custom fields.
To do that I want to use BADI_MATERIAL_OD~PF_STATUS_SETZEN
There I can select data from tables: PCDHDR and PCDPOS and it will be displayed in MM01/02/03
The only problem is: I do not have the Change Number, it's a key for selecting data.
I tried to read it using:
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = 'SAPLMGMM'
dynumb = '0060'
TABLES
dynpfields = lt_dynpfields
But I got exception 3 - Invalid screen name.
Whats wrong?
Is there any other ways to populate custom fields while running MM12/MM11?
Any help appreciated.
2012 May 21 2:07 PM
2012 May 21 2:07 PM
2012 May 21 2:14 PM
Hi, thank for respond.
In my code it was 'SAPLMGMM'. I just made a mistake while copying my code here.
It's exception 3 - Invalid screen name
2012 May 21 2:19 PM
So I suppose the dynpro/program is not in active status when your BaDI get executed. Try to debug and check the Abap stack, if the dynpro is no longer active but the program is, you may try to assign a field-symbol with a global data of the function pool.
DATA dataname TYPE c LENGTH 21 VALUE '(SAPLMGMM)RMMG1-AENNR'.
FIELD-SYMBOLS <fs> TYPE aennr.
* ...
ASSIGN (dataname) TO <fs>.
Should work as RMMG1 is defined via a TABLES statement in the TOP of the function group.
Regards,
Raymond
2012 May 21 2:28 PM