Skip to Content
author's profile photo Former Member
Former Member

Modify code to pull the time dependent master data

I fully under stand the suggestion below for the requirement to add the time dependent attribute comp code

thanks fo rthe help but please tell me if there is a way i can modify the abap code and make the user enter the value for the date on which he want to pull th emaster data for company code or keydate to and from and pull the master data, so how will i proceede should i create the variable on 0doc_date and how to modify the code. please help . i have opened another question with same desc as above to assign points

thanks

soniya

The literal within <..> is supposed to be replaced by the actual field name (as I didn't know the fields). In this case, I am changing your code for costcenter/company-code.

data : wa like /bi0/qcostcenter.

select single * from /bi0/qcostcenter into wa

where costcenter = comm_structure-costcenter

and objvers = 'A'

and datefrom le comm_structure-<keydatefield>

and dateto ge comm_structure-<keydatefield>.

if sy-subrc = 0.

result = wa-comp_code.

endif.

abort = 0.

You can use this code for update rule of company_code. You have to replace '<keydatefield>' with a field name that contains the date on which the company is to be derived. If there is a date in your comm_structure (eg aedat) which you can use, you can specify that field in place of this literal (instead of comm_structure-<keydatefld> use comm_structure-aedat). If you have no such field, and you wish to use current date for getting the company code from time-dependent master data, you can use sy-datum (ie replace comm_strucutre-<keydatefld> with sy-datum).

And it should work.

The 'master data attribute' option is one of the options when you create update rule (one of the radio button options).

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2006 at 08:50 PM

    I am not very sure of your question here.

    are you looking for - User to freely assign the date based on which company_code is to be derived at the time of update rule execution?

    If so, what purpose would it serve? Can you describe the context of such a requirement?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      That the code is doing anyway.

      If your txn data in the cube doesn't have a date, how does it know it is Feb data, or, it is March data?

      If it has a date or month field, you should modify and use this code to update the company based on that date instead of system date.

      Other than that minor variation, it is already doing what you look for.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.