cancel
Showing results for 
Search instead for 
Did you mean: 

Date Format Conversion from MM.DD.YYYY to YYYYMMDD

former_member188325
Active Contributor
0 Kudos

Hi All,

I am trying to load data from r/3, and i have date format as MM.DD.YYYY in source system.how can i convert this into YYYYMMDD format in transfer rules(I know that we have to write a routine in transfer rules).Could anybody help me out pl?..pl give me conversion routine for it.

Here BW Filed is 0DATE and R/3 Filed is ZZDATE.

regards

murali.

Message was edited by: Murali

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Go through this

SDATE Conversion Routine :

http://help.sap.com/saphelp_nw04/helpdata/en/07/d63a68db9110459d63c495b16f522e/content.htm

Regards

Siddhu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

What is the Domain or data type used in the defination of ZZDATE ? If is DATE(Domain) or DAT(data type), I donot think that we need to have some conversion at transfer rule.Sysstem automatically converts it. By the by are you getting any problem at the time of loading?

With rgds,

Anil Kumar Sharma .P

former_member188325
Active Contributor
0 Kudos

Thanks for u r reply anil.Yes i am getting error whileloading..Error message is "

26.09.2005 13:36:16 Value '20112004 ' of characteristic 0DATE is not plausible BRAIN 27 "

regards,

murali.

Former Member
0 Kudos

Hi,

What is the domain(or data type) used for the ZZDATE field.

And also I donot think that there is a standard FM or Formula or Program to convert the avialable format to reqired format. So here we should use routine.

With rgds,

Anil Kumar Sharma .P

former_member188325
Active Contributor
0 Kudos

Hi Anil,

I am sorry. I am getting error while activating the ODS data.not at the time of loading.

regards,

murali.

Former Member
0 Kudos

Hi,

Try to under stand what I am asking :

<b>What is the domain(or data type) used for the ZZDATE field.</b>

Ok ,

If some records are having proper format and others are having wrong format, even we canot correct this with routine also. So in this case you have to edit manually at PSA, then do upload.

You are right, when we are populating data to ODS , if there is any wrong format of value, it will not disply the error at the time of loading .It will through the error at the time of activation.

With rgds,

Anil Kumar Sharma .P

Former Member
0 Kudos

Hi sidhartha ,

Nice help .

Hi Murali,

Sorry , I am not aware of this routine.Now use it for the transfermation.

With rgds,

Anil Kumar Sharma .P

former_member188325
Active Contributor
0 Kudos

Hi Anil,

Thats what i was wondering...anyway thanks for u r time.

Sidhartha@ its mentioned that "Call up the test report RSSCA1T0 to be able to better visualize the functionality of this routine. This test report contains the complete date conversion with external as well as internal presentations." How to run this report..?

regards,

murali.

Former Member
0 Kudos

Murali,

Try this code.

DATA: ZT1 LIKE SY-DATUM,

S1(2) TYPE C,

S2(2) TYPE C,

S3(4) TYPE C.

SPLIT TRAN_STRUCTURE-/BIC/ZZDATE AT '.' INTO S1 S2 S3.

CONCATENATE S3 S1 S2 INTO ZT1.

RESULT = ZT1.

Message was edited by: ravi raj

Former Member
0 Kudos

Hi Ravi,

Nice Code.

But if the record has the proper format,It will unneccessarly chane to wrong format.

With rgds,

Anil Kumar Sharma .P

Former Member
0 Kudos

yes anil, aagree with u. but i thought all records coming from r/3 are of the same format mm.dd.yyyy and he wants that to be yyyymmdd.

former_member188325
Active Contributor
0 Kudos

Thanks a lote for u r code ravi.As of now i have all the r/3 records in mm.dd.yyyy format...but as anils said,how to handle if there are any correct records in future????

regards,

murali.

Former Member
0 Kudos

Murali,

Why donot define SDATE as the conversion routine for the infoobject , as sidhartha suggested.

With rgds,

Anil Kumar Sharma .P

Former Member
0 Kudos

guess u need to have a if statement which will check whether the field in transfer structure is of the correct format or not. if it is correct format, it should not enter the loop otherwise it should enter the loop and process our code.

but u need to check this each record.

former_member188325
Active Contributor
0 Kudos

Hi Anil & Ravi,

SDATE converts DD.MM.YYYY to YYYYMMDD as i understood.but i have date in the format MM.DD.YYYY

Does SDATE Work for it?

regards,

murali.

Former Member
0 Kudos

Hi,

If you are sure that for each and every record from R/3 holds the date format in MM.DD.YYYY, you can use the code as Ravi said. If the different records are having different format, then you will have only one option: Manually editing at PSA. But it is good to eliminate these type of format errors at R/3 itself,by not allowing users to enter unregular values.

With rgds,

Anil Kumar Sharma .P

former_member188325
Active Contributor
0 Kudos

yes anil.u r correct.Thanku all for u r time.

Assigned points to all useful answers.

regards

murali.

Message was edited by: Murali