cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp as BigInteger

Former Member
0 Kudos

Hi,

I am developing a webdynpro app which uses a standard RFM (CRMXIF_ORDER_SAVE) as the model.

I have generated the proxy classes for the deepnested RFM and I am able to call the RFM successfully.

One of the import atrribute for the input structure is a table DATES, which has a column has CRMT_DATE_TIMESTAMP_FROM as the datatype element.

From webdynpro, the timestamp can be only set as the bigdecimal.

I tried creating new BigDecimal("yyyymmddhhmmss") but this doesn't work. Can anyone suggest, what is the right format to create the BigDecimal.

Thanks for your time.

Regards,

Munish

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

There is a typo in the subject. I meant BigDecimal.

Thanks

Former Member
0 Kudos

Hi,

Get the date object and get the long value and initialize the BigDecimal.

Just try the below lines of code

Date dt = new Date("01-Jan-2005");

BigDecimal bd = new BigDecimal(dt.getTime());

Hope this helps.

Regards,

Santhosh.C

Former Member
0 Kudos

Santhosh,

Thanks for your reply.

That is the first thing I did, getting th millisecs from zero epoch. That didn't work. Then I read somewhere in the forum someone tried this format "yyyymmddhhmmss" and that is what I tried and that didn't work either.

Thanks

Former Member
0 Kudos

Hi M_S

Probably this could be usefull for you:

Instead of just returning / assigning the same value you may convert it back 'n' force between timestamp and BigDecimal.

VS

Former Member
0 Kudos

Valery,

Thanks for your reply.

I am saving some 50 attributes and for some of them I map a different value attribute to the model attribute and do these data conversions. Meaning, I do follow the methodology you proposed.

My problem is with the timstamp. I have given the code snippent below. However I do datacoversion at the view level, finally the controller has to populate the model node (timestamp) as bigdecimal. And what is the format it should be.

That is where i am having a problem.

Thanks for your time.

Crmxif_Order_Save_Input input = new Crmxif_Order_Save_Input();
wdContext.nodeCrmxif_Order_Save_Input().bind(input);
Crmxif_Bustrans data = new Crmxif_Bustrans();
input.addData(data);

Crmxif_Appointment_Xt dates = new Crmxif_Appointment_Xt();
Crmxif_Appointment dates_data = new Crmxif_Appointment();
dates_data.setAppt_Type("PRODDATE");
dates_data.setTimestamp_From(new BigDecimal("20050101000000"));

dates.addData(dates_data); 

Former Member
0 Kudos

Hi M.S

What is the domain of your data element? How do you enter test data in SAP GUI? Will be you able to do a Date to this "data type" conversion in ABAP ?

If so try writing a wrapper Remote function module with a modified structure but this time use DATS datatype and try doing the converion in ABAP

Regards

Pran

Former Member
0 Kudos

Hey Guys,

Same code once with a model reimport worked. For the time and help I am awarding points for those who helped.

Thanks,

MS