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: 

Query in selection screen

Former Member
0 Kudos

In my requirement in the selection screen have to enter the company code,fiscal year and posting date.Posting date should be got based on the fiscal year.Have done coding to fetch the posting date.Now how to bring this posting date to the selection screen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Saranya,

You can do like this.

At selection-screen on field fiscal_year.
  
 * Get Posting date based on fiscal year entered on the screen.
    Move it to w_posting_date.

     set one flag variable. w_flag = 1.

At selectin-screen .
  if w_flag = 1.
    loop at screen.
      if screen-name = 'POSTING_DATE'.
        Posting_date = w_posting_date.     "Pass the value here.
        Modify screen.
      endif. 
    endloop.
  endif.

Regards,

Rajitha.

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

in the initialization statement pass that date to screen field.

Former Member
0 Kudos

Hi,

You can put your select query for posting date in INITIALIZATION event with target field posting date.

such that posting date field will have a default value when selection screen will be displayed.

One more way is that because you want posting date based on fiscal year, you can put your select query in AT SELECTION-SCREEN ON FIELD (<posting_date>)

Regards

Abhijeet

Former Member
0 Kudos

Hi,

Pass the value in the initialiaztion.

data:

w_date type d.

parameters:

p_date type d.

initialization.

select sinlgle date

from your table

into w_date.

if sy-subrc eq 0.

move w-date to p_date.

endif.

Now you can see the selected date on your selection screen.

Regards,

Rama.

Former Member
0 Kudos

Hi Saranya,

You can do like this.

At selection-screen on field fiscal_year.
  
 * Get Posting date based on fiscal year entered on the screen.
    Move it to w_posting_date.

     set one flag variable. w_flag = 1.

At selectin-screen .
  if w_flag = 1.
    loop at screen.
      if screen-name = 'POSTING_DATE'.
        Posting_date = w_posting_date.     "Pass the value here.
        Modify screen.
      endif. 
    endloop.
  endif.

Regards,

Rajitha.