Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Programcoding for adding new rules in transformation in BI

Former Member
0 Likes
455

Hallo,

I am searching for a class or coding where i can add a new rule in a transformation in a new created transformation.

Can anybody help me.

My Coding see below:

* Create new Transformation by using
  TRY.
      CALL METHOD cl_rstran_trfn=>factory
        EXPORTING
          i_tranid       = d_tranid
          i_s_source     = l_s_source
          i_s_target     = l_s_target
          i_expert       = rs_c_false
          i_new          = rs_c_true
          i_with_message = rs_c_false
        RECEIVING
          r_r_tran       = o_r_tran_tlogo.

    CATCH cx_rstran_not_found.
      ASSERT 1 = 0.
    CATCH cx_rstran_input_invalid.
      ASSERT 1 = 0.
  ENDTRY.


* Save of transformation
  try.
      call method o_r_tran_tlogo->if_rso_tlogo_maintain~save
        EXPORTING
          I_WITH_CTO = rs_c_true
        IMPORTING
          e_subrc    = l_subrc.
    CATCH cx_rs_error_with_message .
      RAISE EXCEPTION TYPE cx_rsks_cancelled.
  endtry.
  IF l_subrc <> 0.
    RAISE EXCEPTION TYPE cx_rsks_cancelled.
  ENDIF.

  • Then i want to to Add Rules to the new transformation

I've tried to solve the problem by using the

class: CL_RSTRAN_TRFN

and Method : ADD_RULE

Then i used the method save

But it doesn't work

Greetings

meno

Edited by: Matt on Apr 3, 2009 1:42 PM

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
414

Try using class CL_RSTRAN_TRFN_RULE to create the rule, then use CL_RSTRAN_TRFN->add_rule( ).

matt

Read only

Former Member
0 Likes
414

Thank you Matt for your advise.

I have problems to create the coding for these steps.

There are two classes. How can i combine these both.

Maybe you can give me an example.

Greetings

meno