Q

Field issues in Update Rules

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 x. For these sets of registry, it needs to be summarized. I created the routine, but although I have 5 registers that matches with the set of the fields, one register is being skipped. I don't know what is wrong in my routine. If you can help me I will be glad... The selection routine is:

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

Dig deeper on SAP ABAP

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close