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

Date format in smartform

Former Member
0 Likes
2,578

Hi All,

I am currently working on smartform development. In my smartform,the month in date format should be display as  character,  date and year should be in number format..for example , 06.05.2013 should be display as  May 06,2013. How can I acheive this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,509

Hi Ganesh,

Try this too,

DATA: v_output(11),

      v_fin(11).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

   EXPORTING

     input         = '20130506'

  IMPORTING

    OUTPUT        = v_output

           .

CONCATENATE v_output+4(3) v_output+0(2) ',' v_output+8(4) INTO v_fin.


Regards

Anoop

Hi All,

I am currently working on smartform development. In my smartform,the month in date format should be display as  character,  date and year should be in number format..for example , 06.05.2013 should be display as  May 06,2013. How can I acheive this?

10 REPLIES 10
Read only

venuarun
Active Participant
0 Likes
2,509

Hi Ganesh,

You can use these function modules to get the month name

ISP_GET_MONTH_NAME

MONTH_NAMES_GET

or you can use this function module

DATA :  l_begda(60) TYPE c,

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

     EXPORTING

       input  = pn-begda

     IMPORTING

       output = l_begda.




you can pass it through your driver program to smartform .

Regards

Arun VS

Read only

former_member186413
Participant
0 Likes
2,509

I don't think there is super silver bullet which can achieve your goal. If I were you , I would create a specify function for it.

It's very simple.

Suppose, the import parameters is our 'DATE" type (name: d_in) and export parameters is string (name:output).

CASE d_in+2(2).

     WHEN '01'.

               output = 'Jan'.

     WHEN '02'.

               output = 'Feb'.

     .

     .

     WHNE '12'.

               output = 'Dec'.

ENDCASE.

CONCATENATE output d_in+0(2) ',' d_in+4(4) INTO output SEPARATED BY space.

Read only

0 Likes
2,509

I assume myself, that my knowledge is very narrow right now, this is what I'm going to do.

Read only

former_member202818
Active Contributor
0 Likes
2,509

HI Ganesh,

DATA :  l_date(11) TYPE c,

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

     EXPORTING

       input  = sy-datum

     IMPORTING

       output = l_date.


concatenate l_date+2(3) space l_date(2) ',' l_date+5(4) into l_date.

Read only

VenkatRamesh_V
Active Contributor
0 Likes
2,509

Hi Ganesh,

Hope it help full.

Pass the month to t247 table to get the corresponding long text and short text of month Description.

Eg:

SELECT SINGLE ktx FROM  t247 INTO t247-ktx WHERE spras EQ sy-langu AND MNR = lv_date+04(02).
     CONCATENATE lv_date+06(02) t247-ktx lv_date(04) INTO  lv_sysdat SEPARATED BY '-'.

Regards,

Venkat.

Read only

Former Member
0 Likes
2,509
Read only

Former Member
0 Likes
2,510

Hi Ganesh,

Try this too,

DATA: v_output(11),

      v_fin(11).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

   EXPORTING

     input         = '20130506'

  IMPORTING

    OUTPUT        = v_output

           .

CONCATENATE v_output+4(3) v_output+0(2) ',' v_output+8(4) INTO v_fin.


Regards

Anoop

Read only

Former Member
0 Likes
2,509

Hi Ganesh,

Currently in your code, how the date is being dispalyed? I mean to say in which format?

Thanks & Regards,

Swati

Read only

former_member1716
Active Contributor
0 Likes
2,509

The exit CONVERSION_EXIT_LDATE_OUTPUT should help you in achieving the requirement.

Regards,

Satish

Read only

Former Member
0 Likes
2,509

Hi Ganesh,

Use FM : CONVERSION_EXIT_LDATE_OUTPUT

Regards,

Pankaj