Update Rule: DEC to NUMC (4) returning 0000
Hi SDN,
I have a DEC key figure in ods1 that I would like to load into a NUMC characteristic in ods2. The NUMC is set to a length of 4, and the DEC values from ODS are always 4 digits long.
I have created an update rule for the NUMC characteristic and set it to overwrite. I am using a routine to load this infoobject.
in my update rule i have:
RESULT = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
I am always getting 0000 returned as a result, even though there are DEC values (eg. 1234.000) in ZMYDECFIELD. I'm assuming that a type conversion is not working correctly.
I have also tried:
date: tempNumc TYPE n LENGTH 4.
*try conversion
tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
RESULT = tempNumc.
This also did not work. Does anyone have any suggestions?
Thanks!!
Hi..
Check your code:
date: tempNumc TYPE n LENGTH 4.
*try conversion
tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
RESULT = tempNumc.
Here the Variable TempNumc is of length 4.
While assigning the value of DEC field it is transferring from Right to Left. So it is only copying 0000.
You declare the Variable TempNumc with More LENGTH.
date: tempNumc TYPE n LENGTH 20.
*try conversion
tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
RESULT = tempNumc.
Try this... It should work for u.
Cheers.
Similar Messages
-
Return tables in Routines used in an Update Rule
I previously had a routine configured as an update method in an Update Rule. On the configuration screen where I specified the Routine name, I checked "Return Table".
Now I've deleted this Routine and I am using the Source Key Figure as the Update Method. However the "Return Table" box is still checked and if I uncheck it, it goes back to "Checked" status as soon as i scroll to the next key figure and then back to the original key figure.
While this doesnt sound like too serious a problem, I think it's causing my Update rules to fail during activation with the message, The field "RESULT" is unknown, but there is a fiel rows 1698." (SAP typo, not mine).
Following the suggestions in the Help for this error do not work either. When I try to choose Extras -> Display Activated Program, I receive a second message "Unable to find a tool to process the request".
Can anyone help?Wardell,
sounds like a bug to me. Open a message to SAP support to get a fix.
Regards,
Marc
SAP NetWeaver RIG -
hi all
i need to write a routine at the update rule level for currency type....
currency type has data of type 00,01,02 loaded to psa and then to infocube
i need only 00 data to be loaded into cube, so want to write a routine
can you please provide the coding for the same so that i can write at the update rule level for curr type field
RegardsPROGRAM CONVERSION_ROUTINE.
Type pools used by conversion program
TYPE-POOLS: RS, RSARC, RSARR, SBIWA, RSSM.
Declaration of transfer structure (selected fields only)
TYPES: BEGIN OF TRANSFER_STRUCTURE ,
InfoObject 0COMP_CODE: CHAR - 000004
HEADER_COMP_CO(000004) TYPE C,
InfoObject 0PLANT: CHAR - 000004
HEADER_PLANT(000004) TYPE C,
InfoObject 0MATERIAL: CHAR - 000018
HEADER_MATERIAL(000018) TYPE C,
InfoObject 0MATL_TYPE: CHAR - 000004
HEADER_MAT_TYPE(000004) TYPE C,
InfoObject 0MATL_GROUP: CHAR - 000009
HEADER_P_GROUP(000009) TYPE C,
InfoObject 0LOTSIZE_IT: QUAN - 000013
LOTSIZE(000007) TYPE P,
InfoObject 0UNIT: UNIT - 000003
LOTSIZE_QTY_UNIT(000003) TYPE C,
InfoObject 0FISCPER: NUMC - 000007
PERIODE(000007) TYPE N,
InfoObject 0FISCVARNT: CHAR - 000002
FISCAL_Y_VARIANT(000002) TYPE C,
InfoObject 0PCPITEMCAT: CHAR - 000001
ITEM_CATEGORY(000001) TYPE C,
InfoObject 0PCP_RES: CHAR - 000035
COST_ITEM(000035) TYPE C,
InfoObject 0COMPONENT: CHAR - 000018
MATERIAL(000018) TYPE C,
InfoObject 0VAL_CLASS: CHAR - 000004
VALUATION_CLASS(000004) TYPE C,
InfoObject 0PLANT_COMP: CHAR - 000004
PLANT(000004) TYPE C,
InfoObject 0SEND_CMPC: CHAR - 000004
COMPANY_CODE(000004) TYPE C,
InfoObject 0CO_AREA: CHAR - 000004
CONTROLLING_AREA(000004) TYPE C,
InfoObject 0COSTCENTER: CHAR - 000010
COST_CENTER(000010) TYPE C,
InfoObject 0ACTTYPE: CHAR - 000006
ACTIVITY_TYPE(000006) TYPE C,
InfoObject 0WORKCENTER: CHAR - 000008
WORK_CENTER(000008) TYPE C,
InfoObject 0VENDOR: CHAR - 000010
VENDOR(000010) TYPE C,
InfoObject 0INFO_REC: CHAR - 000010
INFO_RECORD(000010) TYPE C,
InfoObject 0ABCPROCESS: CHAR - 000012
PROCESS(000012) TYPE C,
InfoObject 0AMOUNT: CURR - 000015
VALUE(000008) TYPE P,
InfoObject 0AMOUNTFX: CURR - 000015
VALUE_FIXED(000008) TYPE P,
InfoObject 0AMOUNTVR: CURR - 000015
VALUE_VARIABLE(000008) TYPE P,
InfoObject 0OI_MENGE: QUAN - 000015
QUANTITY(000008) TYPE P,
InfoObject 0BASE_UOM: UNIT - 000003
QUANTITY_UNIT(000003) TYPE C,
InfoObject 0PRICEUNIT: DEC - 000005
PRICE_UNIT(000003) TYPE P,
InfoObject 0CURRENCY: CUKY - 000005
CURRENCY(000005) TYPE C,
InfoObject 0CURTYPE: CHAR - 000002
CURRENCY_TYPE(000002) TYPE C,
InfoObject 0COSTELMNT: CHAR - 000010
COST_ELEMENT(000010) TYPE C,
InfoObject 0COSTCOMP: NUMC - 000003
COST_COMPONENT(000003) TYPE N,
InfoObject 0CCOMPSTRUC: CHAR - 000002
COST_COMP_STR(000002) TYPE C,
InfoObject 0SCRAPQTY: QUAN - 000015
SCRAP_QTY(000008) TYPE P,
InfoObject 0COMP_SCRAP: QUAN - 000015
COMP_SCRAP_QTY(000008) TYPE P,
InfoObject 0COSTVAR: CHAR - 000004
COSTING_VARIANT(000004) TYPE C,
InfoObject 0COSTVERS: NUMC - 000002
COSTING_VERSION(000002) TYPE N,
END OF TRANSFER_STRUCTURE .
Global code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
FORM COMPUTE_CURTYPE
Compute value of InfoObject 0CURTYPE
in communication structure /BIC/CS0CO_PC_PCP_10
Technical properties:
field name = CURTYPE
data element = /BI0/OICURTYPE
data type = CHAR
length = 000002
decimals = 000000
ABAP type = C
ABAP length = 000002
reference field =
Parameters:
--> RECORD_NO Record number
--> TRAN_STRUCTURE Transfer structure
<-- RESULT Return value of InfoObject
<-> G_T_ERRORLOG Error log
<-- RETURNCODE Return code (to skip one record)
<-- ABORT Abort code (to skip whole data package)
FORM COMPUTE_CURTYPE
USING RECORD_NO LIKE SY-TABIX
TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
G_S_MINFO TYPE RSSM_S_MINFO
CHANGING RESULT TYPE /BI0/OICURTYPE
G_T_ERRORLOG TYPE rssm_t_errorlog_int
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
$$ begin of routine - insert your code only below this line -
DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
If <SOURCE_FIELDS>-CURTYPE NE '00'
Delete DATA_PACKAGE.
RESULT = .
returncode <> 0 means skip this record
RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
FORM INVERT_CURTYPE
Inversion of selection criteria for InfoObject 0CURTYPE
This subroutine needs to be implemented only for SAP RemoteCubes
(for better performance) and for the Report/Report Interface
(drill through).
--> I_RT_CHAVL_CS Ranges table for current InfoObject
--> I_THX_SELECTION_CS Selection criteria for all other InfoObjects
<-- C_T_SELECTION Selection criteria for fields of
transfer structure
<-- E_EXACT Flag: Inversion was exact
FORM INVERT_CURTYPE
USING I_RT_CHAVL_CS TYPE RSARC_RT_CHAVL
I_THX_SELECTION_CS TYPE RSARC_THX_SELCS
CHANGING C_T_SELECTION TYPE SBIWA_T_SELECT
E_EXACT TYPE RS_BOOL.
$$ begin of inverse routine - insert your code only below this line-
DATA:
L_S_SELECTION LIKE LINE OF C_T_SELECTION.
An empty selection means all values
CLEAR C_T_SELECTION.
L_S_SELECTION-FIELDNM = 'CURRENCY_TYPE'.
Selection of all values may be not exact
E_EXACT = RS_C_FALSE.
$$ end of inverse routine - insert your code only before this line -
ENDFORM. -
Problem: Exchange rate in Update rules with DELTA mode
Hi experts,
During the loading since the ODS13BIL towards the CUBE, I use in the update rule the function
"CONVERT_TO_LOCAL_CURRENCY" to convert a currency.
The loading mode is DELTA.
If I modify an invoice in the system source (R/3) for example: "change on" (0CH_ON), during the loading delta since the ODS towards the cube, the exchange rate is reversed (sign), which implies that the values of the ratios during the conversion with the function module " CONVERT_TO_LOCAL_CURRENCY" are false.
How could I resolve this problem?
Example:
1-First load:
R/3:
Key figure 1 :100
Exchange Rate :-1,2
Document currency :USD
Local currency :EUR
Change on :00.00.0000
ODS13BIL:
Key figure 1 :100
Exchange Rate :-1,2
Document currency :USD
Local currency :EUR
Change on :#
CUBE:
Key figure 1 :100/1,2
Currency :EUR
2-Seconde load:
R/3:
Key figure 1 :100
Exchange Rate :-1,2
Document currency :USD
Local currency :EUR
Change on :06/01/2006
ODS13BIL:
Key figure 1 :100
Exchange Rate :-1,2
Document currency :USD
Local currency :EUR
Change on :06/01/2006
CUBE:
Key figure 1 :100/1,2
Currency :EUR
and
Key figure 1 :-100*1,2 <-- False
Currency :EUR
Thank you for your precious help.Hello,
Thank you for your answer but that still not works: Give erroneous data is corrected but the data which are not erroneous become erroneous.
I think that if I manage to return the field "Exchange misses" (0EXCHG_RATE) nonmodifiable by the DELTA mode, I cross that will resolve the problem.
With what is used following fields in the definition of the ODS, and it is what impacts it on the existing data: "Non cumulative value" et "Cumulative value"
thanks a lot. -
Hi experts,
What are the types of update rules?
Regards,
SivaHi......
Yes either you can say what are the different update types.........that Praveen has already ansered..............or you can say.........
You can say what are the diffrent types of update routines...then the answer is :
1) Start Routine in Transfer Rules
2) Transfer Routine in Transfer Rules.
3)Start Routine in Update Rules
4)Update Routine in Update Rules.
The routines that you write in transfer rules are applicable to all the Data targets that get the data from that particular Infosource, when you are going to write some code in Transfer rules, you have to understand that you are going to manupilate the data that is going to get into BW .
If you are going to write in Update Rules , then that logic is going to apply only for that particular Data target .
Eg : Let suppose I have a Flat file that gets data from 3 countries, US, Canada and Mexico.
Now I have prepared the data source for the same . But I dont want to have the data of Mexico in to BW itself.
So I will write a Start routine at TR to eliminate the data of Mexico.
My Next step is I want the data of US into one ODS and Canada data in to another ODS.
For this I handle the dataflow at Start routine in Update rules, to eliminate Canada data for US ODS and Vice Versa.
start routine in transfer rules
Look up to load master data
excluding
Start Routine in Transfer Rules
Sample code in Update Rule to restrict data selection?
Append Datapak - transfer start routine
Excluding Blank field in Infopackage Filter
Trans Routine ABAP help ..
transfer routine
Date key figure: Convert DATS format to DEC format
Date Conversion in Flat File
Transfer Routine ABAP
conversion exit
Date Conversion
Problem with conversion char to numc in transference rules
conversion routine..?
update routine
How to call a function in Update Rules to reverse a key figure sign
Need Sample Code for Update Rules
Date calculation
Difference between data in PSA and Data in Infocube
No RETURNCODE <> 0 allowed in update routines in transfer mode
the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
Access master data in update rules
Date key figure: Convert DATS format to DEC format
start routine in update rules
Is it possible to read a third ODS in update rules between two ODS?
update rule coding while loading data from ODS to CUBE
Start Routine in Update Rules to populate additional fields from ODS
Coding in Update Rules accessing a Z-Table
Start routine
Regards,
Debjani........... -
Start routine and update rules
Hi,
What is accessed first:-
Start Routines or Update Rules?
What is the use of global variables in start routine?
Please reply.
Thanks.Hi......
You have different types of Routines in BW .
1) Start Routine in Transfer Rules
2) Transfer Routine in Transfer Rules.
3)Start Routine in Update Rules
4)Update Routine in Update Rules.
The routines that you write in transfer rules are applicable to all the Data targets that get the data from that particular Infosource, when you are going to write some code in Transfer rules, you have to understand that you are going to manupilate the data that is going to get into BW .
If you are going to write in Update Rules , then that logic is going to apply only for that particular Data target .
Eg : Let suppose I have a Flat file that gets data from 3 countries, US, Canada and Mexico.
Now I have prepared the data source for the same . But I dont want to have the data of Mexico in to BW itself.
So I will write a Start routine at TR to eliminate the data of Mexico.
My Next step is I want the data of US into one ODS and Canada data in to another ODS.
For this I handle the dataflow at Start routine in Update rules, to eliminate Canada data for US ODS and Vice Versa.
Global variables in Start routine
You can have global variables, internal tables populated by the
startup routine. This data will be available to the field
routines. Create yourself a start routine, declare some
variables in the global section, and then create a field
routine. You will be able to use the globally declared objects
in the field routine
Please check below help link for routines in sap netweaver 2004s
http://help.sap.com/saphelp_sem60/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
How to guide "How to transformations routines".Please check the below link:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dc1d9990-0201-0010-16aa-db3c4eb8b642
start routine in transfer rules
Look up to load master data
excluding
Start Routine in Transfer Rules
Sample code in Update Rule to restrict data selection?
Append Datapak - transfer start routine
Excluding Blank field in Infopackage Filter
Trans Routine ABAP help ..
transfer routine
Date key figure: Convert DATS format to DEC format
Date Conversion in Flat File
Transfer Routine ABAP
conversion exit
Date Conversion
Problem with conversion char to numc in transference rules
conversion routine..?
update routine
How to call a function in Update Rules to reverse a key figure sign
Need Sample Code for Update Rules
Date calculation
Difference between data in PSA and Data in Infocube
No RETURNCODE <> 0 allowed in update routines in transfer mode
the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
Access master data in update rules
Date key figure: Convert DATS format to DEC format
start routine in update rules
Is it possible to read a third ODS in update rules between two ODS?
update rule coding while loading data from ODS to CUBE
Start Routine in Update Rules to populate additional fields from ODS
Coding in Update Rules accessing a Z-Table
Start routine
Hope this helps you..........
Regards,
Debjani.........
Edited by: Debjani Mukherjee on Oct 1, 2008 4:58 PM -
Error when transporting a transformation (Update rule) BI 7.0
Error when transporting a transformation (Update rule) BI 7.0
Hi all,
Im trying to transport the transformation between the infocube 0FIGL_C10 and the ODS 0FIGL_010 from BI Dev into BI QAS. I kept getting a return code 12.
Transport message:
Program terminated (job: RDDEXECL, no.: 18141700)
See job log
Execution of programs after import (XPRA)
End date and time: 20070620181432
I go to the log and I got the following message:
Job started
Step 001 started (program RDDEXECL, variant, user ID DDIC)
All DB buffers of application server vrxsapq1 were synchronized
ABAP/4 processor: ASSERTION_FAILED
Job cancelled
Im using BI 7.0
I dont know what it is. Can someone tell what should I do or what Im missing?
Thanks a lot
Regards
VicHi Victor,
check this thread may it solves your problem
Re: Error during the creation of transport request
one more thread
/message/2785863#2785863 [original link is broken]
cheers
Sunil
Message was edited by:
Sunil John -
Error in ODS Update Rules.
Hi,
We have an abap routine in an ODS Update rules to get FISC YEAR (type NUMC 4) with a field FISCPER(numc 7) from a table. This routine worked fine. But now we moved the abap routine to cmod program in r/3, and when I am doing a direct mapping of fiscper to fiscyear, I am getting this error message 'Fiscal year variant missing for time conversion of characteristic 0FISCYEAR'. I already did a direct mapping of Fiscal year variant in the update rules.
Am I missing some thing here?
Thanks!Yes, I am getting fiscvar as V6 from cmod program in r/3, and did a direct mapping in update rules.
-
Error when transpotring Update Rules
Dear colleagues.
When transporting an update Rules into our Quality enviroment the system pops up the following error:
IC=ZWEPP_C02 IS=ZWE_BOM_RMX_IS syntax error: rows 0.
I've verified the Update Rules on the Quality System and everything is correct but it remains inactive due to the transport fails.
I would appreciate your feedback.
Thanks in advance.Dear khaja.
I send you the transport log as well as the Return Code.
Error when activating update rule 5MYASZMBOIQZSRR60674OBKJ3
IC=ZWEPP_C02 IS=ZWE_BOM_RMX_IS error when generating InfoCube Update program
IC=ZWEPP_C02 IS=ZWE_BOM_RMX_IS syntax error: rows 0 (When generating the update program for data target ZWEPP_C02, InfoSource ZWE_BOM_RMX_IS, a syntax error occured in row 0. Message no. RSAU466)
Errors occurred during post-handling RS_AFTER_IMPORT for ROUT L
Please, let me know if you need anything else.
Thanks. -
Update rules 8COBW2ENYVCAS3541UFGKPO80 read in version M
Hi I am getting following error while transporting update rules to production server, this transport is working fine in quality server, but it is throwing error in Production only.
<b>Start of the after-import method RS_UPDR_AFTER_IMPORT for object type(s) UPDR (Activation Mode)
Update rules 8COBW2ENYVCAS3541UFGKPO80 read in version M
Update rules 9G5ESWQPKF9P9ILN91RXZ6M2J read in version M
Error when activating update rule 8COBW2ENYVCAS3541UFGKPO80
Activation of the update rules for ZODS_TSH 8ZODS_RCO
IC=ZODS_TSH IS=8ZODS_RCO error when checking the update rules
Error when activating update rule 9G5ESWQPKF9P9ILN91RXZ6M2J
Activation of the update rules for ZODS_TSH 8ZODS_ATS
IC=ZODS_TSH IS=8ZODS_ATS error when checking the update rules
Start of the after-import method RS_UPDR_AFTER_IMPORT for object type(s) UPDR (Delete Mode)
Update rules 8COBW2ENYVCAS3541UFGKPO80 read in version M
Update rules 9G5ESWQPKF9P9ILN91RXZ6M2J read in version M
Errors occurred during post-handling RS_AFTER_IMPORT for UPDR L
RS_AFTER_IMPORT belongs to package RS
The errors affect the following components:
BW-WHM (Warehouse Management)
Post-import method RS_AFTER_IMPORT completed for UPDR L, date and time: 20070926155436
Post-import methods of change/transport request DS2K930550 completed
Start of subsequent processing ... 20070926155435
End of subsequent processing... 20070926155436
</b>Start of the after-import method RS_UPDR_AFTER_IMPORT for object type(s) UPDR (Delete Mode)
Update rules 8COBW2ENYVCAS3541UFGKPO80 read in version M
Update rules 9G5ESWQPKF9P9ILN91RXZ6M2J read in version M
Errors occurred during post-handling RS_AFTER_IMPORT for UPDR L
RS_AFTER_IMPORT belongs to package RS
The errors affect the following components:
BW-WHM (Warehouse Management)
Post-import method RS_AFTER_IMPORT completed for UPDR L, date and time: 20070926155436
Post-import methods of change/transport request DS2K930550 completed
Start of subsequent processing ... 20070926155435
End of subsequent processing... 20070926155436
Execute reports for change/transport request: DS2K930550
Reports for change/transport request DS2K930550 have been executed
Start of................ 20070926155436
End of.................. 20070926155436
Execution of programs after import (XPRA)
End date and time : 20070926155436
Ended with return code: ===> 8 <===
<b></b> -
Inserting code in final steps of Update Rule transformation
Hi,
I am extracting data into a cube from an ODS and doing some aggregation in the process. E.g 3 records in the ODS might become 1 in the cube.
This is fine for some things like Quantity, but not ideal for things like unit price. One work around is for the ODS to have a counter.
e.g
MATERIAL QUANITITY UNIT_PRICE COUNTER
1234 13 $1.50 1
1234 21 $1.50 1
1234 45 $1.50 1
This comes across into a cube like
MATERIAL QUANITITY UNIT_PRICE COUNTER
1234 79 $4.50 3
- unit price can then be calculated by dividing unit price by counter - however it needs to be done within the query.
I thought perhaps we could perform this calculation when populating the cube, if the items were firstly collected within an interim table before being passed to the return_table.
i.e
1. Define key figure using ABAP routine and return table.
2. Append INTERIM_TABLE within update rules for each read of the ODS
3. Once all ODS records have been read and inserted at an aggregate level within INTERIM_TABLE, loop through INTERIM_TABLE, perform calculation and append RETURN_TABLE.
My question is: Is there a simple way to determine that all ODS items have been read (like an "at last" statement) and if so, where can this code be inserted? Can it be simply placed in the update rules routine if I have the appropriate logic to determine that all items have been read?
Thanks
AdrianHi Adrian,
Why cant you use Addition, minimum or maximum in update rules...?? Here you can use Maximum option for Unit Price.
http://help.sap.com/saphelp_nw04/helpdata/en/3f/0e503c3c0d563de10000000a114084/content.htm
Hope it Helps
Srini -
"Old" update rule from ODS not working
Hi Gurus,
I need to set up the "old" fashioned update rule to load data from an ODS1 to another ODS2.
The thing is that I need to set up an update rule because I need to implement a Return Table Routine that is not supported (as far as I know) by the new Transformation/DTP.
When I select option (through the right mouse click over ODS1) "Other Options" - "Create Update Rule" it takes me out of the RSA1 and leaves me in the main menu making it impossible to create a new update rule.
The strange thing is that I have this working from and ODS to an InfoCube.....
Suggestions, a workaround??
Andrea.Hi Jerry,
Just to confirm that this is not working. The tys_TG_1 structure only shows me the target infoprovider structure. Check that in the how to, to be able to derive employee first you need to assign eache source_filed to the result_field leaving employee blank.
I need to have in the same place, the source_field structure (source infoprovider field structure) and the result_field structure (target infoprovider structure). That is what the "old" return table gives me as in the same place I can have the communication_structure (source infoprovider field structure) with the return_table structure (target infoprovider structure).
Just to understand, in the source infoprovider I have 12 Key Figures (1 for each period) and I have to split each incoming record to 12 records. If I work only with the result_field structure tys_TG_1 and the result_package tyt_TG_1 I'm not able the see those 12 KF.
So... return table functionality is not fully supported by BW 7 as far as I know.
Any other ideas why I'm not able to create the old Update Rules from an ODS?
Regards,
Andrea. -
Update rule from one Cube to another
Hello Gurus!
Here is the situation :-
We have a IC ZCube1. This cube contains order data at schedule line level. It contians an IO for each Hold Status (in all 10 ) . IO has value 'X' if it is active else blank. 1 order line item can have multiple holds.
We need a aging report that should show how long particular line is on a Hold .
Date of change of hold status is not in the cube ZCube1, it is in another ODS. We have created new cube(ZCube2) that will have Orderitem, Line#, DOC#...etc(as key field) and an IO for Hold status (here we have only one IO to hold all status code) and data of change of hold status (we will populate it from ODS ) .
We have create start routine in ZCube2 that filter out order lines with no active Hold status. Also in this start routine we have logic to create 1 row for each hold status and store it in internal table(ITAB1).
Problem :
Not able to understand how to proceed in update rule to insert multiple rows from ITAB1 into ZCube2.
We can copy ITAB1 to ITAB2 and read it with Key fields. After this we have ITAB2 with multiple Hold status codes with same order item.
Problem here is how do I assing multiple rows from ITAB2 in update rule to get multiple line item in ZCube2.
Any thought or input to above said will be very helpful.
Thanks,
Murtuza.Hi Srinivas,
I did some change , till earlier post I was trying to figure out how to Move source DP values to internal table.
Eventually what I need is to Break each order line from source pacakge which contians multiple holds on same line into 1 orderline with only 1 hold status .
e.g for a orderline if there are 3 hold Source DP will return 1 row . After I execute below code is start routine Source DP will have 3 order line everything same but hold status . I have done changes to the code in previous post and I am able to achieve what I need , but not sure this is efficient way to do ...
Please advice .
LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
MOVE-CORRESPONDING <SOURCE_FIELDS> TO wa_ITAB_DP.
IF <SOURCE_FIELDS>-/BIC/ZCSTATDM EQ 'X'.
wa_ITAB_DP-/BIC/ZCSTATDM = 'X'.
wa_ITAB_DP-/BIC/ZCSTATFH = ''.
wa_ITAB_DP-/BIC/ZCSTATCC = ''.
wa_ITAB_DP-/BIC/ZCSTATSC = ''.
wa_ITAB_DP-/BIC/ZCSTATSP = ''.
wa_ITAB_DP-/BIC/ZCSTATFA = ''.
wa_ITAB_DP-/BIC/ZCSTATFV = ''.
wa_ITAB_DP-/BIC/ZCSTATNF = ''.
wa_ITAB_DP-/BIC/ZCSTATPV = ''.
wa_ITAB_DP-/BIC/ZCSTATIP = ''.
APPEND wa_ITAB_DP to ITAB_DP.
ENDIF.
IF <SOURCE_FIELDS>-/B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STATFA = ''.
wa_ITAB_DP-/BIC/ZCSTATFV = ''.
wa_ITAB_DP-/BIC/ZCSTATNF = ''.
wa_ITAB_DP-/BIC/ZCSTATPV = ''.
wa_ITAB_DP-/BIC/ZCSTATIP = 'X'.
APPEND wa_ITAB_DP to ITAB_DP.
ENDIF.
CLEAR wa_ITAB_DP.
ENDLOOP.
SOURCE_PACKAGE[] = ITAB_DP[] . -
hi,
i am writing some logic in the start routine of the update rule to a cube from ODS.inside the logic i am using 3 diff. custom function modules which fetch data from 3 diff. queries and populate data in 3 internal tables. But my problem is when i use these 3 function modules, only the first function module populates the data in the first internal table and the rest 2 are not populating data in internal tables but when executed individually, they are working fine.I have to obtain all the data before looping at data package , so i used these 3 function modules serially outside the loop and trying to fetch data and store in internal tables for further processing.
But, only one fm is working .
Any help is appreciated.
Thanks in advance.hi,
I have no short dumps and the return code of the function module is equal to zero.i am passing correct parameters only .In my custom fm , i am using standard bapis to generate session id's for the fms.
For the first fm the session id is 0001 and the result is correct and for the second and third fm, the session id is 0002 and 0003 , so the fms are not returning correct result.Inside my custom fm , when i tried to forcefully put 0001 in session id , then the fms are not giving results saying that Session id 0001 unknown.Any help or analysis is really appreciated.
Thanks in advance. -
I have a routine in my update rule that performs a lookup to another ODS. To improve my performance I would like to try writing a temporary variable to memory that can then be referenced when loading each record. For example here's some pseudo code:
1) if vendor already exists then do nothing
2) set AP key and set Purchasing key for performing lookups
(ie: AP key = Company Code + FiscalYearPeriod + AccountingDocumentNumber)
(ie: Purchasing key = Company Code + FiscalYearPeriod + PurchasingDocumentNumber)
3) does temporary AP variable exist and does it match AP key?
3a) if yes then EXIT and return temporary AP variable
3b) if no then perform ap lookup based on AP key
3c) was lookup successful - was vendor found?
if yes then set temporary AP variable and EXIT and return value
if no then continue
4) does temporary Purchasing variable exist and does it match Purchasing key?
4a) if yes then EXIT and return temporary Purchasing variable
4b) if no then perform purchasing lookup based on Purchasing key
4c) was lookup successful - was vendor found?
if yes then set temporary Purchasing variable and EXIT and return value
if no then EXIT (Do nothing - essentially leave blank)
My question is 1) Whether it's indeed possible to pass this temporary variable and 2) can you give me a sample of code that I would use to read/write the variable?
Thanks so much!You can use Import/Export to cluster database. This way you can share the same variable value between different programs/routine.
EXPORT value TO DATABASE INDX(Indx) ID 'Variable Id'.
IMPORT value FROM DATABASE INDX(Indx) ID 'Variable Id'.
For more details you can refer the following:
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3c53358411d1829f0000e829fbfe/frameset.htm
Regards,
RB
Maybe you are looking for
-
Dear All, As a part of year closing / Beginning activities, I executed AJAB ..... to change the open fiscal year from 2007 to 2008 so that I could change the asset fiscal year to 2010. But the system was unable to do so, and no list was generated. Ki
-
Determining the current viewId
Hi, I need to determine the current view id, therefore I am using the following code: /* adf-settings.xml */ <adf-settings xmlns="http://xmlns.oracle.com/adf/settings"> <adfc-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
-
CS2, AS: Output: Separation preview.
Hi, I already have done a quick check but in case someone could help: Is it possible to automate the separation preview process or even do it for real (ex. output blue plate as jpeg). From the Indd document, i generate two different logical plates (i
-
Measuring impedance with AT-MIO-16E??
Hi to everyone, I am starting my experience with Labview at the technical university and I have to "write" a program in Labview 6.1 that will use the NI AT-MIO-16E-10 board and will generate the signal to Analog Output, the signal will go through the
-
Can I import iMatch categories and descriptions into the organizer?
I own both iMatch (v3.6) and Photoshop Elements (8) I want to migrate my photo and video catalog to the Elements Organizer avoiding a lot of work creating tags and categories all over again. Is there a way to import my categories and descriptions I m