Info package Routine - How to write
Hi ,
Can any body give me the step step by process on how to write Info package routine. Actually my requirement is to load the current month Data automatically through infopackge . I can write the ABAP code , but i am told to write in Infopackage level.
Thanks in advance..
Hi,
In our case we had a requirement to load the data for the transactions occuring in the last 15 days only, so we have write the routine on the last modified date feild in the infopackage.so as to select only records modified or created in the last 15 days..
attached is the sample code....
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'LAST_MODIFIED_DA'.
l_idx = sy-tabix.
data : w_cdate type d .
l_idx = sy-tabix.
w_cdate = sy-datum.
w_cdate = w_cdate - 15 .
L_t_RANGE-LOW = w_cdate .
L_t_RANGE-HIGH = sy-datum .
L_t_RANGE-SIGN = 'I'.
L_t_RANGE-OPTION = 'BT'.
append l_t_range.
modify l_t_range index l_idx.
p_subrc = 0.
Hope it helps...
Regards,
Umesh.
Similar Messages
-
Info Package Routine issue.
Hi I was working on an info package routine. I have to load somw documents based some some criterias. My question is how may values can i append for loading Document No. i have somwhere about 400,000 records. I'll have all those doc no's in an Internal table... Can i append all those and load or is there any limit for doing so.
Thanks in Advance.Hi Siva,
I would suggest to use range instead of appending the document numbers one by one. Its not best of approach.
You can maintain a transparent table with different range values if you don't have sequential values. Write a routine in the info-package to restrict the document number to the ranges.
Hope it helps.
Thx.
Soumya -
If I want to delete a line of data in say an update rule start routine, I can write for example the following:
DELETE DATA_PACKAGE WHERE <field> NE 'ABC'.
I am wondering if I can write the same in an info package and if so rather than DATA_PACKAGE what should I be referencing? ThanksHi Nitin,
Please note that is is not possiable to delete any data in InfoPackage routine, but surely you could ignore the value of a field when it is not equal to ABC or just load data for a field for value ABC. If that field is not present in the selection screen, you could get it into the selection screen by selecting it in RSA6, datasource maintenance.
No need to write a routine, it is just a simple selection is what you need to give.
Hope this helps.
Regards,
Pankaj -
Hi
For FIGL_4 there is both open items and closed items. i want to filter only Open Items Accounting doc no's records for Customers,Vendors,GL account at info package level.
There are 3 ODS's in BW side for Open items Customers,Vendors,GL accounts. i want to filter open items based on these 3 ODS's Active data table.But i am getting error when i execute the request in Info Package.
*Error Message "For sel. field 'BELNR ', no selection with SIGN = ' '; OPTION ' ' allowed RSM1 607 *
Below is the Info package Routine code
program conversion_routine.
Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rssdlrange.
Global code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
TABLES: /BIC/AZOCFFIGL00,/BIC/AZOCFBSID00,/BIC/AZOCFBSIS00
,/BIC/AZOCFBSIK00.
DATA: ...
TYPES : BEGIN OF TY_ZOCFBSID,
/BIC/ZMCFADCNO LIKE /BIC/AZOCFBSID00-/BIC/ZMCFADCNO,
END OF TY_ZOCFBSID.
TYPES : BEGIN OF TY_ZOCFBSIS,
/BIC/ZMCFADCNO LIKE /BIC/AZOCFBSIS00-/BIC/ZMCFADCNO,
END OF TY_ZOCFBSIS.
TYPES : BEGIN OF TY_ZOCFBSIK,
/BIC/ZMCFADCNO LIKE /BIC/AZOCFBSIK00-/BIC/ZMCFADCNO,
END OF TY_ZOCFBSIK.
DATA : TB_ZOCFBSIS TYPE TABLE OF TY_ZOCFBSIS WITH HEADER LINE,
WA_ZOCFBSIS TYPE TY_ZOCFBSIS.
DATA : TB_ZOCFBSID TYPE TABLE OF TY_ZOCFBSID WITH HEADER LINE,
WA_ZOCFBSID TYPE TY_ZOCFBSID.
DATA : TB_ZOCFBSIK TYPE TABLE OF TY_ZOCFBSIK WITH HEADER LINE,
WA_ZOCFBSIK TYPE TY_ZOCFBSIK,
FLAG TYPE I.
$$ end of global - insert your declaration only before this line -
InfoObject = ZMCFADCNO
Fieldname = BELNR
data type = CHAR
length = 000010
convexit = ALPHA
form compute_BELNR
tables l_t_range structure rssdlrange
using p_infopackage type rslogdpid
p_fieldname type rsfnm
changing p_subrc like sy-subrc.
Insert source code to current selection field
$$ begin of routine - insert your code only below this line -
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'BELNR'.
l_idx = sy-tabix.
SELECT
/BIC/ZMCFADCNO
FROM /BIC/AZOCFBSID00
INTO TABLE TB_ZOCFBSID.
SELECT
/BIC/ZMCFADCNO
FROM /BIC/AZOCFBSIK00
INTO TABLE TB_ZOCFBSIK.
SELECT
/BIC/ZMCFADCNO
FROM /BIC/AZOCFBSIS00
INTO TABLE TB_ZOCFBSIS.
LOOP AT TB_ZOCFBSID INTO WA_ZOCFBSID.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
l_t_range-low = WA_ZOCFBSID-/BIC/ZMCFADCNO.
Append l_t_range.
CLEAR l_t_range.
ENDLOOP.
LOOP AT TB_ZOCFBSIK INTO WA_ZOCFBSIK.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
l_t_range-low = WA_ZOCFBSIK-/BIC/ZMCFADCNO.
Append l_t_range.
CLEAR l_t_range.
ENDLOOP.
LOOP AT TB_ZOCFBSIS INTO WA_ZOCFBSIK.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
l_t_range-low = WA_ZOCFBSIS-/BIC/ZMCFADCNO.
Append l_t_range.
CLEAR l_t_range.
ENDLOOP.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
Edited by: AtulMohan Mishra on Dec 27, 2010 1:11 PMHi
Now i am facing an error during data extraction from Source system
error message in BW system "Error occurred in the data selection " Data Package 1 : arrived in BW ; Processing : 2nd processing step not yet finished
when i checked in SM37 (R3 system) i found the job has been cancelled and Log of this job says
"Asynchronous sending of InfoIDOCs 2 in task 0001 (0 parallel tasks) DATASOURCE = 0FI_GL_4
ABAP/4 processor: SAPSQL_WHERE_CANT_SCAN
Job cancelled "
it seems to me the Problem in Routine at Info Package level.
My Requirement is to fetch only those Accounting Doc. No. RECORDS from 0FI_GL_4 data source which are present in Active data table of BSID,BSIK,BSIS ODS's.
So i want to put logic at Info Package routine .
1) fetch all Accounting Doc. No. from Active data table of BSID,BSIK,BSIS Ods's and Match those Accounting Doc. No.'s with the 0FI_GL_4 data source Accounting Doc. No's.if a Accounting Doc. No. match with 0FI_GL_4 data source Accounting Doc no then that corresponding record from 0FI_GL_4 will go to the ODS
Regards
Atul -
How to set request number of info package using start routine
Hi All,
I have a specific requirement in which I need to upload only selective request nos from PSA to DSO.
Any one can suggest how to set request number of info package using start routine or any other mode so that only selective request should proceed using DTP?
Thanks
SangitaYou'll probably want to do this in a start routine. It is probably not advisable to hard-code the technical name of the InfoPak. They seem to remain the same upon transport, unlike DTP technical names which are locally generated.
I would do a SQL select like this in a start routine, and then filter based on the results of the SQL. You'll probably want to sort the results by date and time, both descending. Or do a MAX in the SQL.
Please let me know if this isn't clear.
select q~rnr q~logdpid q~tdatum q~tuzeit
from rsreqdone as q
inner join rsldpio as p
on p~logdpid = q~logdpid
where p~objvers = 'A'
and p~logdpid like 'ZPAK%'
and p~source = 'your data source' -
How to write an inverse routine for an info object at field level.
Hi All,
Our requirement is as follows:
Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs). The point of the inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT. That way, the field types match and finding the data in APO is much quicker.
Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
*****Code to convert from 40 chars to 18******
*In APO if the material contains all integers values the material will
* come over as a 40 byte field. It needs to be shortened.
IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
*In APO if the material contains any character fields the material will
* not be zero filled and will be left alligned. Take the 1st 18 bytes.
ELSE.
short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
ENDIF.
*add leading zeros to numeric only value
IF short_material CO '0123456789 '.
w_num18 = short_material.
short_material = w_num18.
ENDIF.
RESULT = short_material.
*$*$ end of routine -
***********here the iverse routine need to write************
* Method invert_0MATERIAL
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
METHOD invert_0MATERIAL.
*$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
Here you would write logic in 0MAT_PLANT to do the opposite of the above,
convert 18 back to 40 characters.
*$*$ end of inverse routine - insert your code only before this line *-*
The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
Could anybody please help me or let me know any idea related to this.Hi All,
Our requirement is as follows:
Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs). The point of the inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT. That way, the field types match and finding the data in APO is much quicker.
Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
*****Code to convert from 40 chars to 18******
*In APO if the material contains all integers values the material will
* come over as a 40 byte field. It needs to be shortened.
IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
*In APO if the material contains any character fields the material will
* not be zero filled and will be left alligned. Take the 1st 18 bytes.
ELSE.
short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
ENDIF.
*add leading zeros to numeric only value
IF short_material CO '0123456789 '.
w_num18 = short_material.
short_material = w_num18.
ENDIF.
RESULT = short_material.
*$*$ end of routine -
***********here the iverse routine need to write************
* Method invert_0MATERIAL
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
METHOD invert_0MATERIAL.
*$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
Here you would write logic in 0MAT_PLANT to do the opposite of the above,
convert 18 back to 40 characters.
*$*$ end of inverse routine - insert your code only before this line *-*
The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
Could anybody please help me or let me know any idea related to this. -
How to control data load in Info-Package using ABAP?
Hello Gurus:
I am trying to resolve couple of issues.
1. I need to load data DAILY Full Load into a Planning cube. I have the 0NETDUEDATE for selection in the
Info-package. I am getting data from anothe base A/R cube. I want to Load Daily ONLY those records
for which the "0NETDUEDATE" is Greater than "System Date". I think the logic would be IF 0NETDUEDAT
.GT. SYS-DATUM, bruing the record. What should be the statement in 'Result' for keeping the record?
(I don't know ABAP, so need help here...!)
2. Similalry, before loading the data above, I want to delete all the existing records from Planning cube where
0NETDUEDATE is GT System date (records loaded the previosu day need to be deleted as the amounts may
have changed). How can I achieve this selective deletion automatically in PC??
Appreciate your feedback very much.
Thanks... SMaaHi Shruti,
1) If i understand your requirement correctly you need to load only data which has 0NETDATE greater then sydatum.
So you can do this in infopackage .Infopackage>Data selection->0NETDATE(field)-->type(colum).here you can selecy ABAP type(6).Now you create ABAP code in this.
Here in ABAP code you need to specify high and low range ,Also the relation character like GT or BT(between).
i guess some how ur code will look like this
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
InfoObject = 0NETDUEDATE
Fieldname = NETDUEDATE
data type = NUMC
length = 0000010
convexit = PERI6
form compute_NETDUEDATE
tables l_t_range structure rssdlrange
changing p_subrc like sy-subrc.
Insert source code to current selection field
$$ begin of routine - insert your code only below this line -
data: l_idx like sy-tabix.
l_idx = sy-tabix.
l_t_range-low = sy-datum.
l_t_range-option = 'GT'.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
i am not sure about coding but you can surely do it it is like specifying the ranges dynamically(you need to try it out)
(also as mentioned by others you can do this in traansformation routines)but infopackage routine you can directly write in PROD system.
2) And regarding the Selective deletion you donu2019t have nay process type in Process chain which does this
But there is function module u201C rsdri_infoprov_delete " which can be used to develop a program( I guess you must be having a existing ZProgram in ur system already available because this is used commonly.
Other wise you need to develop a ZProgram for this.
Thanks and Regards
Arun -
Routines for File name at External Data in Info Package level.
Hi All,
Can any one give the example codes of how to write the routine for Files at External Data in Info Package level.
Regards
srinivasHi Srinivas
Here iam attaching a sample code in the infopackage level this code is used to select the Current version from TVARV table ..based on the version from variable the data is loaded into the ods..
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'FISCPER'.
l_idx = sy-tabix.
tables tvarv.
data: v_prever(6) type c,
v_fiscper(7) type n.
clear tvarv.
select single low
from tvarv
into v_prever
where name = 'ZBSK_PREVIOUS_RELEASED_VERSION' and
type = 'P' and
numb = '0000'.
concatenate v_prever(4) '0' v_prever+4(2) into v_fiscper.
concatenate '0' v_prever+4(2) v_prever(4) into v_fiscper.
l_t_range-low = v_fiscper .
modify l_t_range index l_idx.
Hope the above code helps you..
let me know in case of any concerns.. and further help needed..
bye
Shu Moh.. -
Example Code for Routine at Data Target in Info Package.
Hi,
Can any one send the example code for writing the routines at Data Target of Info Package for Deleting the Request from Info Cube after Update.
Thanks in Advance,
Regards,
srinivasHi All,
I want to know some examples for guidance in writing the Abap Routine at Data Target of Info Package for Deleting the Request from Info Cube after Update.
In the Data Targets of Info Package for Info Cubes we can delete the previous request based on the Conditions, exceptions and also based on the Abap Routine. I just want to know how do we write the Routine.
This option is adjacent to the Maintain to Data Target in Data Targets of Info Package and will available for Info cube only.
Thanks in Advance,
Regards,
srinivas -
ABAP Routine in selection of Info package in 3x
Hello Experts
We need to load distinct PO data in 3x server.
I have added this distinct po values in range table of info package abap routine.
However its not loading for range table values more than two selections/pos.
If I try to append more than 2 values,only last one is uploaded.
However after load, in monitor tab-header , selection paramenters I can see all PO values in selection.
Some how it works only for two inputs (rows) in range table of ABAP routine in infopackage.
Anybody has faced such issue? any help is appreciated!
Edited by: Kanchan Angalwar on Jan 30, 2010 9:59 AMHi,
Please post your ABAP code here -
Data selection in info package using ABAP routine.
Hi,
when we are scheduling the info package(Infp package name is like XYZ),we want to load past 6 months data from the current date(INFO OBJECT(0CREATEDON) BETWEEN (Sy-Datum - 6 months TO Sy-Datum),in the selection tab in schedule i want to write the abap routine (type 6).please can any one have this type of code please sedn to me asap.
this is very urgent.delivery is tomorrow.hi Lekha,
try following code.
seems you post the same question twice, one posting is sufficient. and please don't forget to reward helpful answers.
data: l_idx like sy-tabix.
read table l_t_range with key
iobjnm = '0CREATEDON'.
l_idx = sy-tabix.
DELETE l_t_range
WHERE iobjnm = '0CREATEDON'.
L_t_RANGE-SIGN = 'I'.
L_t_RANGE-OPTION = 'EQ'.
if not work, try
L_t_RANGE-OPTION = 'BT'.
BT = between
last 6 month
L_t_RANGE-LOW = sy-datum - 180.
current date
L_t_RANGE-HIGH = sy-datum.
append l_t_range.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform. -
How to write a procedure to run the call the custom package from backend
Hi All
Oracle 10g
Oracle Apps R12
I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
where trunc(route_date) = trunc (sysdate+2).
so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
so now how to write a procedure for this
Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
can some could provide the steps to do this
Thanks & Regards
Srikkanth.MThis is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
And no, I won't do it for you.
Sybrand Bakker
Senior Oracle DBA -
Data deletion routine in the info package
Hi All,
I am writting an data deletion routine in the info package.
it is working fine...
but when we are transporting the info package, that routine is not getting transported.
we have tried sending ths info package through a transport connection.
but still it is not taking the routine to next system.
please let me know if any one has a solution for this.
Thanks,
MugdhaHi Mughda,
Collect the infopackage using transport connection, While collecting the infopackage make sure that Routines are also collected in the same request.
Else most of systems will have authorizations to create infopackages, so try to create one IP and use the routine in IP.
Hope this helps.
Rgs,
I.R.K -
How to write a start routine in the trasnformations ?
Hi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekharHi,
Yopu can write the below lines of code adn try
SORT source_package BY Receive nr Type ASCENDING.
DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr Type.
But you should make sure which record of the either rows need to deleted
i.e in
F9001;LU;J001;662;
F9001;LU;J002;662
You need to decide to eliminate 1st or 2nd one.(depends on your requirement) -
How to write the start routine in the transformations ?
Hi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekharHi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekhar
Maybe you are looking for
-
How to write to mounted disc image
I need to add a file to a disc image I created, but it always comes up no write no matter what I do. Anyone know a good tip to do this? Thanks.
-
PDF output generated by XML Publisher is not printing in Dotmatrix Printer
Hi All, We have designed a template for a particular concurrent program to print it's output format in PDF. The concurrent is running fine and it has produced the output in PDF format. But we are unable to take a printout of the output in our Dotmatr
-
16 phones in 4.5 years!
The following is my tale, based on email written to Verizon ahead of a small claims case I will soon be filing against Verizon, of how I came to be known as “14-phone guy”: In 4.5 years, Verizon has sent me 16 warranty replacement phones – this does
-
Adf AutoSuggest Popup not working properly with af:InputText
Hi, I have a scenario where I have a inputText box with autoSuggest . Now I need to validate the inputText for having minimum of three characters . I added the af:ValidateLength .The moment I added af:ValidateLength or any customValidator ,the af:aut
-
Hi, Regarding 9iAS release 1.0.2.2 and Portal 3.0.9 We have a requirement to send email from Portal BUT the database server sits behind a firewall and cannot connect to the email server directly (ruling out UTL_SMTP use that I am familiar with!). Hav