on 06-11-2015 9:06 AM
Hello, everyone.
I have a task to alter position configuration data (the one that's shown in Extras - Configuration) when order is saved in VA01/VA02.
What I do is the following:
The code seems to work fine for the existing positions. However, when a position is added, the configuration changes are not saved after saving the order. My guess is that CUCB_SET_CONFIGURATION needs position to exist already in the database.
So, the question is: are there any workaounds or other solutions?
I know, I can move all my code to a custom RFC-enabled FM and call it with a STARTING NEW TASK addition. The FM body will then wait until order is saved and update the configuration data. But RFC-call causes an implicit commit, which is apparently undesired inside a user-exit.
Thank you in advance.
Just in case anyone cares, the solution seems to be found: config can be changed using cl_cbase class. The call sequence is the following:
cl_cbase=>get_current_cbase_by_instance( iv_instance = vbap-cuobj iv_check_only_buffer = 'X' ).
cl_cbase->get_configuration
change config as needed
cl_cbase->set_configuration
cl_cbase->set_mark_for_saving
Methods are called inside USEREXIT_SAVE_DOCUMENT_PREPARE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
Why don't you go for V2 Update module as V1 is where the order will be updated and you don't have to be concerned about explicit commit as SAP will take care of it.
R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.