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

Help reqd for Selection Screen Input paramter

Former Member
0 Likes
1,205

Hi Friends,

I've developed a noraml ALV grid report which have Date selection option as input selection parameter. In that , I want to declare last month date as defualt value to date-low range. Whenever the Tcode is entered, it should show the date ranges with my default values as date-low is last month date and date-high is current system date (this one I've given as sy-datlo).

Please help me how to declare last month date to my low range field.

thanks & regards

sankar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,003

hi,

Use FM 'DATE_GET_MONTH_LASTDAY' to get the Last day of the month for the give date.

Regards,

Srilatha.

10 REPLIES 10
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,003

There are so many function modules to get last date of month.

Or apply a simple logic get first date of current month and then subtract 1.

Search in SCN for the Query.

in initialization event pass dates to low high values of select-options and append it.

Read only

0 Likes
1,003

Hi Keshu T,

Thanks for your propmt reply.

I've done and tried all the logic with FM , append in the initialization process. I din't find any to my required output as it is not showing the date-low value when i execute my report but if i click the f4 help it's bringing my default value into the screen. I think it should be done thru SE51 process but Im not sure.So y I need help and posted here after I searched so many threads in SCN query.

Pls advise.

regards

Sankar.

Read only

Former Member
0 Likes
1,004

hi,

Use FM 'DATE_GET_MONTH_LASTDAY' to get the Last day of the month for the give date.

Regards,

Srilatha.

Read only

0 Likes
1,003

Hi Sirlatha,

thanks for your reply.

I know the FM or how to get the current date value...my question is how to declare it to date-low range field as default value and it should be shown when i execute my report or after the enter the tcode.

Hope Im clear in reply.

Please advise.

Sankar.

Read only

0 Likes
1,003

select-options:so_dat for sy-datum.

parameters:pa_dat type datum.

initilization.

so_dat-low = sy-datum.

so_dat-high = sy-datum.

append so_dat.

pa_dat = sy-datum.

Try it before this thread gets Locked

Read only

0 Likes
1,003

Hi Keshu.T,

Im sure I used your code in SAP ECC 6.0 se38 editor.But your logic is not worked out as I was sure before and tried earlier with all possible ways.

Could u please try the same from your end and reply me whether you find the low date range value was shown or not???

Again I'm confirming that I want to display the low-date value(either sy-datum or last month whatever it may be) range with input as a default value from my report when executing.

I don't want how to get or append dates to my so-date selection table.

Please adivse.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,003

Hello Sankar,

I think Keshu went a lil'bit off track

initilization.

so_dat-sign = 'I'. "Sign
so_dat-option = 'EQ'. "option
so_dat-low = sy-datum.
so_dat-high = sy-datum.
append so_dat.

Now you can see the data in the Select-Option by default.

BR,

Suhas

Read only

0 Likes
1,003

Hi Suhas,

i think so there is no need to specify the sign and options.


SELECT-OPTIONS:so_dat for sy-datum.

INITIALIZATION.
so_dat-low = sy-datum.
so_dat-high = sy-datum.
append so_dat.

START-OF-SELECTION.

BREAK-POINT.

it assigns BT by default.

Sankar:Please provide your code

Read only

0 Likes
1,003

Hi Keshu.T,

I admit my mistake, u did correct and in my actual report(done by another developer) it was given ' ' as defualt value to low-date range in declaration (that was a include program) and so why I didn't get my answer after I tried several possible ways. I didn't check the report correctly and replied you as error in your code. U replied me prefectly.

Thanks to you and regret inconvenience caused by me.

Hope u forgive.

thanks to all.

Regards

sankar.

Read only

0 Likes
1,003

Warning: If you use fm DATE_GET_MONTH_LASTDAY make sure note 1063114 is implemented. Without it, the fm does not calculate correct 'last date of the month' value for December. Even if the note is from year 2007 we are facing the error still in ECC 6.0 system with EHP3 having fresh installation. I personally just found this problem today as per observation by my colleague.

I think I'll open a new thread about this error in fm DATE_GET_MONTH_LASTDAY so that developers can suggest alternatives even if it is not that difficult to write your own fm for the same purpose.

br Kimmo