cancel
Showing results for 
Search instead for 
Did you mean: 

Changing IDOC function module?

Former Member
0 Kudos

Hello everyone!

I would like to make changes to the function module responsible for creating Sales Order Idocs: IDOC_INPUT_ORDERS. How should I go about this procedure? Do I need to copy the existing function module and create a new one? If so, how do I point the IDOC (ORDERS05) to the new function module (for example, ZIDOC_INPUT_ORDERS).

Thanks in advance!

Warm regards,

Glenn

Accepted Solutions (1)

Accepted Solutions (1)

former_member859847
Active Contributor
0 Kudos

Hi,

Function Modules associated to process codes.

try to create your own process code and assign the function module(ZIDOC_INPUT_ORDERS).

for outbound process code - we41

for inbound process code -we42.

warm regards

mahesh.

Former Member
0 Kudos

Thank you for your replies! I'll try your suggestions as soon as I get my hands on our system!

If you have any other information on how to properly edit the IDOC function module (for example, adding ABAP checking codes before populating the IDOC fields) it would be great if you could share them!

Warm regards,

Glenn

turmoll
Active Contributor
0 Kudos

> I would like to make changes to the function module responsible for creating Sales

> Order Idocs: IDOC_INPUT_ORDERS. How should I go about this procedure?

> Do I need to copy the existing function module and create a new one?

(1)This is one possible solution, another one is to use some (2)customer function exits for inbound Idoc – these enhancements might be useful: MM06E001, VEDA0001or (depending on platform you are) you might go for e.g. (3)“Implicit enhancement”. In last two cases you probably don’t need to create Z-FM and Z-process code.

> If so, how do I point the IDOC (ORDERS05) to the new function module (for

> example, ZIDOC_INPUT_ORDERS).

1) Copy FM to ZFM

2) Specify characteristic of FM – BD51

3) Create Z-inbound process code: WE42 and assign a Z-FM to it.

4) Assign FM to message type – WE57

>If you have any other information on how to properly edit the IDOC function

> module (for example, adding ABAP checking codes before populating the IDOC

> fields) it would be great if you could share them!

To add some checks at the beginning you might use all three possible solutions:

(1) in ZFM you might add you code at the very beginning and return some error message

(2) you might use on of the available customer function exits to do some checks

(3) you can do the implicit enhancement and also return some error code at the very beginning of standard FM

In both cases I recommend to go for approach no (2). Useful tcodes: CMOD and SMOD.

Regards,

Jakub

Former Member
0 Kudos

Thank you very much, Jakub, for that wonderfully detailed response.

Best regards,

Glenn

francisco_blay2
Explorer
0 Kudos

Just in case someone looking for a problem like mine arrives here.

I have ZIDOC_INPUT_PRDERS wich is a copy of IDOC_INPUT_ORDERS and calls it internally after a few checks. It did not worked properly, I had error VG223 (iDoc blocked)

I found this thread wich solved it. Just looked at configuration of IDOC_INPUT ORDERS in transaction BD51 and copied to our function ZIDOC_INPUT_ORDERS and all works fine now.

Thanks a lot!

Regards

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

For this idoc, in the partner profile the current inbound processing code is ORDE which in turn calls IDOC_INPUT_ORDERS. After a new fucntion module is created, u may create and change the inbound processing code in we42.

Regards,

Prateek

Former Member
0 Kudos

Hi,

the copying of existing function Module is based on what kind of changes you are expecting in the modified function Module.

You need to pass the Header information of the IDOC to be process such as Message Type, Variants, IDOC basic typs, Receiver port and sender port Process codes etc...information to the newly created function module.

If you are copying it as it is ..then I think all this information will come as it is.

Thanks

Swarup