cancel
Showing results for 
Search instead for 
Did you mean: 

Routine in BI.7

Former Member
0 Kudos

Hi Experts,

Iam new to ABAP and alrady have update rule code in 3.x and same code i need in transformation field routine . can any one tell me detail steps the ame same code in bi.7

PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line  *-*
* TABLES: ...
 DATA:  mon(2) type n,
        year(4) type n,
        ymon like sy-datum.
*$*$ end of global - insert your declaration only before this line   *-*


FORM compute_data_field
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
  USING    COMM_STRUCTURE LIKE /BIC/CSZIS_OUTSTANDING_AGING
           RECORD_NO LIKE SY-TABIX
           RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING RESULT LIKE /BIC/AZOAR_MM00-CALDAY
           RETURNCODE LIKE SY-SUBRC "Do not use!
           ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line        *-*
* fill the internal table "MONITOR", to make monitor entries
ymon = COMM_STRUCTURE-/BIC/ZPUR_DATE.
* result value of the routine
  RESULT = ymon.
* if abort is not equal zero, the update process will be canceled
  ABORT = 0.

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

Regards

Rk

Accepted Solutions (1)

Accepted Solutions (1)

shanthi_bhaskar
Active Contributor
0 Kudos

map the field(s) from source to target

DATA: mon(2) type n,

year(4) type n,

ymon like sy-datum.

ymon = Source-fields-/BIC/ZPUR_DATE.

result = ymon.

Former Member
0 Kudos

Hi bhaskar ,

Thank you vey much for your fast reply.

i tried your code it showing some syntax error.

here in 3.x data source zpur_date (infoobject) mapped to the badat and after that the code has been written in the update rule.

As per your reply i mapped 0calday to BADAT and zpur_date also mapped to BADAT i written the code in 0calday i got this error .Can you please let me know further solution

E:The field "SOURCE-FIELDS" is unknown, but there is a field with

similar name "SOURCE_FIELDS". "SOURCE_FIELDS".

Regards

Rk

shanthi_bhaskar
Active Contributor
0 Kudos

yes use SOURCE_FIELDS instead source-fields and also please provide ur code in update routine

Former Member
0 Kudos

hi ,

the update routine code

PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line  *-*
* TABLES: ...
 DATA:  mon(2) type n,
        year(4) type n,
        ymon like sy-datum.
*$*$ end of global - insert your declaration only before this line   *-*


FORM compute_data_field
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
  USING    COMM_STRUCTURE LIKE /BIC/CSZIS_OUTSTANDING_AGING
           RECORD_NO LIKE SY-TABIX
           RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING RESULT LIKE /BIC/AZOAR_MM00-CALDAY
           RETURNCODE LIKE SY-SUBRC "Do not use!
           ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line        *-*
* fill the internal table "MONITOR", to make monitor entries
ymon = COMM_STRUCTURE-/BIC/ZPUR_DATE.
* result value of the routine
  RESULT = ymon.
* if abort is not equal zero, the update process will be canceled
  ABORT = 0.

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

i tried what ever suggested still syntax error showing

E:The data object "SOURCE_FIELDS" does not have a component called

"/BIC/ZPUR_DATE".

Regards

Rk

former_member181964
Active Contributor
0 Kudos

Hi,

In BI & we have Source Fields and Targets Fields concept in Routines. You always need to maintain equal fields in both places, if you want to write any routine.

You can see the following coding blocks , if you click on Start Routine in Transformations, here I just given some example code, so in that both blocks you need to maintain the correct/equal Fields/InfoObejcts, you need to add manually if you get any error.

TYPES:
      BEGIN OF _ty_s_SC_1,
  *      InfoObject: 0CUSTOMER Customer number.
        CUSTOMER           TYPE /BI0/OICUSTOMER,
   *      InfoObject: 0CPR_PARROL Partner Function.
        CPR_PARROL           TYPE /BI0/OICPR_PARROL,
  *      InfoObject: 0WORKCENTER Work Center/Resource.
        WORKCENTER           TYPE /BI0/OIWORKCENTER,
   *      Field: RECORD.
        RECORD           TYPE RSARECORD,
    END   OF _ty_s_SC_1.

*$*$ end of rule type
    TYPES:
      BEGIN OF _ty_s_tg_1_full,
*      Field: SID Master data ID.
        sid           TYPE rssid,
*      Field: DATAPAKID Data packet number.
        datapakid           TYPE rsdatapid,
*      Field: RECORD Data record number.
        record           TYPE rsarecord,
*      InfoObject: 0BILL_NUM Billing document.
        bill_num           TYPE /bi0/oibill_num,

*      InfoObject: 0KNVAL Condition Value.
        knval           TYPE /bi0/oiknval,
*      Field: RECORD.
        record           TYPE rsarecord,
      END   OF _ty_s_sc_1__rule_67.

Thanks

Reddy

Former Member
0 Kudos

Hi,

Can you please tell me how to do that in my sceanario.

Regards

Rk

former_member181964
Active Contributor
0 Kudos

Hi,

Click in Routine in Transforamtions in Change mod eand then add /BIC/ZPUR_DATE using + button i.e on Target InfoObejct you have routine so click on that routine and then add /BIC/ZPUR_DATE Infojbect by using F4 help and then enter into code window you can find that field in SOURCE_FIELDS so now try with your code.

RESULT =  SOURCE_FIELDS-/BIC/ZPUR_DATE

As per your field you adjust the routine.

Thanks

Reddy

Former Member
0 Kudos

Hi,

thank you very much for your reply .

iam new this project here i have one enhancement required for ods .

3.x

here in transfer rules zpur_date assigned to badat from data source to ods.

in ods update rule routine has been written the code has been mentioed .insteaad of witting abap code why dont we assign brdat to 0calday in transfer rules.some loading problem in 3.x i designed in BI.7

BI.7

shall i map the badat to 0calday .Here Can you explain me what is the necessary writing routine according to the above code in 3.x

Regards

Rk

Edited by: rama krishan on Apr 14, 2010 12:18 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Right click on update rules ---> Additional Functions ---> Create Transformation. Then the rules are converted to transformations and then activate.

Hope this helps,

Regards,

Rama Murthy