cancel
Showing results for 
Search instead for 
Did you mean: 

Characteristic relationship - checking on #

cora_juste
Explorer
0 Kudos
621

Dear gurus,

I have been working since forever on this one very important function. To not lock specific combinations in my planning adso when these combinations exist with value = 0 in the locking adso. (combination of 6 info objects)

Now AMDP does not work yet for check input readiness.

My ABAP check-methods is way too slow though. It drives my crazy. The query is not fast anyway since we need 365 day in the rows.

Two problems:

Partner can be empty sometimes (not assinged, #) in both ADSOs. I have issues with that. The characteristic combination seems to ignore those combinations. So implemented a when statement and two characteristic relationships (one with, one without partner using the same exit). Using both relationships is so slow. Do you have an idea for me.

Here my generic coding which jsut worked fine before I included the partner company.

cheers, Cora

assign component '/BIC/ZTVERSION' of structure i_s_chas to field-symbol(<data_ztversion>).

assign component 'COMP_CODE' of structure i_s_chas to field-symbol(<data_comp_code>).

assign component 'CALMONTH' of structure i_s_chas to field-symbol(<data_calmonth>).

assign component '/BIC/ZTLQPOSIT' of structure i_s_chas to field-symbol(<data_ztlqposit>).

assign component '/BIC/ZTURSART' of structure i_s_chas to field-symbol(<data_ztursart>).

assign component 'PCOMPANY' of structure i_s_chas to field-symbol(<data_pcompany>).



  select * from /bic/azlocks2 into table @data(my_locked) where amount ne 0.
sort my_locked by /bic/ztversion comp_code calmonth /bic/ztlqposit /bic/ztursart pcompany.

read table my_locked with key
/bic/ztversion = <data_ztversion>
comp_code = <data_comp_code>
calmonth = <data_calmonth>
/bic/ztlqposit = <data_ztlqposit>
/bic/ztursart = <data_ztursart>
pcompany = <data_pcompany>
assigning field-symbol(<locked>).
if sy-subrc = 0.
e_is_valid = rs_c_false.
else.
e_is_valid = rs_c_true.
endif.

endmethod.

Accepted Solutions (0)

Answers (1)

Answers (1)

gregor_dieckmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Cora,

a combination is called automatically valid if one of the components contains the initial value. As the name indicates, such combinations are not checked. But you can change this if you set the 'EXCL #' flag in your relation in transaction RSPLAN, in the BW Modeling Tools the flag is called 'Also apply to automatically valid combinations'.

The concept is explained in the documentation and also here in this forum, cf.

https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/4c/b82d6b54182102e10000000a42189e/content.htm?no_c...

Your exit is slow because the exit is called record based and you do a 'full' select on the your check table /bic/azlocks2 in these calls; as you read everything for amount <> 0 you can do this already in the CONSTRUCTOR of your exit class and buffer the result e.g. in a hashed table with the keys you use to access the my_locked table (which is a standard table by now). Sorting is also not needed. Then in method CHECK you just need to do the 'read table ... with table key ...'.

Remarks:

1 Characteristic relationship calls can be buffered by the system, in an exit implementation you can set the attribute N_USE_EXTERNAL_BUFFER to 'X' to use this, cf. note 1067433.

2. Maybe you don't even need an exit implementation: as zlocks2 seems to be an a(DSO) you may delete all records with amount = 0 and use this (a)DSO in a characteristic relationship of type DSO.

Regards,

Gregor