04-12-2012 5:23 AM
Hi Experts,
I have done one enhancement in program -SAPMV45A in include - MV45AF0B_BELEG_SICHERN.
There i have used one function module VC_I_GET_CONFIGURATION, there i am passing object no and
its giving characteristics value. Now problem is while creating sales order when i put breakpoint above function module and
execute the transaction VA01 its giving me proper values and while i execute the transaction by putting breakpoint below function module
or without breakpoint its not giving any value .
All input parameters for function module are correct. I have no clue about whats happening here.
Kindly provide me the solution.
regards,
Viraj
04-12-2012 7:30 AM
04-12-2012 7:47 AM
try some wait statement after or before FM. you may be able to get desired result.. nt sure though
04-12-2012 7:48 AM
Dear Viraj,
If what you are putting is correct then the only reason I see is implicit commit during debugging may be cause it to work properly
Check the link
· Due to the implicit database commit, inconsistent datasets can occur in the database.
What might be happening is when you enter the debugger before calling the FM commit is occuring and for some select inside this FM is getting the values!! when you are putting the break point after the FM the commit is not executed before FM and some select is failing inside the FM
Did you try in VA02? Try creating some in VA01 and try changing something in va02 and saving. See if it working there?
04-12-2012 7:58 AM
Another Option JUST FOR TESTING
Try putting a commit work before calling the FM. Run VA01 whithout any break point or break point after FM call. See if it's working. If it's working. then you need some different FM or Enhanmcnet point.
04-12-2012 8:28 AM
04-12-2012 8:35 AM
Hi,
As gaurav suggested the commit work is only for testing..Please don't use it in your code.. It will effect LUW'S.. I suggest try different enhancement point for your requirement.
Regards,
Nagaraj
04-12-2012 8:43 AM
Viraj Please don't use commit work here. It may cause incosnisitencies later . Try finding a better place whwere you can put your code .
Don't you find any place MV45AFZZ where your code will be working(say
USEREXIT_SAVE_DOCUMENT )?
Please do mark helpful/correct answers . It may help someone in future.
04-12-2012 8:58 AM
gaurav i tried at MV45AFZZ USEREXIT_SAVE_DOCUMENT , there i was getting object no. but
my FM VC_I_GET_CONFIGURATION was not giving any value and i went to se37
and exuceted the same it was not returning any value so that ehnacement point is not useful for me i tried in sum other ehnancement where FM was returning value but i was facing the same problem.
is there any other way except commit work.
04-12-2012 9:17 AM
I don't know your requirement and what you are doing with the output of the FM. I won't be able to suggest it.
But if commit work is soves your problem then try creation a z- update task fm. Put your code in it. and call this FM in update task. in the USEREXIT_SAVE_DOCUMENT.
If it doesn't work then inside the call the FM is background task. put someting like the below in the begining of your FM
do 10 times.
select single vbeln from vbak in l_v_vbeln where vbeln = (your new sales order).
if sy-subrc = 0.
l_v_flag_saved = 'X'.
exit.
else.
clear l_v_flag_saved.
wait upto 10 seconds.
endif.
enddo.
if l_v_fag_updated = 'x'.
*do your code
endif.
04-12-2012 9:41 AM
Hi,
If you pass correct data the Fm will return correctly and my question is why you need the output of FM , are you modifying any value in the program.I believe USER_EXIT_SAVE_DOCUMENT and USER_EXIT_SAVE_DOCUMENT_PREPARE , you can try..
Regards,
Nagaraj
04-12-2012 9:56 AM
yes my requirement i have to take all the configuration values in one varaiable and assign it to long text during sales order creation time
04-12-2012 12:50 PM
Hi initially i used commit work before function module it was returning values but now its not returning. is there any other way by which function module can return value
regards,
viraj
04-13-2012 8:52 AM
Hi,
You might want to try INCLUDE MV45AFZB, form USEREXIT_GET_FIELD_FROM_SDCOM.
Or may be you need to move the process after the order created successfully, (via workflow or else). Just to make sure that the configuration data has been stored and accessible via FM VC_I_GET_CONFIGURATION.
Regards,
Oki
04-13-2012 9:14 AM
Hi Oki i tried include MV45AFZB USEREXIT_GET_FIELD_FROM_SDCOM but i mnot getting configuration values.
04-13-2012 9:05 AM
Hi Oki i tried include MV45AFZB USEREXIT_GET_FIELD_FROM_SDCOM but i mnot getting configuration values.