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

CUSTOMER-FUNCTION '002' is skipped

Former Member
0 Likes
3,013

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?

9 REPLIES 9
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,698

Hi Mark,

Keep a break point inside the project and see.

Regards,

Madhu.

Read only

Former Member
0 Likes
1,698

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)

Read only

0 Likes
1,698

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.

Read only

Former Member
0 Likes
1,698

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..

Read only

0 Likes
1,698

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.

Read only

0 Likes
1,698

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

Read only

0 Likes
1,698

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

Read only

0 Likes
1,698

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?

Read only

0 Likes
1,698

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.