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

how to transfer routine from BW 3.5 to 7.0 for 0AGE_RANGE?

we can see infoobject 0AGE_RANGE in update rule 0HR_PY_1 of cube 0PY_C02 using BW 3.5 methode, has the following routine. Now I want to create one new cube ZPY_C02 using BW7.0, the question is where and how to write routine for 0AGE_RANGE, pls info. Many thanks!

PROGRAM UPDATE_ROUTINE.

$$ begin of global - insert your declaration only below this line -

  • The update routines for infocube PY_C02 are the same

  • as of infocube PA_C01

  • TABLES: ...

  • DATA: ...

*constants: prg_upd_rules like sy-repid value 'RS_BCT_HR_UPDATE_RULES'.

data: employee_md like /bi0/memployee,

employee_wa like /bi0/memployee,

person_md like /bi0/mperson,

PERSON_WA LIKE /BI0/MPERSON.

DATA: G_RECORD_NO LIKE SY-TABIX.

INCLUDE RS_BCT_HR_UPDATE_RULES_GENERAL.

INCLUDE RS_BCT_HR_PAPA_UPDATE_RULES.

$$ end of global - insert your declaration only before this line -

FORM compute_key_field

TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring

USING COMM_STRUCTURE LIKE /BIC/CS0HR_PY_1

RECORD_NO LIKE SY-TABIX

RECORD_ALL LIKE SY-TABIX

SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

CHANGING RESULT LIKE /BI0/V0PY_C02T-AGE_RANGE

RETURNCODE LIKE SY-SUBRC

ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update

*

$$ begin of routine - insert your code only below this line -

DATA: ULTIMO LIKE SY-DATUM,

AGE TYPE I.

IF G_RECORD_NO <> RECORD_NO.

G_RECORD_NO = RECORD_NO.

CLEAR: EMPLOYEE_MD, PERSON_MD.

CLEAR: EMPLOYEE_WA, PERSON_WA.

ENDIF.

PERFORM CALCULATE_ULTIMO

using COMM_STRUCTURE-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

CHANGING ULTIMO

RETURNCODE.

PERFORM READ_MD_PERSON

using COMM_STRUCTURE-employee

COMM_STRUCTURE-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

CHANGING EMPLOYEE_WA

PERSON_WA

RETURNCODE.

EMPLOYEE_MD = EMPLOYEE_WA.

PERSON_MD = PERSON_WA.

IF NOT PERSON_MD-DATEBIRTH IS INITIAL.

AGE = ULTIMO0(4) - PERSON_MD-DATEBIRTH0(4).

IF ULTIMO4(4) LT PERSON_MD-DATEBIRTH4(4).

AGE = AGE - 1.

ENDIF.

IF AGE LT 20.

RESULT = 1.

ELSEIF AGE LT 30.

RESULT = 2.

ELSEIF AGE LT 40.

RESULT = 3.

ELSEIF AGE LT 50.

RESULT = 4.

ELSEIF AGE LT 60.

RESULT = 5.

ELSEIF AGE LT 70.

RESULT = 6.

ELSE.

RESULT = 7.

ENDIF.

ELSE.

CLEAR RESULT.

ENDIF.

RETURNCODE = 0.

$$ end of routine - insert your code only before this line -

*

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jun 05, 2008 at 01:43 PM

    Hi,

    You should write it in the transformation, when you assign your source to the infoobject, in rule type you select Routine.

    The code should be very similar to the one you posted.

    Hope this helps,

    Regards,

    Diego

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 05, 2008 at 01:46 PM

    1) should I assign which source to the infoobject 0AGE_RANGE?

    2) How to do the next step? Please give info step by step?

    Thanks!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 05, 2008 at 03:16 PM

    Hi, BW expert

    no body can give a guide to handle this case step by step?

    Add a comment
    10|10000 characters needed characters exceeded

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.