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.
Dig deeper on SAP ABAP
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header.continue reading
An SAP user needs information on how to change the password on several SAP user accounts from a central location.continue reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.