Skip to Content
author's profile photo Former Member
Former Member

date in smartforms

hello everybody,

i have a field order_date which is in a format for eg 27.08.2007 how can i change into

27 august 2007 in smartforms

plz advise ...very urgent

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 11:09 AM

    select single ltx from t247 where mnr = date+4(2). Declare date and ltx in global declaration.

    &date+6(2)& ltx & &date(4)& will do.

    for putting subfield use the pencil icon on text node. Hope it helps.

    Regards,

    Mallick

    Message was edited by:

    DEBOPRIYO MALLICK

    Message was edited by:

    DEBOPRIYO MALLICK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 11:11 AM

    Hi,

    I think no direct way for this in SAP.

    So u have to do it manually. Means,

    Put CASE

    ENDCASE

    like this,

    dt = ur date.

    day = dt+6(2).

    mon = dt+4(2).

    yr = dt+0(4).

    CASE mon.

    WHEN '01'.

    mon1 = 'JANUARY'.

    WHEN '02'.

    mon1 = 'FEBRUARY'.

    WHEN '03'.

    mon1 = 'MAR'CH.

    WHEN '04'.

    mon1 = 'APRIL'.

    WHEN '05'.

    mon1 = 'MAY'.

    WHEN '06'.

    mon1 = 'JUN'.

    WHEN '07'.

    mon1 = 'JULY'.

    WHEN '08'.

    mon1 = 'AUGUST'.

    WHEN '09'.

    .

    .

    .

    .

    .

    ENDCASE.

    concatenate day mon1 '-' yr into exp_date.

    Hope it will helpful to u.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 11:11 AM

    hi,

    you can handle this feature in ABAP code.

    1. Develope a code that can convert month number into text

    2. create a string that will contain day month year in char format

    3. This string you pass as date string

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 29, 2007 at 11:16 AM

    try:

    data zdate type sy-datum.

    data zmn(2) type c.

    data: zdate(2) type c,zyear(4) type c.

    zmn = order_date+4(2).

    zdate = order_date+6(2).

    zyear = order_date+0(4)

    case zmn.

    when '01'.

    zmonth = 'Jan'.

    when '02'.

    zmonth = 'Feb'.

    .

    .

    .

    when '12'.

    zmonth = 'Dec'.

    endcase.

    display zdate zmonth zyear on text element

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Both of the suggested code using table T247 should work, but they both need to be changed to specify a value for the field SPRAS (the language). I would suggest field CONTROL_PARAMETERS-LANGU so the language of the form is used.

      Regards,

      Nick

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 11:42 AM

    Hi .

    You can use this function MONTH_NAMES_GET

    CALL FUNCTION 'MONTH_NAMES_GET'

    • EXPORTING

    • LANGUAGE = SY-LANGU

    • IMPORTING

    • RETURN_CODE =

    TABLES

    month_names = it_month

    • EXCEPTIONS

    • MONTH_NAMES_NOT_FOUND = 1

    • OTHERS = 2

    .

    IF sy-subrc <> 0.

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

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

    ENDIF.

    loop at it_month where MNR = p_date+4(2).

    there is month name.

    endloop.

    Have fun.

    Sayan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.