‎2009 Jan 26 2:18 PM
Hi,
I am working on inbound IDOC processing. I created an extension for an IDOC. I created custom segment & included it in the extension that I created. The Message type was also custom. (I merely copied an existing standard Message Type for some other purpose). I also assigned Function Module to Message Type & IDOC type. I have other necessary settings configured as required. The problem that I am encountering is as follows:
Incorrect function module IDOC_INPUT_SHPCPR called up
Message no. B1044
Diagnosis
The function module IDOC_INPUT_SHPCPR, which was called for the application input, was not able to process the IDoc. A possible cause is that the IDoc has wrong message type or IDoc type.
Procedure
Please check the message type assignment for the application function module in the ALE customizing.
Now to troubleshoot the above error, I made sure that I have an entry with FM. IDOC_INPUT_SHPCPR, IDOC Basic Type ,custom IDOC extension & custom Message Type. But even then I see the above error. This error appears as Status 51 for the test IDOC that I processed.
Can anyone please tell me how to solve this? Thanks in advance.
‎2009 Jan 26 2:49 PM
Hi,
The Message type was also custom. (I merely copied an existing standard Message Type for some other purpose).
This is incorrect.
You must use the standard message type here. There is a check in the function module to see if the message type is SHPCPR and if not it will error out.
regards,
Advait
‎2009 Jan 26 2:49 PM
Hi,
The Message type was also custom. (I merely copied an existing standard Message Type for some other purpose).
This is incorrect.
You must use the standard message type here. There is a check in the function module to see if the message type is SHPCPR and if not it will error out.
regards,
Advait
‎2009 Jan 26 2:51 PM
Hi Advait,
In that case, what can I do to resolve the issue? There is a reason for using a copy of the standard message type & would like to accomodate changes for the same. So could you please let me know the possible solution for the problem?
Look forward for your reply.
Thank you.
‎2009 Jan 26 2:59 PM
Hi,
Generally we don't copy message types to create custom message types. If you have implemented extensions and that is the reason you are creating custom message type, then this approach is incorrect.
Extensions are a standard way of including custom segments into IDoc types/Basic type.
Then depending on the message type and extension type you can do the furter processing in the function module's user exits.
The solution is to keep the standard message type with extensions or copy the function module to a custom function module and make changes and use that function instead. But the latter approach is a dirty one and I would not recommend it.
regards,
Advait
‎2009 Jan 26 3:07 PM
Hi Advait,
Thanks for the response.. So in case I am required to create a custom FM, what part of the standard FM/ where do I change it? The requirement of using a custom Message type has been decided because some other processing will be carried out based on the Message Type. So to accomodate that functionality, the custom message type idea was proposed.
Also could you please point me out where exactly it's checking for the message type to be the standard message type? I am kind of lost because I was going through the FM & could not find it.
Please let me know. Look forward for your reply.
Thank you.
Edited by: Sap Help on Jan 26, 2009 10:08 AM
Edited by: Sap Help on Jan 26, 2009 10:09 AM
‎2009 Jan 26 3:20 PM
On line 49 of the function module :
* Loop through the IDocs' control records
LOOP AT idoc_contrl.
* Check the IDOCs message type
current_mestyp = idoc_contrl-mestyp.
PERFORM idoc_message_type_check
TABLES idoc_status
USING idoc_contrl
mestyp-shpcpr
CHANGING subrc.
Perform looks like this ( in Include LV56IF0C...)
FORM idoc_message_type_check
TABLES t_idoc_status STRUCTURE bdidocstat
USING f_idoc_contrl STRUCTURE edidc
default_mestyp LIKE edidc-mestyp
CHANGING subrc LIKE sy-subrc.
IF current_mestyp <> default_mestyp. " Here the variable default_mestyp has the value SHPCPR
MESSAGE ID msg-id "Global variable
TYPE 'E'
NUMBER msg-nr_wrong_function "Global variable
WITH current_mestyp "message type
'IDOC_INPUT_SHIPPL'"Your function module
f_idoc_contrl-sndprt "Sender partner type
f_idoc_contrl-sndprn "Sender number
RAISING wrong_function_called.
Again let me warn you that you will have to copy the entire function group V56I. Copying the function module alone will not help because there are many reusable subroutines in different includes of the function-pool.
regards,
Advait
‎2009 Jan 26 3:50 PM
Hi Advait,
Thanks for the info. How can I find out the corresponding function group? And does that mean I have to create a Z function group? I am just going to use the Z FM. So what are the changes that I need to do in this case?
Kindly let me know.
Thank you.
‎2009 Jan 26 5:54 PM
Hi,
The function group is V56I, but what changes you need to do is impossible to say. You will have to make the changes and test the same.
regards,
Advait
‎2009 Jan 27 9:43 PM
Hi,
Thanks. You are right. There are many sub-routines. Will have to try it now by making a custom group.
Thanks for all the help.
‎2009 Jan 27 11:56 PM
Instead of creating a new message type, check if it's best to define a message variant or message function (you can see these fields in WE20 and WE57; these fields + the message type uniquely identify the message).
Now, if you still can't do that, instead of duplicating the function group, enhance function group using enhancement framework if you have nw 7.0, or make a modification of standard if you have a lower release.
(I think that copying whole sap programs to just change a few lines of code is a bad practice because upgrades (SPAU) will not be able to detect/adjust this copied program)
‎2009 Jan 28 4:35 PM
Hi,
Thanks for your reply. Will try & check if it can work once done with the current solution proposal at hand. I am in the midst of it, so would like to finish it off first & see.
Thanks again.
‎2009 Jan 26 2:50 PM
After quickly peeking into the code I suspect there is a check inside IDOC_INPUT_SHPCPR to allow only SHPCPR as message type, so your custom message type conflicts with that.
Thomas
‎2009 Jan 26 2:57 PM
Hi Thomas,
Could you please tell me how to solve this issue then? Create a custom FM with the changes as needed? What do you suggest?
Look forward to your reply.
Thank you.