cancel
Showing results for 
Search instead for 
Did you mean: 

Hierarchy Time Dependent ABAP code

Former Member
0 Kudos

Dear Experts,

I want to ask a custom BADI ABAP code to get the hierarchy of a dimension member where Time Dependent Hieararchy is implemented in that dimension.

Currently we are using Interface method IF_UJA_DIM_DATA->get_hier_of_mbr to get the hierarchy reference.

Sample Code:

DATA: o_test     TYPE REF TO if_uja_dim_data.

CALL METHOD o_test->get_hier_of_mbr

     EXPORTING

       i_member = lv_member

*      i_dateto = lv_datum

     RECEIVING

       ro_hier  = lo_hierarchy.

However after we implement the time dependent on the dimension, this method returns nothing unless we specified the i_dateto parameter to the method (which is optional).

While my requirement is to get the hierarchy of the member with the date when this logic is executed, putting SY-DATUM to this parameter does not give me the result that I need. I need to put the i_dateto as '99991231' so the hierarchy returned by this method is the latest hierarchy, but not the current date where this logic is executed.

Is there any way to make that the time hierarchy obtained is the one when the logic is executed? Or is there any other method that is feasible to meet with my requirements?

Thanks

Regards,

Siswono

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Siswono,

Have you tried to use the date from the TIME dimension for i_dateto?

Andy

Former Member
0 Kudos

Hi Andy,

Unfortunately the format of the dimension member and the parameter i_dateto is different.

i_dateto has the type UJ_DATE while dimension members has UJ_DIM_MEMBER type.

Regards,

Siswono

Former Member
0 Kudos

yes, but you can try convert the date into the UJ_DATE format.

Former Member
0 Kudos

Hi Andy,

I don't understand what do you mean by converting the date into the UJ_DATE format from TIME dimension member. As you know the format of TIME dimension is YYYY.MM, and the format of UJ_DATE is YYYYMMDD. How we can get the date if we can only get the month and year from the time dimension?

And also, I believe I have mentioned that when I put system parameter SY-DATUM which is the current date, the hierarchy does not return because the method itself only select from the enddate (i_dateto parameter) and not the range where the hierarchy exists.

Regards,

Siswono

Former Member
0 Kudos

Hi Siswono,

Ok, I see what you mean.

Then I would suggest that you determine the hierarchy end date first.

read the hierarchy table by determine its technical name, then find the hierarchy with your date that's between the start date and end date, then you can use the end date for the next step.

use get_hier_of_mbr with the determined end date.


Andy