cancel
Showing results for 
Search instead for 
Did you mean: 

how to debug for Eixt Class CL_RSPLS_CR_EXIT_BASE

Former Member
0 Kudos

Hello,

I have created a input ready query and I have a requirement where we can use based on the characteristic of Organisation and Country to derive the Material group.

For example:

Country Organsiation Material group

16 4518 =====> 164518

I know I can use classes in SE24.

I am assuming I should use CL_RSPLS_CR_EXIT_BASE for my requirement.

I have defined a characterisitc relationship with Organisation and Country as source characteristic and Material group as target and chose Characteristic Combinations Based On : Exit class and Exit Class: CL_RSPLS_CR_EXIT_BASE

In IF_RSPLS_CR_METHODS~DERIVE :

FIELD-SYMBOLS: <l_chavl> TYPE ANY.

data: l_pur_org type /BI0/oid_pur_org,

l_country type /bi0/oid_country.

ASSIGN COMPONENT 'D_PUR_ORG' OF STRUCTURE c_s_chas

TO <l_chavl>.

l_pur_org = <l_chavl>.

ASSIGN COMPONENT 'D_COUNTRY' OF STRUCTURE c_s_chas

TO <l_chavl>.

l_country = <l_chavl>.

*

CLEAR <l_chavl>.

CONCATENATE '10' l_pur_org l_country INTO <l_chavl>.

ASSIGN COMPONENT 'D_MTLGROUP' OF STRUCTURE c_s_chas

TO <l_chavl>.

For the above function I get Organisation and Country from input schedule and it should derive Material group and save it into the cube.

Is code wrong? It can not debug when i execute the query.

ps. I have tried to create break-point, and external break-point. But it does not work.

Thanks for your suggestion.

Edited by: gang qin on Jan 11, 2010 9:12 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.

First you should create your OWN class based on CL_RSPLS_CR_EXIT_BASE via se24.

Second redefine 3 methods: CHECK and CREATE without any code and DERIVE with your code.

As I understand your material group should be: '10' (constant) + pur_org + country cancateneted.

If Im right plz try the next code (plz note the code is not checked and debigged. If you will set breakpoint in method derive in your own class you can debug it).

You can change this code in section with comments "**** Your derivation algorithm here"

METHOD if_rspls_cr_methods~derive.

        • infrastructure needed by the buffer:

DATA: l_s_mesg TYPE if_rspls_cr_types=>tn_s_mesg,

l_is_valid TYPE rs_bool.

FIELD-SYMBOLS: <l_th_buf> TYPE HASHED TABLE,

<l_s_buf> TYPE ANY.

CLEAR e_t_mesg.

        • use the buffer?

        • o_use_buffer is switched on by default in the constructor

IF o_use_buffer = rs_c_true.

  • yes:

ASSIGN o_r_th_buf->* TO <l_th_buf>.

ASSIGN o_r_s_buf->* TO <l_s_buf>.

<l_s_buf> = c_s_chas.

READ TABLE <l_th_buf> INTO <l_s_buf> FROM <l_s_buf>.

IF sy-subrc = 0.

IF o_r_is_valid->* = rs_c_true.

c_s_chas = <l_s_buf>.

RETURN.

ELSE.

IF e_t_mesg IS SUPPLIED.

APPEND o_r_s_mesg->* TO e_t_mesg.

ENDIF.

RAISE EXCEPTION TYPE cx_rspls_failed

EXPORTING

msgid = o_r_s_mesg->msgid

msgty = o_r_s_mesg->msgty

msgno = o_r_s_mesg->msgno

msgv1 = o_r_s_mesg->msgv1

msgv2 = o_r_s_mesg->msgv2

msgv3 = o_r_s_mesg->msgv3

msgv4 = o_r_s_mesg->msgv4.

ENDIF.

ENDIF.

ENDIF.

        • Your derivation algorithm here:

FIELD-SYMBOLS: <zpur_org> TYPE ANY.

FIELD-SYMBOLS: <zcountry> TYPE ANY.

FIELD-SYMBOLS: <zmat_grp> TYPE ANY.

ASSIGN COMPONENT '/BI0/d_pur_org' OF STRUCTURE <l_s_buf> TO <zpur_org>.

ASSIGN COMPONENT '/BI0/d_country' OF STRUCTURE <l_s_buf> TO <zcountry>.

ASSIGN COMPONENT '/BI0/'D_MTLGROUP' OF STRUCTURE <l_s_buf> TO <zmat_grp>.

CONCATENATE '10' <zpur_org> <zcountry> INTO <zmat_grp>.

l_is_valid = 'X'.

        • End of your derivation algorithm:

  • update the buffer with the result:

  • l_s_mesg should contain a message in the 'invalid' case

  • l_is_valid should indicate whether derivation was possible

  • <l_s_buf> should contain the derived fields

IF o_use_buffer = rs_c_true.

o_r_is_valid->* = l_is_valid.

IF o_r_is_valid->* = rs_c_true.

INSERT <l_s_buf> INTO TABLE <l_th_buf>.

c_s_chas = <l_s_buf>.

ELSE.

IF e_t_mesg IS SUPPLIED.

o_r_s_mesg->* = l_s_mesg.

APPEND l_s_mesg TO e_t_mesg.

ENDIF.

INSERT <l_s_buf> INTO TABLE <l_th_buf>.

RAISE EXCEPTION TYPE cx_rspls_failed

EXPORTING

msgid = l_s_mesg-msgid

msgty = l_s_mesg-msgty

msgno = l_s_mesg-msgno

msgv1 = l_s_mesg-msgv1

msgv2 = l_s_mesg-msgv2

msgv3 = l_s_mesg-msgv3

msgv4 = l_s_mesg-msgv4.

ENDIF.

ENDIF.

ENDMETHOD.

Answers (1)

Answers (1)

Former Member
0 Kudos

My code posted not formatted.

You can find this code formatted [here|https://www.box.net/shared/g7qqkydarn].

Former Member
0 Kudos

Hi,

Im having the same situation also. Its not the matter of coding. I have redefine the derive and the create method and hardcode break-point statement in those 2 methods. Ive created characteristics relationship with derivation based on exit class in the planning model, created aggeragation level, filter, planning function fox and created planning sequence which will process the planning function fox also. Then I created a variant for the planning sequence, and run it in SE38 program RSPLS_PLSEQ_EXECUTE. But it dont stop at those break-points. Am I missing anything?

Thanks!

Former Member
0 Kudos

Hi.

Your actions are right.

What your char rel supposed to do ? When you want it will be processed ?

Did you try to enter NEW line (lets say in WAD or modeler) and check whether it stops in debugger ?

Which break point you have ? Did you tried to set external breakpoint ? Did you tried to set BREAK-POINT ID Z_YOUR_BP_CREATED_IN_SAAB_TRANS_CODE ?

Regards.

Former Member
0 Kudos

HMmmm... I put BREAK-POINT statement in the method CREATE, DERIVE and CHECK.

Currently my query is input enable already, meaning when I view the query, the keyfigure field can be input something.

So, by right it should checks my characteristic relationship.

I want the Characteristic relationship to be executed when I view the query which starts in change query mode.

Currently it hit the break-point in the method CHECK only when I run the query but of course I cant modify anything in the method since it doesnt have CHANGING parameter. When I press planning function button Generate Combination it hits the breakpoint in the CREATE method. But I dont know why none of my actions able to make the program to go into the DERIVE method.