on 11-18-2005 12:19 PM
Hello BW gurus
i m creating a cube same str of 0sd_c03.for this i have 7 datsources.2lis_11_vahdr
, 2lis_11_vaitm,
2lis_11_v_itm
,2lis_12_vcitm,
2lis_12_vchdr,
2lis_13_vdhdr,
2lis_13_vditm.
There is one field in cube" gross weight in Kilogram" but in the datasource field its only "gross weight" not in kilograms.
when i m applying update rules for this key fig its saying "source currency and target currency gross weight must b same".and update rules are not activating.
can anybody tell me how can i solve this problem.
Hi Tarun,
In my system many KFs in that cube are mapped with a routine!
For example, the following is a routine in 2LIS_11_VAITM update rule:
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: IN TYPE F,
OUT TYPE F,
DENOM TYPE F,
NUMER TYPE F.
Def. of 'credit-documents': following doc.categ. are 'credit docs'
return order (H)
credit memo (K)
Credit-documents are delivered with negative sign. Sign is switched
to positive to provide positive key-figures in the cube.
*
The combination of characteristics DE_CRED and DOC-CLASS provides
a comfortable way to distinguisch e.g. positive incoming orders or
order returns.
Def. der 'Soll-Dokumente': folgende Belegtypen sind 'Soll-Belege'
Retoure (H)
Gutschriftsanforderung (K)
Soll-Dokumente werden mit negativem Vorzeichen geliefert. Um die Kenn-
zahlen positiv in den Cube zu schreiben, wird das Vorzeich. gedreht
Die Kombination der Merkmale DEB_CRED und DOC-CLASS gibt Ihnen die
Möglichkeit schnell z.B. zwischen Auftrags-Eingang oder Retouren zu
unterscheiden.
DATA: DEB_CRED(2) TYPE C VALUE 'HK'.
DATA: QUOT(1) TYPE C VALUE 'B'.
constants: c_msgty_e value 'E'.
$$ end of global - insert your declaration only before this line -
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BI0/_2CS2LIS_11_VAITM
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BI0/V0SD_C03T-GR_WT_KG
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
$$ begin of routine - insert your code only below this line -
CLEAR RESULT.
DATA: WEIGHT LIKE COMM_STRUCTURE-GROSS_WGT.
IF COMM_STRUCTURE-UNIT_OF_WT NE 'KG'.
WEIGHT = COMM_STRUCTURE-GROSS_WGT.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = COMM_STRUCTURE-GROSS_WGT
UNIT_IN = COMM_STRUCTURE-UNIT_OF_WT
UNIT_OUT = 'KG'
IMPORTING
OUTPUT = WEIGHT
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
DIVISION_BY_ZERO = 2
INPUT_INVALID = 3
OUTPUT_INVALID = 4
OVERFLOW = 5
TYPE_INVALID = 6
UNITS_MISSING = 7
UNIT_IN_NOT_FOUND = 8
UNIT_OUT_NOT_FOUND = 9
OTHERS = 10.
IF SY-SUBRC NE 0.
CLEAR MONITOR.
MONITOR-msgno = '009'.
MONITOR-msgid = 'SDBW'.
MONITOR-msgty = c_msgty_e.
MONITOR-msgv1 = COMM_STRUCTURE-UNIT_OF_WT.
append MONITOR.
RETURNCODE = 4.
WEIGHT = 0.
ELSE.
RESULT = WEIGHT.
RETURNCODE = 0.
ENDIF.
ELSE.
RESULT = COMM_STRUCTURE-GROSS_WGT.
RETURNCODE = 0.
ENDIF.
IF COMM_STRUCTURE-DOC_CATEG CA DEB_CRED.
RESULT = RESULT * ( -1 ).
ENDIF.
$$ end of routine - insert your code only before this line -
*
ENDFORM.[/code]
To get all URs properly you'd better activate business content.
Best regards,
Eugene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check of the fields are correctly mapped in tranfer rule.
Regards,
Rohini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.