Routine in InfoPackage DataSelection
Hi,
Can someone provide me the ABAP code for the below mentioned scenario.
In the InfoPackage, I want to extract only those Business Partners which are available in the other DSO.
Thanks in Advance
Mahesh Kumar
Below is the sample routine used at infopackage level in one of our projects to load only the data for few plants, i had modified the code replace you IO(Business partner) and check
data: l_idx like sy-tabix.
DATA : IT_PLANT LIKE TABLE OF /BI0/P<Business partner>.
data : IT_BPART_WA type /BI0/P<Business partner>
read table l_t_range with key
fieldname = 'BUSINESS PARTNER'.
l_idx = sy-tabix.
SELECT * FROM /BI0/P<info object> INTO TABLE IT_BPART WHERE <use the logic if any>
LOOP AT IT_PLANT INTO IT_BPART_WA.
l_t_range-low = IT_BPART_WA-<IO>.
l_t_range-SIGN = 'I'.
l_t_range-OPTION = 'EQ'.
append l_t_range.
ENDLOOP.
modify l_t_range index l_idx.
p_subrc = 0.
Similar Messages
-
ABAP Routine at infopackage dataselection
I got one scenario to use ABAP Code.
In data selections we have CALWEEK.
We are loading to from flatfile to cube.Every week we load the data to cube.
If the flat file week=present week(sys week) then update to cube or else fail.Hello,
In infopackage write the below routine for week selection.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'CALWEEK'.
l_idx = sy-tabix.
data: g_week type /BI0/OICALWEEK.
CALL FUNCTION 'DATE_GET_WEEK'
Exporting
DATE = sy-datum
Importing
WEEK = g_week.
l_t_range-iobjnm = '0CALWEEK'.
l_t_range-FIELDNAME = 'CALWEEK'.
l_t_range-sign = 'I'.
L_T_RANGE-OPTION = 'EQ'.
l_t_range-LOW = g_week.
modify l_t_range index l_idx.
p_subrc = 0.
Note: the above example is with reference to char 0CALWEEK.
Regds,
Shashank -
ABAP routine in infopackage that runs function in ECC
Hi All
I need to have dynamic filter in the info package
I have program in ECC that brings me the value that I need to filter in my info packege
I want to use ABAP routine in infopackage that runs function in ECC and brings the value that was received from the ECC function
Is that possible?
ThanksHi All
my CTO found the following option
function module that is "remote-enabled module "
then you call CALL FUNCTION 'Y_FM_IDOC_CATSDB' DESTINATION 'SAP4.7E'
you need to define it in SM59
code example
data: BEGIN OF IT_SOBSL OCCURS 0,
SOBSL(2),
END OF IT_SOBSL.
DATA: ls_range type STANDARD TABLE OF rssdlrange WITH HEADER LINE.
SELECT /BIC/ZSPEPROCI FROM /BIC/SZSPEPROCI INTO TABLE IT_SOBSL
WHERE /BIC/ZSPEPROCI NOT BETWEEN 'AA' AND 'ZZ'
AND /bic/zspeproci ne '' .
BREAK-POINT.
LOOP AT IT_SOBSL.
ls_range-IOBJNM = 'SOBSL'.
ls_range-LOW = IT_SOBSL-SOBSL.
ls_range-SIGN = 'I'.
ls_range-OPTION = 'EQ'.
APPEND ls_range .
ENDLOOP.
loop at ls_range.
append ls_range to l_t_range.
endloop. -
What is use of routine in Infopackage screen
Hi,
What is use of routine in Infopackage screen.
can anyone provide me a scenerio.
Thanks,
cheta.Yes they are very helpful...
I will explain you one scenario....
Because of certain irregularities in the system, I have to take a full upload everyday from 1st Apr 2007 to the current date...earlier I was extracting that data manually because I have to give the current date in the "TO" field....now my From date is 1st April 2007 and From Date is Sy-Datum...now this package is scheduled and I have removed the manual intervention.
Hope this clears you.
Regards
Gajendra -
Regarding the routine in infopackage
Hi Experts,
I have an infopackage with only full load update,i am loading a daily load into the target with that ..now what i want to know is that i want to create a routine in infopackage so that it deletes the previous day data automatically ..so that if i am loading todays data it wont be duplicated..so can any one give me the code and step by step ways to do that ..i would appreciate the answers and assign maximum points for the valuable one...
regards,
RkIf it is going to be full load, you have some options like:-
a. At Infopackage Level:- Under the data-targets tab, you have a check box for deleting the targets contents before loading, if you check that tab, the data will be deleted automatically before loading.
But beware that ALL data will be deleted and only today's data will remain there.
b. Process Chains:- If your selections are same, you can use a process type "Delete Overlapping Request" in the process chain, and it will delete the contents before reloading them.
Hope this helps.
Cheers,
Sumit -
Routine in Infopackage - Extraction
Hi All,
I want to know ; How to write Routine in the Infopackage Extraction?
I know that we can write Routine in Infopackage extraction.
PLease let me know the steps.
Regards,
Macwan James.Hi
In ifopackage we use routine for selection, please find below threads related to this which will be helpfull to you:
Infopackage Selections Tab-OLAP Variable/ABAP Routine
ABAP Routine correction in the selections fields of a Infopackage
Re: how to write routine for infopackage
Regards
Ravi -
ABAP Routine in InfoPackage for selection
Hello,
I have 2 InfoPackages for loading from ODS1 to ODS2. InfoPackage 1 is restricted via ABAP Routine to load only certain customer numbers.
InfoPackage 2 is supposed to load all other customer numbers - therefore the ABAP Routine makes ranges that exclude the customer numbers selected in InfoPackage 1.
Now I face the fact that the selection of InfoPackage 2 is much to small in numbers. Problem is, the ranges only work when entered manually - but via ABAP entry these ranges don`t work. I can`t understand why this problem happens. Do you have an idea?
Example (first number is from, 2nd number is to)
InfoPackage 1: customer numbers
5| 5
100|100
999|999
InfoPackage 2: customer numbers
0|4
4|99
101|998
1000|99999
But selection of InfoPackage 2 does not work propberly...
Thanks for your help,
AngelikaHi,
no, that was just a typing mistake. Sorry.
The problem is, that in Monitoring I can see the selection and it looks good.
But when I check the number of datasets selected it is far to small. Therefore I don`t believe the selection works.
I tried manually to put all the ranges selected by ABAP Routine in InfoPackage 2 in another InfoPackage 3 - the selection is identically to InfoPackage 2 (but not made via ABAP, but manually) and in Monitoring the selection looks absolutly alike.
But the manuall InfoPackage 3 selects far more records than InfoPackage 2.
I can`t understand the problem. Can you? Can you give me advice?
Thanks,
Angelika -
Routine in Infopackage not working
Hi all..
I wrote a routine in Infopackage with the selection Abap routine 6. for some reason the code is not selecting..i mean if the code has to get fisc year 2007, instead its getting all the records from all the years. i tested out the code in abap se38, it works fine, the function module is working fine, i am missing something here in infopackage, can anyone please let me know.
Here is the code.
data: l_idx like sy-tabix,
Year type /BIC/CS8ZCBFCOPA-FISCYEAR.
data : begin of itab occurs 0.
include structure /BIC/PZOCDPYCTA.
data : end of itab.
CALL FUNCTION 'ZBW_GET_FY_PKG_SELECTIONS'
EXPORTING
VTYPE = '010'
IMPORTING
ZOCDPYCTA = itab.
loop at itab.
read table l_t_range with key
fieldname = 'FISCYEAR'.
l_idx = sy-tabix.
l_t_range-SIGN = ' I '.
l_t_range-OPTION = ' EQ '.
l_t_range-LOW = itab-FISCYEAR.
modify l_t_range index l_idx.
endloop.
p_subrc = 0.
The FM takes the input as 010 and gets all the records related to that..which is 2007 year records instead its getting all the records from all years..please help me.
Thanks
VjCheck the monitor to see what values are entered as the restrictions in the infopackages for fiscal year. if the correct values don't show up in the monitor you know the routine is the problem and not a system bug.
Also, you may want to consider doing a range if the multiple single values isnt working. -
Include for Routine in Infopackages
Hi All,
i created a routine in infopackage. The extraction is working as expected.
We have several Infopackages which should work with the same logic. That means i have to copy the routine in all IP.
I would like to avoid that by inserting the routine in an include so that by changing something, the chnage should be central.
I could i do it?
ThanksHello,
you can write a universal routine in se38 and call it in all your IP. You can also implement OOPs concept and use a global class for your requirement. Goto tcode SE24 and declare the class with methods. Call this class in all your IP.\
Else you can write a global routine in SE38 (INCLUDE) and call this include in all your IP. This what we are doing in our project where we need to implement the same logic in all 10 IPs. We declared a subroutine and call this subroutine every where.
Regards,
satyam -
Routine in Infopackage selection
Hi,
We are using DB Connect and hence we need to write a routine in Infopackage selections to restrict the data to be extracted.
In the source file, there is a field called " Time stamp".
This is a Char 23 field with mm-dd-yyyy-hh.mm.ss.sssss format.
My requirement is lookinto first 10 char ( only for date) and filter the records. If the date = Sy-datum, then only, i want to extract the data in BI staging.
Is it possible to write a routine in Infopackage ? Can you pls help me ?
Or do i need to take the whole data into PSA and then write a routine in transformation while uploading to Data Target ?
Regds,
BW SmallHi,
See the below code for Including 0FISCPER dynamically, so in that way you can write code to get your selection or change the data formate etc.., show this code to ABAPer ask according to this code implement your logic.
In below code I'm calculating 0FISCPER based on Sy-Datum using FM.
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: ...
* DATA: ...
*$*$ end of global - insert your declaration only before this line *-*
* InfoObject = 0FISCPER
* Fieldname = FISCPER
* data type = NUMC
* length = 000009
* convexit = PERI7
form compute_FISCPER
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,
zzdate LIKE sy-datum,
zzbuper LIKE t009b-poper,
zzbdatj LIKE t009b-bdatj,
zzperiod(7) TYPE c.
READ TABLE l_t_range WITH KEY
fieldname = 'FISCPER'.
l_idx = sy-tabix.
zzdate = sy-datum - 1.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
i_date = zzdate
* I_MONMIT = 00
i_periv = 'V3'
IMPORTING
e_buper = zzbuper
e_gjahr = zzbdatj.
* EXCEPTIONS
* INPUT_FALSE = 1
* T009_NOTFOUND = 2
* T009B_NOTFOUND = 3
* OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONCATENATE zzbdatj zzbuper INTO zzperiod.
l_t_range-low = zzperiod.
l_t_range-option = 'EQ'.
l_t_range-sign = 'I'.
MODIFY l_t_range INDEX l_idx.
p_subrc = 0.
*$*$ end of routine - insert your code only before this line *-*
endform.
Thanks
Reddy -
ABAP routine at Infopackage selection options
Dear all,
I need to write ABAP Routine at InfoPackage Selection Options.
Requirement is to bring only the versions (contains 2 characters) starting with 'C'.
Ex. I need versions CR, CP...
Code template is the following:
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'VERSB'.
l_idx = sy-tabix.
modify l_t_range index l_idx.
p_subrc = 0.
Can anybody help me to resolve this?
RegardsHi,
here is an example:
DATA: string(40) TYPE c.
CONCATENATE 'C' '%' INTO string.
SELECT *
FROM /bi0/hwbs_elemt
INTO TABLE lt_hwbs_elemt
WHERE nodename LIKE string.
Best regards,
Frank -
Call function in abap routine of infopackage
Experts,
Good day. I have a problem concerning the data to be imported in my ods.I can't find a similar thread corcerning my problem. My File date field should contain only 2 years and 3months data of recent data. I'm using a call function fima_date_create to filter values of zfile_date.
CALL FUNCTION 'FIMA_DATE_CREATE'
EXPORTING
I_DATE = sy-datum
I_FLG_END_OF_MONTH = ' '
I_YEARS = 2-
I_MONTHS = 3-
I_DAYS = 0
I_CALENDAR_DAYS = 0
I_SET_LAST_DAY_OF_MONTH = ' '
IMPORTING
E_DATE =
E_FLG_END_OF_MONTH =
E_DAYS_OF_I_DATE =
The sy-datum becomes the High value and the date generated by this FM will be the low value. I already tested this function module and it is what i want. How Should I write the ABAP code for this in the abap routine for my infopackage? Or what steps do I need to take.Hi,
When you choose the option to write a routine for one of the characteristics in the infopackage selections, you get a window to write your code with some prewritten code as below. Modify it as shown below, for your requirement.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'CALDAY'.
l_idx = sy-tabix.
START of YOUR CODE
<----
Required logic -
>
L_T_RANGE-LOW = <lower limit of range>.
L_T_RANGE-HIGH = <upper limit of range>.
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'BT'.
END of YOUR CODE
modify l_t_range index l_idx.
p_subrc = 0.
Hope this helps. -
I am in the process of creating an ABAP routine in the Infopackage to load current month based on system data from one cube in BW to another Cube in BW. I am getting the following error in the load. I am not an ABAPer and would appreciate if you can help or guide me with a sample code.
Here is the error.
For sel. field '/BIC/Z_APOSNAP', no selection with SIGN = ''; OPTION '' allowed.
Thank you
NeeluHi Neelu,
U can create a ABAP Routine of the type 6 (ABAP Routine),The field you are trying to populate is a select-option so you have to define both Sign and Option along with Low and High values.
As u want to load current month, from a system values , u can do it from sy-datum.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = ''/BIC/Z_APOSNAP'.
l_idx = sy-tabix.
l_t_range-low =
l_t_range-high =
l_t_range-sign =
l_t_range-option =
modify l_t_range index l_idx.
p_subrc = 0.
Just u can fill Sign as 'I' and Option 'EQ'.
Fill Low and High with values u get from System Data.
Hope this Helps,
Thanks,
Krish
**awarding points is way of saying thanks in SDN. -
Need to write ABAP Routine at infopackage Selection Options
Hi All,
I need to write ABAP Routine at Info Package Selection Options.
Requiremnet i need to bring some Sales Document Types (Sales Orders Types) only from R/3.
Ex I need OrderTypes ZQT,ZSIV etc
Can any body help to resolve this.
Regards,
P.C.V.Hi P.C.V,
If the order type field is already available in the Data Selection Tab of the InfoPackage, then you just need to place your selections there (e.g. order type = ZQT, ZSIV) without the need to use ABAP routines.
If ever you really need an ABAP routine, here is an example ABAP routine. The most important concept is to modify the range table l_t_range so that the selection reflect what you need.
data: l_idx like sy-tabix.
data: w_startdate like sy-datum,
w_startweek like scal-week,
w_maxdate like sy-datum,
w_maxweek like scal-week.
w_startdate = sy-datum.
w_maxdate = w_startdate + 104 * 7.
* Calculate horizon for extraction
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = w_startdate
IMPORTING
WEEK = w_startweek
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = w_maxdate
IMPORTING
WEEK = w_maxweek
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
read table l_t_range with key
fieldname = 'CALWEEK'.
l_idx = sy-tabix.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = w_startweek.
l_t_range-high = w_maxweek.
modify l_t_range index l_idx. -
Hi,
I have an InfoPackage that loads into multiple InfoCubes. Sometime at the end of this year we will stop loading one of the InfoCube.
What ABAP code do I use to achieve this result? How do I do this type of filter from InfoPackage?
Thanks in advance for your precious time and help
Best regard
ArjunHi Arjun,
Would be having an InfoPackage against which you would be checking the 'End of the year' ie any time characteristics say 0CALDAY,
In your routine check this InfoObject for End of the year and if true you can allow this to load to further InfoProviders or Datatargets.
Othervise do what ur business logic says.
This you can do provided you know the exact date ( value) .
Otherwise try to find out any infoobject whose value is important in terms for ur infoprovider loading . and you can use that infoobject to check in routine.
Say you want to load XYZ if its not the end of year and otherwise you waht keep it constant.
if SOURCE_FIELDS-Ocalday < '20081231'.
temp = xyz.
else.
temp = '00000000'.
endif.
Results = temp.
Hope this Helps.
Regards
Praeon
Maybe you are looking for
-
Senario: Need to manage 500 Enterprise iPads Requirements; 1) Trackable via Find my iOS device (we have 500 iPads and with the 100 device limit per iCloud account for Find my iOS device limit we have 5+ iCloud accounts). 2) Individually named iPads
-
Can the 27" iMAC be hooked up to my SKY (non HD) box so I can use it instead of a TV? If so how do I do it? I would like to be able to view my Sky programs through the iMAC rather than have a seperate TV set up in the same room. I have no interest in
-
Vendor Master report with address, telephone number & email ID
Dear All, Kindly provide to me T Code for Vendor master report along with vendor address,Telephone number & email ID. Krajesh
-
Can't Find A Hard Disc to install
I'd like to add an additional Hard Disc but cannot find one for the older MacPro version. Is there somewhere on this site I can buy one? If not, why? More importantly, where can I buy one? Processor 2x2.66 GHz Dual-Core Intel Xeon Thanks in advance!
-
How to access/ recover files?
My user account is not functioning. Once i open it, the screen just becomes black and even if i turn off the pc and turn it on again, the problem is still there. i can open the account of my brother but i can't access my files through there. is there