Skip to Content
0

Customer Classification Implicit Commit changing to Customer General Data Screen

Mar 10, 2017 at 06:57 AM

122

avatar image

Hello,

I am currently facing a strange behavior in the customer master data. I enhanced the User exit CLFM0002 EXIT_SAPLCLFM_002 ZXCLFU02. A User Exit which is called before you save your customer classifications. I am writting a change pointer for a custom IDoc Type I created.

Now following scenario happens. I want to add a Classification which is then triggern the Change Pointer creation in the User Exit.

I go in the Transaction XD02 via Extras > Classifications and add my specific customer classification. This then triggering the Function Module CHANGE_POINTERS_CREATE_DIRECT. The Function Module itself makes an INSERT call to the database table BDCP2 but without an commit. Now when I go back to the general data screen, an implicit commit is somewhere called which then creates the entrie in the BDCP2 table without the data being saved. This causes now an issue when my background job reads the change pointers as in this moment my data is not saved.

I need this particular user exit as function modules are able to maintain the customer classifications without calling the customer master data. So therefore I cannot use only the Customer User Exit / Badis.

Does someone experienced this behavior before or is there a way I can avoid the change pointer creatin at this point?

Thanks for all your help,.

BR,

Andreas

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jelena Perfiljeva
Mar 13, 2017 at 05:24 PM
0

This seems like a basic LUW question... Are you using IN UPDATE TASK?

Otherwise it'd be very strange for a standard transaction to perform a COMMIT prematurely. Could there be another user exit gone wrong? Can you see where COMMIT is happening exactly? I'm afraid there is more troubleshooting to do in your system...

P.S. There is a standard IDoc for the classifications, not sure why you need a custom one...

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hello Jelena,

thanks for your answer and sorry for my late reply. I did not get any notifications.

I do not trigger the classification idoc itself, rather I trigger a custom IDoc when a specific classification is added to a customer.

The thing is that I do NOT see where the commit is happening. I debbuged to the latest point possible before jumping to general data screen itself and till this point no commit is triggered. After the customer general data screen is displayed the commit is done for my change pointer. But the classifications table ins the background are not updated.

When I am trying to use the "IN UPDATE TASK" syntax, I get following dump:

The function module "CHANGE_POINTERS_CREATE_DIRECT" was called with the addition "... IN UPDATE TASK". However, it is not flagged in the Function Library as executable in the update task.

This is a very weird issue I have not seen before.

Thanks for your time and help.

BR,

Andreas

0

Sorry I don't have much time to spend on this but I suspect this might be a wrong approach altogether. I don't have the solution from the top of my head though. It just doesn't feel right... You might want to read more about the custom change pointers and see how the standard IDoc for classification works.

Obviously in a user exit that is triggered when you simply navigate away from the screen you can't call any INSERT commands. (That's just bad design.) Try creating a custom FM to call with IN UPDATE TASK and put all the update code there. Or search for another user exit.

0

Hello Jelena,

I used the User exit CLFM0002 EXIT_SAPLCLFM_002 ZXCLFU02 as it is possible to maintain the customer classifications with the Function Module BAPI_OBJCL_CHANGE. This Function Module does not call any BAdI's or User Exit from the Customer Master Data as it specificly changes the classifications. I didn't know that this User Exit will then be called by the Customer Change Transaction but it makes sense as you can save the customer classification via XD02 . That this User Exit does not call the commit immediately when switching screens makes also sense but somehow this does not apply to the function module I implemented.

Just for your understanding. We are using SAP Hybris and as SAP Hybris does not have a proper way to save the customer classifications at the moment or using the standard classification IDoc at all, we created a new IDoc Message Type for our requirements. It is not the requirement to save the classification to a customer but rather than save those classifications to separte place in Hybris. So I had the idea, when user maintain this particular customer classification, I read it in the User Exit and create a change pointer so I am able to send then the required customer classifications to Hybris.

I will try your approach and let you know if it solved the issue.

Thanks for your help.

BR,

Andreas

0
Rakshith Gore
Mar 22, 2017 at 05:16 AM
0

Hi Andreas,

Is there any reason you chose this customer exit rather than filtering the BDCP2 entries in BDCP_BEFORE_WRITE??

Thanks & Regards,

Rakshith Gore

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Rakshith,

as I was using the Function Module BAPI_OBJCL_CHANGE, I was looking for a user exit which were called before the save of the customer classifications. Thats the reason I found the User exit CLFM0002 EXIT_SAPLCLFM_002 ZXCLFU02.

But I understand your approach, I try if I can use your approach for my situtaion.

Thanks for your help.

BR,

Andreas

0