‎2009 Feb 26 4:59 AM
Dear Freinds ,
i made a table and maintainance generator ,
it has one of the field is date field . (eg. target date)
Now i want the user to restrict enter only last date of the month , and not other date ...
if user enter any other date of the month , then it will say an error message ..
eg. for feb 2008 user is allowed to enter 29.02.2008
for feb 2009 user is allowed to enter 28.02.2009
all the above enteries are entereed in user maintainance i.e sm30 ...
‎2009 Feb 26 7:09 AM
Copy the Function Group Name which you have given in Table maintenance Generator. Then Go to SE80 and Change the Module Pool Program Generated.
Ajay
‎2009 Feb 26 7:09 AM
Copy the Function Group Name which you have given in Table maintenance Generator. Then Go to SE80 and Change the Module Pool Program Generated.
Ajay
‎2009 Feb 26 9:14 AM
Hi,
U can modify the Fun grp generated . And u can use the FM CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = l_date
EXCEPTIONS
day_in_not_valid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
to get the last day of the month.
Check that l_date is same as the date entered by the user. If not equal then u can give an error msg.
Keerthi.
‎2009 Feb 26 4:45 PM
Hi Ajay,
U said u have created the table maintance then u will be enter the values from Sm30 as i know.
On that case create the table eventes.
With the event 05.
with in the abap editor
Can function 'FKK_LAST_DAY_OF_MONTH'.
IMPORTING
DAY_IN = traget date.
exporting.
u will get the last day of the month.
IF sy-subrc NE '0'.
raise error message
endif.
Thanks
‎2009 Feb 27 7:49 AM
Hi,
use view v_tvimf. SE16-> v_tvimf. Give ur table name. Use event '01'. create form routine, and in the routine, write your code to restrict the data, or to give error message
Regards,
Arun.
‎2009 Feb 27 8:39 AM
Hi ,
See this thread
/people/sudheer.cheedella/blog/2006/02/20/extracting-data-in-table-maintenance
regards,
Arun.
‎2009 Feb 27 12:24 PM
Hi Ajay,
Actually instaed of entering the values why can't you give the default dates in PBO of that screen.
You can write a logic for the years and the months and assign the default value to the date field.
so it will check for the current date and be defualt it will show the last date of that month and make that field as noneditable.
so there can not be any changes to that field in table maintianence Generator.
Regards,
Madhavi
‎2009 Mar 02 6:26 AM
Hi,
Use the Table Maintenance Events.In your case use the event "01-Before saving the data in the database " and code in the respective FORM.
For details on how to use table maintenance events,check below link:-
https://wiki.sdn.sap.com/wiki/x/AoOUAQ
-Regards,
Bhumika
‎2009 Mar 02 11:06 AM
Hi,
check below link for table maintanance generator
Regards,
Madhu