cancel
Showing results for 
Search instead for 
Did you mean: 

converting the char into date format?

Former Member
0 Kudos

Hi!!! Guru's

i am using std DS of SD 2LIS_11_VAITM, in that the date fields are in the the char format, so i wann show the difference of the to dates in Days into the report, can any body put some light on this thread.

wil assign pts for sure

thanks in adv

mohan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mohan,

As you have maintained your dates as a Charecterstic it is not possible to subtract them any way.If you have maintained them as key figures you can subtract them.

Now do one thing.Go for virtual Keyfigure and use a variable of processing type Customer Exit and write a routine to calculate the result.

Hope this helps.

Regards

Karthik

Former Member
0 Kudos

HI!!! Karhik

I am using std cube of 0SD_C04(Delivery Service) in that the objects 0SHIPDATE (Goods arrival date), 0GIDATE(Goods issue date), 0LOADDATEK (Loading date), 0REQ_DATEK (Delivery date), 0ACT_GI_DTK (actual goods issue), 0DSDEL_DATK (Requested delivery date), 0MATAV_DATK (Material availability date) used as key figer of data type - DEC DEC - Counter or amount field with comma and sign.all these key figer are asign in the Tranfer Rule is DATE fields from Source System. the senario is to show the dates and differnce of the dates in the report.

so can u tell me the how to convert the these object in to the date field.

waiting for u r valueable reply

thanks

regards

Mohan

Former Member
0 Kudos

Hello,

I think u can achieve this at query level.

You can try variable with replacement path . In your scenario you will have to have 2 variables one for ex. 0SHIPDATE and another one for ex. 0GIDATE .

After that create formula ( Number of days ) of subtraction on this two variables .

Gimme ur mail-id , i will forward a doc on this if u want...

Regards,

SRIKANTH

Message was edited by:

KANTH SRI

Former Member
0 Kudos

Hi!!!! KANTH SRI

thanks for reply...

ya as u understand the senario is same, so i m not geting the date diff of 0ACT_GI_DATE (actual delivery date) and 0GIDATE (plan delivery date), these objects r maintined as CHAR- DATE Objects becose these r SAP deliver objects, can u send me any doc's about this, mail id is <i><u>mohangoudasp@yahoo.co.in</u></i>

thanks

regards

mohan

Former Member
0 Kudos

Hello Mohan,

I have sent the doc to ur id...please check it...

Regards,

SRIKANTH

Former Member
0 Kudos

Hi!!!! KANTH SRI

ya got u r mail but unfortunatly i m not able to download the doc wat u r sent , plz so can u send me once again to my another id <u><i>mohangouda@aol.in</i></u>

thanks

regards

mohan

Former Member
0 Kudos

Hi Mohan,

I think you can achieve this using a little bit of ABAP at transfer rule level or Update rule level. Declare two local variables, populate both with the values of the date and perform substraction. And the result will go to the new field's value.

Regards.

Former Member
0 Kudos

i have sent...

Former Member
0 Kudos

Dear KANTH SRI,

Thanks a lot,,,,, and u r great...

exactly wat u sent is wat i want, so thanks once again to help. and my problem was solved, and all who ever reply to this thread once again thanks.

thanks

regards

Mohan

Answers (4)

Answers (4)

andrea_previati
Contributor
0 Kudos

if you manage your date as KF it is possible to calculate the difference simply calculating them as formula in calculated key figures or with a simple routine in transformations of this type :

RESULT = SOURCE_FIELDS-/BIC/ZDATE1 -

SOURCE_FIELDS-/BIC/ZKNDATE2

Hope it helps

Former Member
0 Kudos

Hi mohan,

You can also use this Function module for the same.This is fine that previous.

FIMA_DAYS_AND_MONTHS_AND_YEARS

Regards

Karthik

Former Member
0 Kudos

Hi!!!! Karthik

thanks for reply...

ya gonn try u r suggesation FM n get back u, ok

thanks

regads

Mohan

Former Member
0 Kudos

Hi If your charecterstic is in date format use this fm to get difference of date in days

<b>HR_HK_DIFF_BT_2_DATES</b>

and for this pass output format = ' 02'

Note that Date1 > date2.

to substract.

Hope this helps

Regards

Karthik

Former Member
0 Kudos

while fetching the dat in BW, use time characteristic & then direct subraction can be performed on these in the report.

Former Member
0 Kudos

Dear Pallavi.

thanks for reply...

ya i am fatching data in bw using date char, if my question is, Is it possible to get the date difference in days like (date1-date2) in calculation field?

thanks

regards

mohan

Former Member
0 Kudos

Add one key fig as number for days in your data target.

Then you can subract these dates in the TR to get no. of days in this new KF.

Former Member
0 Kudos

Dear Pallavi

thanks for reply...

Plz can u explain me how can i subract these dates in the TR to get no. of days in this new KF about ABAP program, bcos i don't no ABAP pragram.

waiting for u r valueble words...

thanks

mohan

Former Member
0 Kudos

**declare two vars.

data: frm_date like sy-datum,

to_date like sy-datum.

frm_date = TRAN_STRUCTURE-<i>your date field</i>.

to_date = TRAN_STRUCTURE-<i>your date field</i>.

RESULT = frm_date - to_date.

I'm not very good at ABAP. If you get any error please let me know.