How to Code "AND" logic in Update Rule?
Hi:
I have minimal ABAP knowledge and need some help....
I have to use the Query logic and code in my Update rule... (i.e. multiple conditions have to be met)
IF (COMM_STRUCTURE-Sales_Org = '100' AND COMM_Structure-Division = 'LA' AND COMM_STRUCTURE-Acct_Grp = '0120')
RESULT = COMM_STRUCTURE-Credit_Amoutn (I want to assign a specific KF)
ELSE
RESULT = 0 (I want to assign Zero)
ENDIF
I attempted this logic, but I keep getting an error with 'AND' statement. I am not sure what is the syntax.
Can someone please help me out with the logic/sytax
Thanks..... Lee
Hi:
I responded without checking the logic.... assuming it would work...!~
Unfortunately it gives me error:
QUOTE
E:Incorrect logical expression: ")" must be followed by "AND" or "OR" . .
UNQUOTE
Can anyone help me resolving this please....!!!!
Thanks... lee
Similar Messages
-
How to find all the cubes update rules transfer rules ,programms ,ds,ect
HI SDN
Is there any tables for finding update rules,cubes,multiproviders in the system.
can any body tells me the tables for the objects all the objects
thxHi Rubane,
These the tables which gives relevant info,
Here are few of those -
Thought it may be of some use if we make a list of useful BW tables
for instance
v_rszglobv = variables
/bic/f (cubename) is the fact table of a content cube
/bic/D (cubename) P is the package dimension of a content cube
/bic/D(cubename) U is the unit dimension of a content cube
/bic/D(cubename) T is the time dimension of a content cube
/bic/D(cubename) I is the userdefined dimension of a content cube
/bic/m (object name) master data of object
/bic/t (object name) text data of object
/bic/H (object name) hierarchy data of object
you can replace the BIC with BI0 for business content object and cubes
RSDIOBJ - index of all InfoObjects
RSSELDONE - Monitor: Selections for executed request
RSREQDONE - Monitor: Saving of the QM entries, state of the uploads, all info about the upload via request number, field: RNR
ODS Table names
1.New data: /BIC/A (ODS NAME)40
2.Active data: /BIC/A (ODS NAME)00
3.Change log: /BIC/B ( NUMBERS)
RSRREPDIR which is the table containing all your reports.
RSTSODS - table that contain relation between "ODS Name" and PSA Table.
TBDLS - Logical system customization, when you run TA: BDLS
EDP21 - Partner Profile, when you run TA: WE20
RSBASIDOC - Assignment of source systems to BIW systems incl. IDoc type
In V_COMPDIR_COMPIC you can also see all your reports. The advantage is that you can see the name/text of the query, not only the technical id.
RSDCUBEIOBJ Objects per InfoCube (where-used list)
RSDODSOATRNAV InfoObject in ODS (navigational attributes)
RSDODSOIOBJ InfoObject in ODS
RSDIOBJT InfoObject texts
RSDIOBJ Directory of all InfoObjects
RSDKYF Key figures
RSDBCHATR Master data attributes
RSBBSQUERYDIR BW: Directory of the Query Sender
RSBBSQUERY BW: Query Receiver
RSBBSQUERYT BW: Texts for Query Receiver
TQOP Compare Operators for View Maintenance Query
TQOPT Compare operators for view maintenance query (texts)
TQLOT Logical operators for view maintenance query (texts)
ROMSDIOBJ BIW: Assignment of master data attributes to InfoObjects
RODCHA BIW: InfoObjects / characteristics
RODIOBJCMP BIW: InfoObjects / compounding
RODKYF BIW: Key figures
ROAPPLT BIW: Name of the application components
RSUICDONE BIW: Selection table for user-selection update ICs
RODTIM BIW: Time characteristics
RODUNI BIW: Units
RSIST InfoSource texts
RSIS InfoSource (transaction data)
RSISOSMAP Mapping Between InfoSources and OLTP Sources
RSOSFIELDMAP Mapping Between OLTP Source Fields and InfoObjects
RSUPDDAT Update rules key figures
RSUPDKEY Update rule: Key per key figure
RSUPDROUT Update rules - ABAP routine - check table
RSRWBINDEXT Titles of binary objects (Excel workbooks) in InfoCatalog
RSRWORKBOOK 'Where-used list' for reports in workbooks
RSDDIME Dimensions directory
RSDDIMEIOBJ InfoObjects per dimension (where-used list)
RSDDIMET Dimension Texts
RSZCOMPDIR Directory of reporting components
RSZELTATTR Attribute selection per dimension element
RSZELTDIR Directory of the reporting component elements
RSZELTTXT Texts of reporting component elements
RSZELTXREF Directory of query element references
RSZGLOBV Global Variables in Reporting
RSDCUBET Texts for the InfoCubes
SMEN_BUFFC-Table for Storing Favorites.
tables which hold the list of BEx Queries, Web Reports, and Workbooks,
RSRREPDIR
RSZCALC
RSZCEL
RSZCHANGES
RSZCOMPDIR
RSZCOMPIC
RSRWORKBOOK
RSZCOMPDIR - Directory of reporting components
RSZELTDIR - Reporting Component Details
RSBCT_NAVKEY_T
RSBCT_NAVKEYDET
check it in the following table
RSDDAGGL
RSDDAGGLF
RSDDAGGRDIR
RSDDAGGRDIR_M
RSAABAP - Routines
Thanks,
Sudhakar. -
ABAP assistance - start routine logic in update rule
I have used an existing update rule and have based my logic around the same. The purpose of the rule is to look up customer master data and get a subset of customer numbers from the transaction records so that the values for customer number from the transactional data will not be updated if it does not match with existing master data customer numbers.
The loads are full and we drop the data before we load.
I have listed the logic below (the number at the front is to be considered as the line number) and a list of open questions that I have thereafter:
Start routine logic:
1 DATA: l_index LIKE sy-tabix.
2 DATA: BEGIN OF ls_customer,
3 customer TYPE /BI0/OICUSTOMER,
4 objver TYPE RSOBJVERS,
5 END OF ls_customer,
6 lt_customer LIKE TABLE OF ls_customer.
7 REFRESH: lt_customer.
8 LOOP AT DATA_PACKAGE.
all customers from data package
9 ls_customer-custno = DATA_PACKAGE-custid.
10 ls_customer-objver = 'A'
11 APPEND ls_customer TO lt_customer.
12 ENDLOOP.
12 SORT lt_customer.
13 DELETE ADJACENT DUPLICATES FROM lt_customer.
14 IF NOT lt_customer[] IS INITIAL.
15 SELECT /BI0/OICUSTOMER RSOBJVERS
16 FROM /BI0/PCUSTOMER
17 INTO CORRESPONDING FIELDS OF TABLE lt_customer
18 FOR ALL ENTRIES IN lt_customer
19 WHERE ls_customer-custno = DATA_PACKAGE-custid
20 AND ls_customer-objver = 'A'
21 SORT lt_customer BY customer ASCENDING
22 ENDIF.
Questions
Line
1 - what is the purpose of this line? What is it that is being declared
2 - in some code I have seen this line with OCCURS 0 at the end what does this mean with and without the term?
4 - I am using the Data Element name is this correct or should I use the field name?
3 - 5 here I declare an internal structure/table is that correct?
6 - here I declare a work area based on the internal table is that correct?
7 - What would happen if I avoided using the REFRESH statement?
8 - 12 - Is this syntactically correct, I am trying to get a set of data which is the customer numbers which match the master data customers and the master data record is án active version and than appendíng to the work area?
13 - My understanding is this will reduce the number of records in the work area is this correct and needed?
14 - 22 I am trying to identify my required set of data but feel I am repeating myself, could someone advise?
Finally what logic would I actually need to write in the key figure object, could I use something like:
Result = lt_customer.
Thanks
Edited by: Niten Shah on Jun 30, 2008 8:06 PM1. This line is not required
2. OCCURS 0 is the OLD way of defining an internal table with that structure. As it is, it just defines a flat structure.
3. Data element is usually best
3-5 Yes
6. No. Here you are declaring a table of the type of the flat structure. Just as the ABAP says!
7. Nothing. But by putting this in, you ensure that you know the state of the table (empty) before you start looping through the data package
8-12. You can tell if it is syntactically correct by pressing Ctrl-F2 when in the editor. Looks ok.
13. Ensures your list of customers contains no duplicated. The code up to this point is building a list of all the unique customers in the data package.
14-22. Goes to the database and brings back ONLY those customers which are found in the master data. Looks ok.
This is a start routine (that's why you've got a data package). You don't use result. You should update the datapackage. But this you haven't done. Double click on the table name /BIC/PCUSTOMER to get the correct field names.
So you have to loop through the data package again, and check if the customer in the datapackage is lt_customer. If it is, fine, otherwise you blank it and report an error, or set an error message or whatever.
I wouldn't do it like this. I'd do something like this:
STATICS: st_customer TYPE HASHED TABLE OF TYPE /bi0/oicustomer
WITH UNIQUE KEY TABLE_LINE.
* st_customer retains its value between calls, so only populate if empty
* In one run of the infopackage, this will mean you do only one read of
* the master data, so very efficient.
IF st_customer IS INITIAL.
SELECT customer FROM /BI0/PCUSTOMER
INTO TABLE st_customer
WHERE objvers EQ 'A'. " Only active values
ENDIF.
* Go through data package
LOOP AT DATA_PACKAGE.
* Check whether the customer exists.
READ TABLE st_customer TRANSPORTING NO FIELDS
WITH TABLE KEY table_line = DATA_PACKAGE-custid.
CHECK sy-subrc IS NOT INITIAL.
* If you get here, the customer isn't valid. So I'm just setting it blank
CLEAR DATA_PACKAGE-custid.
MODIFY DATA_PACKAGE. " Updates the datapackage record
ENDLOOP.
Even this is not fully optimised, but it's not bad.
I strongly suggest that you get yourself sent on the basic ABAP programming course if you're going to do a lot of this. Otherwise, read the ABAP documentation in the help.sap.com, and, from the editor, get the cursor on each ABAP keyword and press F1 to read the ABAP help.
matt -
How to debug start routines of update rules from ODS to InfoCube
Dear gurus,
I have an update rule from ODS to InfoCube. I wrote a start routine in the update rule. Now I want to debug it. I went to monitor and simulate update the data package and only got the prompt "No data exists in the corresponding PSA table". So how can I debug this start routine?
Thanks in advance.
Jin MingJin,
In order to use PSA between ODS and InfoCube, you may have to use an exclusive InfoPackage and load separately. In that InfoPackage, choose the radio button to use a PSA.
I think you are currently updating the InfoCube directly without using a separate InfoPackage.
Look for an InfoSource under DataMarts (search for 8<ODS Technical name>) and create your InfoPackage there.
Good luck. -
How can me and my husband update our 2 new mobile ...
I purchase 2 new sim cards 1 for me and 1 for my husband, both were purchased in Israel under my own account since the provider (Golan Telecom) does not have an option for registering with my husband's passport number, only with my Israeli ID number.
Yesterday my husband tried to update his new number in his own Skype account and couldn't do so. apparently Skype does not recognise the +972-58 initials and asks for some code.
I tried to update mine and got the same result, i couldn't update and i have no idea what is this code and where to get it from. Golan Telecom refered me to ask Skype as they don't have any idea what it is all about, they don't have information.
How can we update our new numbers on each of our accounts?Each of you select your device in iTunes.
Click the tabs across top and select what you want to sync.
Click the Apps tab and uncheck Automatically sync new apps. -
Convert ABAP code in start routine/update rule to transform. start routine
Dear BW ABAPers,
I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created transformation / start routine. My ABAP knowledge is limited. Will you please help?
*this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
LOOP AT SOURCE_PACKAGE.
IF ( SOURCE_PACKAGE-cppvlc EQ 0
AND SOURCE_PACKAGE-cppvoc EQ 0
AND SOURCE_PACKAGE-cpquaou EQ 0 ).
DELETE SOURCE_PACKAGE.
CONTINUE.
ENDIF.
no_scl is initial ( e.g. for good receipts, billing)
value has to be set depending on storno
IF SOURCE_PACKAGE-no_scl IS INITIAL.
IF SOURCE_PACKAGE-storno = 'X'.
SOURCE_PACKAGE-no_scl = -1.
ELSE.
SOURCE_PACKAGE-no_scl = 1.
ENDIF.
MODIFY SOURCE_PACKAGE.
ENDIF.
ENDLOOP.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
Many thanks and look forward to your kind feedback.
Kind regards,
CsabaDear All, Durgesh,
thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
DATA: I_PACKAGE TYPE TYT_SC_1.
FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
I_PACKAGE[] = SOURCE_PACKAGE[].
LOOP AT SOURCE_PACKAGE assigning <i_package>.
IF ( <i_package>-BWGEO EQ 0
AND <i_package>-BWGEOO EQ 0
AND <i_package>-BWMNG EQ 0 ).
DELETE SOURCE_PACKAGE index sy-tabix.
CONTINUE.
ENDIF.
no_scl is initial ( e.g. for good receipts, billing)
value has to be set depending on storno
IF <i_package>-NOSCL IS INITIAL.
IF <i_package>-ROCANCEL = 'X'.
<i_package>-NOSCL = -1.
ELSE.
<i_package>-NOSCL = 1.
ENDIF.
ENDIF.
ENDLOOP.
Points have been assigned accordingly.
Thanks,
Csaba -
How-to get transformations from transfer/update rules
Hi all,
we did an upgrade to BI 7.0 frm BW 3.5, how shall we get the new things like transformations,DTP for tha already existing cubes/ODS. is there any procedure to convert transfer and update rules to transformation.
Thanks all,
RegardsMigration - Yu may wish to read below steps
Transformation Rules
automatic mapping without the use of an Infosource.
steps are listed below.
On the InfoSource Tab (Note- Ensure DataSource and Infosource have not been migrated)
1. Right Click > Additional Functions > Create Transfer Rules
2. Activate Transfer Rules
3. Right Click > Additional Functions > Transformation erzeugen
On the DataSource Tab
4. Create Transformation (Map to DSO, should map automatically)
5. Migrate DataSource
6. Create InfoPackage
7. Create DTP
Assessing Migration Scenario's
Transformation Rules
Strategy toward new and 3.x datasource / infosource
Re: Few questions on BC activation..
Replicate NEW/3.x datasource - Methodology
Replicate NEW/3.x datasource - Change back to 3.x datasource Methodology
Re: Datasource Identification
Hope it Helps
Chetan
@CP.. -
How to get the hierarchy in update rules
i want to update the material hierarchy to the open hub data file
i create a update rule(transformation)
and i want to get the node name at the last level of the hierarchy tree above the material level
how can i do this?no
for example
now we have maintain the hierarchy of material like this:
026(level 1)
-026/100(level 2)
-026/200(level 2)
|-026/20010(level 3)
|---800501234(level 4)
in this hierarchy tree,the material 800501234 is in the level 4
and i want to get the last level hierarchy node above the material
for 800501234,the hierarchy node is 026/20010
so
i want to export the data like this:
hierarchy id | material
026/20010 | 800501234
how can i do this?
Edited by: Yang Zelphar on Mar 25, 2009 5:03 AM
Edited by: Yang Zelphar on Mar 25, 2009 5:04 AM -
How to read another ODS in update rules
Hi Experts,
I have to read another ODS to get the QTY field and update the key fig in my cube. I want to write the SQL statement as follows
Select doc_num
material
Sum (qty)
From ODS2
where doc_num = datapackage-doc_num
and material = datapackage-material
Group by
doc num
material.
In ODS2 the data is at the item level and that is why we need to sum it up. Could someone please send the exact code that I need to write in the update rules.
Thanks,
LokeshHi Reddy,
Edit the update rules,find the key figure for which you dont want the currency translation and change the translation to "No currency Translation".Then activate the update rules.This will probably resolve your problem.
Thanks & Regards,
suchitra.V -
[off-topic] How to {code} and {quote} tags?
Hi Experts,
In the old JIVE forum, we had two tags - { code } and { quote } (without spaces)
In this new forum, quote tags are there... but can anybody please tell me how to bring the { code } tags?
Like the one used here - https://forums.oracle.com/message/11041702
( { code } tags - White vertical stripes )
-- RanitYes, the others have the correct answer, but you can also get the quoting lines by playing with the pre syntax in the html editor. You have to be careful to move the </pre> tags to the right place in the hierarchy, and there seems to be some pre- and post- processing going on that might mess it up anyways - when the system is slow and you go into the advanced editor, you can get a glimpse of some of that happening. I think that is why they can't get it right, it's too helpful. I gave up trying to figure it out, except when it won't work and I have to futz with it (sometimes when you quote, it all gets quoted and there's no way to add an unquoted line).
Here I added a <pre class="jive_text_macro jive_macro_quote" jivemacro="quote"> and an associated </pre> on your "Thanks for responding" line:
ranitB wrote:
Hi Dude,
Thanks for responding. Did you manage to check the link I posted previously? I used the { code } tags there.
Just wanted to know how to get those "white vertical lines" around my code. They look neat, decent and still preserve the code formatting. (unlike the Syntax highlighting >>)
I did some decoding in HTML mode, with <code> and <pre> tags and CSS "class=jive-pre" ... but no good.
Are you getting my concern... Any pointers?
-- Ranit -
How to change techn. name of update rules
hi, all,
is it possible to rename update rules, or, instead, to copy them under another techn. name(complete, not only a row)?
Can anyone help me?
best regards
neven
Message was edited by: Neven Terzievhi Neven,
it's possible to copy update rules between data targets, but the technical name is generated by system (alpahnumeric). so if you just want the name changed, perhaps you can copy to another target and then copy back by specify the data target in 'template'. or not sure if you can use the data target itself as tempate. can specify more your consideration to change the name ?
hope this helps. -
I have an internal table with two fields FLD1 & FLD2(flag). I have to make sure that for same FLD1, there has to be only one FLD2 flag:
FLD1 FLD2
A X
A
B X
B X
B
For example in the above example, 'B' has two 'X' therefore, I have to give an error message saying " Maintain only one 'X' value for B"
How do I do this?
Thanks
Sgtry the code given below. It may help to code occording to ur desired logic.
DATA: BEGIN OF it OCCURS 10,
fld1 TYPE c,
fld2 TYPE c,
END OF it.
PARAMETERS: pfld1 type c .
pfld2 type c.
data temp type i.
start-of-SELECTION.
loop at it.
if it-fld1 = pfld1 and it-fld2 = pfld2.
temp = 1.
STOP.
endif.
ENDLOOP.
end-of-SELECTION.
if temp = 0.
it-fld1 = pfld1. it-fld2 = pfld2.
append it.
write: / 'data append'.
sort it by fld1.
loop at it.
write: / it-fld1, it-fld2.
ENDLOOP.
else.
WRITE / 'Maintain only one',pfld2, 'value for',pfld1.
it-fld1 = pfld1. it-fld2 = ''.
APPEND it.
sort it by fld1.
loop at it.
write: / it-fld1, it-fld2.
ENDLOOP.
endif.
regards
Vijaykumar Reddy. S -
How to code my logic in Search Help Exit
Hi,
I need to add my own Search Help say MATOG in Material MATNR Collective Search Help MAT1-> Collective Search help MAT1_A.
Is it possible?
And , when I need to add my own logic in Search Help exit for my particular Search Help, how should I code?
Thanks,
Shivaa..Hi,
Go through below link, it gives you step by step approach in implementing search help exit.
https://wiki.sdn.sap.com/wiki/display/Snippets/ImplementingSearchHelp+Exits
Regards,
Raghavendra -
Satellite L100 - How to download and install BIOS update?
I bought this Satellite L100 in 2006, and it dawned on me that by now I might need a BIOS update (the laptop sometimes freezes at Startup).
I found an update on the Satellite website dating July 6th 2007 but the download instructions are confusing and the driver(s) simply don't come through. Can someone help me with another link for this download?>how do I 'uncheck' HDD, In msconfig?
What do you mean by uncheck? Do you want to disconnect the HDD or to remove it from the notebook?
In msconfig you can disable (uncheck) the processes which are running in the OS background! You cannot disable HDD in msconfig.
>. I also experience breaks in the sounds of Window message tunes and short freezing moments in all webvideo's I run. Could this have something to do with a bad connection with the HDD
I doubt the HDD connection could cause this Maybe the HDD itself
It would be interesting to know if the same would happen using a new HDD and fresh installed OS. I had a Win XP installed on my notebook. It was a long time since new installation the notebook and OS were soo slowly because many registry keys were corrupted.
I installed the OS again, cleaned the OS using CCLeaner, disabled not necessary background processes and the notebook ran much faster -
Updates rules inactive after add KF
Hi experts,
we have to add aditional key figures to a infocube that is already in Q and P systems (with data).
Now we are not being able to transport the update rules to those systems.
Correct me if i'm wrong but if you add aditional characteristic's or key figures you don't need to delete data in the infoproviders in the ohter systems.
we have already try to transport:
cube and then update rules;
all together cube and update rules
in both cases it fails.
thanks in advance for any sugestionVaradarajan, our database is in SQL the spaces requirements that you refer are the same for this scenario? The fact table for this infop is 43G in Q system and our database have enough space.
am i making this analysis ok including the Db space?
Praveen the update rules are not datamart's.
The transport ends with a 8 code and for each update rule inlcude gives the message:
Update rules 2237DNCKOFJ13SFIK2PT581MQ read in version M
Error when activating update rule 2237DNCKOFJ13SFIK2PT581MQ
Sadeesh, all necessary objects are in the destiny system and no modifications were made at infosource/data source level.
Thank you all for the answers.
Maybe you are looking for
-
2 computers on the same network question
My comp is downstairs and my daughters is upstairs... We have a wired Linksys router... Is there a way that I can listen to her music and vice-versa?
-
Error-can't view photos in photo library using this version of iphoto .
Hi, I recently bought a macbook air and wanted to transfer pictures to it from my old mac (macbook 10.4.11). I viewed the pictures through file sharing, but was unable to finish saving most of the pictures that day. When I try and view my iphoto phot
-
Customer part payment of receipt
Hi We are accounting part payment by selecting the residual payment option. When we select residual payment SAP create a new item line where we update in header orginal Invoice reference where system will not loose orginal Invoice. Alternatively if w
-
Dear All, Presently i have +3 years of experience of Procurement, Logistic Arrangement, & Imports Clearance. I am doing this for Hospitality Project (Material Required for Hotel Construction ie. Civil, Interiors, MEP etc.) My Functional Area is as fo
-
Hi Forum, I've looked through the messages regarding content based routing or similar's but the answers did not satisfy my needs. I have an XSLT mapping from a flat file structure to an IDOC. To qualify the receiving system I have to do a database lo