cancel
Showing results for 
Search instead for 
Did you mean: 

CL_RSPLS_CR_EXIT_BASE how to use the create method

Former Member
0 Kudos

Hi everybody

I am using a copy of CL_RSPLS_CR_EXIT_BASE in the relationships derivation of our planning project. I do not understand how CL_RSPLS_CR_EXIT_BASE works.

Here is the problem:

I use the class to derivate 0COSTCENTER from 0CO_AREA and 0COORDER. In one planning function everything works fine. With the use of the relationships the class is called and in the DERIVATE Method I can select the responsible costcenter from the 0COORDER data with 0COORDER and 0CO_AREA.

But I also have a planning sequence which is also using the relationships but on step 7 (costcenter from co_area and coorder) it directely calls the DERIVATE method. But in the DERIVATE Method I do not have the source fields COORDER and CO_AREA as source data available....

How does this work? Where do I get the source data from? In the first case I have it all in the parameter c_s_chas.... but in the CREATE method I can't find the source data.

Thanks for any input.

Have a nice day

regeards

Christophe

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Christophe,

I'hm going to implement the CREATE method, but what is the structure of e_th_chas ?

Thanks in advance.

0 Kudos

Hi Christophe,

it seems that you are confusing the methods DERIVE and CREATE. The system only calls DERIVE if all source fields are filled. The CREATE method has to return all valid combinations for a given selection for all characteristics used in the exit relation. Please check also the documentation of the methods in SE24. If your relation is based on master data, create can ususually easily implemented by selecting the right data from the master data table.

Regards,

Gregor

Former Member
0 Kudos

Hi Gregor

thanks for your reply. I definitely am or was pretty confused about DERIVE and CREATE. Can you confirm the following so that I know if I got it now:

In CREATE i select data from the master table (for example COSTCENTER COORDER and CO_AREA if those are the characteristics I use in the exit relation (source = COORDER, target = COSTCENTER and CO_AREA). Those are also the lines I find in the selection criteria table i_tsx_seldr.

I fill all the selected combinations into the internal table e_th_chas (in the same order of fields like they are in i_tsx_seldr).

That's it and then the system gets the necessery data from this selection?

In this way I get a new error message in my planning sequence:

Nachwert-Einschränkung 1 zu Teilvorgang 1 bewirkt folgenden Fehler

Es konnte keine Kombination erzeugt werden

What am still doing wrong?

Thanks a lot!

best regards

christophe

0 Kudos

Hi Christophe,

the create method has to fill table e_th_chas with all admissible combinations for the given selection table i_tsx_seldr. Use the method seldr_to_range to convert i_tsx_seldr to a the format e_t_range which is similar to a standard ABAP range table.

The selection tables can be compared with the 'where' part of an SQL statement. So in general it is not ok to pick values from the selection table and to fill it to e_th_chas.

The create method does the something similar compared to a transaction data read, but it returns only the keys. To do this one needs a selection table and a rule to create the admissible records: In the exit case the 'create' implementation is this rule. All values in the created combinations have to be inclued in the selection (inclusion means set inclusion, i.e. as 'f in range' in ABAP).

It is not so simple to give easy examples for exit implementations since the most relevant cases are contained in the standard:

- relations based on master data attributes,

- relations based on hierarchies,

- relations based on DataStores.

One option for you would also be to maintain the admissible combinations in a DataStore, then an exit implementation is not necessary.

Best regards,

Gregor