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

How to execute Update Module FM after final commit work for a T-code.

Former Member
0 Likes
314

Hello Folks,

I have a bit complex issue with my current object.

We have modified MM41/MM42 transactions and added a subscreen to fulfill the requirement.

We have designed the subscreen and embedded the same to MM41/MM42 through SPRO configuration.

Now for update business logic,i am trying to execute one Function module(Update Module) in update Task...so that it will be executed once after the final commit work will be done for MM41/MM42.

But its not executing.

To fulfill my requirement i need to execute the FM only after Final Commit work for MM41/MM42.

Please suggest in this regard.

Even i can see few BADI's which are triggering through MM01/MM02 but not through MM41/MM42.

BADI_ARTICLE_REF_RT

BADI_MATERIAL_CHECK

BADI_MAT_F_SPEC_SEL

Code with which i am trying is given below.

After PAI event of the subscreen---

1: MODULE USER_COMMAND_9001.

2: MODULE user_command_9001 INPUT.

PERFORM sub_save_mara ON COMMIT.

ENDMODULE.

3: FORM sub_save_mara.

CALL FUNCTION 'ZMMUPDATE_MARA_APPEND_STRUCT' "IN UPDATE TASK

EXPORTING

materialno = gv_matnr

appendmara = ty_zzmara.

ENDFORM. "sub_save_mara

4: FUNCTION zmmupdate_mara_append_struct.

  • "----------------------------------------------------------------------

""Update Function Module:

*"

""Local Interface:

*" IMPORTING

*" VALUE(MATERIALNO) TYPE MATNR

*" VALUE(APPENDMARA) TYPE ZZMARA

*"----


  • Data Declaration for Local use

DATA : w_mara TYPE mara.

  • Selecting the latest values for the material.

SELECT SINGLE * FROM mara INTO w_mara WHERE matnr = materialno.

IF sy-subrc = 0.

  • Move the ZZMARA values to structure MARA

MOVE-CORRESPONDING appendmara TO w_mara.

  • Update the values in table MARA.

MODIFY mara FROM w_mara.

ENDIF.

ENDFUNCTION.

Kindly suggest.Thanks in advance.

Regards

Ansumesh

Moderator message - Cross post locked

Edited by: Rob Burbank on Dec 17, 2009 9:38 AM

1 REPLY 1
Read only

Former Member
0 Likes
261

answered