cancel
Showing results for 
Search instead for 
Did you mean: 

Date Conversion problem!

Senthilprakash1
Participant
0 Kudos

Hi,

I have a MS SQL Database.

They are sending Date to XI. and I need to convert the Date sent by the sender and Give to Receiver in the Below Format :

SENDER -


> XI------> RECEIVER

2008-05-23 -


>XI-------> May2008

2007-04-19 -


>XI-------> April2007

SENDER DATA TYPE: datetime

How to achieve the Receiver format above specified?

How to achieve the above type of conversion in XI.

How to convert the Date sent by sender and Give the month and Year to the receiver in Above format mentioned.

Please Advice.

Regards,

Senthilprakash.

Edited by: senthilprakash selvaraj on Oct 10, 2008 8:19 AM

Edited by: senthilprakash selvaraj on Oct 10, 2008 8:20 AM

Accepted Solutions (1)

Accepted Solutions (1)

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

You can do it with the DateTrans standard function.

Specify the following in the pattern.

input pattern: yyyy-MM-dd

Target Date Pattern : MMMMyyyy

Thanks

SaNv...

Former Member
0 Kudos

"DateTrans" std fun will do it.

use this funtion between sender and receiver. Double click on it and enter required format.

Answers (6)

Answers (6)

santhosh_kumarv
Active Contributor
0 Kudos

Hi all~

I am suprised why to substring, concat and use fixedValue table to make this mapping complex if this can be achieved with the standard function DateTrans.

I would like to enlightem about the month in the DateTrans function.

Using

MM - is to represent in arithmentic format like 01,02,03 etc...

MMM - is to represent in string format with a limitation on 3 character like jan,feb,mar etc...

MMMM - is to represent in string format of the complete month name like January, February etc....

Thanks

SaNv...

Former Member
0 Kudos

Thanks for this gr8 info.

it will really help us... once gain thanks..

santhosh_kumarv
Active Contributor
0 Kudos

u r mst welcome Sarvesh....

This feature is not documented and may be that is the reason we are not aware of this...!

The [help.sap documentation |http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm]has the function description only as Converts date format I to another date format O.

Would be helpful if this feature is documented.

Thanks

SaNv..

Former Member
0 Kudos

Hi Senthil,

The DateTrans standard function will get you the required output.

Format of Source Date : yyyy-MM-dd

Target Format : MMMMyyyy or MMMMMyyyy

Thanks,

Swapna.

Former Member
0 Kudos

Hi,

It is easy, since as a output you wnat only MONTH & YEAR, so just use the sbustring, concat & fixedValue table to get your result.

First without doing any date trans just do substring of year & month separatly, now pass the month to fixedValue table (where you will declare all the month & it's corresponding values) to get the month in desired format.

Now finally concatenate month & year to get the final result.

Regards,

Sarvesh

Former Member
0 Kudos

Hi,

check the below thread..It will solve your issuse..

[https://forums.sdn.sap.com/click.jspa?searchID=17296719&messageID=6307657]

Regards,

Prakasu

former_member187563
Contributor
0 Kudos

hi,

first you take your input date and use date transform to get the month

input yyyy-dd-mm

output mm

then use fixed value to get the corresponding month.

Again use your input and date transform to get the year.

input yyyy-dd-mm

output yyyy

use concatenate function to combine them.

regards,

ujjwal kumar

ParvathyS_SAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Use DateTrans and fix value function

SENDER -


> XI------> RECEIVER

2008-05-23 -


>XI-------> May2008

2007-04-19 -


>XI-------> April2007

input length is 10

A be the input of format YYYY-MM-DD

B be the output of format MonthYYYY

Substring(0,3) = Year

Substring(4,5)= Month

The month value goes inside a FixValue function.

Then you concat both the substrings.