Application Development 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: 

Function module not working without breakpoint

Former Member
0 Kudos

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

15 REPLIES 15

former_member404244
Active Contributor
0 Kudos

Hi,

Try in different ehnacement point and see.

Regards,

Nagaraj

Former Member
0 Kudos

try some wait statement after or before FM. you may be able to get desired result.. nt sure though

Private_Member_49934
Contributor
0 Kudos

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?

0 Kudos

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.

Former Member
0 Kudos

thnks garav commit work is working fine

0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

Hi Oki i tried include MV45AFZB USEREXIT_GET_FIELD_FROM_SDCOM but i mnot getting configuration values.

Former Member
0 Kudos

Hi Oki i tried include MV45AFZB USEREXIT_GET_FIELD_FROM_SDCOM but i mnot getting configuration values.