cancel
Showing results for 
Search instead for 
Did you mean: 

Date and Time error

Former Member
0 Kudos

Hi

Can any one give me suggestions on urgent basis..we are failing the mapping issues since 48 hours..

My RFC is have Date and Time field which will concatenate and will be display following format in JDBC table in one column:

2006-02-09 00:00:00.000

I have concatenated date and time fields and trying to passing to JDBC, but its always failing the mapping, even time field is not populating in payload other than all fields populating the data..

While i'm execute the RFC using se37, time field showing data as format HH:MM:SS, but i dint understand why it not coming across to XI? If i'm able to see time field in payload ,then atleast i can understand the problem for map failing? am i right?

Note: without time field i'm able to insert the data into jDBC with date field,after requirement change ,we added time field in RFC and reimported and done mapping using concate..but its failing always..!

Now we are facing some other problem , after adding the time field in RFC .Some times my data is displying in some other columns ,its mismatching data into all fields..example : company code is displying some other columns in paylaod, like other fields..why it is happened? even map properly made!

Thanks in Adavance..

Regards.>Rambarki

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rambarki,

Pls do note the following.

1. When you execute teh RFC you might be getting the time as HH:MM:SS. But the in R/3 system this ':' symbol is coming depending on the user defaults.

2. If you need to populate the current date and time during mapping then pls do use the following

//To get current Date

public static String getDateValue(Map inputparam)

{

trace = (AbstractTrace) inputparam.get(

StreamTransformationConstants.MAPPING_TRACE);

Date currentDate = new Date();

SimpleDateFormat formatter

= new SimpleDateFormat ("yyyyMMdd");

String dateString = formatter.format(currentDate);

return dateString;

}

//To get Current Time

public static String getTimeValue(Map inputparam)

{

trace =

(AbstractTrace) inputparam.get(

StreamTransformationConstants.MAPPING_TRACE);

SimpleDateFormat formatter

= new SimpleDateFormat("HHmmss");

Date currentTime

= Calendar.getInstance().getTime();

String dateString1

= formatter.format(currentTime);

return dateString1;

}

In this methods above try changing the formats. This method we use in the mapping to provide the current date & time of the mapping.

3. For data getting in different order, try checking how you are taking each field for mapping.

Cheers

JK

PS: Award points if this helps you

Former Member
0 Kudos

Hi JK

thanks for quick help..let me know where do i copy this code into mapping editor? i just know graphical mapping only..

and my date is may or may not current date,,its should any one with time also..its coming from RFC table..!

regards..rambarki

Former Member
0 Kudos

Hi Rambarki,

is the date & time coming from SAP(thru RFC) in the form YYYYMMDD & HHMMSS...

If yes, in the mapping to the target field use the following...

Date -- substring(4,2)
                      
                       concat("/")
                      /           
Date -- Substring(6,2)             
                                    Concat("/")
                                   /           
             Date -- substring(0,4)                  
                                                 Concat(" ")  -- Output date time field
Time(separated by ":" the same way as date)     /

Thanks,

Renjith

Former Member
0 Kudos

Hi Rambarki,

to me that sounds like a problem with the RFC Cache. Has your XI system be restarted since the RFC structure changed? If not, than the RFC cache still contains the old structure although you imported the new one to the Repository. You can force a reload of the RFC cache by restarting service SAP XI Adapter: RFC in the visual admin toll or a restart of the J2EE Engine.

Regards

Christine

Former Member
0 Kudos

Yes ur right Christine,

RFC cache not refreshed my old values..after restart the J2ee engine its working fine..but mean time my SAP people had changed RFC date field.. now they combined DATE and TIME in one field and made had char type in RFC. so rfc now sending the datatime in field

: 2000-02-09 15:23:23

so accroding to that i need to change my JDBC sructure again..

thankk u..regards..rambarki

Answers (0)