cancel
Showing results for 
Search instead for 
Did you mean: 

Populate Time Characteristic

Former Member
0 Kudos

Experts,

I have the date in this format - 2007M01D12 in my flat file. I have to populate this to both 0Calday (YYYYMMDD) and 0Calmonth (YYYYMM) in my DSO. I am using BI 3.x. Where and How do I make these necessary changes? Please explain in detail.

Thanks,

Pooja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pooja,

You can go with update routine which retrieves only YYYYMMDD for 0Calday (YYYYMMDD) and YYYYMM for 0Calmonth (YYYYMM).

In the update routine, write the following code.

For 0Calday:

RESULT = COMM_STRUCTURE-/BI0/CALDAY0(4)5(2)+8(2).

(take first 4, 6, 7 and 9, 10th characters of the field and push it into the result)

For 0Calmonth:

RESULT = COMM_STRUCTURE-/BI0/CALMONTH0(4)5(2).

Regards,

KK.

Former Member
0 Kudos

Can I use this code in BI 3.x? I am not using BI 7.0. Once again, I have two date fields, posted day and execution day. Both are in the format 2007M01D12 as mentioned earlier. My client wants 0calday as well as 0calmonth for both posted day and execution day in the DSO. Now the important question is, what should I include in my infosoure? Should I include only posted day and execution day fields or even 0calday and 0calmonth. Where should I map posted day to 0calday and 0calmonth; and execution day to zcalday (reference 0calday) and zcalmonth (reference 0calmonth)? Also under data field in DSO what are the time chars that I should be dragging.

Former Member
0 Kudos

You can use this code in BW 3.5.

Map required fields with respect to flat file fields in your transfer structure.

Go for the routine specified. It may help you. In the routine, mention the correct field name in XXXXX of COMM_STRUCTURE-/BI0/XXXXXX...

Former Member
0 Kudos

Where and how do I input this update routine code?

Former Member
0 Kudos

hi,

use the code in the start routine and store thevalues in the internal table and pass the values in the update routines for each object.

hope if you have the date and month format for all date and month fields as u mentioned, then you can use the star routine to get the required format and update routine to pass the values to the objects.

Ramesh

Former Member
0 Kudos

Pooja,

For the calday use just the calday routine. For the calmonth, first implement the calday conversion logic from yyyyMmmDdd to yyyymmdd and then continue the code with log for calmonth and assign it to calmonth.

example

for CALDAY

data: wa1 type /BIC/OICALDAY.

wa1 = comm_structure-calday.

replace 'M' with '' into wa1.

replace 'D' with '' into wa1.

condense wa1 no-gaps.

RESULT = wa1

For calmonth

wa1 = comm_structure-calday.

replace 'M' with '' into wa1.

replace 'D' with '' into wa1.

condense wa1 no-gaps.

Result = wa1(6).

Hope this helps

Thanks

Yashu Raj

Answers (3)

Answers (3)

Former Member
0 Kudos

Can anyone go through this chain and help me on my last question.

Former Member
0 Kudos

The code given was for 3.5 Only. You can use this code. You will be including both 0calday and 0calmonth in infosource and map it to the respective date fields. In ths ODS, you should include 0Calmonth and Zcalmonth.

Thanks..

Shambhu

Former Member
0 Kudos

If I include 0calday, 0calmonth, zcalday and zcalmonth in the infosource, then where will I be including the infoobject fields posted day and execution day? After this can you also let me know where exactly should I input the update routine codes.

Former Member
0 Kudos

Even I came acroos the same problem once. What I did was to change the Format in the Flat file itself. It depend s on the number of records also...if you have very less no. of record, make changes in the flat file itself. Otherwise, go for Routine.

Thanks..

Shambhu