Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MM11/MM12 custom fields problem

Former Member
0 Likes
947

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.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
850

First try to replace 'SAPMGMM' with 'SAPLMGMM'.

Regards,

Raymond

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
851

First try to replace 'SAPMGMM' with 'SAPLMGMM'.

Regards,

Raymond

Read only

0 Likes
850

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

Read only

0 Likes
850

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

Read only

0 Likes
850

Thank you Raymond! That's it.