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

Custom - Material Master Update using an IDOC (Message Type - MATMAS_BAPI)

Former Member
0 Likes
4,166

Hello everyone,

I was writing a functional specs. Basically, I want to update the material master MM02 using an IDOC (MATMAS_BAPI01 - Basic Type & MATMAS_BAPI - Message Type). This is currently working.

To my understanding, this currently uses function module - BAPI_IDOC_INPUT1 to update the material master after the IDOC is posted to SAP ECC from XI system.

Now I want to add one small validation logic before it actually updates the material master (MM02).

I looked around and found one exit - EXIT_SAPLMV02_002 in enhancement MGV00001. I was almost sure that this EXIT can be used to write the custom validation code before, actual MM02 updation.

However while trying to establish a link between this EXIT and BAPI_IDOC_INPUT1, I found that EXIT_SAPLMV02_002 is actually a part of another function module - IDOC_INPUT_MATMAS01 and not BAPI_IDOC_INPUT1. I am stuck here if adding the custom logic in the exit really going to work.

a bit of googling and I found from WE30 that the purpose of both these function modules are actually different. While BAPI_IDOC_INPUT1 actually create & updates the material master (also plant specific master data which is my need), IDOC_INPUT_MATMAS01 is just for maintenence of few fields in MM02 (may be custom fields).

Can anyone point out if my thing is in right direction?

Also please offer any solution where shall I put the Custom Logic in the EXIT or the some variants of

BAPI_IDOC_INPUT1.

A less technical explanation would be appreciated as I come from a functional background and invloved in this for writing the func specs. I want to make it sure that what I write is not useless and makes some sense.

Thanks in advance,

Arunesh

7 REPLIES 7
Read only

Former Member
0 Likes
2,929

I hope you are in the right track, just use the include 'ZXMGVU04' in the function module 'EXIT_SAPLMV02_002' to develop your custom code. Since user exits will trigger for several scenarios better to check some conditions such as checking Idoc type & message type and other related information.

For this purpose you can use structure 'EDIDC'.

Read only

0 Likes
2,929

Hi Satya,

The program ZXMGVU04 is already included in the EXIT for inclusion of some other modules logic.

So the custom code can be simply added there.

The issue however remains, is there a way through which I can check that BAPI_IDOC_INPUT1 (say executed through "standard Inbound processing" or "Inbound Processing Module" in WE19) will internally invlove the EXIT.

Yes, EDIDC is used currently, I think. That's what I see when I test it from WE19 manually and it updates the material master successfully (off course without the Custom Validation)

Any idea how to verify my doubt.

-- Arunesh

Read only

Former Member
0 Likes
2,929

try debugging function module BAPI_IDOC_INPUT1 if you can find any exits

Regards,

Lalit Mohan Gupta.

Read only

0 Likes
2,929

Hi Lalit,

Did some head breaking with the function module - BAPI_IDOC_INPUT1 to check whether it is calling the EXIT_SAPLMV02_002 internally. Couldn't get anywhere.

On question of another EXIT in BAPI_IDOC_INPUT1, I don't see any. I am not very proficient in ABAP code, I must say though.

I found the list of exits from google, almost same list everywhere.

http://www.sapfans.com/forums/viewtopic.php?f=21&t=296637

here I got the EXIT, I am talking about.

Any other way to find either the EXIT or link the above?

-- Arunesh

Read only

0 Likes
2,929

just for a quick check for available exits,

open the mentioned FM in se37

start a GLOBAL search for the key words of CUSTOMER FUNCTION by selecting the radio button of MAIN PROG.

Then, u can see some CALL CUSTOMER FUNCTION statements:

I guess, u knew that, to trigger any exit, we hv to create a project in CMOD and activate it.

thanq

Read only

0 Likes
2,929

Hi,

Just checked in SE37 for "CUSTOMER FUNCTION" in where used list (sorry I didn't understand your point of main program).

I don't find any in BAPI_IDOC_INPUT1 but only in IDOC_INPUT_MATMAS01 which I expected but no joy. This still keeps me at the same point.

am I missing anything?

my list of EXIT is also at

http://help.sap.com/saphelp_47x200/helpdata/en/f9/8268985c5b11d396a400a0c930e0da/content.htm

Thanks,

Arunesh

Edited by: Arunesh Chakrapani on Apr 16, 2009 8:39 PM

Read only

0 Likes
2,929

Arunesh,

You can create/change Materials using IDOC_INPUT_MATMAS FM also. Check if the Segment exist in this MATMAS05 basic type for updating Plant Master Data. You can compare segments for both Basic Types. If you have, then you can use this one too.

Also, you can go into debug mode uisng WE19 transaction code and put a break point at statement 'CUSTOMER FUNCTION' and see if it stops you there.

Shylesh