*** Abap Routine in Infopackage selection ***
Hi !!!
I have the scenario below:
I have created an infoobject called CAEMPFF. In the infopackage selection under field 0COMP_CODE I want to create an abap rotine to read all vaules filled in CAEMPFF.
How can I do that using abap routine ?
Thanks in advance,
Leandro.
Hi Leandro,
In the infopackage, under 0comp_code (or probably field BUKRS if it's an ERP datasource), you should select ABAP routine (6) under Type field. Then, you'll be prompted to create the routine.
There you should create a program that reads all the values of your infoobject master data table.
Hope this helps.
Regards,
Diego
Similar Messages
-
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 -
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. -
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 -
Abap Routine for Date selection in Infopackage
Hi
I have to write an abap routine for date selections in the infopackage,
There are two date begda and enda.
Do i code for BEGDA and fill in the begin date using routine and use another routine to fill the ENDA.
JPJPHi JP,
If you have two info objects BEGDA and ENDA in the Info package for selection
then you will have to write seperate routine for each of them.
If you want to give single value for each date field then update only the field l_t_range- low otherwise if you want to give range then you can update the internal table fields l_t_range-low and l_t_range-high .
Regards,
Prakash -
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. -
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 -
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. -
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 AT INFOPACKAGE FOR DATE RANGE
hi all,
I want to Schedule my infopackge with selection options
0DATE infoobject with First date of current month( 01.02.2008) to last date of current month ( 29.02.2008).
this i have to get automatically bcoz i have to use this in process chain.
so I want to write a routine for this at the infopackage level with ABAP Routine -6 option.
So please suggest me how to write the code for this case.
thanks,
kiran manyam.Hi Kiran,
Please paste the following code there and also check for syntax error.
data first_date type d.
data last_date type d.
first_date = sy_datum.
first_dat+6(2) = '01'.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
Exporting
DAY_IN = first_date
Importing
LAST_DAY_OF_MONTH = last_date.
read table l_t_range with key
fieldname = 'DATE'.
if sy-subrc = 0.
l_idx = sy-tabix.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = first_date.
l_t_range-high = last_date.
modify l_t_range index l_idx.
else.
move 'DATE' to l_t_range-fieldname.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = first_date.
l_t_range-high = last_date.
append l_t_range.
endloop.
endif.
p_subrc = 0. -
Debug abap routine in infopackage
Hi experts,
What is the easiest way to debug an abap routine used in the infopackage for dynamic selection? When I go into the code I cannot place a breakpoint. Optionally I can do a /h before hitting the schedule button but what can I look for to go directly to my abap code?
markHI
Below is an excerpt from a reply by AHP few months back
put a loop on the routine,
data : debug(1).
do.
if debug = 'X'.
exit.
endif.
enddo.
and when run infopackage, go to sm50,
on that process, menu program->debug program,
in debug screen, type in debug, and fill with X and click 'edit'-pencil icon.
F5 to next step.
hope this helps.
Regards
Prakash -
Excluding Value Range - ABAP Routine at Infopakage Selection
Hi,
In Production the volume of data is very high, I m splitting the data based on Material No.
000000000000 - 4ZZZZZZZZZ,
500000000000 - 8ZZZZZZZZZ,
900000000000 - FFFFFFFFFFFFF,
and the remaining Material No.s.
I created seperate InfoPaks for the material Ranges for the above three.
I need to load the remaining Material No. data. For the I need to write the ABAP routine at the Infopakage Selections.
Can you help me doing so.
Thanks in Advance.
Surya.Hi,
analyse the data. total data u can split with the help of Organisational values. take the case in souce system i have 40 million records of sales orders. then i will do like how many sales area's we have in our organization. assume. 4 sales areas then i willl create a infopackage for each. so tat u won't miss any data.
don't go for Material number, select organisational values.
all the best.
Nagesh. -
Using ABAP routines for data selection
Hello,
I want to use ABAP routine to determine value range of data selection in Data Package but when I use routine for one field, selection criterias for other fields are ignored, e.g.:
in Data Package I have two selection fields:
CPUDT Accounting Document Entry Date
AEDAT Date of the Last Document Change by Transaction
For CPUDT I wrote ABAP routine
and for AEDAT I have just typed in period of time.
I started data extraction and open Monitor for this Data Package.
At Header tag I checked selections info and there is selection only for CPUDT.
Could somebody explain me is it normal system behaviour?
Thanks
AndrzejThanks for reply but that would be too easy...
I have tried your advice but nothing changed.
I think this is data extraction configuration problem.
Andrzej -
ABAP Routine for 0FISCPER select data in InfoPackage
Hi all,
I need to write a routine which has to return values from the last FISCPER to the current FISCPER in the data selection of the infopackage.
Do somebody already do it?
ThksTry this:
Global Declarations
CONSTANTS: c_1(1) TYPE n VALUE 1,
c_fiscvarnt TYPE /bi0/oifiscvarnt VALUE 'Z1', "Use whatever your default Fiscal Year Variant is"
c_i(1) TYPE c VALUE 'I',
c_bt(2) TYPE c VALUE 'BT'.
DATA: l_tabix LIKE sy-tabix,
l_fiscper3 TYPE /bi0/oifiscper3,
l_fiscyear TYPE /bi0/oifiscyear,
l_min TYPE /bi0/oifiscper,
l_max LIKE /bi0/oifiscper.
Routine
CLEAR: l_fiscper3,
l_fiscyear.
CALL FUNCTION
'DATE_TO_PERIOD_CONVERT'
EXPORTING
i_date = sy-datum
i_periv = c_fiscvarnt
IMPORTING
e_buper = l_fiscper3
e_gjahr = l_fiscyear.
CONCATENATE: l_fiscyear l_fiscper3 INTO l_max.
l_fiscper3 = l_fiscper3 - c_1.
IF l_fiscper3 LT 1.
l_fiscyear = l_fiscyear - c_1.
l_fiscper3 = c_1.
ENDIF.
CONCATENATE: l_fiscyear l_fiscper3 INTO l_min.
READ TABLE
l_t_range
WITH KEY
fieldname = 'FISCPER'.
MOVE: sy-tabix TO l_tabix,
c_i TO l_t_range-sign,
c_bt TO l_t_range-option,
l_min TO l_t_range-low,
l_max TO l_t_range-high.
MODIFY
l_t_range
INDEX
l_tabix.
p_subrc = 0.
Edited by: Dennis Scoville on Dec 7, 2009 11:07 AM
Maybe you are looking for
-
I have two Apple IDs because i travel frequently between Mexico and the US, and the apple stores offer different products, so i like to download music, movies and TV series from both sites. Apparently apple changed the conditions, becauise until a fe
-
Create a filename based on form content
Hello, I always have a hard time explaining my question's but here goes. I have a button which saves a form once filled out. I would like to take the thinking out of this when it comes to naming the file and it create the name based on a numerical fi
-
Copying items in Apple Remote Desktop
According to the manual, you should be able to copy items between the local and remote computer, either by dragging or by selecting "Copy Items" button. But each time I try, it gave me an error message saying the "This task is not supported on the re
-
Hi , there is a way to create a user definied field definition that connects in a specific table of my application an list a column? Thanks.
-
When I look at the report, I saw this: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000083e58951 Any thoughts? Like said above, not having issues with the other items in my suite.