Conditional outputs needed in interactive reports
APEX version = 4
- DB version and edition = 10g
- Web server architecture = OHS
- Browser(s) used = I.E. 8
- Theme = #5 opal
- Templates
- Region/Process type
Hello
I have a system where records have statuses and depending on who is logged in when they access the report I need to alter the query, example if it is the system administrator they see all records, but if it is a regular user they only see records with certain statuses. I tried to put a begin and end with an if statement in the region source, but it did not work.
Any suggestions would be appreciated.
Thank you
Hi UserXY,
a possible solution is to extend your SELECT to return some HTML-Tags which take care of coloring or whatever you want to do.
e.g.
SELECT OID
, LAST_NAME
, CASE WHEN IS_URGENT=1 THEN '<span style="color:red;">'||IS_URGENT||'</span>' ELSE TO_CHAR(IS_URGENT) END AS IS_URGENT
FROM MY_TABLE
WHERE ...Peter
Similar Messages
-
Conditionally displayed columns of interactive report not displayed
We have an interactive report in which few of the columns have been defined with conditions for display.
But on the interactive report page, when the conditions are satisfied these columns do not display in the report by default.
These columns are found in the 'Select Columns' -> 'do not display' pane. Everytime the report is run, these columns need to be selected using the select column.
Is there anyway to make the columns appear in the report by default, when conditions are true.Thanks Jari for your help.
For this issue, we finally came up with a work around.
we removed the conditions from all the columns then ran the application report page.
Clicked on Select Columns and moved the columns from the do not display pane to the right pane.
Ordered them as needed. Then saved the report as primary.
Then again went to the edit page-> interactive report and applied the conditions to the necessary columns.
and it worked.
When I went to the report these columns are displayed by default. -
Output only the Interactive Reporting document in an IR job/output?
Hello,
I have created an Interactive Reporting job using the File->Import->File as Job. I have walked through the various screens to supply oce connection information, output directory etc. The output however, shows up as a Table of Contents - 1) Interactive Reporting Document 2) Interactive Reporting Document (Web Client) 3) A HTML file that contains log information.
Is there a way to specify that only yhe Interactive Reporting Document be generated and placed in a target directory of choice?
I don't want to produce an output everyday and have my users open up the Table of Content and have them pick the document. I just want the document output standalone.
Thanks in advance.Wasn't there an Acrobat issue that affected this as well? Make sure that is updated, too.
While I'm on it, this is being viewed in Acrobat/Reader, right? Anything else, especially Mac Preview is a bit of crapshoot. -
Please help! XML output needed for OBIEE report.
Hi,
I need an xml output of the OBIEE report. I have tried extrating the xml result using GO url but the xml format is not satisfactory. The default output assigns C0,C1..column names to each column data while on the other hand I need the name of the column and not C0 or C1.
Hence, can anyone please suggest as to how can I format the OBIEE xml output internally i.e. without doing it manually.
Please let me know if more explanation is required.
Thanks in advance!!Hi,
Thanks for the response but unfortunately Bi Publisher is even not giving the required output.
The output of Bi Publisher is like
<_170627_>170627</_170627_>
<_TRADES_._TRADE_ID_>2996</_TRADES_._TRADE_ID_>
<_FALSE_>FALSE</_FALSE_>
<_N_>N</_N_>
<_170627_>170627</_170627_>
<_R_>R</_R_>
and the output of OBIEE is
<C0>170627</C0>
<C1>2996</C1>
<C2>FALSE</C2>
<C3>N</C3>
<C4>170627</C4>
<C5>R</C5>
<C8>B</C8>
In both the cases I get leading and trailing tags which are not required. Ideally according to the requirement C0 should have been Trade ID, C2 - Cancellation option and so on.
The BI Publisher does give the output to some ectent but lans up capturing the table name also as u see it is Trades.Trades Id. I even reuire few extra tags which caary report information and this data is not being pulled from database.
Hence please help!! I am really very much confused!!
Thanks!!! -
Help needed in Interactive report
Hi,
my requirement is:
in first list, i have to display some sales orders from vbak.
in second list, user has to select multiple sales orders by check boxes besides them & click on execute.
in third list, sales orders(which is selected in second list) details has to be display.
Plese help me how to put check boxes for user selection in second list.
Thnx in advance.
sreenivas.Hii
REPORT Z_INTERACTIVE no standard page heading
Line-size 100 line-count 20(3)
message-id zkirru.
***SELECTION SCREEN*******
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
select-options: S_MATNR FOR V_MATNR.
PARAMETERS: CHECK1 AS CHECKBOX ,
CHECK2 AS CHECKBOX .
SELECTION-SCREEN END OF BLOCK B1.
*******INTERNALTABLE DECLARATION
DATA:BEGIN OF IT_MARD OCCURS 0,
MATNR LIKE MARD-MATNR, "MATERIAL NO --KEY
WERKS LIKE MARD-MATNR, "PLANT --KEY
LGORT LIKE MARD-LGORT, "STORAGE LOCATION--KEY
INSME LIKE MARD-INSME, "QTY INSPECTION STOCK
EINME LIKE MARD-EINME, "RESTRICTED BATCH STOCK
SPEME LIKE MARD-SPEME, "BLOCKED STOCK
END OF IT_MARD.
DATA:BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
ERNAM LIKE MARA-ERNAM,
END OF IT_MARA.
FOR SECONDARY LIST**********
DATA:BEGIN OF IT_MARA_ALV OCCURS 0,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
ERNAM LIKE MARA-ERNAM,
END OF IT_MARA_ALV.
START-OF-SELECTION.
SET PF-STATUS 'STATUS'.
WRITE 'CHECK THE CHECK BOXES'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
IF CHECK1 = 'X'.
SET PF-STATUS 'DIALOG'.
SET TITLEBAR 'FIRST BASIC LIST'.
WINDOW STARTING AT 8 5 ENDING AT 45 15.
WRITE 'CHECK SECOND BOX FOR SECOND LIST'.
ELSEIF CHECK2 = 'X'.
SET PF-STATUS 'DIALOG' EXCLUDING 'SELE'.
SET TITLEBAR 'SECOND BASIC LIST'.
WINDOW STARTING AT 55 10 ENDING AT 70 12.
WRITE 'SECOND BASIC LIST'.
ENDIF.
ENDCASE.
DATA:V_REPID TYPE SY-REPID,
V_MATNR TYPE MARA-MATNR.
*****TYPE POOLS*******************
TYPE-POOLS:SLIS.
DATA:IT_MARD_FC TYPE SLIS_T_FIELDCAT_ALV,
FC TYPE SLIS_FIELDCAT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_alv_EVENT,
IT_MARA_ALV_FC TYPE SLIS_T_FIELDCAT_ALV.
INITIALIZATION.********
INITIALIZATION.
V_REPID = SY-REPID.
AT SELECTION-SCREEN.*****
AT SELECTION-SCREEN.
PERFORM VALIDATION.
*******START OF SELECTION************
START-OF-SELECTION.
PERFORM GETDATA.
PERFORM POPULATE_FIELDCATALOG.
PERFORM FILL_EVENTS.
END-OF-SELECTION.
PERFORM DISPLAY_LIST.
*& Form GETDATA
text
--> p1 text
<-- p2 text
FORM GETDATA .
SELECT MATNR
WERKS
LGORT
INSME
EINME
SPEME FROM MARD INTO table IT_MARD WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0.
SORT IT_MARD BY MATNR.
select matnr
ersda
ernam
from mara
into TABLE it_mara
FOR ALL ENTRIES IN IT_MARD where matnr = IT_MARD-MATNR.
ENDIF.
ENDFORM. " GETDATA
*& Form POPULATE_FIELDCATALOG
**POPULATING FIELD CATALOG BY SPECIFYING ATTRIBUTES TO FIELD-NAMES.
FORM POPULATE_FIELDCATALOG .
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'MATNR'.
FC-KEY = 'X'.
FC-HOTSPOT = 'X'.
FC-OUTPUTLEN = 18.
FC-SELTEXT_L = 'MATERIAL NUMBER'.
APPEND FC TO IT_MARD_FC.
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'WERKS'.
FC-KEY = 'X'.
FC-SELTEXT_L = 'PLANT'.
APPEND FC TO IT_MARD_FC.
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'LGORT'.
FC-KEY = 'X'.
FC-SELTEXT_S = 'STR LOC'.
FC-SELTEXT_M = 'STORG LOC'.
FC-SELTEXT_L = 'STORAGE LOCATION'.
APPEND FC TO IT_MARD_FC.
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'INSME'.
FC-KEY = 'X'.
FC-SELTEXT_S = 'QTY INSP'.
FC-SELTEXT_M = 'QTY INSP STOCK'.
FC-SELTEXT_L = 'QTY INSPECTION STOCK'.
APPEND FC TO IT_MARD_FC.
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'EINME'.
FC-KEY = 'X'.
FC-SELTEXT_S = 'RES STK'.
FC-SELTEXT_M = 'RES BATCH STK'.
FC-SELTEXT_L = 'RESTRICTED BATCH STOCK'.
APPEND FC TO IT_MARD_FC.
CLEAR FC.
FC-TABNAME = 'IT_MARD'.
FC-FIELDNAME = 'SPEME'.
FC-KEY = 'X'.
FC-SELTEXT_S = 'BLK STK'.
FC-SELTEXT_M = 'BLK STOCK'.
FC-SELTEXT_L = 'BLOCKED STOCK'.
APPEND FC TO IT_MARD_FC.
ENDFORM. " POPULATE_FIELDCATALOG
*& Form FILL_EVENTS
text
--> p1 text
<-- p2 text
FORM FILL_EVENTS .
**THIS FM IS USED TO FILL ALL EVENTS IN IT_EVENTS-NAME'S FILED**
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO WA_EVENTS.
IF SY-SUBRC = 0.
MOVE 'DISPLAY_HEADER' TO WA_EVENTS-FORM.
MODIFY IT_EVENTS from wa_events INDEX SY-TABIX.
ENDIF.
READ TABLE IT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE INTO WA_EVENTS.
IF SY-SUBRC = 0.
MOVE 'DISPLAY_FOOTER' TO WA_EVENTS-FORM.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
READ TABLE IT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND INTO
WA_EVENTS.
IF SY-SUBRC = 0.
MOVE 'PROCESS_SECONDARYLIST' TO WA_EVENTS-FORM.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
ENDFORM. " FILL_EVENTS
FORM DISPLAY_HEADER.
FORMAT COLOR 2.
WRITE:/15 'INTELLI GROUP ASIA PVT LTD.'(002) .
ENDFORM.
FORM DISPLAY_FOOTER.
FORMAT COLOR 5.
WRITE:/150 'PAGE NO.'(003),SY-PAGNO.
ENDFORM.
*& Form DISPLAY_LIST
text
--> p1 text
<-- p2 text
FORM DISPLAY_LIST .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_MARD_FC
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = 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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_MARD
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_LIST
*& Form VALIDATION
FORM VALIDATION .
SELECT MATNR FROM MARD INTO V_MATNR
UP TO 1 ROWS
WHERE MATNR IN S_MATNR .
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'INVALID MATERIAL NO'.
ENDIF.
ENDFORM. " VALIDATION
FORM PROCESS_SECONDARYLIST USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE
SLIS_SELFIELD .
CASE L_UCOMM.
WHEN '&IC1'.
*READ TABLE IT_MARD INDEX L_SELFIELD-TABINDEX.
REFRESH IT_MARA_ALV.
*LOOP AT IT_MARA WHERE MATNR = IT_MARD-MATNR.
LOOP AT IT_MARA WHERE MATNR = L_SELFIELD-VALUE.
MOVE-CORRESPONDING IT_MARA TO IT_MARA_ALV.
APPEND IT_MARA_ALV.
CLEAR IT_MARA_ALV.
ENDLOOP.
PERFORM DISPLAY_SECONDARYLIST.
ENDCASE.
ENDFORM.
*& Form DISPLAY_SECONDARYLIST
FORM DISPLAY_SECONDARYLIST .
PERFORM FIELD_CATALOG_SECONDRY.
PERFORM DISPLAY_SLIST.
ENDFORM. " DISPLAY_SECONDARYLIST
*& Form FIELD_CATALOG_SECONDRY
FORM FIELD_CATALOG_SECONDRY .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_MARA_ALV'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_MARA_ALV_FC
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. " FIELD_CATALOG_SECONDRY
*& Form DISPLAY_SLIST
FORM DISPLAY_SLIST .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_MARA_ALV_FC
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_MARA_ALV
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.
Regards
Naresh -
Multiple Queries on Interactive Report
hi all,
Can i run multiple queries based on some condition in creating an interactive report?? I mean
i want to run a single query as
if :P12_QUERY == 1 then
first query
else if :P12_QUERY == 2 then
second query
end if;
Please provide me the syntax if its possible. Plz help me in this regard.
With Regards,
Sunil BhatiaHello,
You will need to create a pipeline function and use it in your query. But both your queries have to return the same dataset.
Example:
function choose_query(v_query_type integer) return some_type pipelined
is
v_query varchar2(4000);
v_cur sys_refcursor;
v_row some_type;
begin
if :P12_QUERY == 1 then
v_query := 'select ....';
else if :P12_QUERY == 2 then
v_query := 'select ....';
end if;
open v_cur for v_query;
loop
v_row := some_type(null, null, null);
fetch v_cur into v_row;
exit when v_cur%notfound;
pipe row (v_row);
end loop;
close v_cur;
end;In interactive report you have to set query:
select * from table(choose_query(:P12_QUERY ))
Best Regards, Kostya Proskudin -
Classical and Interactive reports / BSP
what are classical report and interactive reports
I dont know anything abot BSP. How to start and what are the pre-requsites.
Pls provide me the useful link for that
Thank you
JohnHi,
<b>Classical Reports:-</b>
These are the most simple reports. Programmers learn this one first. It is just an output of data using the Write statement inside a loop.
Classical reports are normal reports. These reports are not having any sub reports. IT IS HAVING ONLY ONE SCREEN/LIST FOR OUTPUT.
<b>Interactive Reports</b>As the name suggests, the user can Interact with the report. We can have a drill down into the report data. For example, Column one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can HIDE that data under those material numbers. And when the user clicks the material number, another report (actually sub report/secondary list) which displays the vendor details will be displayed.
<b>
For BSP's</b>
/people/thomas.jung/blog/2006/01/13/custom-bsp-extensions-time-stamp-and-range-ui-elements
http://searchsap.techtarget.com/tip/0,289483,sid21_gci886185,00.html
BSP Basics
If you search the forum aout the BSP, you will get more info
Regards
Sudheer -
Export XML from interactive report
Hi all,
is there a way to export the resulting output of an interactive report as XML (inline and/or attachment), like a normal report can do? (with FLOW_XMLP_OUTPUT_R<region_ID>)
The download option for ir provide only CSV and PDF.
Regards,
MarcoI explain my request.
I have a very complex SQL query, which is (much) more than 4000 characters and it works well in the interactive report.
As the interactive report is quite different from the normal report and the procudure FLOW_XMLP_OUTPUT_R<region_ID> doesn't seem to work, I'm obliged to create a report query in the shared components to get also the XML output, but shared report query accepts query less than 4000 characters long.
Any idea?
Marco -
need an interactive report to list the purchase orders details for a vendor that has interactive drill down options to give the detail of vendor from vendor master.
Check this sample code
TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
BUKRS LIKE EKKO-BUKRS,
BSART LIKE EKKO-BSART,
LIFNR LIKE EKKO-LIFNR,
END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
WA_EKKO TYPE I_EKKO.
*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
WA_EKPO TYPE I_EKPO .
*variable for Report ID
DATA: V_REPID LIKE SY-REPID .
*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
declaration for events table where user comand or set PF status will
be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
I_VARIANT1 TYPE DISVARIANT,
I_SAVE(1) TYPE C.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCATLOG.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_REPORT.
*& Form BUILD_FIELDCATLOG
Fieldcatalog has all the field details from ekko
FORM BUILD_FIELDCATLOG.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'AEDAT'.
WA_FIELDCAT-SELTEXT_M = 'DATE.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'LIFNR'.
WA_FIELDCAT-NO_OUT = 'X'.
WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. "EVENT_CALL
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form data_retrieval
retreiving values from the database table ekko
FORM DATA_RETRIEVAL.
SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
ENDFORM. "data_retrieval
*& Form bUild_listheader
text
-->I_LISTHEADEtext
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'this is my first alv pgm'.
HLINE-TYP = 'H'.
ENDFORM. "build_listheader
*& Form display_alv_report
text
FORM DISPLAY_ALV_REPORT.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = I_TITLE_EKKO
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'ZLAY1'
I_SAVE = 'A'
is_variant = i_variant
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKKO
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_alv_report
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
PERFORM BUILD_FIELDCATLOG_EKPO.
PERFORM EVENT_CALL_EKPO.
PERFORM POPULATE_EVENT_EKPO.
PERFORM DATA_RETRIEVAL_EKPO.
PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_EKPO.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_EKPO
text
FORM BUILD_FIELDCATLOG_EKPO.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELP'.
WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MENGE'.
WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-SELTEXT_M = 'UOM'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'NETPR'.
WA_FIELDCAT-SELTEXT_M = 'PRICE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*& Form event_call_ekpo
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL_EKPO.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. "event_call_ekpo
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT_EKPO.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form TOP_OF_PAGE
text
FORM F_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.
FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.
FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_EKPO
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKPO
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.
Reward points if useful. -
Refresh Interactive Report Definition via PLSQL
Hello!
I am currently working on set of generic database-apex applications.
That means I have two applications. The first is the admin apex application used to define columns and tables.
The second application is the one for the end users, where they can view and edit the values.
My problem now is: Every time the admin adds or removes a column I need to edit the user-apex application, open the region definition of all interactive reports and switch to the report attributes to add/remove the columns of the report.
I would like to automate this step via plsql. How can I achieve this?
I guess the first step would be to load a list of all IRs...
select * from apex_application_page_ir where application_id = 133;
But I don't know how to reload the columns...
Can anyone help?
Thanks in advance!
BR MikeHello Andre, Hello Mimi!
Thank you for your messages.
First to your idea Mimi, i think you brought me on the right track. Using your update statement doesn't works for me.
There are some missing permissions I couldn't grant and in addition I think this would hardly work because apex_application_page_ir is a complex view.
But I am currently working on a solution using the wwv_flow_worksheet_standard.synch_report_columns function. Code like this:
DECLARE
l_flow_id NUMBER (20);
l_region_id NUMBER (20);
l_query VARCHAR2 (4000);
l_result VARCHAR2 (4000);
BEGIN
SELECT application_id, region_id, sql_query
INTO l_flow_id, l_region_id, l_query
FROM apex_application_page_ir
WHERE page_id = 9 AND application_id = 133;
APEX_040100.wwv_flow_worksheet_standard.synch_report_columns (p_flow_id => l_flow_id,
p_region_id => l_region_id,
p_query => l_query,
p_add_new_cols_to_default_rpt => 'Y');
COMMIT;
END;
Unfortunately it doesn't work. When executing the synch_report_columns procedure the following error raises.
ORA-01003: no statement parsed
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1685
ORA-06512: at "SYS.DBMS_SQL", line 629
ORA-06512: at "APEX_040100.WWV_FLOW_WIZARD_API", line 840
ORA-06512: at "APEX_040100.WWV_FLOW_WORKSHEET_STANDARD", line 2735
ORA-06512: at line 23
Maybe you or someone else can reproduce the error?
Therefor you simply need an interactive report on a page, based on a view. Remove some column of the view definition-the IR will display an error like this:
ORA-20001: get_dbms_sql_cursor error ORA-00904: "DUV_FOCUS_OFFSET": invalid identifier
Then execute the code above (use your page and app_id).
After the execution the IR should work again. In my opinion...
@Andre: The application I am working on is a critical pice of software used in a highly sophisticated semiconducter fab.
It is simply impossible to train some of the shift leaders or operators on apex, in fact it is a great thread if someone else can change the application and produces a downtime.
So for me it is necessary to script everything as far as possible. I finished nearly everything, simply the synch of the report columns is missing...
BR Mike -
Interactive report - Save as html, possible to save file in database?
Hi
I am in a situation where I want the output of a interactive report in HTML format, but I do not wan't to download the files to my computer. I want to automate my process to display the report and save the file to database and to be attached to a email from Apex in a later stage.
Is this possible at all? tried different aproaches with saving data to clob and converting to blob, but it all look horrible for the end user.
Sincerely
JohnnyCheck if the subscription feature or download -> email available in apex 4.0 serves your purpose.
-
How to write if condition in Interactive reporting
Hi,<BR>Following function is existing in cognos<BR>if ( Calculation in the Report starts with M ) then ( 1 ) else ( months-between ( FolderItemRef[Prompts.Common.Dates.EffStartDt],FolderItemRef[Prompts.Common.Dates.EffEndDt] ) + 1 ) <BR><BR>I need to incorporate same in the Interactive reporting.I can keep Calculation in the report,EffStartDt,EffEndDt as the prompt and can get the value. But at query request line how can i incorporate the above expression so that i can get the output as the column in result set.<BR><BR>In addition to creation of computed column what else need to be done. Nullif function cannot be useful.<BR><BR>Let me know your points.<BR><BR>Regards<BR>R.Prasanna
<p>Hi prsan,</p><p>When you create a computed item column you can add standardJavaScript into the definition. To find out whether the valuestarts with an 'M' we can use the Substr built in function whichtakes a string, the start position of the substring and the numberof characters, for the else part of your conditional we can use theMonthsBetween built in function.</p><p>So if the column you are referencing is called Calc_In_Report wecan define the computed item as the if statement below.</p><p>Cheers,</p><p>--Ryan</p>
-
Interactive Report Performance With Conditional Link
Apex 3.2
I have a interactive report.
The underlying sql would return 127000 rows
The sql is
select
lde.ods_system,
lde.ldekey,
msg.sendersystem,
msg.messagetype,
msg.messageversion,
msg.msgseqnumber,
msg.alternatekey,
msg.crudmarker,
msg.clrbookdate,
msg.clrbookresult,
lower('udf_'||msg.messagetype) button,
lde.ldekey||'.'||msg.alternatekey||'.'||msg.msgseqnumber udm_key
from
clr_esbmessageheader msg,
clr_adm_systemmessage adm,
udm_lde lde
where
adm.ldeid = lde.ldeid and
msg.sendersystem = adm.system and
msg.messagetype = adm.messagetype and
msg.messageversion = adm.messageversion and
msg.receiversystem = 'SCIPS'
order by msg.clrbookdate desc
This report only takes 1 second to display.
I need to add a conditional link to another page, so I used
case
when lower('udf_'||msg.messagetype) = 'udf_distreceipt' then
'<a class="type" href="' || apex_util.prepare_url('f?p='||:APP_ID||':52:'||:APP_SESSION||'::'||:DEBUG||':RIR'||':IR_MSG_KEY,P52_PG:'|| lde.ldekey||'.'|| msg.alternatekey ||'.'|| msg.msgseqnumber ||','|| 50, null, 'SESSION') || '"title="Go to udf_distreceipt Report">udf_distreceipt</a>'
else 'no link' end table_link
The sql seems to be ok, because the report accepted it, but selecting the new column and saving the report takes forever (over 2 mins)
Now the report takes over 2 minutes to run and I still need to add more conditions.
Have I coded the link incorrectly ?
GusHi Gus,
Are you wanting to put the link in the query for a specific reason?
I had to do a similar thing in the past and just completed the column link section for the column.
Why not just have the following in the query:
case
when lower('udf_'||msg.messagetype) = 'udf_distreceipt' then
udf_distreceipt
else null END table_link
Then do the linking using column link section:
You would specify your link text as #TABLE_LINK# which should then be conditionally displayed due to the case statement, then add in all the page item and values to pass across using a normal link column.
Thanks
Paul -
Unable to open PDF output (PDF downloaded from Interactive Report--APEX)
Hi,
I'm getting below error while opening a PDF file downloaded from an interactive report (APEX).
Adobe reader cound not open "TEST.pdf"because it is either not supportd file or because the file has been damaged.
Thanks & Regards,
Ramamuni.Steps of pdf Printing of Report from FOP:
1) Download and unzip the following needed files in D:\Apex_fop directory.
2) Open your command prompt .
Change the directory to D:\Apex_fop\cocoon-2.1.11.
Set the Java_Home environment variable as: set JAVA_HOME= C:\Program Files\Java\jdk1.5.0_21
then type build war
3) After getting the prompt back as D:>Apex_fop>cocoon-2.1.11>
Copy coocon.war file from the folder D:\Apex_fop\cocoon-2.1.11\build\cocoon.
Paste this file into webapps subdirectory in main tomcat directory having path as D:\APEX_FOP\apache-tomcat-6.0.26\webapps.....place it in the top
level of webapps directory.
4) Now just startup tomcat as D:>APEX_FOP>apache-tomcat-6.0.26>bin>startup.bat
The cocoon.war file will automatically uncompressed as directory.
5) To change the port of apache tomcat , edit apache-tomcat-6.0.26\conf\server.xml & change port attribute of Connector element from 8080 to 8181.
Just check whether Tomcat is running or not as http://localhost:8181/
& to check cocoon type http://localhost:8181/cocoon/
6) Now copy fop_post directory & paste it undes new cocoon directory in webapps having path as D:\APEX_FOP\apache-tomcat-6.0.26\webapps
\cocoon.
7) Now you need to do some apex settings as follows:
In APEX, just log in as ADMIN into apex/apex_admin and went to Instance Settings and did the following:
- Print Serverr: Standard Support
- Print Server Protocol: HTTP
- Print Server Host Address:localhost
- Print Server Port: 8181
- Print Server Script: /cocoon/fop_post
In your APEX application, in the Regions section, Click on the Print link next to your report and do the following settings:
- Enable Report Printing: Yes
- Link Label: Print
- Response Header: Report Settings
- View File As: Attachment
- Output Format: PDF
- Report Layout: Default Report Layout
- Print URL: f?p=&APP_ID.:1:&SESSION.:FLOW_XMLP_OUTPUT_R1063230002781575
8) Open up the Report Page and click Print , You will get the pdf report.
I am sure this will help you
Regards -
Get condition from interactive report
Hi all!
I have an interactive report.
After the user has set some filter conditions I would like to write the ID's of the selected datasets into a table.
This should take place in an "after-submit-process" in pl/sql.
Something like:
INSERT INTO #OWNER#.log_table (OBJT_ID) VALUES (SELECT ID FORM #OWNER#.source_table WHERE
":APEX_REPORT_CONDITION");
My question:
Is there an apex-object like ":APEX_REPORT_CONDITION"?
Thanks for your help!
KaiHi Jari,
thank you for your reply. But I need s.th. different:
If I load my report-page and display "Debug" the SQL behind the report looks like:
select
null as apxws_row_pk,
+"ID",+
+"NUMBER",+
+"TITLE",+
+"ENTRY_DATE",+
+"PRIOPRITY",+
+"PROBABILITY",+
count(*) over () as apxws_row_cnt
from (
select * from (
select
r.ID,
r.NUMBER,
r.TITLE,
r.RPRI_NAME,
r.ENTRY_DATE,
r.PRIORITY,
r.PROBABILITY
from #OWNER#.MY_TABLE r
where r.usr_name = :APP_USER
+) r+
where ("PROBABILITY" = :APXWS_EXPR_1*
and "PRIORITY" = :APXWS_EXPR_2)*
+) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)+
+0.44: binding: ":APP_USER"="APP_USER" value="USER"+
+0.44: IR binding: ":APXWS_EXPR_1"="APXWS_EXPR_1" value="(10-50%)"+
+0.44: IR binding: ":APXWS_EXPR_2"="APXWS_EXPR_2" value="Hoch"+
+0.44: IR binding: ":APXWS_MAX_ROW_CNT"="APXWS_MAX_ROW_CNT" value="10000"+
As we can see, apex put an own select-statement around the original statement.
What I need is the part in bold letters and the APXWS_EXPR_x-values. How can I get it?
Has anyone any ideas? Thanks in advance!
Kai
Edited by: user610935 on Nov 25, 2009 11:27 PM
Edited by: user610935 on Nov 25, 2009 11:27 PM
Maybe you are looking for
-
Apple Unibody 13.3" MacBook Pro (Mid-2010): 4GB vs. 8GB DDR3 1066MHz Memory (RAM). 1. About my Mac. Processor: Intel® Core 2 Duo (2.66GHz) Memory (RAM): 4.00GB DDR3 1066MHz (2 x 2.00GB) Hard Drive: 320GB 5400RPM (Apple Stock HD) G
-
To givingupusa - a simple Encore Tutorial
To givingupusa - a simple Encore Tutorial I have CS5, so you need to go slowly to be sure you find the correct commands for your version of Premiere Pro and Encore This is for DVD only, since I don't do BluRay Verify these steps with the book or PDF
-
Went to edit a few of my bookmarks in the bookmark bar but for some reason i cant seem to access anywhere to edit them or re-arrange them. [IMG]http://i2.photobucket.com/albums/y45/thelibertine1982/12345.jpg[/IMG] Any ideas whats going on?
-
How do I switch from one column to the next, skip around? Tab key doesn't seem to do itl. I can't find any "help" in "help". Help. Please. Thank you.
-
A classic question: Time Refresh without using Javascript
Hi guys, I know this has been asked before. For people who are illterated to Javascripts, like me, is there a way decent enough to solve this kinda of problems? I have a timer in a region of a page. The timer needs to be refreshed at least every 2 se