cancel
Showing results for 
Search instead for 
Did you mean: 

From z_view can I call a Z FM, wherein I placed COMMIT WORK statement?

former_member194142
Participant
0 Kudos

Hello,

I developed a custom WDA, wherein i have my_view_2, wherein I have On_Button_Action event handler methos, well

In this On_Button_Action, I am calling a custom FM, in this custom FM I am updating a custom table by using MODIFY and COMMIT WORK statements.

Pls. let me know

1) Is it OK/safe that Can I call a custom FM, wherein we have MODIFY & COMMIT WORK statements?

2) If not, pls. suggest that how can achieve my requirement?

Thank youi

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

In WDA, the business logic should be separated and it should be placed in a model viz class, function module, BAPI etc

Hence, FM is also a model and you can call FM in WDA.

As suggested by Mr. Chandra, it is standard practice that we use assistance class to write our business logic.


In your case, you can create a method in assistance class with MODIFY & COMMIT WORK logic and call method in WDA as you require.

Regards,

Rama

Answers (1)

Answers (1)

Former Member
0 Kudos

Yeah, you can call your FM in the view, but its recommended according to Web Dynpro Architecture

you create the Assistance class and call your FM into the method of assistance class  and call the method of assistance class in the view.