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: 

month name & year

Former Member
0 Kudos

Hi,

I need to give month name & year as input for the client.I want to know how to give search help for these.

selection-screen:begin of block b1 with frame title text-001.

parameters:p_mon type char10.

parameters:p_year type char4.

selection-screen:end of block b1.

thanks in advance.

8 REPLIES 8

Former Member
0 Kudos

hi,

for p_mon

use

MONTH_NAMES_GET

naveen_inuganti2
Active Contributor
0 Kudos

Hi..,

You can create search help for this parameters in the AT SELECTION ON VALUE REQUEST event.

In that for month..,

Create one internal table with 15 cahr field.

and populate all month names into that table with append statement.

And then use F4IF_INT... Function module...

And for Year..

Let me know if there is any range?

Thanks,

Naveen.I

Former Member
0 Kudos

Hi Hosmath,

The same topic has been discussed in this thread. Check the code:

Regards,

Chandra Sekhar

Former Member
0 Kudos

Hi,

search for similar fields in tables like LFAI which gives name1

MKPF which gives year in field mjahr.

Try this

SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_name LIKE LFA1-NAME1OBLIGATORY,

P_YEAR LIKE MKPF-MJAHR OBLIGATORY,

P_DATE LIKE SY-DATUM.

SELECTION-SCREEN END OF BLOCK BLOCK1 .

0 Kudos

hi,

following code going for dump.....any soln pls

selection-screen:begin of block b1 with frame title text-001.

parameters : p_month type char10."LIKE isellist-month.

parameters:p_year type char4 obligatory.

selection-screen:end of block b1.

data:begin of itab occurs 0,

ltx like t247-ltx,

end of itab.

select * from t247 into corresponding fields of TABLE itab where spras = 'EN'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_month.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = p_month

  • PVALKEY = ' '

DYNPPROG = sy-repid

  • DYNPNR = ' '

DYNPROFIELD = p_month

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = itab[]

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

0 Kudos

Hi...

P_MONTH should be in quotes... while passing into function module..

Check this sample code..,

data: ltx like t247-ltx.
data:begin of itab occurs 0,
ltx like t247-ltx,
end of itab.

selection-screen:begin of block b1 with frame title text-001.
parameters : p_month like ltx.
parameters:p_year type char4 obligatory.
selection-screen:end of block b1.

at selection-screen on value-request for p_month.
select * from t247 into corresponding fields of table itab where spras = 'EN'.
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
  exporting
  retfield = 'P_MONTH'
  dynpprog = sy-cprog
  dynpnr = sy-dynnr
  dynprofield = 'P_MONTH'
  value_org = 'S'
  display = 'F'
  tables
  value_tab = itab.

Thanks,

Naveen.I

0 Kudos

Hi Hosmath,

I guess the following will be very easy to use.It will have automatic search help for month

PARAMETERS : p_month TYPE ALMONTH.

Cheers,

Kothand

0 Kudos

HI KOTHAND,

IS THERE ANY SEARCH HELP FOR YEAR LIKE THIS....PLS HELP