‎2012 Jan 10 4:12 PM
When I process an inbound order IDoc, it skips over CUSTOMER-FUNCTION '002', as though it is not activated. I read note 753153 which says to activate the function in SMOD or CMOD. In CMOD, there is a project with SAP Enhancement VEDA0001, which includes function EXIT_SAPLVEDA_002 (as shown in txn SMOD for VEDA0001). This exit function has one line of code that says 'INCLUDE ZXVEDU04'. We made some changes to ZXVEDU04. Everything is generated and activated. CMOD shows a green check and a green box next to this component. But when we process the IDoc, it skips over the statement "CALL CUSTOMER-FUNCTION '002'" in LVEDAF59. We watched it in debug mode, it skips over the statement and sy-subrc remains 0. The code in ZXVEDU04 is not getting executed. I even tried using CMOD to de-activate then activate everything again. Still, no luck. Why is it being treated as if it does not exist or is not activated?
‎2012 Jan 10 4:40 PM
Hi Mark,
Keep a break point inside the project and see.
Regards,
Madhu.
‎2012 Jan 10 4:50 PM
Go to SE80 and generate the user exit function group XVED (Program -> generate) and also activate it (by right clicking XVED and clicking activate). Sometimes it may happen that all components may not be active.
Repeat the same for function group VEDA (for IDOC_INPUT_ORDERS)
‎2012 Jan 13 1:43 PM
I activated the function groups via SE80, but still am getting the same problem. The customer function is skipped over and ignored, and sy-subrc remains 0.
‎2012 Jan 13 1:51 PM
open the component in the next screen of CMOD and activate the component.
on the main screen of CMOD deactivate the project and activate it again..
‎2012 Jan 30 4:05 PM
I have tried many different things, but still no luck. I deactivated and reactivated. I regenerated every function, every program. I even deleted the CMOD project, then re-created it. While in debug mode, when it gets to the command CALL CUSTOMER-FUNCTION '002', it just skips over it. SY-SUBRC remains zero. Function EXIT_SAPLVEDA_002 just won't execute. The same problem is happening with CUSTOMER-FUNCTION '001', FM EXIT_SAPLVEDA_001.
‎2012 Jan 30 7:23 PM
A bit more info I have found, regarding this info. We are using process code ORDE, instead of DELO.
The DELO process code executes the customer function:
Process Code: DELO
Executes function: IDOC_INPUT_ORDERS
Function Group: VEDA
Main Program: SAPLVEDA Include: LVEDAF5A
Form: CUSTOMER_FUNCTION_IDOC
Statement: CALL CUSTOMER-FUNCTION '001' Exit FM is executed
Executes FM: EXIT_SAPLVEDA_001
SY-SUBRC = 0
But the process code we are using, ORDE, gives me the problem:
Process Code: ORDE
Excutes function: Z_IDOC_INPUT_ORDR
Function Group: ZVEDA
Main Program: SAPLZVEDA Include: LVEDAF5A
Form: CUSTOMER_FUNCTION_IDOC
Statement: CALL CUSTOMER-FUNCTION '001' skips over this statement
SY-SUBRC = 0
‎2012 Jan 30 8:29 PM
Process Code: ORDE
Excutes function: Z_IDOC_INPUT_ORDR
Function Group: ZVEDA
Main Program: SAPLZVEDA Include: LVEDAF5A
Form: CUSTOMER_FUNCTION_IDOC
Statement: CALL CUSTOMER-FUNCTION '001' skips over this statement
SY-SUBRC = 0
Exactly what I have suspected - Your program name is SAPLZVEDA and the standard SAP program name where the exit EXIT_SAPLVEDA_001 is being called is SAPLVEDA. Since there is NO FM with the name EXIT_SAPLZVEDA_001, it is skipping over the FM.
From SAP help on [call customer-function|http://help.sap.com/abapdocu_702/en/abapcall_customer-function.htm]
Preparation by SAP
An empty or partly implemented function module must be assigned to the function module exit function_exit using the transaction SMOD. The name of the function module consists of "EXIT_", the program name, which contains the statement CALL CUSTOMER-FUNCTION, and the three-character name in function_exit. The interface of the function module is completely defined by SAP.
I'm not sure if you still would be able to create the FM with that name of not in the system. What was the need of creating Z FG ?
Regards,
Naimesh Patel
‎2012 Jan 30 8:40 PM
As Nameish points out, the user exit is for SAP standard code. Can I ask a further question? Since something persuaded someone to do the unthinkable (for me) and clone and whack and hack on an SAP program, why do you need a user exit? Since someone has already decided that the client/employer can accept the risk of future unsupported failures in SAP, by introducing a cutom program instead of enhancing the SAP standard, why not just whack and hack a little further and put in the code that you need, directly into the "z" object?
‎2012 Jan 30 8:48 PM
Thank you, I understand the problem now. This Z function is a copy of the SAP function. It was created before I got here. Since it is a custom Z program, I won't bother trying to use customer-function '001' or '002'. Instead, I'll just add some more custom code. There is a custom field on the sales order "Additional Data 2" tab that we want to populate from the IDoc. This means I also need to add BDC data it needs before it calls VA01. This means I will need to make a Z copy of include LVEDAF0F. Not the ideal way to do it, I know. I'd rather scrap this Z function and just use the user-exits that work with FM IDOC_INPUT_ORDERS. Thanks again for helping me figure this out.