on 03-26-2015 7:30 PM
Hello Gurus,
A report is run on a monthly basis for Billing commissions. Info cube has all the data related to the Billing commission.
It has a custom field for total commissions for which the data gets populated from the DSO based on the Billing
document conditions. Look up has been done for the total commissions field. Most of them are showing up
the right values, but few billing documents are showing up the wrong values.
I made an attempt by reloading the effected Billing documents into Info cube, now the code works and
total commissions are showing up right values. I tried selective deletion and loaded the data for the whole month,
the billing documents again show up the wrong values. These billing documents show up the right values when
they are loaded individually.I tried checking if the code was wrong, but it was working when the effected ones
are loaded individually. Please let me know your suggestions on this. Thanks in advance
Hi Sri Harsha,
Please check billing document and item in "Semantic Groups" tab in DTP for and try load data for 1 Month.
Check the data now, if not work, please paste the code here for analysis.
Thank you,
Nanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the reply Nanda. Below is the code that is used for populating the field in info cube
using the look up to another DSO based on the billing document conditions, below is the code
z9sd_c07 is the info cube for billing commissions
z9sd_o23 --> billing document conditions
L_ZUARC like /BIC/AZ9SD_O2300-INV_QTY,
L_ZUART like /BIC/AZ9SD_O2300-KPRICE,
L_ZCGU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCTU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCNU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCQU like /BIC/AZ9SD_O2300-KNVAL,
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS8Z9SD_O24
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/VZ9SD_C07T-/BIC/ZPRTVALU
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal table "MONITOR", to make monitor entries
* result value of the routine
RESULT = L_ZCGU + L_ZCTU + L_ZCNU + L_ZCQU.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.
Nanda,
Please find the start routine below
Z9SD_O21 = Billing document header
L_ZUARC like /BIC/AZ9SD_O2300-INV_QTY,
L_ZUART like /BIC/AZ9SD_O2300-KPRICE,
L_ZCGU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCTU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCNU like /BIC/AZ9SD_O2300-KNVAL,
L_ZCQU like /BIC/AZ9SD_O2300-KNVAL,
FORM SELECT_POST_ST
USING COMM_BILL_NUM LIKE /BIC/AZ9SD_O2100-DOC_NUMBER.
* COMM_BILL_DATE LIKE /BIC/AZ9SD_O2100-BILL_DATE.
IF COMM_BILL_NUM <> /BIC/AZ9SD_O2100-DOC_NUMBER.
* OR COMM_BILL_DATE <> /BIC/AZ9SD_O2100-BILL_DATE.
CLEAR /BIC/AZ9SD_O2100.
SELECT SINGLE DOC_NUMBER /BIC/ZPOST_ST
INTO (/BIC/AZ9SD_O2100-DOC_NUMBER,
* /BIC/AZ9SD_O2100-BILL_DATE,
/BIC/AZ9SD_O2100-/BIC/ZPOST_ST )
FROM /BIC/AZ9SD_O2100 WHERE
DOC_NUMBER = COMM_BILL_NUM.
ENDIF.
ENDFORM. "SELECT_POST_ST
*$*$ end of global - insert your declaration only before this line *-*
* The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS8Z9SD_O24.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
* to make monitor entries
* if abort is not equal zero, the update process will be canceled
* DELETE DATA_PACKAGE WHERE STORNO = 'X'.
*
* DELETE DATA_PACKAGE WHERE /BIC/ZPSTAS = 'A'.
* CG: 07/02/07 Assign Summarization group for each partner function
* based on Master Data.
DATA: LV_LINES TYPE I.
DATA: LV_RETURN(1).
DESCRIBE TABLE DATA_PACKAGE LINES LV_LINES.
IF LV_LINES > 0.
CLEAR: LV_RETURN, SY-SUBRC.
CALL FUNCTION 'Z_FIND_SUM_GROUP_2'
IMPORTING
MY_RETURN = LV_RETURN
TABLES
IT_DATAPACKAGE = DATA_PACKAGE
EXCEPTIONS
GENERAL_ERROR = 1.
ENDIF.
ABORT = 0.
*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.
Nanda,
Please correct me if I understood your question wrong.
ZCGU ZCTU ZCNU ZCQU are the conditions types in the
DSO z9sd_o23. KNVAL is the condition value that populates in DSO z9sd_o23 along with condition types The look up has been done to populate KNVAL values as total commission at Info cube based on the above condition types.
Hi Harsha,
As I understand problem is not clearing old values before assigning.
you will get correct value when you execute with selection because at that time it will process only once so you will get correct value.
you will get wrong value when you execute with multiple selection(like for one month) because at that time it will process multiple times hence old values also adding and so clear before every new assignment.
Please debug your code and if your not comfortable with ABAP seek help from others.
Hints:
Before populating values for L_ZCGU + L_ZCTU + L_ZCNU + L_ZCQU first clear and then assign as like below.
Clear : L_ZCGU + L_ZCTU + L_ZCNU + L_ZCQU.
and assign.
and then use
RESULT = L_ZCGU + L_ZCTU + L_ZCNU + L_ZCQU.
Thank you,
Nanda
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.