Hi, I am BW consultant with little experience in ABAP coding.
I am creating a routine in Update Rules which reads the information that has
been loaded into InfoCube. For a set of fields, the programs try to reach
another table in order to get a set of registry that matches with the set
of fields. Each register of these sets of the fields has a specific value
For these sets of registry, it needs to be summarized.
I created the routine, but although I have 5 registers that matches with
set of the fields, one register is being skipped. I don't know what is
in my routine.
If you can help me I will be glad...
SELECT /BIC/ZSDLS_QTY FROM /BIC/FZSS_THRU INTO L_STOCKQTY WHERE KEY_ZSS_THRU1 = L_DIMCOMPCODE AND KEY_ZSS_THRU2 = L_DIMPAYER AND KEY_ZSS_THRU4 = L_DIMMATERIAL AND KEY_ZSS_THRUT = L_DIMCALDAY. L_ACUMULA = L_ACUMULA + L_STOCKQTY. ENDSELECT. IF SY-SUBRC = 0. RESULT = L_STOCKQTY * 28 / L_TOTAL_NW4. ENDIF.
I really don't know what is wrong here.
Without seeing your data, it is not so easy to help. But here are some
tips. First of all, rather than perform the addition yourself, let the
database server do the work:
SELECT SUM( /BIC/ZSDLS_QTY ) INTO L_ACUMULA FROM /BIC/FZSS_THRU WHERE KEY_ZSS_THRU1 = L_DIMCOMPCODE AND KEY_ZSS_THRU2 = L_DIMPAYER AND KEY_ZSS_THRU4 = L_DIMMATERIAL AND KEY_ZSS_THRUT = L_DIMCALDAY.
Using debugger, find out the value of L_DIMCOMPCODE,L_DIMPAYER etc., at the point of selection. The use SE16 on table /BIC/FZSS_THRU, using these values, and see what you get back. The problem is most likely to be on your selection not matching exactly.
This was first published in October 2002