cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate plan data before saving the data

former_member210676
Participant
0 Kudos

I have a total row in my planning layout which is a summation of plan data in 2 other rows. While saving the data, I should check whether the total is 200 and if not the data should not be saved. How can I achieve this! Any help would be appreciated.

Regards,

Tipo.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

before saving you can execute a planning sequence/function and check the data. This can be done e.g. in a FOX. If the total is not the value you are expecting you can raise an error mesage in your FOX.

In your save button you have a command to call the above mentioned planning sequence/function

and another one to save the area. So the planning sequence/function is executed first and generates an error message.

Please note that this does not prevent to save the data using the context menu (e.g. in BExAnlyzer).

If you want to make shure that using the context menu does not save your data, you need to plan in a different version and when you press the button "save" you can repost the planning data to your planning version once the FOX mentioned above has checked that the data is ok. Saving is the last step in this sequence.

Hope this helps.

Regards Matthias Nutt

SAP Consulting Switzerland

former_member210676
Participant
0 Kudos

Hi Matthias!

Thank you for ur reply!

By ur solution, i will have a planning sequence with a fox formula and a save function. If the total value is wrong, the fox formula will send a error message and I think that it will not stop the execution of save function next. So save will be executed inspite of fox check fail.

But i m not sure! Are u sure that save function will not be executed if fox sends an error??

Former Member
0 Kudos

Hi,

give it a try. the creation of planning function which does nothing except throwing an error message should not be a problem.

Regards Matthias

Former Member
0 Kudos

Hi,

I'm also facing the same problem in my development...I tried above all the ways,but we cannot stop saving the wrong data.In this case you have to write the java script for save button, before saving the data if it is correct then go for the next step to save other wise throw an error message or without save the data .

You need to write the JAVA script for save button,in this code you need to read the data form the layout and check the total value, i am not sure if layout is dynamic how we can achieve this???.

My development also stopped for this issue,In my case i have two layouts ,one is for actual and another one is for Planing layout(Function - Distribution equally),using the fox code i succeed to read and throw an error message for incorrect data but i can not stop to saving for incorrect total data.

Once you solved this problem please post the message in SDN.This type of requirements is very tough and we need to share to our friends.

Thanks.

former_member210676
Participant
0 Kudos

Hi Sri,

I solved this issue. I am using exit function to achieve this functionality. First i get the required data from the buffer through XTH_DATA of exit func and then i check whether it is corerct! if it is wrong i m setting a mark and thru this i verify whether data is wrong or right! if it wrong i send out an error msg thru ET_MSG of exit func or else i save d data.

Plz open new thread for ur queries becoz d one who helps u will go without points!!!!!

Regards,

Ares!

former_member210676
Participant
0 Kudos

Hi Matt,

Thank you for ur help. The fox formula doesnt work becoz it doesnt prevent the already existing consistent data from being saved! Anyways thankz for ur help!!!!

Regards,

Ares.

Former Member
0 Kudos

Hi,

Thanks for your idea..

I have a one question using exit how your are stopping the incorect data???

Can you explain little bit more.How you developed the function module and after validating the data how you stopped to saving the incorrect data???

Thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

<Font Face="Tahoma" Color="Blue">

Hi,

Write a FOX Code to do this check and use that FOX Code as "Function after data change" in your planning layout design.

Regards,

Abhijit

<removed request for points>

</Font>

Edited by: Siegfried Szameitat on Nov 5, 2008 10:07 AM

former_member210676
Participant
0 Kudos

Hi Pathak!

But with Fox formula how would i call save when the total value is correct??