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

triggering abap code on movement type

former_member925838
Participant
0 Likes
1,212

Hello Experts,

Is there any way to trigger an abap program(zreport) on selection of perticular movement type in MIGO or any other place from where that movement type is selected.

I mean let say for movement type 601, during entire processing whenever this movement type is used i need to trigger my report. is it possible? is there any other way to do the same?

Thanks,

Amar

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,134

Amar,

Is the report triggering any other movement types ?

Kesav

9 REPLIES 9
Read only

Former Member
0 Likes
1,134

You can use the BADI MB_DOCUMENT_BADI that has two methods the first one is just before update happens and the other triggers during update. Please read the documentation before using them.

Alternatively you can use SMOD enhancement MB_CF001 that has a user exit that is called just before commit.

Read only

Former Member
0 Likes
1,134

use MB_DOCUMENT_BADI, select the method as per the task you are performing.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,135

Amar,

Is the report triggering any other movement types ?

Kesav

Read only

0 Likes
1,134

Thanks for all the replies.

My report is not triggering any movement type.

its just report which fills some Ztables.

Yeah that BADI might be useful, but what exactly happens is the document is not created when my code gets executed.

what exactly i want is if the required movement type is selected i want to fetch data from different tables and put some data in ZTABLE with some additional Z fields fields. Currently I have created a Ztcode where the input field is MIGO doc no or Delivery doc no. but every time client has to execute this ZTCODE in between there standard flow.(Which is uncomfirtable for them). so i want it should get triggered automatically...

Hope I am clear in explaining my problem...

Thanks,

Amar

Read only

0 Likes
1,134

Hi,

Please let us know what have you written in MB_DOCUMENT_BADI ?

Check with MB_MIGO_BADI and method POST_DOCUMENT.

Examples are available in class CL_EXM_IM_MB_MIGO_BADI. Check it in se24 with the method mentioned.

Also please search for available information in SCN. Such types of questions are already discussed.

Kesav

Read only

0 Likes
1,134

Yes..

Thats what i wanted, I am getting all the data which i required to join other tables.

MB_MIGO_BADI method post_document.

Many thanks Keshav.

Thanks,

Amar

Read only

0 Likes
1,134

Hi Kesahv,

Actually the field which I want to chk, i.e movement type is not available in post_document.

so i am afraid, i cant use this method.

thanks,

Amar

Read only

0 Likes
1,134

Its available in the parameter IT_MSEG. Field BWART.

Kesav

Read only

0 Likes
1,134

Yes it is.....

sorry, actually I checked in Header only..

Solved my problem.

full points awarded.....

Thanks,

Amar