Urgent: ABAP routine in transfer rules
Hi,
when i am loading master data from R/3 into BW, i need to filter some records based on material type. there is no option in RSA6 (on R/3) or in Infopackage (BW) to make it available for filter.
So i assume i need to write ABAP routine in transfer rules. can some one help me with ABAP. i need to load the records only when MTART field(material type) in MARA is "FINI" or "RAW" and skip other records.
what is difference between deleting the whole data packet and deleting the record.
Thank you very much in advance
Regards
Emil
Hi
Write the below code in the start routine of your transfer rules.
Regards
Prakash
DATA: IT_DATA TYPE STANDARD TABLE OF TRANSFER_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
DATA: S_DATA, T_DATA TYPE TRANSFER_STRUCTURE.
LOOP AT DATAPAK INTO S_DATA.
IF S_DATA-MTART EQ 'A' OR S_DATA-MTART EQ 'B'.
MOVE S_DATA TO T_DATA.
DELETE S_DATA.
ELSE.
DELETE S_DATA.
ENDIF.
APPEND T_DATA TO IT_DATA.
ENDLOOP.
CLEAR T_DATA.
DATAPAK[] = IT_DATA[].
Assigning points is a way of saying thanks on SDN!!
Similar Messages
-
How to find the existing START ROUTINEs in Transfer Rules in whole system ?
Hi all,
How to find the existing Start Routines in Transfer Rules in BW System, please ?
I know that we could find from the Transfer Rules.
Is there any way to find instead of looking at Transfer Rules for <b>each</b> InfoSource?
Thanks,
Venkat.Hi Venkat
You can find it in these tables
RSTRAN
RSUPDROUT
RSAROUT
RSAABAP
RSAABAPINV
Thanks
Tripple k -
Help on Start Routine at Transfer Rule.
Hi guys,
We r extracting data from generic extractor into BW.My target is to fill Attributes of 0Customer(Infoprovider) Infoobject.
We have added two navigational attributes to it CLASS A and CLASS B.
Data coming from R/3 has three fields Customer,Class,n field called as ATWRT.
For each customer there are two records .
For Ex
Customer Class ATWRT
001 A FOOD
001 B Supermarket
002 A Chain
003 B Magnum
In the target customer is key
Now the TASK is that in the target the definition for class A which is present in ATWRT should go to navigational attribute ClassA
n Defination for B should go in NAV Attribute CLASS B . that means there should be single record in the target comprising both value in NAV attribute.
For Ex
Customer Class A Class B
001 FOOD Supermarket
002 Chain Magnum
i want to write program in start routine of transfer rules. If u can suggest any other method also it will good to me to sort this issue. Suggestions are expected.
Points will be awarded for the write suggestion.
Pls help me out.Dennis,
Thank you so much for the quick response.
I think it is working. I only have one concern!!!!.
I feel like during the testing I found something weird that eventhough there are only 8 records in the psa and four records only have the value ('status') that we need from customer master data-field1, it is still picking the 5th record, not sure why. I see that once it is written in to the data target then the value is showing it as 'status' and in psa it is different.
So I wonder if it is converting that field in the routine based on our constant! Please let me know your input.
p.s data target does not have the field1 available. So just like you corrected my code it has to bring it from customer master data and join customer to with the customer-field1 =' status', then pick else delete other records.
Regards,
Su -
Debugging of Routines in transfer rules
Hi All,
I wrote a routine and trying to debug.I tried to debug using "Simulate update" option when we right click in the monitor screen.I don't know how to proceed from there.Could some one explains the steps to debug the routine in transfer rules?
Your help is greatly appreciated.
Thanks
ManishHello Manish,
You can create a Watch point if you are looking for some InfoObject / table field values.
Or you can keep pressing F5 for step by step debugging (takes long time) and double click the field when you see them.
If you want to go by block by block instead of line you can use F6 and F7 and if you want to execute you can F8 as what we do for execution.
If you are sure where you want to check then set a break point by double click or select the line and click the Break Point Icon in the top and press F8, the system will automatically stops at the break point then double click the field you need and check the value in the right side window.
If you are using BW3.x the you can switch between New Debug mode (Multiple screen and will be difficult to use if you are new) and Classical Debug Mode (easy to use)
Hope it helps
Thanks
Chandran -
If you write routine in transfer rules what will happen
If you write routine in transfer rules what will happen?
Hi,
If we write routines in Transfer Rules:
If it is Start Routine: Record Level Transformation
If it is at Rules: Field Level Transformation
In both case, the transformations are activated before the data entering into BW.
Hope this Information helps u..........
Assigning points is the way of saying THANKS in SDN
Regards
Ramakrishna Kamurthy -
Debugging: start routine in transfer rules
Hi !
can you please tell me how to debug start routines and field routines in transfer rules?
If possible please tell me too debugging of update rules.Hi Rajib,
Go to the monitor -> Details tab -> Processing -> Choose the datapackage you want to debug -> Right click -> Simulate update -> Choose eather activate debugging in transfer rules (to debug in transfer rules) or debugging in update rules(for start routine and update rules).
You can mention the number records you want to debug also, if you have an idea of which records you want to debug you can give the number of that record.
Once the debug screen comes up, press F8...the control stops at first break point...from there you can do a step by step debugging (F5).
Hope this helps...
Regards,
Kalyan -
Write ABAP routine in transformation rule
Dear all,
I am very new to ABAP. Currently I would like to transfer some data from cube A to cube B. The problem is
Cube A and B have different Unit of Mesure. The product standard cost is based on each Item's UOM. For example:
Cube A data:
ItemNo } UOM } Standard cost
ABC } P5 } 30
Cube B data:
ItemNo } UOM } Standard cost
ABC } EACH } 5 (30/5)
In transformation rule, I plan to use ABAP routine to calculate each record to new Stand cost if Cube A has different UOM than Cube B.
Can I call a program in this ABAP routine?
In ABAP routine, how can I delare other source table and fields?
Thanks for you help!The preferable method, if you're on BI 7 or later, is to create a filter in the DTP so that the records where 0CLR_DOC_NO is blank aren't even passed into the Transformation.
If not, then you can add the following code into the Start Routine of your Transformation.
DELETE
source_package
WHERE
clr_doc_no EQ ' '. -
Start Routine for transfer rules
Hello experts,
I want to use the SQL DISTINCT keyword to return non-duplicate results from a table in a DataSource (data base) in a the start routine for the transfer rules.
How do I address that table in the start routine of the TR?
I thought about something like that.
TABLES: mytable
DATA: itab_mytable type table of mytable
SELECT DISTINCT CUSTID, etc.
FROM mytable into table i_tab.
I am new to ABAP so I would be happy to get some suggestions!
thanx in advance
AxelHello Oscar,
as fa as I understood the entire data package in the transfer structure format is used as parameter (DATAPAK) for the routine.
so I want to perform a SQL statement on DATAPAK!
But it sais it can't find DATAPAK in ABAP-Dictionary as a table!
can I actually perform SQL statements on DATAPAK?
Thanx
Axel -
ABAP Guidelines for transfer rules & Update rules
Is there any guidelines for abap when using it for transfer rules and update rules? I am looking for some best practise in this area.
Thank you,There is no specific differences in the standards/coding procedure for Transfer Vs. Update Rulse.
This can only come from a combination of requirement, design and experience! (in no particular order)
for e.g.
If the converions are the same for all data targets, you would use the transfer routine, start routine in the Transfer rules.
If the converions are different for different data targets, you would use the update routine, start routine in the Update rules.
Key concerns being performance, modularization, reduced effort and ease of maintenance.
Not sure I have answered you question! Please get back if there is something specific you are interesed in (a scenario perhaps!)
Rishi -
I am using the datasrource 0MM_PUR_VE_01,if the score for Evaluation
Criteria or the score for subcriterion is Zero then this datasource is
not picking those particular records
Vendor Eval.Crite Subcriterion score Score for Subcrit Eval. Crit
1 Price01 Price Level 01 87
Quality02 Line/Stock 02 87
Vendor Audit 03 0
Delivery03 On-Time
Delivery01 87
Quantity Reliability02 0
Shipping Instructions03
can be checked with t-code me61
If the score of the Evaluation criteria or score of subcriterion is 0 the datasource 0MM_PUR_VE_01 is not picking that particular record
in the above example Datarsc not picking the records of subcriterion Vendor Audit 03, Quantity Reliability02,
actually this data is coming from table ELBP so whenever the score is zero even tha table is not storing that particular record
I will have 5 evaluation criterion like Price,Quality,Delivery,Service,Service & the subcriterions for these also are fixed
so i BW transfer rules I have to write a code in such a way that if the particular record is missing then it shouls treat it as score 0
Ex:-\
Eval criter Score
Price 10
Quality 20
Delivery 0
Service 10
Service 20
Now my table wont store the record Delivery as the score is 0
As my evaluation criteria ar e fixed in the update rules I need thelogic that if particular record is missing then it should show it as 0
If my requiremnt is not clear pls let me knoe
as this has to be solved very urgently
Thanks
MayaHi,
If you want it to write in Transfer Rule
assumption that you have permant/contract in transfer rule as per <b>" can see the attribute permanent/contract in the transfer rules as it is the attribute"</b>
and
Permanant--"p'
Con--'C"
Try this code in Employee number
DATA: ZEMP TYPE TRANSFER_STRUCTURE-/BIC/ZEMPNumber.
zemp = TRan_structure-/bic/zempNUmber.
if TRan_structure-/bic/zpercon = 'P'.
concatenate '7' Zemp to ZEMP.
else
concatenate '8' zemp to zemp.
endif.
RESULT = zemp.
Yes to can read from Master Data table.
you can write code in Start routine in Update rule.
check out this...
Re: Start Rou
Regards,
San! -
How to write a Globla Routine for Transfer Rules
Hi Experts,
How to write a Global Routine for Tranfer Rules ? Where all the infoobjects need to be grouped? Effect need to be shown on group of fields that are available in a single structure.
Thanks in Advance
VaraHi,
Are you aware of Start Routine available?.. This helps to write a routine on all the infoObjects available in Transfer Structure
http://help.sap.com/saphelp_nw04/helpdata/en/b3/0ef3e8396111d5b2e80050da4c74dc/frameset.htm
regards
Happy Tony -
Problem while writting routine in transfer rules
Hi All,
I am assigning the routine 'Fill Partner Cost center from partner objects' to the infoobject '0PART_CCTR'.
In the transfer rules I create a routine for the '0PART_CCTR' but then it prompts to select any field /infoobject. The problem is the infoobject '0PART_CCTR' is not there in the selection and if I choose all the fields then while saving it gives error.
Can anybody help me out please.
Regards,
Sushmitacheck ur datasource is active or not......also if its active is it having all the fields which you want in ur routine..if not then u can't write the routine for it...
Now since ur writing transfer routine..most probably ur laoding from source system r/3 right?
So u won't have infoobject in ur source fields..u will find fields like matnr etc(source system fields name..which u have to map with infoobjects in ur transfer rule..).is it true???
Regards
RK -
Purpose of Routine in transfer rules in BW
Hello BI Gurus,
Please tell me the purpose of "Routine" selection in the transfer rules.
with regards,
vasuVasu,
The routine selection in TRs has many uses and advantages like cleansing, removing, transforming the data to your desired requirements from what it was not so.
Check out this link for an understanding of routines:
http://help.sap.com/saphelp_nw70/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
Hope this helps. -
Start routine in Transfer Rules for Data Mart update
Hi,
Is it possible to create a start routine in a transfer rule of a Datamart update (from ODS to Cube)?
Thxs.
LauQRoberto,
If I read well the content of note 499404 - referred to in 630854 - I conclude that it is recommended to use update rules rather than transfer rules in the case of ODS objects when one wishes to modify data records up to the eventual data target.
Do you agree?
Thxs.
LauQ -
Start Routine in Transfer Rules
Hi all ,
I am trying to write a start routine in the Transfer rules ....I just want to know which is package that i have to loop to get mt records ....
id it LOOP at DATAPAK ....
My records ...
ENDLOOP
This is where i need to put the logic or else where ..please let me knowhi,
check if sample code helps
DATA: l_s_datapak_line type TRANSFER_STRUCTURE,
l_s_errorlog TYPE rssm_s_errorlog_int.
tables : table1.
data : l_field1 liek table1-field1,
l_tabix like sy-tabix.
loop at datapak into l_s_datapak_line.
l_tabix = sy-tabix.
fill field1 with data
select single field1 into l_field1
from table1 where fieldintable1 = l_s_datapak_line-[fieldname]
if sy-subrc = 0.
l_s_datapak_line-field1 = l_field1.
modify datapak from l_s_datapak_line index l_tabix.
endif.
endloop.
Maybe you are looking for
-
Where and how can I buy a new AC adaptor for a 30" HD cinema display?
I bought large numbers of Apple products in Hong Kong but have since moved to a remote area of the Philippines where internation telephone calls are extremely difficult. The AC adaptor of my 30" HD cinema display with aluminum case has been lost so I
-
How to make directaccess windows server 2012 access the IPv4 link
HI all, I have built a directaccess for win7 with IPv4 only intrant successfully,and it work's good.but here is a problem that I can't access the IPv4 link,for example I can access http://www.test.com ,but I can't access the url http://192.168.13.13
-
N73 camera, changing default scene to user defined...
n73 manual says that AUTO scene is default but user can make USER DEFINED scene to be default. how can I do that? every time I start camera, there is AUTO scene.
-
Database Design - Drop Down Menus
Hello alll, I'm designing the database of Tire Store. We need to manage the Items and the Price List. The tire has many specifications, ex: Category, Aspect Ratio, Origin, Pattern, Ply, etc Each one of these specifications has a list of values (Drop
-
OS: Windows Server 2003 Standard Edition DB: 9.2.0.8.0 One of my database boxes is getting several "faulting application apache.exe" errors roughly every ten minutes. When I check the list of services I don't have Apache listed anywhere, and apache.e