Calculated field in a Report Template
Hi,
I am trying to create a calculated field based on other calculations made in placeholder fields on a report template.
If I have the following 2 fields:
e.g. A = (1+2), B = (2*3)
what is the best way to get C = A div B rather than having to list out all the calculations (i.e. (1+2) / (2*3)
How can you set these first 2 fields as variables into the calculation?
Thanks
Steve
For variables read this:
http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535390
Set x:=5
<?xdoxslt:set_variable($_XDOCTX, 'x', 5)?>
Get value of 'x'
<?xdoxslt:get_variable($_XDOCTX, 'x')?>
Perform calculation on x, like x:=x+8
<?xdoxslt:set_variable($_XDOCTX, 'x', xdoxslt:get_variable($_XDOCTX, 'x' + 8)?>
cheers
Jorge
Similar Messages
-
Creating Formula calculated field in BI publisher Template
Hi,
I am creating a report template (rtf) using oracle BI publisher Desktop for siebel 8.1.1 and i need to add a new field that divide two created count fields , but i don't know how to make it and i didn't have any help from the designer guide.
Thanks for Your Help.Hi,
Have you tried:
<?format-number:count(FIELD1)/count(FIELD2);'999G990D000'?>Or are the two count fields stored in XSL variables?
Regards
Andy -
Change Preferred Viewing Locale by a paramter field in the report template
Hello,
Is there a method that allows to change the Preferred Viewing Locale at the report template level?
Actually I have some templates for final clients in different countries, and these reports should be generated in Infoview.
In order to generate reports in different languages, I inserted a parameter {?Language}
Then for caption/text I used a formula like this
Select {?Language}
Case "en_US": .....
Case "de_CH": .....
Case "it_IT": .....
Case "nl_BE": .....
However this won't work for date axis in charts and number formats.
So I switched to Preferred Viewing Locale settings, which seemed to be exactly what I wanted cause everything can be changed according to the local settings, except that I need to change the setting every time by selecting View - Preferred Viewing Locale - German - (Germany)... for 20 different reports
And what's more important is that I cannot change this setting when I launch the template in Infoview. Change in Preferences will impact all the templates while I just need change on one template only.
I had a look on all the functions available and it seems that ContentLocale function can only display the current setting.
Is there any solutions?
Thanks in advance,
WenzhaoPost your question to BOE Admin forums
-
Calculated field in classic report
I am trying to editable columnin classic report and based on the values that users fill in that filed calculate value in another column. I have seen something similar on the forum but nothing really worked for me.
My report is based on sql query.
select column1,
column2,
column3 from table
I want column2 to be updatable, and that column3=column2+column1Sorry, in this thread you can see better what I meant in the post above.
ROW-------Country-------LOB-------YTD_PURCHASES-------YTD_INCOME-------Manual -------Total
1-----------USA-----------Utilities-----------1000000-----------50000----------------0-----------50000
2-----------USA-----------Electric-----------1000000-----------70000-----------------0-----------70000
3-----------USA-----------Security-----------1000000-----------90000------------------0-----------90000
4-----------CAN-----------Utilities-----------1000000-----------110000---------------30000-----------140000
5-----------CAN-----------Magic-----------1000000-----------130000--------------25000-----------155000
6-----------CAN-----------Plumbing-------1000000-----------150000-----------------0-----------150000
Thanks,
Gagi -
Again: Number Format, Decimals in calculated fields
My customer wants to know how he can have calculated fields in his reports.
I've found out that e.g. this works for the calculation:
<?format-number:((SALARY) div (../../DEPTSAL));'#,##0.00'?>
But there is no way that I can get a precision of two decimals. All given formats are ignored.
Maybe this is an issue with the european decimal sign , (Comma).
How is this to be fixed?
The use of the translate function was recommended somewhere. I have no idea how to bring it together with my calculation formula.
Thanks in advance,
Kai
Message was edited by:
kaiHi kai,
First you need to remove comma from your amount field then you can get your result.
If you have any comma in your amount field then xml number format does not work.
Look this forum:
Re: How to indicate number percission in a template?
Thanks
Ravi
Message was edited by:
Ravi Tripathi -
Access to customizing default: report templates
I seem to remember far back in the corners of my memory, someone here on the forum mentioning that although we didn't have access at the time (probably back at HTMLDB 2.0) to customize the default report templates, that there were plans to make this an option in a future version of Apex. Does anyone have any idea if this is something that is being planned, or better yet, available today?
If you're not sure what I'm talking about I'm referring to the field that says 'Report Template' in the 'Layout and Pagination' section of the 'Report Attributes' page in the application builder.
The problem I'm having is that I'm using the 'default: vertical report, look 2 (show null columns)' report template and I've got some long column headings that I want to include a line break between each word of the heading, so they're stacked vertical instead of wide horizontally. I've add HTML break tags to the headings but they're disappearing when the page is rendered.
I've made sure to set the 'Strip HTML' setting to 'No', but whether it's set to yes or no doesn't matter, the headings display the same either way.
BTW, doing the same thing in a template based multi-row report seems to work fine. However, trying to use/apply the 'Value Attribute Pairs' report template yields the same result as the default vertical look template.
So I have 2 questions:
1) anyone know how I can make these heading words stack up vertically, one word to a line?
2) are we going to get access to customize the default report templates?
EarlHello,
1) anyone know how I can make these heading wordsstack up vertically, one word to a line?
Probably the best way to do this is to just hard code
a <br /> between your words.That's exactly what I'm doing (and what I said in my original post), however those breaks are disappearing during page rendering when I choose the report templates I mentioned.
I don't understand why this technique works in the multi-row report templates and not in these vertically oriented value/attribute report layouts.
2) are we going to get access to customize thedefault report templates?
No, you should just use a regular theme based
template, the default report templates are there for
backwards compatibility and well basically for people
that don't care about the UI. Since your at the point
it seems you do care about UI the proper thing to do
is to move to a standard report template that you
have full control over.Fair enough. I'll look into that, but I think there's still an open question here as to why the HTML breaks aren't being returned in the page markup for these report layouts.
Regards,
CarlEarl -
How to change the column value which is coming from DO by a calculated field?
Hi all,
I want to change a column value based on my calculated field value. I have a column which is coming from DO which is based on External Data Source. I have a calculated field in my report. When there is any change in the calculated field then the column which is coming from DO needs to be changed. It means the DO needs to get updated when there is a change in the calculated field. Or like if the calculated field meets some condition then I need to change/update the same in the DO. This has to be done on the fly. the report should not submitted for this. when there is a change in the calculated column the DO column needs to get updated.
Thanks,
Venky.Ok, I've been a customer for very many years, I'm on a fixed retirement
income. I need to reduce my bills, my contract ends in Dec. I will be
pursuing other options unless I can get some concessions from Verizon. My
future son-in-law was given this loyalty plan, so I know this is a
reasonable request. My phone number is (removed) acct number
(removed)
>> Personal information removed to comply with the Verizon Wireless Terms of Service <<
Edited by: Verizon Moderator -
Sum calculated field in report
Hi, I have a report that groups by employee then by machine. In this report I sum several fields, but need to sum a calculated field and can't figure it out. This is the calculation:
<?( QTY_MOVED) div ( TIME +.001 ) div ( INVERSE + .001)?>
This is a total field using a field that works fine.
<?sum(current-group()/QTY_REJ)?>
How do I incorporate the calculation in the <?sum(current-group()/.............I get errors if I just put in the calculation above.
thanks!Thank you for your help. After taking your advice and getting it to work by messing around with the brackets, management has changed their mind on the calc. Now they want me to use this calculation:
SELECT EMPLOYEE, SUM(QTY_MOVED), SUM(QTY_REJ), SUM(TIME), (nvl([b]sum(QTY_MOVED),0)/nvl(sum(TIME),0))/nvl(sum(INVERSE),0) eff ,'DIRECT'
FROM VW_TIMETRACK
WHERE START_DATE >= :BEGIN
AND START_DATE <= :END
AND WORK_ORDER <> ' '
GROUP BY EMPLOYEE
to get the average. Now the weird thing is, I can get the value in toad, and I can get it to output in raw xml data, but when I try to add the eff field right next to the sum(time) field in the word form, nothing shows up. Absolutely no data. But it is in the xml. I'm using <?sum(current-group()/EFF)?> , just like I am for <?sum(current-group()/TIME)?> . I've made it text, numeric, decimal. Nothing is coming out. -
Data missing in Crosstab report with calculated field via case when
I use the Oracle 10g discoverer. When I create a crosstab report with a calculate field via function case when and put it as datapoint, some of the data is not showing. I tried to not use the case when function for the calculate field, then all the data show.
I really do not the reason. Could anybody help me out with many thanks?Let me explain more.
I have the original data below.
Work order, Team, Hours_worked, date
800001, S1, 5, 2012/01/01
800001, S1, 15, 2012/01/10
800001, S2, 4, 2012/01/04
800002, S1, 3, 2012/01/15
There are multipul records for the same work order, team on the same day or different.
Finally I want to set the start date and end date as the parameter to create a crosstab report format like
start date>=2012/01/01 and close date<=2012/01/05
Team
Total hours total hours within the range
Work order S1 S2 ... S1 S2 ...
800001 20 4 5 4
800002 3 0 0 0
in order to do it, I create two parameters independently start date and close date. Then I create a calculate field hours_worked_withinrange via
Case when date>=:start date and date<=:end date then Hours_worked else 0 end
This calculated field is correct in the tabular format report in discoverer desktop. But when I duplicate the list as crosstab. Some data is missing in crosstab data point.
I checked once I change the calculate field defination not use case when. (For example, C1=hours_worked*2). Then everything runs correct. -
How to give the calculation in Finacial report templates asper indian local
Dear experts
help me, how to give calculation in Financail report Templates in SAP b1 for calculating Gross profit and Netprofit seperately. I am facing some error while giving formula in financial report templates.
Thanks
RegardsHi Mathiladath,
Try this,
->> Financials. -> Financial Report Templates in that follow this steps.
1.Report. -> Choose (Profit and Loss)
2.Template.-> Define New -> Give the name for template.
3.And click the Generate Chart of account button in bottom right.
4.put the Tick mark in Subtotal Check box
5.now u can see Formula button (Click and Open the Formula Definition window and put the Formula)
using this button create appropriate formula for your requirement(ask help your A/C department)
6.Chose this template in P/L.
Regards,
Madhan. -
Financial Report Template- Calculation error
Hi All
I have developed a template for Profit and Loss Statement by using
Financial report Template
Under operating expenses heading i am having following heads
F&B consumption
Non-F&B Consumption
Gas Fuel ...
Operating Expenses value i am getting is wrong due to the following reason
F&B consumption calculates ( F&B consumption= F&B Opening Stock+ F&B
Purchase- F&B Closing Stock)
I need to add a formula to find F&B Consumption that is coming under F&B
Consumption head
Non-F&B consumption calculates (Non- F&B consumption= Non-F&B Opening
Stock+ Non-F&B Purchase- Non-F&B Closing Stock)
I need to add a formula to find Non-F&B Consumption that is coming under
Non-F&B Consumption head
For calculation from the system
In the present calculation the Operating expenses is derived by adding
the closing stock value as just an other expense head instead of
subtracting the same and also by ignoring the subtotal which actually
refers to the calculation (Consumption=Opening stock+Purchase-Closing Stock)
Calculation Expecting
We need the Operating expenses to either consider the subtotals to add
for the expenditure or the closing stock value needs to be reduced from
the Expenses.
Please help to solve the issue
Regards
RashidThis error usually means the workspace agent is not up and running or can't be connected, are you sure that workspace is definitely up and running and you can log into workspace.
Cheers
John
http://john-goodwin.blogspot.com/ -
Use calculated field(s) in other report
Hi everyone,
Is there a way to use a calculated field by itself in another report? I don't want to insert a sub report because it takes up too much space.
I just need to use few fields in other calculations in the new report.
Thank youThe only way I can think of doing this without subreports is to save the values in a database somewhere. In order to do this, the values would have to be calculated in the report's SQL Command data source. (I'm guessin' that's probably not what you're looking for, but using subreports is the only other way I can think of...)
HTH,
Carl -
Regd: Calculation of TOTAL field in ALV report
Hi All,
We have a scenario that we are not getting the total value for numeric fields in ALV report.
Below i have given the code used for it.
G_KEY = 'X'.
G_NOKEY = SPACE.
G_SUM = 'X'.
G_NOSUM = SPACE.
PERFORM BUILD_FIELDCAT USING 'VBELN' G_KEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'BLDAT' G_NOKEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'VGBEL' G_KEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'POSNR' G_KEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'MATNR' G_KEY G_NOSUM..
PERFORM BUILD_FIELDCAT USING 'LFIMG' G_NOKEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'VRKME' G_NOKEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'NETPR' G_NOKEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'BRTWR' G_NOKEY G_NOSUM.
PERFORM BUILD_FIELDCAT USING 'VALUE_INR' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'B_DUTY' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'S_TOTAL1' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'CV_DUTY' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'C_CVD' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'S_TOTAL2' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'C_DUTY' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'S_TOTAL3' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'A_DUTY' G_NOKEY G_SUM.
PERFORM BUILD_FIELDCAT USING 'T_DUTY' G_NOKEY G_SUM.
PERFORM BUILD_LAYOUT.
PERFORM BUILD_DISPLAY.
*& Form DISPLAY
text
FORM BUILD_DISPLAY.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = TEXT-000
I_GRID_SETTINGS =
IS_LAYOUT = IG_LAYOUT
IT_FIELDCAT = IG_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IG_INBOUND
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "DISPLAY
*& Form BUILD_FIELDCAT
text
-->G_FIELDNAME text
-->L_KEY text
-->L_SUM text
FORM BUILD_FIELDCAT USING L_FIELDNAME LIKE DD03L-FIELDNAME L_KEY TYPE C L_SUM TYPE C.
CLEAR WG_FIELDCAT_LN.
ADD 1 TO G_COL_POS.
WG_FIELDCAT_LN-REF_TABNAME = 'IG_INBOUND'.
WG_FIELDCAT_LN-FIELDNAME = L_FIELDNAME.
WG_FIELDCAT_LN-KEY = L_KEY.
WG_FIELDCAT_LN-DO_SUM = L_SUM.
WG_FIELDCAT_LN-COL_POS = G_COL_POS.
WG_FIELDCAT_LN-NO_OUT = SPACE.
WG_FIELDCAT_LN-QFIELDNAME = SPACE.
WG_FIELDCAT_LN-HOTSPOT = SPACE.
APPEND WG_FIELDCAT_LN TO IG_FIELDCAT.
ENDFORM. "BUILD_FIELDCAT
*& Form BUILD_LAYOUT
text
FORM BUILD_LAYOUT.
IG_LAYOUT-TOTALS_TEXT = 'Total Amount'.
*IG_LAYOUT-SUBTOTALS_TEXT = 'A'.
IG_LAYOUT-ZEBRA = 'X'.
ENDFORM.
Help and Sugesstions will be much appreciated.
Thanks & Regds.
Ramesh.This is sample program for the same
REPORT Z_50657_ALV_EX2
NO STANDARD PAGE HEADING
LINE-COUNT 65(3)
LINE-SIZE 220
MESSAGE-ID ZZ.
* Type Pools *
TYPE-POOLS: SLIS, ICON.
* Tables *
TABLES: VBAK. "Sales Document Data
* Internal Tables *
* TABLE TO HOLD DATA OF SALES DOCUMENT
DATA: BEGIN OF IT_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN, "Sales Document
VBTYP LIKE VBAK-VBTYP, "SD document category
AUDAT LIKE VBAK-AUDAT, "Document date (date received/sent)
AUGRU LIKE VBAK-AUGRU, "Order reason (reason for the business)
AUART LIKE VBAK-AUART, "Sales Document Type
NETWR LIKE VBAK-NETWR, "Net Sales Order in Doc. Currency
WAERK LIKE VBAK-WAERK, "SD document currency
ICON TYPE ICON-ID, "traffic lights
END OF IT_VBAK.
* Work Areas *
*WORK AREAS DEFINED FOR ALV'S
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV, "field catalog
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "field catalog ITAB
WA_SORT TYPE SLIS_SORTINFO_ALV, "SORT work area
IT_SORT TYPE SLIS_T_SORTINFO_ALV, "SORT ITAB
LAYOUT TYPE SLIS_LAYOUT_ALV, "LAYOUT
WA_FCODE TYPE SLIS_EXTAB, "FUN CODE
I_FCODE_EXTAB TYPE SLIS_T_EXTAB,
WA_EVENTS TYPE SLIS_ALV_EVENT,
IT_EVENTS TYPE SLIS_T_EVENT.
* Selection-Screen *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
PARAMETERS: LIST RADIOBUTTON GROUP G1,
GRID RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
* At Selection-Screen *
*VALIDATION
* Start of Selection *
START-OF-SELECTION.
*POPULATION OF DATA INTO INTERNAL TABLE ITAB
PERFORM GET_DATA.
*DEFINE USER DEFINED FIELDCATALOG
PERFORM DEFINE_FIELDCATALOG.
*SUBTOTALS AND TOTALS DISPLAY USING SORT
PERFORM SORT_LIST.
*CHANGE FCODE OF STATUS
PERFORM CHANGE_FCODE.
*CHECK RADIOBUTTON OPTION AND ACCORDINGLY FINAL DISPLAY
PERFORM CHECK_OPTION.
*& Form GET_DATA
* text
FORM GET_DATA.
SELECT VBELN
VBTYP
AUDAT
AUGRU
AUART
NETWR
WAERK FROM VBAK INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN AND VBTYP = P_VBTYP
AND ERDAT > '01.01.2004' AND NETWR > 0.
LOOP AT IT_VBAK.
IF IT_VBAK-NETWR < 10000.
IT_VBAK-ICON = '@08@'.
ELSEIF IT_VBAK-NETWR > 100000.
IT_VBAK-ICON = '@0A@'.
ELSE.
IT_VBAK-ICON = '@09@'.
ENDIF.
MODIFY IT_VBAK INDEX SY-TABIX.
ENDLOOP.
ENDFORM. "GET_DATA
*& Form CHECK_OPTION
* text
FORM CHECK_OPTION.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
WA_EVENTS-FORM = 'TOP'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
WA_EVENTS-NAME = 'END_OF_LIST'.
WA_EVENTS-FORM = 'END_LIST'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
IF LIST = 'X'.
PERFORM LIST_DISP.
ENDIF.
IF GRID = 'X'.
PERFORM GRID_DISP.
ENDIF.
ENDFORM. "CHECK_OPTION
*& Form DEFINE_FIELDCATALOG
* text
FORM DEFINE_FIELDCATALOG.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'ICON'.
WA_FIELDCAT-SELTEXT_L = 'ICON'.
WA_FIELDCAT-ICON = 'X'.
WA_FIELDCAT-OUTPUTLEN = 8.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC NO.'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-FIELDNAME = 'AUDAT'.
WA_FIELDCAT-SELTEXT_L = 'CREATED ON'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 4.
WA_FIELDCAT-FIELDNAME = 'VBTYP'.
WA_FIELDCAT-SELTEXT_L = 'CATEGORY'.
WA_FIELDCAT-OUTPUTLEN = 1.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 6.
WA_FIELDCAT-FIELDNAME = 'AUGRU'.
WA_FIELDCAT-SELTEXT_L = 'REASON'.
WA_FIELDCAT-OUTPUTLEN = 3.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-FIELDNAME = 'AUART'.
WA_FIELDCAT-SELTEXT_L = 'DOC TYPE'.
WA_FIELDCAT-OUTPUTLEN = 4.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 7.
WA_FIELDCAT-FIELDNAME = 'NETWR'.
WA_FIELDCAT-SELTEXT_L = 'NET VALUE'.
WA_FIELDCAT-OUTPUTLEN = 17.
WA_FIELDCAT-DECIMALS_OUT = 2.
* WA_FIELDCAT-DO_SUM = 'X'.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 8.
WA_FIELDCAT-FIELDNAME = 'WAERK'.
WA_FIELDCAT-SELTEXT_L = 'UNIT'.
WA_FIELDCAT-OUTPUTLEN = 50.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "DEFINE_FIELDCATALOG
*& Form DEFINE_LAYOUT
* text
FORM DEFINE_LAYOUT.
LAYOUT-ZEBRA = 'X'.
LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL SUM'.
LAYOUT-WINDOW_TITLEBAR = 'EXERCISE 2'.
LAYOUT-TOTALS_TEXT = 'TOTAL'.
ENDFORM. "DEFINE_LAYOUT
*& Form SORT_LIST
* text
FORM SORT_LIST.
WA_SORT-FIELDNAME = 'VBELN'.
WA_SORT-TABNAME = 'IT_VBAK'.
WA_SORT-SPOS = 1.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'NETWR'.
WA_SORT-TABNAME = 'IT_VBAK'.
WA_SORT-UP = 'X'.
WA_SORT-SPOS = 2.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
ENDFORM. "SORT_LIST
*& Form LIST_DISP
* text
FORM LIST_DISP.
PERFORM DEFINE_LAYOUT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT
IS_LAYOUT = LAYOUT
IT_SORT = IT_SORT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
IT_EXCLUDING = I_FCODE_EXTAB
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_EVENTS = IT_EVENTS[]
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBAK
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "LIST_DISP
*& Form GRID_DISP
* text
FORM GRID_DISP.
PERFORM DEFINE_LAYOUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_SORT = IT_SORT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
IT_EXCLUDING = I_FCODE_EXTAB
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = IT_VBAK.
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "GRID_DISP
*& Form STATUS
* text
* -->P_EXTAB text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STATUS' EXCLUDING P_EXTAB.
ENDFORM. "STATUS
*& Form USER_COMMAND
* text
* -->R_UCOMM text
* -->RS_SELFIELD text
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
LEAVE TO SCREEN 0.
WHEN '&IC1'.
SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form CHANGE_FCODE
* text
FORM CHANGE_FCODE.
WA_FCODE = 'PRNT'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&OAD'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&AVE'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&EB9'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&SUM'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&UMC'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&XPA'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
WA_FCODE = '&OMP'.
APPEND WA_FCODE TO I_FCODE_EXTAB.
ENDFORM. "CHANGE_FCODE
*& Form TOP
* text
FORM TOP.
IF LIST = 'X'.
WRITE:/ SY-ULINE.
WRITE:/ 'DATE:', SY-DATUM,55 'INTELLIGROUP ASIA PVT LTD'.
WRITE:/ 'TIME:', SY-UZEIT.
WRITE:/ 'USER NAME:', SY-UNAME,60 SY-TITLE.
WRITE:/ 'PAGE', SY-PAGNO.
WRITE:/ SY-ULINE.
ENDIF.
IF GRID = 'X'.
DATA: LS_LINE TYPE SLIS_LISTHEADER,
E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
* Listenüberschrift: Typ H
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
* LS_LINE-KEY: not used for this type
LS_LINE-INFO = 'Summary'.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
* Kopfinfo: Typ S
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = 'Intelligroup'.
LS_LINE-INFO = ''.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
LS_LINE-KEY = 'ASIA'.
LS_LINE-INFO = 'PVT LTD'.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
* Aktionsinfo: Typ A
CLEAR LS_LINE.
LS_LINE-TYP = 'A'.
* LS_LINE-KEY: not used for this type
LS_LINE-INFO = 'truman'.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = E04_LT_TOP_OF_PAGE
I_LOGO = 'ENJOY_SAP_LOGO'.
ENDIF.
ENDFORM. "TOP
*& Form END_LIST
* text
FORM END_LIST.
IF LIST = 'X'.
SKIP 2.
WRITE:/60 'END OF PAGE'.
ENDIF.
IF GRID = 'X'.
DATA: LS_LINE TYPE SLIS_LISTHEADER,
E04_LT_END_OF_LIST TYPE SLIS_T_LISTHEADER.
* Listenüberschrift: Typ H
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
* LS_LINE-KEY: not used for this type
LS_LINE-INFO = 'Summary'.
APPEND LS_LINE TO E04_LT_END_OF_LIST.
* Kopfinfo: Typ S
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = 'Intelligroup'.
LS_LINE-INFO = ''.
APPEND LS_LINE TO E04_LT_END_OF_LIST.
LS_LINE-KEY = 'ASIA'.
LS_LINE-INFO = 'PVT LTD'.
APPEND LS_LINE TO E04_LT_END_OF_LIST.
* Aktionsinfo: Typ A
CLEAR LS_LINE.
LS_LINE-TYP = 'A'.
* LS_LINE-KEY: not used for this type
LS_LINE-INFO = TEXT-105.
APPEND LS_LINE TO E04_LT_END_OF_LIST.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = E04_LT_END_OF_LIST.
ENDIF.
ENDFORM. "END_LIST -
2 Mileage Policy Schedules on the same Expense report Template
Hi,
I am trying to create another mileage rate schedule and put in the same expense report template. It works and when you input mileage information for trip X,Y,Z on the Expense Report, the choice is there (drop down list) and the correct rate is automatically included in calculations.
The thing is that the project expenditure fields are grey and cannot input project/task etc.. I think I did the whole setup whether its on the Project Billing or Costing (expenditure category/type) and Payables Manager (ER template).
Am i Missing something?
Thank you,
Edited by: 985580 on Mar 15, 2013 8:55 AMRoseline,
Create a new button and select the option to create the button as an item and not in the region position.
Item buttons behave differently to Region Position buttons.
If you are wanting to use the button to "SUBMIT" the page, you will need to change the button to Target is a URL and add javascript:doSubmit('YOUR_REQUEST_VALUE');
Gus..
REWARDS: Please remember to mark HELPFUL or CORRECT posts on the forum, not just for my answers but for everyone!
;-) -
DAX Dynamic Banding | Calculated Member based on Calculated Field
Good morning,
I've created a Power Pivot model that measures the blood glucose levels of clinical patients at specific times of the day. The requirement is that this metric, let's call it GlucoseLevel, is always averaged as it wouldn't make sense to sum up the values.
To meet this first requirement, I set the "Summarize By" property of the GlucoseLevel column to "Average".
The second requirement is to band the GlucoseLevel values so that groups of people can be measured by this band rather than by the individual measure values. I created a banding table in Excel and then imported it into the Power Pivot model. The banding table
has three columns (BandName, MinValue and MaxValue) and has the following values:
VERYLOW: Min Value = 0; Max Value = 3.99
OK: Min Value = 4; Max Value = 6.99
WARNING: Min Value = 7; Max Value = 10.99CRITICAL: Min Value = 11; Max Value = 30.00
It is at this point where I face my challenge. I have a GlucoseLevel measure and I have a banding table. Great. The challenge is: How do I create a calculated, dynamic
member that will look at my GlucoseLevel measure (at whatever level), do a lookup to my banding table, and then return the "BandName" column from the Banding table at that specific level? So to clarify what I mean by level: I want to be able
to view the bandings at Year level, or a Month level, or even at a week level. Then depending on what level I am at, my measure should have a Band associated to it.
I've tried to solve this issue in a couple of ways:
Attempt 1
Create a calculated column in my fact table that contains a nested IF statement to manually band my GlucoseLevel values. This works fine if I view my data at the lowest level of granularity, however
it does not work if I start looking at my data at the day, week, month etc. levels
Attempt 2
1.) Create a calculated field (not a calculated column) that averages my GlucoseLevel measure. This is cool because it will average my measure at whatever level I am viewing it at. Let's call
this field Bob...
2.) Band my measure Bob by creating another calculated field (called PatientBand). This field uses my banding table (described earlier) in conjunction with my calculated field Bob. This works perfectly, except for one big flaw: Excel sees this banding field
as a measure, and not as something that I can use as a column / row...
So my question is: Can I trick Excel into viewing my PatientBand calculated field as an attribute, and not as a measure? And if not, how do I get around this challenge? Here is the DAX formula that I used to create my second calculated field "PatientBand":
PatientBand:=CALCULATE(
VALUES (Bandings[BandName]);
FILTER (
Bandings;
Test[Bob] >= Bandings[MinValue]
&& Test[Bob] <= Bandings[MaxValue]
Thanks!So there are 2 ways that I can think of for doing that.
1) if you are only using MDX clients like Excel or Reporting services you can create a text based measure that returns the banding name. (Note that this sort of approach does not work at the moment with PowerView as it only displays numeric measures). This
would effectively let you show a label next to a reading as opposed to moving the reading under a given banding column.
Banding Name :=
CALCULATE (
VALUES ( Bands[BandName] ),
FILTER (
Bands,
[Average of GlucoseReading] >= Bands[BandMin]
&& [Average of GlucoseReading] <= Bands[BandMax]
&& NOT ( ISBLANK ( [Average of GlucoseReading] ) )
2) This next approach will show the results exactly as you had them in your sample screenshots. It just takes a slight bending of the DAX. I'm using a SUMX here, not because I want to sum anything, but because the "X" version of SUMX basically loops over
every row in the specified table and sums the expression in the second parameter. I have setup the second parameter so that it only returns a single value for the average if it is in the appropriate banding.
Banded Average:=IF (
HASONEVALUE ( Bands[BandName] ),
SUMX(
'Bands',
IF (
NOT ( ISBLANK ( [Average of GlucoseReading] ) )
&& [Average of GlucoseReading] >= MIN ( Bands[BandMin] )
&& [Average of GlucoseReading] <= MIN ( Bands[BandMax] ),
AVERAGE(Readings[GlucoseReading]),
BLANK()
,AVERAGE(Readings[GlucoseReading])
http://darren.gosbell.com - please mark correct answers
Maybe you are looking for
-
Hello, I'm having a strange problem with my newly aquired USB 6009. I've written an app to read the temperature from a temperature controller using the 6009 and that all works fine. However, the problem comes when I port this code into another applic
-
Safari crashes when I try to login to igoogle
When I open my igoogle home page safari crashes but when I open to google.com and then navigate to www.google.com/ig > it doesnt crash So what gives? Am I missing something? Larry Typical (rather long) report sent to apple is below: Process:
-
My C7280 all in one will no longer scan
My C7280 all in one will no longer scan to my computer. I get an error message that says "no scan options, refer to device documentation to troubleshoot". I have tried all I know. I have re-downloaded the origianl disc software numerous times to no a
-
Problems importing mts files from Canon HF M30 to PrE 9
I am not new to premiere elements, but I am new to PrE 9. I am also new to AVCHD, having recently received a Canon HF M30 camcorder. Now, when I import my video (as .mts files), the playback in Premiere Elements 9 is very choppy. What am I doing w
-
Creating a JTable with expandable rows.
Hi Was wondering if anyone could help me out. I'm trying to create a table where its possible to click on and expand a row so it displays more rows containing information about a the main row. Its kind of like a cross between a tree structure and a t