cancel
Showing results for 
Search instead for 
Did you mean: 

Date problem

Former Member
0 Kudos

Hi

I am using smartforms for contract order , here simple thing is not working in one of the secondary window we have &IS_EKKO-BEDAT& if I try to change the format by using set date mask its not working but if just print the above variable its printing.

I am getting confused here!! how to change this format for e.g I want this field to print in Month/Day/Year[like December/12/2008].

please do guide me.

Thanks

Sudharshan

Accepted Solutions (1)

Accepted Solutions (1)

former_member181995
Active Contributor
0 Kudos

For Ex Todays date How you suppose to print?

December/15/2008?

or

12/15/2008?

And how it is printing right now?

Former Member
0 Kudos

I need this to print as December 15 2008 even I tried to use FM to do this but didnt get ...

former_member181995
Active Contributor
0 Kudos

Use Subroutine pools and Do code like this:

Zreport.
data:date TYPE sy-datum VALUE '20081215',
      month TYPE char2,
      name type char20,
      out type char20,
      T247 TYPE STANDARD TABLE OF T247 WITH HEADER LINE.
month = date+4(2).
CALL FUNCTION 'MONTH_NAMES_GET'
 EXPORTING
   LANGUAGE                    = SY-LANGU
* IMPORTING
*   RETURN_CODE                 =
  TABLES
    month_names                 = T247.

LOOP AT T247 where MNR = month.
name = T247-LTX.
ENDLOOP.
CONCATENATE name date+6(2) date+0(4) INTO out SEPARATED BY space.
WRITE out.

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Everyone!!

Former Member
0 Kudos

Hi,

try to use the following code.

call function 'DATE_TO_PERIOD_CONVERT'

exporting

i_date = is_bedat

i_monmit = 00

i_periv = 'K1'

importing

e_buper = p_month

e_gjahr = p_year

exceptions

input_false = 1

t009_notfound = 2

t009b_notfound = 3

others = 4.

call function 'MONTH_NAMES_GET'

exporting

language = sy-langu

  • importing

  • return_code =

tables

month_names = i_months

exceptions

month_names_not_found = 1

others = 2.

loop at i_months where mnr = p_month.

move i_months-ktx to month_s.

endloop.

concatenate month_s '/' ls_bedat0(2) '/' ls_bedat4(4) into ls_string separated by space.

now pass this variable to ur smartforms.

Hope this will help to solve ur issue.

Regards

Srimanta

Former Member
0 Kudos

Declare one variable v_ date of type string.

date is in variable v_invd

it_date contains values of months jan to dec

v_month = v_invd+4(2).

read table it_date with key mnr = v_month.

concatenate it_date-ktx v_invd6(2) v_invd0(4) into v_date separated by space.

Former Member
0 Kudos

Hi

Try FM CONVERSION_EXIT_LDATE_OUTPUT and set the date format as per the requirement

Import parameters Value

INPUT 20081012

Export parameters Value

OUTPUT 12. October 2008

Regards

Shiva