* sign in ABAP code
Hi Experts
I found in SAP code the usage of * sign but it wasnt in select statement. Anyone knows how below statement works?
i_frggr = *ekko-frggr
Thanks in advance.
az
Hi,
the statement with *
i_frggr = *ekko-frggr
you can find in the declarations that they would be declared in this way
Tables : *ekko,
ekko.
These kind of declarations are used in the programs which has updates in it...
so *ekko keeps the older value and it is treated as a normal work area only, It has no special meaning attached to it.
ekko holds the modified or updated value which has to be updated in the database table.
so to differentiate between older values and modified values
they used '*' to differentiate them thats all,
Regards,
Siddarth
Similar Messages
-
Date range selection in abap code in infopackage
Hi!
I have a field called "OPEN_DATE".
When the infopackage is runned, I need the abap code to fint the current date, and from that, make a date range from the first day of current month to the last day of current month
Ex:
Current date = 12.12.2008
Abap code should extract 01.12.2008 - 31.12.2008
Thanks!Hi helge,
Data: l_idx like sy-tabix.
Data: date_low like sy-datum,
date_high like sy-datum.
Date_low = sy-datum.
date_low+6(2) = '01'.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = Date_low
IMPORTING
LAST_DAY_OF_MONTH = date_high
read table l_t_range with key
fieldname = 'OPEN_DATE'.
l_idx = sy-tabix.
Pass Range values to L_T_Range Table.
Move date_low to L_T_Range -Low.
Move date_high to L_T_Range -High.
L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
modify l_t_range index l_idx.
p_subrc = 0.
Regards, -
Error in the ABAP Code for Customer Exit Variable
Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
In CMOD i had written the below Code:
When 'ZVWKNO'.
DATA: WEEK(2) TYPE N,
WEEKNO(2) TYPE N.
IF i_step = 1.
l_st_date = SY-DATUM.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = l_st_date
IMPORTING
WEEK = l_fn_week.
CHECK sy-subrc = 0.
WEEK = l_fn_week+4(2).
If WEEK 0.
WEEKNO = WEEK - 1.
l_s_range-low = WEEKNO.
l_s_range-sign = k_sign_inclusive.
l_s_range-opt = k_option_equals.
APPEND l_s_range to e_t_range.
ENDIF.
ENDIF.
But when i execute the query the default value is not populated with Week-1 No in the variable screen
Please update me what went wrong
ThanksCase ZVWKNO. "write this with out comments
When '1'. "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
DATA: WEEK(2) TYPE N,
WEEKNO(2) TYPE N.
IF i_step = 1.
l_st_date = SY-DATUM.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = l_st_date
IMPORTING
WEEK = l_fn_week.
CHECK sy-subrc = 0.
WEEK = l_fn_week+4(2).
If WEEK 0. "check this Week Minimum is '01' and Maximum '52'
WEEKNO = WEEK - 1.
l_s_range-low = WEEKNO.
l_s_range-sign = k_sign_inclusive.
l_s_range-opt = k_option_equals.
APPEND l_s_range to e_t_range.
ENDIF.
ENDIF.
Prabhudas -
Can I use OLAP variable in ABAP Code of infoobject filter
I have 0FISCPER infoobject in filter section of info-package while loading data.
Below OLAP varaibles has below dynamic values that are being calculated at run time.
0P_PRFP2 - (Current fiscal period - 2) ex: 2010010
0P_PRFP1 - (Current fiscal period - 1) ex: 2010011
0FPER - (Current fiscal period ) ex: 2010012
I want to write ABAP CODE FOR using filter values from 0P_PRFP2 to 0FPER. (Last 3 fiscal periods - ex: 2010010 to 2010012).
how to use above standard OLAP variables in ABAP CODE to assign l_t_range (low or high).try this using ABAP routine option (6)
DATA: curryear(4) type N,
currperiod(2) type N,
prevper1(2) type N,
prevyear1(4) type N,
prevper2(2) type N,
prevyear2(4) type N,
prevfiscperYr1(7) type N,
prevfiscperYr2(7) type N,
prevfiscper1(3) type N,
prevfiscper2(3) type N,
w_length1 type i,
w_length2 type i.
curryear = SY-DATUM+0(4).
currperiod = SY-DATUM+4(2).
If currperiod EQ '01'.
prevyear1 = curryear - 1.
prevper1 = '12'.
prevyear2 = curryear - 1.
prevper2 = '11'.
elseif currperiod EQ '02'.
prevyear1 = curryear.
prevper1 = '01'.
prevyear2 = curryear - 1.
prevper2 = '12'.
else.
prevyear1 = curryear.
prevper1 = currperiod - 1.
prevyear2 = curryear.
prevper2 = currperiod - 2.
endif.
w_length1 = STRLEN( prevper1 ).
If w_length1 = 1.
concatenate '0' prevper1 into prevper1.
Endif.
w_length2 = STRLEN( prevper1 ).
If w_length2 = 1.
concatenate '0' prevper2 into prevper2.
Endif.
concatenate '0' prevper1 into prevfiscper1.
concatenate '0' prevper2 into prevfiscper2.
concatenate prevyear1 prevfiscper1 into prevfiscperYr1.
concatenate prevyear2 prevfiscper2 into prevfiscperYr2.
l_t_range-low = prevfiscperYr2.
l_t_range-high = prevfiscperYr1.
* modify l_t_range index l_idx from l_t_range.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx. -
Hello Friends,
Hope you all are well and doing good at your places
Friends, could you please suggest me how should I go for ABAP learning. How much ABAP knowledge is required while working as BW consultant?
I am working as BW consultant from last 1.5 year but not having any ABAP knowledge, so could you please send me some documents which will be useful while working as BW and it will be related with ABAP .
It would be great if any one can send me documents with code sample which genrally used in BW ( like, function module, infoset program, transfer routine, start rotine, user exit ) .
I thanks to you in advance,
Mail id [email protected]
Regardshi Jain,
take a look following doc
'Five Ways to Enhance SAP BI Backend Functionality Using ABAP.pdf' https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4493c4a6-0301-0010-62a2-efd6ded61e04
and check some samples
transfer routine
Date key figure: Convert DATS format to DEC format
Date Conversion in Flat File
Transfer Routine ABAP
conversion exit
Date Conversion
Problem with conversion char to numc in transference rules
conversion routine..?
start routine in transfer rules
Look up to load master data
excluding
Start Routine in Transfer Rules
Sample code in Update Rule to restrict data selection?
Append Datapak - transfer start routine
Excluding Blank field in Infopackage Filter
Trans Routine ABAP help ..
update routine
How to call a function in Update Rules to reverse a key figure sign
Need Sample Code for Update Rules
Date calculation
Difference between data in PSA and Data in Infocube
No RETURNCODE <> 0 allowed in update routines in transfer mode
the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
Access master data in update rules
Date key figure: Convert DATS format to DEC format
start routine in update rules
Is it possible to read a third ODS in update rules between two ODS?
update rule coding while loading data from ODS to CUBE
Start Routine in Update Rules to populate additional fields from ODS
Coding in Update Rules accessing a Z-Table
Start routine
hope this helps. -
Formula Variable with customer Exit (ABAP Code)
Hi Experts,
Please advise me wether i am going in the right way to achieve my requirment else please advise me any alternate approach and update me with the abap code for my customer exit as i am not familiar with ABAP.
My Requirment:
Data :
Emp_ID----Start_Date(DATS)---End_Date(DATS)
I had a user entry (intreval) VARIABLE created on Start_Date
User will enter the date intreval he want to analyze...
Ex: 01.01.2008 to 01.02.2008
Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigure
In the above example it is 31 days
So i created a Formula Variable of Customer Exit now i need a code that will
pass the user entered dates to
FM: FIMA_DAYS_AND_MONTHS_AND_YEARSImport parameters Value
I_DATE_FROM 01.01.2008
I_DATE_TO 01.02.2008
I_FLG_SEPARATE ' '
Export parameters Value
E_DAYS 31
E_MONTHS 1
E_YEARS 1
and need to pass the E_DAYS (31) to the result of formula
User Entry Variable (Intreval) : ZST_VAR
Formula Variable (Customer Exit) : ZND_EXIT
Code
WHEN 'ZND_EXIT'.
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
ls_varrange-low = low_date2.
ls_varrange-high = high_date2.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endif.Hello,
Before the WHEN statement it shoud have a CASE statement. In the user exit coding place your WHEN statement anywhere between CASE...ENDCASE statement.
your code should look like
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
Case i_vnam.
WHEN 'ZND_EXIT'.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
low_date2 = ls_varrange-low.
high_date2 = ls_varrange-high.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range-low = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endcase.
Thanks
Chandran -
Hi Gurus;
Can some one send me the abap codes used mainly for reporting OR can some one give me some sample code used in reporting. my mail id "[email protected]".smod > rsr0001 > EXIT_SAPLRRS0_001 > ZXRSRU01 >
CASE I_VNAM.
WHEN 'ZE_FPPT'.
CALL FUNCTION 'Z_VAR_FP4'
EXPORTING
I_VNAM = i_vnam
I_STEP = i_step
I_T_VAR_RANGE = I_T_VAR_RANGE
IMPORTING
E_T_RANGE = E_T_RANGE.
FUNCTION Z_VAR_FP4.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_VNAM) LIKE RSZGLOBV-VNAM
*" REFERENCE(I_STEP) TYPE I DEFAULT 0
*" REFERENCE(I_T_VAR_RANGE) TYPE RRS0_T_VAR_RANGE
*" EXPORTING
*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID
data: l_s_range type rsr_s_rangesid.
data: LOC_VAR_RANGE LIKE RRRANGEEXIT.
data: year(4).
data: mth(2).
IF I_STEP = 2 .
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE
( VNAM = '0I_FPER' ).
year = LOC_VAR_RANGE-HIGH+0(5).
mth = LOC_VAR_RANGE-HIGH+5(2).
if mth < 10.
concatenate '0' mth into mth.
endif.
concatenate year '0' mth into L_S_RANGE-HIGH.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Regards,
BWer
Assign points if helpful.
Message was edited by: BWer -
ABAP Code for SAP exit varaibles?
Hi,
i) Where can I find the abap code for SAP exit variables
OP_KEYDT used for the net due date
OP_KEYD2 used for the posting date
OP_KEYD3 used for the clearing date, which are used in FI AR aging report(0FIAR_C03).
Based on the Net Due Date, which is key date(0NETDUEDATE), entered by the user at runtime, the posting date and celaring date are populated.
II) The problem is we want to simulate a similar scenario, but with key date, which user enters is based on the custom Net Due Date(ZNETDUEDATE).And this date is populated to posting date and clearing date variables.
How do we acheive that.
Thanks.Hi Kumar,
Try this below mentioned example where default date is current date.
Step1: Create a variable(ex: cur_date) on requrired characteristic with Processing type "Customer Eixt" and check the check box for ready for input(if this variable need in selection screen).
Step 2: Goto T Code : CMOD and provide appropriate Project and choose components and click on display.
Step3: Double click on exit "EXIT_SAPLRRS0_001" you can see include "ZXRSRU01", double click on include.
Step4: Sample code to populate.
WHEN 'CUR_DATE'.
Data : l_p_range_SSS TYPE rrrangesid.
IF I_STEP = 1.
l_p_range_SSS-Low = sy-datum.
l_p_range_SSS-Sign = 'I'.
l_p_range_SSS-Opt = 'EQ'.
APPEND l_p_range_SSS TO e_t_range.
Endif.
The following values are valid for I_STEP:
· I_STEP = 1
Call up takes place directly before variable entry
· I_STEP = 2
Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1.
· I_STEP = 3
In this call up, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called up again.
· I_STEP = 0
The enhancement is not called from the variable screen. The call up can come from the authorization check or from the Monitor.
Also, refer this link..
http://help.sap.com/saphelp_bw320/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
Cheers,
Allen -
ABAP Code Date Selection for InfoPackage Scheduler
Hello Group
I need to automate the selection of valid condition records for an extraction that have a From and To date range.
I noticed there is an option (Routine for time interval) to write ABAP code along with a template that is available in the InfoPackage.
I think the logic for the selection would be any record
Valid from <= today
Valid to >= today
Can anyone help with the ABAP code?
The template is as follows:
program conversion_routine.
Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rsldpsel.
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 -
form compute_time_dependent_dates
changing p_datefrom type d
p_dateto type d
p_subrc like sy-subrc.
Insert source code to current selection field
$$ begin of routine - insert your code only below this line -
p_datefrom =
p_dateto =
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
Thank You for your help!!
FrankI resolved the problem . I have changed the order of read table l_t_range because I need the header .
In the loop at datos I add the line l_t_range-iobjnm = 'ZXGE_UNO'.
The problem wasn't the call RFC it was that I built l_t_range bad. I need the infoObject name.
This is correct!!
READ TABLE L_T_RANGE WITH KEY
FIELDNAME = '/BIC/ZXGE_UNO'.
LOOP AT DATOS.
L_T_RANGE-FIELDNAME = '/BIC/ZXGE_UNO'.
L_T_RANGE-IOBJNM = 'ZXGE_UNO'.
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
CONCATENATE '00' DATOS-WA+3(4) INTO L_T_RANGE-LOW.
APPEND L_T_RANGE.
ENDLOOP.
*READ TABLE L_T_RANGE WITH KEY+
+*FIELDNAME = '/BIC/ZXGE_UNO'.+
+* L_IDX = SY-TABIX.+
+* MODIFY L_T_RANGE INDEX L_IDX
Thanks a lot
Ana -
# sign in postal code field.
Hi Experts,
In ADRC table entry for an addr number, there is # sign in postal code field (NG26BJ#).
And due to this incorrect # sign, there are issues occuring in the system.
Can you suggest where do I search for this # sign in the system?
I mean I searched for customer master, vendor master, etc but could not find out # sign in any partner data postal code field.
Please suggest.
-Chetan.Check all the tables that are on 'where used' list for ADRNR data element in dictionary (SE11).
If it is an "orphaned" record, BW interface should not be actually pulling it in. I would recommend to base the interface on the main table (e.g. KNA1) and only pull ADRC records that are referenced.
The easiest solution would be to write an ABAP report to update the record directly in the database. I wouldn't delete it though, just removed the # sign. Also check the OSS notes or send a message to SAP and they might provide such report for you. -
ABAP Code Required to remove #
Hi,
I have 2 characteristics 0COORDER and 0WBS_ELEMT value for which do not exist for all the data records. As a result I get # in the report. How do I replace # in the report with blank? I dont want to use the VB Script, need a permanent fix. Where should I write ABAP routine for that and also please can anyone give me the ABAP code too.
Thank you,
samin bex, you can use vba macro. in web, use table interface
replacing '#'-sign for 'not assigned' in queries
SAPBEXonRefresh()
Dim c as range
For Each c in resultArea.cells
if c.Value = "#" then c.Value = "-"
Next c
or
by Jens (consider to performance)
put in SAPBEXonRefresh()
resultArea.Select
Cells.Replace What:="#", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows,
MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False
table interface, redefine CHARACTERISTIC_CELL method...
if I_CHAVL = '#'.
c_cell_content = ' '.
endif.
Hope it helps.
Regards -
ABAP code is not shown in SQ01
Hi,
can somebody help us to understand why ABAP code inserted in a query is shown in SE38 but not in SQ01?
The query was probably created with Quickviewer. How can we correct this?
Thank you.Hi Suneel,
MOVE l_calweek TO loc_s_range-low.
loc_s_range-sign = 'I'.
loc_s_range-opt = 'EQ'.
MOVE l_week_temp TO loc_s_range-high.
APPEND loc_s_range TO e_t_range.
CLEAR: loc_s_range,l_calweek,l_week_temp.
ENDIF.
In the last few lines of your code(given above), where you assign 'EQ' to the range options, please assign 'BT' and check. I think as you are giving 'EQ', it takes only the value given in range-low. If you give 'BT', it should take values between range-low and range-high.
Correction suggestion given below.
MOVE l_calweek TO loc_s_range-low.
loc_s_range-sign = 'I'.
loc_s_range-opt = 'BT'.
MOVE l_week_temp TO loc_s_range-high.
APPEND loc_s_range TO e_t_range.
CLEAR: loc_s_range,l_calweek,l_week_temp.
ENDIF.
Thanks,
Archana -
ABAP code to break furthur Query execution
Hello,
I need a simple piece of ABAP code for the following purpose. When I run my query, I get the variable input pop-up. Incase I dont enter any values for the variables, the ABAP code should break furthur execution of the query. Is this possible and how??
Pls Help.
Thanks,SDHi,
The following code will help you, there is one variable ZVAR, it is user input variable on 0CALDAY, if user won't give any input it will take System date else it will process user input Date.
Note: Write this code at the end of the ENDCASE. i.e. below
IF i_step = 3.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZVAR'.
CLEAR: l_s_range.
IF loc_var_range-low EQ '' or
loc_var_range-high EQ ''
l_s_range-low = sy-datum.
l_s_range-high = sy-datum.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ELSE.
l_s_range-low = loc_var_range-low.
l_s_range-high = loc_var_range-high.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
ENDIF.
ENDIF.
Thanks
Reddy -
Hi,
If any body have abap code for YTD(year to date) please share with me. My manual input variable is 0P_FPER(Fiscal year period) in the format of 012.2008. and customer exit variable is 0FISCPER_CE_001.
Thanks,
Ram.define a date field in your Variable Exit...
data : date type sy-datum.
concatenate '01' fisc_year into date.
l_s_range-low = date.
l_s_range-high = sy-datum.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
Regards,
Sharayu -
Creating an xml file from abap code
Hello All,
Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
Thanks in advance,
Paul.This has been discussed before
XML files from ABAP programs
Maybe you are looking for
-
Can't Even Open After Upgrading to iTunes 7.6!
I upgraded two days ago to 7.6 (which, on a side note, when looking about "About iTunes" it still listed it as 7.5) and all of the sudden today it says "The file "iTunes Library" cannot be read because it was created with a newer version of iTunes."
-
Error I am getting at ECC6.0 installation
when installing SAP ECC6.0 on Windows Operating system platform I am getting error at SAPAPPL2.Log at C:\programfiles\sapinst_instdir\ERP\SYSTEM\ORA\CENTRAL\AS Unable to allocate 4108 bytes of shared memory. at SAP Level at IMPORT ABAP I am getting e
-
MPEG-2 Quicktime Component in Mac OS X Lion
The MPEG-2 Component will not install on Mac OS X 10.7, citing that it requires an *earlier* version of Mac OS X? Is there anyway to bypass this version checker? For record: Quicktime 7 is installed (and updated).
-
How to integrate Fiori and Sharepoint
Hi Guys I'm am in the design part of a Fiori project for a customer, they requested the configuration of two Apps: 1. Standard SAP Transactional (No problem here) - R3 username and password authentication 2. MS SharePoint App to be configured i
-
Connect ActionScript With XML Link
Hi, Please if somebody can help me with this issue. I have Flash Movie (with multiple movie symbols) file that parses XML file(gallery.load("gallery.xml") with this <image> <date>03.31.06</date> <title>View of Seatt