Skip to Content
author's profile photo Former Member
Former Member

product hierarchy (MVKE-PRODH).

This issue is not yet solved . Please give me a clue to solve the same.

(MM02) When the material level hierarchy (MARA-PRDHA) is updated on the Basic Data 1 view of the material master, upon saving the system should find all the sales organisations (sales org 2 TAB)n material and update the product hierarchy (MVKE-PRODH).

For this I wrote a piece of code in the exit u2026zxmg0u02 which is in FM : EXIT_SAPLMGMU_001

select single PRDHA from mara into v_PRDHA where matnr = wmara-matnr.

if v_PRDHA NE wmara-PRDHA.

t_mara-MANDT = wmara-MANDT.

t_mara-matnr = wmara-matnr.

t_mara-PRDHA = wmara-PRDHA.

t_mara-tcode = 'MM02'.

append t_mara.

SELECT matnr VKORG VTWEG

FROM mvke into CORRESPONDING fields of table t_mvke

WHERE matnr = wmara-matnr.

IF sy-subrc = 0.

loop at t_mvke.

t_mvke-PRODH = t_mara-PRDHA.

modify t_mvke from t_mvke index sy-tabix.

endloop.

IMPORT V_FLAG FROM MEMORY ID 'Z_FLAG'.

IF V_FLAG IS INITIAL.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

P_KZ_NO_WARN = 'W'

KZ_PRF = 'E'

  • IMPORTING

  • MATNR_LAST =

  • NUMBER_ERRORS_TRANSACTION =

TABLES

AMARA_UEB = t_mara

AMVKE_UEB = t_mvke

EXCEPTIONS

KSTATUS_EMPTY = 1

TKSTATUS_EMPTY = 2

T130M_ERROR = 3

INTERNAL_ERROR = 4

TOO_MANY_ERRORS = 5

UPDATE_ERROR = 6

OTHERS = 7

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*ELSE .

*COMMIT WORK AND WAIT.

ENDIF.

V_FLAG = 'X'.

EXPORT V_FLAG TO MEMORY ID 'Z_FLAG'.

ELSE.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

But the Function Module -MATERIAL_MAINTAIN_DARK is recessively calling the exit .

Please correct if this is not the right way to solve the requirement.

suggest the best.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2009 at 05:38 PM

    Not sure if it's the right way to do this or not, but to avoid that recessive call oo the exit you can call the function SYSTEM_CALLSTACK inside your exit and check the callstack if you came in from the standard MM02 change or from 'MATERIAL_MAINTAIN_DARK' (or you your exit appears twice on the callback).

    If you came in from MATERIAL_MAINTAIN_DARK you just get out of your exit and do nothing.

    Regards,

    Sergio

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2014 at 04:04 PM

    Hi Roshan,

    I have similar requirement, did you get the solutions? if yes please share with me

    Thanks,

    Vinod.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.