cancel
Showing results for 
Search instead for 
Did you mean: 

Last posting date in Bex

Former Member
0 Kudos
278

Hi all,

Below is my requirement,

there is a posting date in the cube, and while running in Bex we have to apply a logic to set the version (like actual,plan),

1. If key date (user variable ) <= latest posting date available for actual then set version = actual

2. If key date (user variable ) >  latest posting date available for actual then set version = actual and plan

Here the challenge is how to find out the latest posting date, I think this can be done via create a new info object based on virtual characteristic and derive logic to find the latest date,  but not sure how it affects while drill down to any characteristics. Any suggessions please?

thanks

Jose

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182470
Active Contributor
0 Kudos

Hi Jijo,

Check my hints:--

1) Create a new text Infoobject called "Version" of length 1. Maintain two records in it like below:--

    Key   Short Description

    A       Maintain "Actual"

    P       Maintain "Actual & Plan"

2) Make this infoobject as Nav Attr to "Posting date"

3) Create a Virtual KF and write a BADI code with the required logic. Your code should read the User entry variable and compare with latest Posting date. You have to SORT Posting Date in Descending.

Sample Code:--


SORT IT_VBRK  BY ERDAT DECENDING

read table it_vbark into wa_vbark index 1.   (" here we got recent date on first row )

latest_date = wa_vbark-erdat.

After that you can compare as per your mentioned logic and set version by considering text infoobject keys.

Regards,

Suman

Former Member
0 Kudos

Hi Suman,

thanks for your reply, I have 2 queries regard to your reply.

1. Is user variable accessible in BADI virtual key figure ?

2.Sorting of posting date - the posting date is a characteristics of the info cube. I am not getting how to get it as an internal table.

former_member182470
Active Contributor
0 Kudos

I am not really sure how to do it in code. You can think of How to achieve your requirement with my hints. Those are not only alternatives.

former_member199945
Active Contributor
0 Kudos

First need to Find latest Posting date :

This can be done either at transformation level/ bex query level

at query level you can refer below doc : posted by  AL

after getting this need to find difference b/w user entered date & Posting date :  this can be achived either using customer exit or formula variable.

using formula variable you can search in scn difference b/w 2 dates in Bex .

Former Member
0 Kudos

Our requirement is not to filter out the lastest posted date rather to get the last posted date and compare with the user entered date, according to that the value of the version variable to set.

former_member199945
Active Contributor
0 Kudos

Here the challenge is how to find out the latest posting date ?

1. If key date (user variable ) <= latest posting date available for actual then set version = actual

2. If key date (user variable ) >  latest posting date available for actual then set version = actual and plan

latest posting date mean ?

Actual & Actual & Plan are they created already / need to come at run time based on that logic ?

Former Member
0 Kudos

hi Seshu,


- latest posting date means the date in which last posting happened, for eg. if the user selects key date as 12/31/2013, and the last postings happend in 11/15/2013, the last posting date is taken as 11/15/2013.

-Yes the version should set on the fly according to the latest posting date and user entered date