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

Fnmodule

Former Member
0 Likes
868

What is the function module name which can take country code as input and delivers date format according to the given input(coutry code)?

ex : for EU---- dd/mm/yyyy

for FE----- mm/dd/yyyy

7 REPLIES 7
Read only

Former Member
0 Likes
823

Hi,

This information is held in table T005X, field DATFM. Take a look at the domain for this field to see the meaning of each value.

Regards,

Nick

Read only

0 Likes
823

Please tell me how to use that output values?

Read only

0 Likes
823

Hi,

After you've read the table to determine the country's format you'll need a case statement based on the format number. In here you then reformat your date statement, either moving in elements of the date from one field to another or using WRITE ... USING EDIT MASK.

Regards,

Nick

Read only

Former Member
0 Likes
823

Hi,

You want C14N_COUNTRY_DATE_DECF_GET

which returns a value 1 - 6, with meanings as follows.

1 DD.MM.YYYY

2 MM/DD/YYYY

3 MM-DD-YYYY

4 YYYY.MM.DD

5 YYYY/MM/DD

6 YYYY-MM-DD

John

Read only

0 Likes
823

Please help me that how to work with that Output values?

it is urgent in my project?

Read only

Former Member
0 Likes
823

Hi,

Use the below code.

data: v_datfm like USR01-DATFM,

v_text like DD07V-DDTEXT,

v_value like DD07V-DOMVALUE_L.

CALL FUNCTION 'C14N_COUNTRY_DATE_DECF_GET'

EXPORTING

I_COUNTRY = 'IN'

IMPORTING

E_DATE_FORM = v_datfm

EXCEPTIONS

COUNTRY_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.

move v_datfm to v_value.

CALL FUNCTION 'C_DIC_DOMAIN_VALUE_TEXT_READ'

EXPORTING

NAME = 'XUDATFM'

SPRAS = SY-LANGU

VALUE = v_value

IMPORTING

TEXT = v_TEXT

EXCEPTIONS

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.

write:/ v_text.

Read only

Former Member
0 Likes
823

Hi,

Use the below code.

parameters: p_land like T005X-LAND.

data: v_datfm like USR01-DATFM,

v_text like DD07V-DDTEXT,

v_value like DD07V-DOMVALUE_L.

CALL FUNCTION 'C14N_COUNTRY_DATE_DECF_GET'

EXPORTING

I_COUNTRY = p_land

IMPORTING

E_DATE_FORM = v_datfm

EXCEPTIONS

COUNTRY_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.

move v_datfm to v_value.

CALL FUNCTION 'C_DIC_DOMAIN_VALUE_TEXT_READ'

EXPORTING

NAME = 'XUDATFM'

SPRAS = SY-LANGU

VALUE = v_value

IMPORTING

TEXT = v_TEXT

EXCEPTIONS

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.

write:/ v_text.