Satndard AVL function code in interactive reports
hai
can any one give some frequently used alv function codes for interctie display
thanking u
regards
murali
Hi Murali,
please find the attached code. hope it helps you....
report zptest_alv1.
**TABLES DECLN
tables: vbrk,vbrp,t001.
type-pools: slis.
type-pools: icon.
***DATA DECLN.
data: v_vbeln like vbrk-vbeln,
v_matnr like vbrp-matnr.
constants: c_user_command type slis_formname value 'F_USER_COMMAND',
c_pf_status type slis_formname value 'F_SET_PF_STATUS'.
**ALV RELATED TABLES.
*--Field Catalog
data: it_fieldcat type standard table of
slis_fieldcat_alv with header line,
it_fieldcat1 type standard table of
slis_fieldcat_alv with header line ,
wa_fieldcat type slis_fieldcat_alv,
*--Layout
wa_layout type slis_layout_alv,
*--Sort
it_sort type slis_t_sortinfo_alv,
wa_sort type slis_sortinfo_alv ,
**-Structure for excluding function codes
wa_extab type slis_extab,
**-To hold function codes to be excluded in ALV toolbar
it_extab type slis_t_extab.
***INTERNAL TABLE DECLN.
data: begin of it_vbrk occurs 0,
vbeln like vbrk-vbeln,
waerk like vbrk-waerk,
vkorg like vbrk-vkorg,
fkdat like vbrk-fkdat,
bukrs like vbrk-bukrs,
netwr like vbrk-netwr,
end of it_vbrk.
data: begin of itab occurs 0,
vbeln like vbrp-vbeln,
posnr like vbrp-posnr,
fkimg like vbrp-fkimg,
vrkme like vbrp-vrkme,
netwr like vbrp-netwr,
matnr like vbrp-matnr,
arktx like vbrp-arktx,
end of itab.
data: it_vbrp like itab occurs 0 with header line.
***selection screen.
selection-screen: begin of block b1 with frame title text-001.
select-options: s_vbeln for vbrk-vbeln,
s_fkdat for vbrk-fkdat obligatory,
s_matnr for vbrp-matnr.
selection-screen: end of block b1.
**INITIALIZATION.
initialization.
s_fkdat-low = sy-datum - 200.
s_fkdat-high = sy-datum.
append s_fkdat.
***AT SELECTION-SCREEN.
at selection-screen.
if not s_vbeln is initial.
select single vbeln from vbrk
into v_vbeln
where vbeln in s_vbeln.
if sy-subrc <> 0.
message e001(zz2).
endif.
endif.
if not s_matnr is initial.
select single matnr from mara
into v_matnr
where matnr in s_matnr.
if sy-subrc <> 0.
message e001(zz2).
endif.
endif.
***START-OF-SELECTION.
start-of-selection.
perform get_data_vbrk.
perform get_data_vbrp.
***END-OF-SELECTION.
end-of-selection.
*--Sort the Output Fields
perform sort_fields.
*--Build Field catalog for the Output fields
perform get_field_catalog.
***MODIFY LAYOUT.
perform modify_layout.
*--Display ALV output
perform list_disp tables it_vbrk
using c_user_command.
*& Form GET_DATA_VBRK
text
--> p1 text
<-- p2 text
form get_data_vbrk.
select vbeln
waerk
vkorg
fkdat
bukrs
netwr
into table it_vbrk
from vbrk
where vbeln in s_vbeln
and fkdat in s_fkdat.
endform. " GET_DATA
*& Form GET_DATA_VBRP
text
--> p1 text
<-- p2 text
form get_data_vbrp .
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO TABLE IT_VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN = IT_VBRK-VBELN.
select vbeln
posnr
fkimg
vrkme
netwr
matnr
arktx
from vbrp
into table itab
for all entries in it_vbrk
where vbeln = it_vbrk-vbeln.
endform. " GET_DATA_VBRP
*& Form GET_FIELD_CATALOG
text
--> p1 text
<-- p2 text
form get_field_catalog .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_VBRK'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat[]
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
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. " GET_FIELD_CATALOG
*& Form SORT_FIELDS
text
--> p1 text
<-- p2 text
form sort_fields .
clear wa_sort.
wa_sort-spos = '01'.
wa_sort-fieldname = 'VBELN' .
wa_sort-tabname = 'IT_VBRK'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
clear wa_sort.
wa_sort-spos = '02'.
wa_sort-fieldname = 'POSNR' .
wa_sort-tabname = 'IT_VBRP'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
endform. " SORT_FIELDS
*& Form MODIFY_LAYOUT
text
--> p1 text
<-- p2 text
form modify_layout .
wa_layout-default_item = 'X'.
wa_layout-zebra = 'X'.
wa_layout-expand_fieldname = 'EXPAND'.
wa_layout-colwidth_optimize = 'X'.
endform. " MODIFY_LAYOUT
*& Form LIST_DISP
text
--> p1 text
<-- p2 text
form list_disp tables p_it_vbrk
using p_user_command type slis_formname.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'POPUP'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING = IT_EXTAB[]
TABLES
T_OUTTAB = IT_VBRK
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.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'POPUP'
i_callback_user_command = 'HANDLE_USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
tables
t_outtab = p_it_vbrk
exceptions
program_error = 1
others = 2.
endform. " LIST_DISP
*& Form POPUP
text
-->P_EXTAB text
form popup using it_extab type slis_t_extab.
*- Pf status
set pf-status 'POPUP'.
endform. " POPUP
*& Form F_USER_COMMAND
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
clear it_fieldcat1[].
clear it_vbrp[].
if rs_selfield-fieldname = 'VBELN'.
read table it_vbrk index rs_selfield-tabindex.
loop at itab where vbeln = it_vbrk-vbeln.
move-corresponding itab to it_vbrp.
append it_vbrp.
endloop.
perform interactive_report.
endif.
endcase.
endform. "HANDLE_USER_COMMAND
*& Form INTERACTIVE_REPORT
text
--> p1 text
<-- p2 text
form interactive_report .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT1[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_l = 'BILLING DOC'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 1.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'POSNR'.
wa_fieldcat-seltext_l = 'ITEM'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 2.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'FKIMG'.
wa_fieldcat-seltext_m = 'INV QTY'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 3.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'VRKME'.
wa_fieldcat-seltext_m = 'SALES UNIT'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 4.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'NETWR'.
wa_fieldcat-seltext_m = 'NET PRICE'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-col_pos = 5.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 6.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-seltext_m = 'SALES ORDER'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 7.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT1[]
IT_SORT = IT_SORT
TABLES
T_OUTTAB = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = wa_layout
it_fieldcat = it_fieldcat1[]
tables
t_outtab = it_vbrp
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. " INTERACTIVE_REPORT
Madhavi
Similar Messages
-
Function module for interactive reporting in alv
hi,
any one knows about f.m used in interactive reporting .
plz forward pseudo code .
praveenhi,
check my example:
REPORT ZSR_ALV_INTERACTIVE.
TABLES : LFA1,EKKO,EKPO.
SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
DATA : BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
END OF ITAB.
DATA : BEGIN OF JTAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
END OF JTAB.
DATA : BEGIN OF KTAB OCCURS 0,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
END OF KTAB.
TYPE-POOLS : SLIS.
DATA : REPID LIKE SY-REPID.
DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
LFA1_W TYPE SLIS_FIELDCAT_ALV,
EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
EKKO_W TYPE SLIS_FIELDCAT_ALV,
EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
EKPO_W TYPE SLIS_FIELDCAT_ALV,
EVENTS_B TYPE SLIS_T_EVENT,
EVENTS_W TYPE SLIS_ALV_EVENT.
PERFORM GET_VAL.
REPID = SY-REPID.
SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
*perform val USING USER_COMMAND sel.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = LFA1_B
IT_EVENTS = EVENTS_B
TABLES
T_OUTTAB = ITAB.
*& Form GET_VAL
text this is to put column headings
FORM GET_VAL.
LFA1_W-FIELDNAME = 'LIFNR'.
LFA1_W-REF_TABNAME = 'LFA1'.
LFA1_W-REF_FIELDNAME = 'LIFNR'.
APPEND LFA1_W TO LFA1_B.
LFA1_W-FIELDNAME = 'NAME1'.
LFA1_W-REF_TABNAME = 'LFA1'.
LFA1_W-REF_FIELDNAME = 'NAME1'.
APPEND LFA1_W TO LFA1_B.
EKKO_W-FIELDNAME = 'EBELN'.
EKKO_W-REF_TABNAME = 'EKKO'.
EKKO_W-REF_FIELDNAME = 'EBELN'.
APPEND EKKO_W TO EKKO_B.
EKKO_W-FIELDNAME = 'AEDAT'.
EKKO_W-REF_TABNAME = 'EKKO'.
EKKO_W-REF_FIELDNAME = 'AEDAT'.
APPEND EKKO_W TO EKKO_B.
EKPO_W-FIELDNAME = 'EBELP'.
EKPO_W-REF_TABNAME = 'EKPO'.
EKPO_W-REF_FIELDNAME = 'EBELP'.
APPEND EKPO_W TO EKPO_B.
EKPO_W-FIELDNAME = 'MATNR'.
EKPO_W-REF_TABNAME = 'EKPO'.
EKPO_W-REF_FIELDNAME = 'MATNR'.
APPEND EKPO_W TO EKPO_B.
EVENTS_W-NAME = 'USER_COMMAND'.
EVENTS_W-FORM = 'VAL'.
APPEND EVENTS_W TO EVENTS_B.
ENDFORM. "GET_VAL
*& Form VAL
text
-->USER_COMMANtext
-->SEL text for retrieving data
FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
DATA : VEN(10) TYPE N,
PO(10) TYPE N.
DATA : MAT(10) TYPE C.
IF SEL-FIELDNAME = 'LIFNR'.
VEN = SEL-VALUE.
SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
I_STRUCTURE_NAME = EKKO_B
IT_FIELDCAT = EKKO_B
IT_EVENTS = EVENTS_B
TABLES
T_OUTTAB = JTAB.
ENDIF.
IF SEL-FIELDNAME = 'EBELN'.
PO = SEL-VALUE.
SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'ITEM DETAILS'
I_TABNAME = 'EKPO'
IT_FIELDCAT = EKPO_B
I_CALLBACK_PROGRAM = REPID
IMPORTING
ES_SELFIELD = SEL
TABLES
T_OUTTAB = KTAB.
ENDIF.
logic to select a record
IF SEL-FIELDNAME = 'MATNR'.
MAT = SEL-VALUE.
SET PARAMETER ID 'MAT' FIELD MAT.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM. "VAL -
Own function in computation (Interactive Report)
Hello,
I have checked package WWV_FLOW_WORKSHEET_DIALOGUE (it's wrapped, so I've checked it only slightly) and table WWV_FLOW_WORKSHEET_COMPUTATION and found that those two objects are responsible for functions we can see/use at Compute panel of Interactive Report. I need to add my own function to computation but it's not possible. When I write MY_FUNCTION(A) in text box and try to apply then I receive message: "Invalid computation expression. MY_FUNCTION".
Is any way to add own function to be seen by Compute option in Interactive Report?
It's important that I don't want to use MY_FUNCTION in query defined in Region Source!
Thanks in advance,
RegardsHi, just stumbled over your question and I happened to have the same problem.
It appears not to be possible to use your own functions although it would definitely be very nice.
However, I found a solution, but given that I already had my knuckles rapped once for mentioning them-who-must-not-be-named (anything starting with "WWV..." really), I am not going to post it here.
If you are still interested (and if you didn't fix it already for yourself), drop me a personal mail and I'll get back to you.
Needless to say, you should think long and hard before you make any modification in any WWV_ object and then decide that you shouldn't.
Regards,
Iulian -
Interaction with transaction codes with interactive reports
hi..
i want to call a transaction code from the report which i prepared.for example...if im displaying the list of order no.of a customer as output ,then when i want to make some changes in the order details ..instead of going to transcode VA02 ..i want the transcation has to open when i double click the order number.Hi,
you have to do some thing like this ...
REPORT ZTETS_CURSOR .
DATA: FIELD(20),
VALUE(10).
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 100 ROWS
INTO TABLE ITAB.
TOP-OF-PAGE.
WRITE:(10) 'VBELN',
(6) 'POSNR'.
END-OF-SELECTION.
LOOP AT ITAB.
WRITE: /(10) ITAB-VBELN,
(6) ITAB-POSNR.
ENDLOOP.
AT LINE-SELECTION.
GET CURSOR FIELD FIELD VALUE VALUE.
IF FIELD = 'ITAB-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VALUE
IMPORTING
OUTPUT = VALUE.
SET PARAMETER ID 'AUN' FIELD VALUE.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
Regards
vijay -
Aggregate function usage in interactive reports
Dear All,
I am trying to use the aggregate option in interactive reports , i am not getting any outputs. Can any one please show any examples from your reports ? or give me some idea to get the functionality work done for my reports.
Thanks in advance.
Regards
Dhanush.RDear All,
I am trying to use the aggregate option in interactive reports , i am not getting any outputs. Can any one please show any examples from your reports ? or give me some idea to get the functionality work done for my reports.
Thanks in advance.
Regards
Dhanush.R -
depends on the parameters related with group, I want to get a different total amount;
the following code does work in oracle reports but too long code. I want to improve the function as simple using Loop statement. would you help me?
function CF_9Formula return Number is
A NUMBER;
B NUMBER;
c NUMBER;
begin
A := :Sum of a group;
B := :Sum of b group;
C := :Sum of b group;
if (:P_1 = '0' ) then
RETURN NVL(0,0)+NVL(B,0)+NVL(C.0);
elsif (:P_2='0') then
RETURN NVL(A,0)+NVL(0,0)+NVL(C.0);
elsif (:p_3='0') then
RETURN NVL(A,0)+NVL(B,0)+NVL(0,0);
elsif (:P_1 = '0' AND :P_2='0' ) then
RETURN NVL(0,0)+NVL(0,0)+NVL(C,0);
elsif (:P_1 = '0' AND :P_3='0' ) then
RETURN NVL(0,0)+NVL(B,0)+NVL(0,0);
elsif (:P_2 = '0' AND :P_3='0' ) then
RETURN NVL(A,0)+NVL(0,0)+NVL(0,0);
elsif (:P_1 = '0' AND :P_2='0'AND :P_3='0' ) then
RETURN NVL(0,0)+NVL(0,0)+NVL(C,0);
else
RETURN NVL(A,0)+NVL(B,0)+NVL(C,0);
END IF;
END;Whats the value for P_1, P_2 or P_3 if its not '0'. If its '1' you could do a:
RETURN :P_1*NVL(A,0)+:P_2*NVL(B,0)+:P_3*NVL(C,0); -
Interactive report from PL/SQL function
Hello All,
i have a pl/sql function that dynamically builds up a sql query and returns it as a varchar2.
when i create a new report then i can use this function in the report like
return f_function(param1,param2,v('APP_ID'), v('APP_SESSION'));
and this works fine.
Except i cannot create an interactive report for this function, because it is not allowed !!!!
So how can i use the function in an interactive report ?
Thanks in advance,
MarcoMarco,
Another rather extreme approach would be to go all the way and make your function pipelined (that is not only build but also execute the query) and then select from it in your interactive report.
The disadvantage here would be that any supplementary filtering would act on the result set of the function (not as an addition to the where clause of the original query). But if you can live with that...
The advantage would be that there's less fiddling with column headers.
Regards,
Iulian -
Compute function on interactive report
Hi Every 1,
I need some help with an interactive report i am trying to produce. What i am trying to do is use to compute function of an interactive report and add the actual count from a week (e.g. week 26) and add it to the forecast count of that week
The problem that i have is that they are on different rows
The table below shows that i am working with.
Week No|Forecast Count|Actual Count*
____26__|_______0______|___128231____
____26__|____180916____|______0______
____27__|_______0______|___164666____
____27__|____180916____|______0______
____28__|_______0______|___169302____
____28__|____180916____|______0______
____29__|_______0______|___159857____
____29__|____180916____|______0______
____30__|_______0______|___162210____
____30__|____180916____|______0______
____31__|_______0______|___152471____
____31__|____180916____|______0______
Any help would be welcome :)
Thanks in advance
-N.S.N.O.Is that the only way that this could be done?
I have tried to get the values on the same row but it has proved very very difficult.
The query i use to get the data is this:
select ROUND(TO_NUMBER(TO_CHAR(TO_DATE(rpad(con_add_td_hr, 10),'yyyy-mm-dd'),'ddd')-2)/7)+1 "Week No", 0, sum(cons_total) "Actual Count"
from corcon01_hour_totals
where db_name='CSAHEPA' and substr(con_add_td_hr,1,4)='2008' and CON_ADD_USER_ID not like '%LDL%'
group by ROUND(TO_NUMBER(TO_CHAR(TO_DATE(rpad(con_add_td_hr, 10),'yyyy-mm-dd'),'ddd')-2)/7)+1
UNION
select week_no, sum(manual_entry_cons)+sum(citedi_cons)"Forecast Data", 0
from concount_forecast_data
where db_name ='CSAHEPA' and year ='2008'
group by week_no
The problem that i have is that the 2 tables are not relate and do not have a matching table structure. For the actual count table i have to generate the week number using a data/hour column.
If you have any suggestions i would be very grateful.
Thanks
-N.S.N.O.
Edited by: N.S.N.O. on Sep 16, 2008 2:21 AM -
Interactive report on view based on pipelined table function.
Hi,
I want to build an Interactive Report on a view.
The view definition contains a select on a pipelined table function. I use context functionality to pass paramaters to the pipelined table function.
A plain select * from #my_view# in SqlPlus results in 121 different rows.
However, If I base my Interactive report on this view, I get 15 repeated rows (all the same).
Is it possible to use pipelined table functionality on an Interactive report? I can't seem to get it working.
If I use the following approach (http://rakeshjsr.blogspot.nl/2010/10/oracle-apex-interactive-report-based-on.html) I do get results, but I can't use this solution for a reason that's not relevant.Hello,
Is it possible to use pipelined table functionality on an Interactive report? I can't seem to get it working. I have used it in one instance and it works fine. However I was passing the values to pipe-lined function directly.
IR Query..
SELECT * FROM TABLE(fn_pipeline(:P1_ITEM_NAME))Call pipe-lined function from IR query directly (instead of using view)
Try sending values to Pipe-lined function directly. In-case if the problem is with setting and getting values from the context?
Regards,
Hari -
Interactive Report Download and Session State Protection
I have created an Interactive Report in an APEX application that I have enabled
session state protection for. The issue I am having is with the "Download"
functionality of the interactive report to a .csv file.
The URL created by selecting Download from the drop down (javascript:gReport.controls.download();)
is built or constructed without a checksum thus causing the error below.
Error
No checksum was provided to show processing for a page that
requires a checksum when one or more request, clear cache, or argument
values are passed as parameters.
The anchor tag containing the URL (/f?p=app_id:page:session_id:CSV:) is contained within
<div id="apexir_CONTROL_PANEL_DROP" class="drop_panel
clearfix" style="">
Running the following: Application Express 3.1.0.00.32 on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
Is there a way to add a checksum to this? OR does anyone have any ideas on how to work around this?
Edited by: Bryce Tuohy on Feb 26, 2009 10:08 AMWORKAROUND:
1.) Create hidden ITEM on page (I named it P23_PREPARED_CSV_DOWNLOAD_URL).
Enter the following for the ITEM
as the SOURCE_TYPE : PL/SQL Function Body
as the SOURCE: return apex_util.prepare_url('f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:CSV:')
2.) Create BUTTON that executes javascript to open POPUP window with this url.
a.) Create Button and enter
<a href="javascript:popupURL('&P23_PREPARED_CSV_DOWNLOAD_URL.')">Download and Save to CSV file</a>as the "Text Label/Alt"
Originally had custom code for javascript POPUP and this is not needed .... just use the APEX javascript function.
Edited by: Bryce Tuohy on Mar 5, 2009 10:47 AM -
How to apply an accent-insensitive search to an interactive report?
Hello all!
I'm trying to put an accent-insensitive search on an interactive report here. For example, if I'm on the page that has the interactive report and if I click the column header of the interactive report, I get to see a search bar that dynamically shows the results that match your input. Now, when I enter "jager", I want to see *"Jägermeister"* as a search result. The search must be accent-insensitive, so that I don't have to enter the ä every time.
My code is as follows:
SELECT name
FROM food_1
WHERE name LIKE 'Jagerme%'
AND NLSSORT(name) IS NOT NULL
ORDER BY NLSSORT(name, 'NLS_SORT=GENERIC_M_AI');As you can see, I first tried getting a result through the SQL Command. It should return the row that has "Jägermeister" as name. However, it doesn't. It tells me "No data found". So, how do I alter my NLSSORT to search accent-insensitive?
Some extra information, I edited the interactive report source to the following:
SELECT DISTINCT a.name, a.foodid
FROM food_1 a INNER JOIN foodunit_1 c
ON a.foodid = c.foodid
WHERE a.foodlanguageid = :P17_SET_LANGUAGE
AND NLSSORT(a.name) IS NOT NULL
ORDER BY NLSSORT(a.name, 'NLS_SORT=GENERIC_M_AI');I also tried doing ALTER SESSION before the SQL code, but it still gives me the same result: No data found.
I'm using APEX version 4.1.1.00.23.
Help and suggestions are more than welcome. ;)
Thanks in advance,
MagaliI found it out!
It's really ridiculous, actually.
Remember this code?
execute immediate ('ALTER session SET NLS_COMP=LINGUISTIC');
execute immediate ('ALTER session SET NLS_SORT=BINARY_AI');Well, this code is perfectly fine. Only, it doesn't execute. This is because it was misplaced...This process is not executed when you place it in the current authentication scheme, under the "Post-Authenticatoin Process" part.
You might wonder why this is, but I have the explanation to that.
You see, when you use an interactive report, the page processing isn't executed when you use the search function of that interactive report... Because it's an interactive report, I guess.
BUT.
An ALTER SESSION from the security attributes, that will execute.
So, the solution to my problem was, in this case:
Go to "Application" --> "Shared Objects" --> "Security Attributes" --> "Database Session" --> "Initialization PL/SQL code". In there, you need to put:
BEGIN
EXECUTE IMMEDIATE 'ALTER session SET NLS_COMP=LINGUISTIC';
EXECUTE IMMEDIATE 'ALTER session SET NLS_SORT=BINARY_AI';
END;By doing this, there's no longer any need to edit the source code of the report!
So, that's the solution. I can finally enter text without special characters in it, and get the corresponding data, with special characters... Ahh. :)
I hope this is helpful to others as well now. ;) -
Doubt in creating interactive report
hi friends,
while creating interactive report i was unable to display the output.bt in my program there is no error
let me explain my program first.
i have created three tables with three internal table name.
first name contains 4 fields with id as foreign key
second table contains 2 fields with id as foreign key
third table contains 2 fields with id as foreign key.
on seeing the output i can see only first table contents,i was unable to see the second & third table contents.
if possible anybody give the syntax for that report.
kindly solve my problem.
thanks
revathy.Hi revathy,
Find the follwing code for interactive report and award points if useful
*TABLES DECLARATION
TABLES : KNA1, VBAK, VBAP.
*SELECT OPTIONS
SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
*INITIALIZATION
INITIALIZATION.
CUST_NO-LOW = '01'.
CUST_NO-HIGH = '5000'.
CUST_NO-SIGN = 'I'.
CUST_NO-OPTION = 'BT'.
APPEND CUST_NO.
*SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON CUST_NO.
LOOP AT SCREEN.
IF CUST_NO-LOW <> 5000.
MESSAGE E001(ZTJ1).
ENDIF.
ENDLOOP.
*BASIC LIST SELECTION
START-OF-SELECTION.
SELECT KUNNR NAME1 ORT01 LAND1 INTO
(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
FROM KNA1
WHERE KUNNR IN CUST_NO.
WRITE:/1 SY-VLINE,
KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
KNA1-NAME1 UNDER 'NAME',
61 SY-VLINE,
KNA1-ORT01 UNDER 'CITY',
86 SY-VLINE,
KNA1-LAND1 UNDER 'COUNTRY',
103 SY-VLINE.
HIDE: KNA1-KUNNR.
ENDSELECT.
ULINE.
*SECONDARY LIST ACCESS
AT user-command.
IF SY-UCOMM = 'IONE'.
PERFORM SALES_ORD.
ENDIF.
IF SY-UCOMM = 'ITWO'.
PERFORM ITEM_DET.
ENDIF.
*TOP OF PAGE
TOP-OF-PAGE.
FORMAT COLOR 1.
WRITE : 'CUSTOMER DETAILS'.
FORMAT COLOR 1 OFF.
ULINE.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'NAME',
61 SY-VLINE,
63 'CITY',
86 SY-VLINE,
88 'COUNTRY',
103 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR SECONDARY LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
*TOP OF PAGE FOR 1ST SECONDARY LIST
IF SY-UCOMM = 'IONE'.
ULINE.
FORMAT COLOR 1.
WRITE : 'SALES ORDER DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'SALES ORDER NO.',
40 SY-VLINE,
42 'DATE',
60 SY-VLINE,
62 'CREATOR',
85 SY-VLINE,
87 'DOC DATE',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR 2ND SECONDARY LIST
IF SY-UCOMM = 'ITWO'.
ULINE.
FORMAT COLOR 1.
WRITE : 'ITEM DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'SALES ORDER NO.',
40 SY-VLINE,
42 'SALES ITEM NO.',
60 SY-VLINE,
62 'ORDER QUANTITY',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*END OF PAGE
END-OF-PAGE.
ULINE.
WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
SY-PAGNO.
SKIP.
*& Form SALES_ORD
*& FIRST SECONDARY LIST FORM
FORM SALES_ORD .
SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
FROM VBAK
WHERE KUNNR = KNA1-KUNNR.
WRITE:/1 SY-VLINE,
VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
40 SY-VLINE,
VBAK-ERDAT UNDER 'DATE',
60 SY-VLINE,
VBAK-ERNAM UNDER 'CREATOR',
85 SY-VLINE,
VBAK-AUDAT UNDER 'DOC DATE',
103 SY-VLINE.
HIDE : VBAK-VBELN.
ENDSELECT.
ULINE.
ENDFORM. " SALES_ORD
*& Form ITEM_DET
*& SECOND SECONDARY LIST FORM
FORM ITEM_DET .
SELECT VBELN POSNR KWMENG INTO
(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
FROM VBAP
WHERE VBELN = VBAK-VBELN.
WRITE : /1 SY-VLINE,
VBAP-VBELN UNDER 'SALES ORDER NO.',
40 SY-VLINE,
VBAP-POSNR UNDER 'SALES ITEM NO.',
60 SY-VLINE,
VBAP-KWMENG UNDER 'ORDER QUANTITY',
103 SY-VLINE.
ENDSELECT.
ULINE.
ENDFORM. " ITEM_DET
REPORT demo_list_at_pf.
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
Secondary List by PF-Key Selection
SY-LSIND = 14
SY-UCOMM = PF06
Example for AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FC1'.
PERFORM out.
WRITE / 'Button FUN 1 was pressed'.
WHEN 'FC2'.
PERFORM out.
WRITE / 'Button FUN 2 was pressed'.
WHEN 'FC3'.
PERFORM out.
WRITE / 'Button FUN 3 was pressed'.
WHEN 'FC4'.
PERFORM out.
WRITE / 'Button FUN 4 was pressed'.
WHEN 'FC5'.
PERFORM out.
WRITE / 'Button FUN 5 was pressed'.
ENDCASE.
sy-lsind = sy-lsind - 1.
FORM out.
WRITE: 'Secondary List',
/ 'SY-LSIND:', sy-lsind,
/ 'SY-PFKEY:', sy-pfkey.
ENDFORM. -
Check all checkbox in an interactive report
Hi,
I would like to add a "check all" functionality in an interactive report. I've done that by adding a javascript function to the header, but when I click the column header to check all the page first executes the javascript that is used by the interactive report (sorting etc). Is there a way to disable this javascript for just the checkbox clolumn, so that my own javascript code is executed?
Or is there another way to add this functionality to the IR?
ThanksThat works great! Thanks jarola
The complete answer in case anyone needs it is to first include the checkbox column in your IRR query
APEX_ITEM.checkbox (1, ca.id) del
Then include this as the column heading
<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">
Then include the code as identified by jarola in the page HTML Header
<script type="text/javascript">
addLoadEvent(RemoveChkOnclick)
function RemoveChkOnclick(){
$x('apexir_DEL').onclick='';
</script>
Edited by: Bill Wheeling on Aug 1, 2010 4:12 AM
Edited by: Bill Wheeling on Aug 1, 2010 4:36 AM -
Interactive reports in abap objects
Hi,
plz send me the code of interactive report using ABAP Objects .
Thanks,
T.Sreekanth.Hi,
It will be similar to what you do in normal report.
Here you may create an object instance and then call some method on the object.
AT LINE-SELECTION.
create object obj.
CALL METHOD obj->method1
IMPORTING
text = im_text.
write: im_text.
Regards,
Sesh -
Interactive report: Can I exclude a particular column from single row view?
Hi -- I posted on this yesterday (Possible to exclude interactive report column from single row display?
a bit anxious for suggestions, I guess!
I've added a column with edit-link functionality to my interactive report query (that is, the link
is not attached to the database data... it's an additional column and shows an icon). It's also
in addition to the default single row view link. (We need both.)
Unfortunately, the Edit link column shows up in the single row view. I've pared it down as much
as I can: the label is empty, and the null value shows as "-". But an extra row with "-" is pretty
ugly. Is there a way to always, completely exclude this column from the single row view?
I know I could put the edit link on a data column, but:
1) I want the link to always be to the left of the data (and the user can re-order columns)
2) when the user doesn't have edit privileges, the link will need to be disabled or just not
be displayed, and I think that would be a problem if the link were on the data. (true?)
Thanks,
CarolPlease disregard this thread, and the one it refers back to. I see a flaw in the design of what I was attempting to do! Creating the link for Editing as a column means the user could inadvertently not display it, or move it, or... any number of problematic scenarios.
Thanks,
Carol
Maybe you are looking for
-
How to get Safari to open an HTML document created in AIR on iOS
We have an iOS app that creates a 3-page HTML document on the user's device and then prints it. We were using Darkredz ANE to do this, but the ANE is broken in iOS 8 and the Darkredz website is abandoned. As a workaround, we want to use Safari to lau
-
Editable DataGrid With DateField
I'm new to flex and struggling with the editable DataGrid. I have a DataGrid with an ItemRenderer that outputs a DateField. I can't figure out how to get the new value of the DateField after the edit. Here is my DataGrid (the endDate column): <mx:Dat
-
OutputStream is already being used for this request.
I have been trying to get images fom Oracle Database and displaying from JSP but get an IllegalStateException:OutputStream is already being used for this request. My code is as follows: <% Connection con = cods.getConnection(); Statement st = con.cre
-
Setting default universal save location
hello, i am setting up my own organizational system, including automation etc., and would like to have any document i create, download, etc. saved to the same folder. for speed, i would like to have this set as a preference or something similar so i
-
Firstly, I hope I haven't duplicated anything. I've been scouring the Internet and had no luck finding my answer. I am a technician in a college (Media Studies department), and we've got a Mac Mini server with Lion which works fine for logging on and