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: 

Module Pool program date validation check

0 Kudos
501

Create a module pool program. Having create and update button , using a custom table. User provide date and provide data in created field like class 1 = , Class 2 = . Based on date it save data in custom table. Right now user can create unlimited data on the same date (like 07.08.2021), But i want to restrict user ,user can entry only one time using same date range and not able to create data using past date like today is 07.08.2021 so user can not create entry using date field 06.08.2021.

Please guided me what should i need to do in PBO & PAI.

11 REPLIES 11

former_member751964
Participant
0 Kudos
221

Thank you for asking a question in the SAP Community!

Your question is very important to us. It would be helpful for you to take the tutorial: https://community.sap.com/resources/questions-and-answers which provides tips for preparing questions that draw the best responses from our members. Plus, by organizing your Community profile using this tutorial: https://developers.sap.com/tutorials/community-profile.html you will encourage more readers to respond to your questions!

Thank you!

Sandra_Rossi
Active Contributor
0 Kudos
221

First of all, you should learn by reading general documentation what dynpro is about. PBO means "before the screen is output" and PAI means "after user typed anything and pressed ENTER or a function key". PAI is for validation.

For the rest, I don't understand what your problem is, it seems rather simple to do, just a IF condition then error.

0 Kudos
221

Dear sandra.rossi,

In PAI and PBO has no issues . In my module pool program I can update even i can save my data also.Problem is user can save several data in the same date. I also used if condition also but I failed.

Sandra_Rossi
Active Contributor
0 Kudos
221

You have said that you want to "restrict user ,user can entry only one time using same date range and not able to create data using past date like today is 07.08.2021 so user can not create entry using date field 06.08.2021", so your PAI which didn't have any issue in the past, has now the issue that it must be changed to add a check. But I'm afraid that people can't help you more if you don't describe your exact issue in adding this check...

0 Kudos
221

Thanks Sandra.

Actually in my program there are several field where department wise daily worker enlisted. user can create and even update the worker number without having any problem but problem is user can create so many entries on the same date even for past date entries also.

Sandra_Rossi
Active Contributor
0 Kudos
221

I don't think you gave enough information so that people can understand and answer.

0 Kudos
221

could you please guided me

raymond_giuseppi
Active Contributor
0 Kudos
221

What have you already coded in PAI for the validation of the date field, shouldn't it be a simple comparison between the current date and the entry date (plausibility of the date) followed by an existence check in the database (only one re-record per day/identifier)?

0 Kudos
221

In my PAI use case statement, when 'Save' i need to check either date is existing or not and only one entry in a day.

0 Kudos
221

Just code a simple SELECT statement in the module, what did you already code?

0 Kudos
221

Dear Raymond,

Thanks I solved the problem.