Application Development and Automation 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: 
Read only

Table Maintainance query

ajay_sharma10
Participant
0 Likes
957

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 ...

1 ACCEPTED SOLUTION
Read only

AjayJangid
Explorer
0 Likes
913

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

8 REPLIES 8
Read only

AjayJangid
Explorer
0 Likes
914

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

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
913

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.

Read only

tarangini_katta
Active Contributor
0 Likes
913

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

Read only

Former Member
0 Likes
913

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.

Read only

Former Member
0 Likes
913

Hi ,

See this thread

/people/sudheer.cheedella/blog/2006/02/20/extracting-data-in-table-maintenance

regards,

Arun.

Read only

Former Member
0 Likes
913

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

Read only

Former Member
0 Likes
913

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

Read only

Former Member
0 Likes
913