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

extracting date from table, format problems

Former Member
0 Likes
686

Hi

I am working on scm side, where i need to get the creation date of material from table /sapapo/matkey .

The problem is the field has a time stamp .

intially i was using fm : CONVERSION_EXIT_TSTLC_OUTPUT

to get the date , but the problem is this fm is not correct , as it depends upon the user date format , and gets date from display

of the table rather than the server . This is giving me an error

as the date format can be different everytime , it can be yyyymmdd or yyyyddmm.

Which is the way of firstly getting creation date from the time stamp , and in the format stored by databse.

5 REPLIES 5
Read only

Former Member
0 Likes
637

Hi,

Use the Write statement. Write statement allways take the User Profile format.

Please let me know if you are not clear.

Regards,

Raja

Read only

Former Member
0 Likes
637

Hi,

try these 2 FMs

CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL

Cheers,

Will.

Read only

Former Member
0 Likes
637

Hi,

You can make use of the functions

LTRM_TIMESTAMP_CONVERT_FROM.

Reward if helpful.

Read only

Former Member
0 Likes
637

Hi thanks for ur replies.

My exact requirement is , that i need to pass the to a bapi which takes the date in the format : yyyymmdd.

So finally whatever be the user date format , i should use the time stamp and get the date , in one standard format always.

It can either be yyyymmdd or YYYYddmm , so that i can set the input for bapi accordingly.

Read only

0 Likes
637

HI abaper


ZDD = ZTEMP+3(2). 
ZMMM = ZTEMP+0(3). 
ZYYYY = ZTEMP+5(4). 

concatenate as you like : zyyyy zmm zdd into final_date.