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

Regarding date formatt

sreeramkumar_madisetty
Active Contributor
0 Likes
1,287

Hi

Can anyone give me sample code to fetch the date as:

YYYYMMDD.

Points are assured for correct answers.

Regards,

Sreeram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,212

Hi,

Try to use use this FM CONVERSION_EXIT_PDATE_INPUT to convert the date format.

Regards,

Ponraj.s.

11 REPLIES 11
Read only

Former Member
0 Likes
1,212

Hi,

IN SAP date is stored like that only. YYYYMMDD.

there is no need for you to fetch separately like that.

Any date field in SAP is stored in that format only.

for ex: select audat from vbak...where... then the data will be YYYY MM DD format only.

reward if useful

regards,

ANJI

Read only

Former Member
0 Likes
1,212

sorry i am not enough clear about your requirement if you are fetching the data from SAP tables then by default the setting is like this...

just you have to declare a variable like sy-datum.

if you want to fetch the data from another area then use fm conversion_exit_pdate_input.

after that also you cant achieve the target then let us know in which format you are getting the date and you have to change the format with character type variables and make some operations on that.

regards

shiba dutta

Read only

Former Member
0 Likes
1,212

from where ?

in any table of SAP data will be stored in the same format YYYYMMDD.

even date in Selection Options also , date of any variables or internal table in the same format.

Regards

Prabhu

Read only

Former Member
0 Likes
1,212

data: date type sy-datum ,

date1 type sy-datum.

date = sy-datum.

concatenate date4(4) date2(2) date+0(2) into date1.

write date1.

ravi

Read only

Former Member
0 Likes
1,212

If the original format is DD/MM/YYYY and you want to convert to YYYYMMDD, use FM CONVERSION_EXIT_PDATE_INPUT.

Read only

Former Member
0 Likes
1,212

Hi Sree ram,

Use function module CONVERT_DATE_TO_EXTERNAL. This will convert the date to the user specific format. So if your user specific format is mm/dd/yyyy, it wiil do.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
1,212

try this fn module

'CONVERSION_EXIT_IDATE_OUTPUT'

Kishi.

Read only

Former Member
0 Likes
1,212

hi sreeram,

there is one more option i dont reme the actual syntax u can use fome keywrod FORMAT do print

FORMAT date as YYYYMMDD

write date.

i am not sure abt the syntax just look for the keyword help i dont have an SAP sys to check out this.

ravi

Read only

Former Member
0 Likes
1,213

Hi,

Try to use use this FM CONVERSION_EXIT_PDATE_INPUT to convert the date format.

Regards,

Ponraj.s.

Read only

Former Member
0 Likes
1,212

Hi,

All dates related to SAP data is stored in tables in the format 'YYYYMMDD' only.Pls try with this FM also ' CONVERSION_EXIT_PDATE_INPUT '.

if helpful give reward

Regards

Vana

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,212

Hi

It's Answered.