Interactive Report Performance
Hi everyone.. I don't see a setting for this, but I do see a need for this. I do have some interactive reports that have a decent amount of data, and this can cause page performance issues. I would love if there was a setting that allowed you to filter before fully rendering. This way I don't have to build a pre-report filter to help with speed.
Any other thoughts/suggestions?
Thanks,
Scott
do you want to filter rows?
I had a similar task and solved it like this:
- create a Interactive Report with few columns
- add a column with checkboxes
- write the selected boxes into a hidden text box
- use the string as filter option
=> the User can select single rows of interest
Also seen here:
http://www.oracle.com/global/de/community/tipps/link_reports/index.html
Sry, it's german. But maybe it helps.
Similar Messages
-
Interactive report performance problem over database link - Oracle Gateway
Hello all;
This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
query like this: (due to sensitivity issue, I can not disclose real table name)
SELECT apex_item.checkbox(1,b.col3)
, a.col1
, a.col2
FROM table_one a
, table_two b
WHERE a.col3 = 12345
AND a.col4 = 100
AND b.col5 = a.col5
table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
I would like to get ideas from people how to resolve or speed-up the query?
Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
Thank you.
Shaun S.Hi Shaun
Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
WITH a AS
(SELECT /*+ MATERIALIZE */ *
FROM table_one),
b AS
(SELECT /*+ MATERIALIZE */ *
FROM table_two),
sourceqry AS
(SELECT b.col3 x
, a.col1 y
, a.col2 z
FROM table_one a
, table_two b
WHERE a.col3 = 12345
AND a.col4 = 100
AND b.col5 = a.col5)
SELECT apex_item.checkbox(1,x), y , z
FROM sourceqry
WITH a AS
(SELECT /*+ MATERIALIZE */ *
FROM table_one),
b AS
(SELECT /*+ MATERIALIZE */ *
FROM table_two)
SELECT apex_item.checkbox(1,x), y , z
FROM table_one a
, table_two b
WHERE a.col3 = 12345
AND a.col4 = 100
AND b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
Sorry for all the questions but it helps to answer the question, if I can.
Cheers
Ben
http://www.munkyben.wordpress.com
Don't forget to mark replies helpful or correct ;) -
Interactive report performance problem over database link
Hi gurus,
I have an interactive report that retrieves values from two joined tables both placed on the same remote database. It takes 45 seconds to populate (refresh) a page after issuing a search. If I catch the actual select that is generated by apex ( the one with count(*) over ()...) and run it from sql environment, it takes 1 or 2 seconds. What on earth does consume the rest of the time and how to speed this up? I would like to awoid creating and maintaining local materialized views if possible.
Regards
SamoHi
APEX normally needs to return the full result set for the purposes of pagination (where you have it set to something along the lines of show x-y of z), changing this or the max row count can affect performance greatly.
The driving site hint would need to refer to the name of the view, but can be a bit temperamental with this kind of thing. The materialize hint only works for sub-factored queries (in a 'WITH blah AS(SELECT /*+ MATERIALIZE */ * FROM etc. etc.)). They tend to materialize anyway and its best not to use hints like that for production code unless there is absolutely no other option, but just sub factoring without hints can often have a profound effect on performance. For instance
WITH a AS
SELECT c1,
c2,
c3,
c4,
c5
FROM schema1.view1)
, b AS
SELECT c1,
c2,
c3
FROM schema1.view2)
SELECT *
FROM a, b
WHERE a.c5 = b.c3May produce a different plan or even just sub factoring one of the external tables may have an effect.
You need to try things out here and experiment and keep looking at the execution plans. You should also change Toads row fetch setting to be all 9's to get a real idea of performance.
Let me know how you get on.
Cheers
Ben
http://www.munkyben.wordpress.com
Don't forget to mark replies helpful or correct ;)
Edited by: Munky on Sep 29, 2009 1:41 PM -
Hyperion Interactive reporting performance issue.
Hi,
We created a report in Hyperion Interactive reporting using Hyperion Essbase as database connection file .
Report performance was good in Interactive reporting Studio we don't have any problem in studio.
when we open the the report in Hyperion Workspace We are facing performance issue of the report and also when i hit refresh button to refresh data in the Workspace,i am getting the following error message
*"An Interactive Reporting Service error has occurred - Failed to acquire requested service. Error Code : 2001"*
Any suggestions to resolve this will be really helpful.
Thanks in advance
Thanks
Vamsi
Edited by: user9363364 on Aug 24, 2010 7:49 AM
Edited by: user9363364 on Sep 1, 2010 7:59 AMHi
i also faced such an issue and then i found the answer on metalink
Error: "An Interactive Reporting Service Error has Occurred. Failed to Acquire Requested Service. Error Code: 2001" when Processing a bqy Report in Workspace. [ID 1117395.1]
Applies to:
Hyperion BI+ - Version: 11.1.1.2.00 and later [Release: 11.1 and later ]
Information in this document applies to any platform.
Symptoms
Obtaining the following error when trying to process a BQY that uses an Essbase data source in Workspace:
"An Interactive Reporting Service error has occurred. Failed to acquire requested service. Error Code: 2001".
Cause
The name of the data source in the CMC contained the machine name in fully qualified name format whereas the OCE contained the machine name only. This mismatch in machine names caused the problem. Making the machine name identical in both cases resolved the problem.
Solution
Ensure that the name of the data source as specified in the OCE in Interactive Reporting Studio matches the name specified in the CMC tool in the field "Enter the name of the data source".
In fact, all fields need to match between the OCE and the CMC Data Source.
regards
alex -
Interactive Reports - Performance Issue
Hi All
We have been getting ORA-04030: out of process memory … more and more frequently since first implementing Interactive Reports. From Enterprise Manager we had a look at the most costly queries and the one that stands out the most is:
SELECT *
FROM WWV_FLOW_WORKSHEET_CONDITIONS
WHERE CONDITION_TYPE = ‘HIGHLIGHT’
AND WORKSHEET_ID = :B2
AND SECURITY_GROUP_ID = :B1
ORDER BY HIGHLIGHT_SEQUENCE, NAME I have done all I can with the memory configuration and we are in the process of upgrading the servers to 64 bit Linux.
However, I noticed that WWV_FLOW_WORKSHEET_CONDITIONS table has 400,000 rows and the above query is performing a full table scan on it. As the query is run each time an IR report is viewed, this could account for the problems. The DBAs are of the opinion that the indexing and query are optimal and cannot be improved, so the obvious solution is to archive and purge the table.
Of the 400k rows, 80% are session values linked to sessions that no longer exists. It would appear that each time a user adds a filter or highlight to an interactive report it is recorded as a session value in the WWV_FLOW_WORKSHEET_CONDITIONS table. When the user logs out and closes the session, the values remain in the table and aren't cleared!!!? We currently average about 90 users a day with 60,000+ page requests so 400,000 rows is way more than I would expect to see.
Am I missing something? How do redundant session values get purged from the ir flows tables? Is there a (supported) way for me to clear them?
This is a critical issue for me now and I have raised an SR on metalink, but if the forum could offer some advice or assistance it would be very much appreciated.
Cheers
Simon
Bumped by: Shunt on May 12, 2009 11:00 AMHi Varad
Thanks for your help. I have had a good play with the purge function and now I'm more confused than ever. First let me explain my test scenario: I have an application with an interactive report in which I am logged in and able to make session changes (without saving the reports). I am observing the session activity on the Interactive Report using the apex_application_page_ir_rpt view which is set to filter on the application and page number for the Interactive Report I am testing.
Test 1
User logs into application, adds a filter to the report.
Result: A new row appears in the apex_application_page_ir_rpt view
Administrator Purges all sessions > 10secs old
Result: The new row is removed from apex_application_page_ir_rpt view
Test 2
User logs into application, adds a filter to the report.
Result: A new row appears in the apex_application_page_ir_rpt view
User logs out of application
Result: The new row remains in the apex_application_page_ir_rpt view
Administrator Purges all sessions > 10 secs old
Result: The new row still remains in the apex_application_page_ir_rpt view view
I hope that makes sense. Why would the session values not be cleared if the user logs out first? Why are they not then cleared if all the sessions are purged?
I am hoping that someone else can repeat the test and see if they find the same result.
Cheers
Simon -
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 -
Performance issue with Hyperion Interactive Reporting Report
Hi,
We created a report in Hyperion Interactive reporting using Hyperion Essbase as database connection file .
Report performance was good in Interactive reporting Studio we don't have any problem in studio.
when we open the report in Hyperion Workspace report performance is very very slow. We are using system 11.1.1.3
Any suggestions to resolve performance issue will be really helpful.
Thanks in advance
Regards
VamsiThank you so much, It is working fine when the report is in table structure (List Report. I mean insert a table and drag and drop the fact items and dimention items in to the table)
The requirement is looks like that, it is not a pivot table. Now I want apply the different color or shadow for Item1 and Item 2 in all groups... Please help me.
Total Fact Fact 1 fact 2 Fact 3 ......
Group 1
Item 1 Item 1 000 000 000 000 ...
Item 2 Item2 000 000 000 000 ....
Group 2
Item 1 Item 1 000 000 000 000 ...
Item 2 Item2 000 000 000 000 ....
Group 3
Item 1 Item 1 000 000 000 000
Item 2 Item2 000 000 000 000
Thanks and Regards,
Murugan -
Interactive Report - Go button perform a page submit?
Hi,
Is it possible to obtain a normal page submit when the Go button in Interactive Report is submitted?
I would like a normal page submit as this is the reliable way to have my different check boxes and select lists saved. These checkboxes and select lists act as bind variables in the IR query, and I do not get reliable results without the page submit. You may for instance experience that the report output looks ok according to your selections, but when you then download to excel, the report content reflects the true session state values.....
Alternatively is it possible to remove/hide the Go button? I could then add a normal button to perform the page submit. I just do not like to confuse my users with two buttons..... for the same purpose....
Best regards,
JesperHi,
With jQuery you can easily change that button attributes.
E.g. set button to submit page, add below to page HTML header
<script type="text/javascript">
$(function(){
$('.apex_finderbar_left .formlayout td input[value="Go"]').removeAttr("onclick");
$('.apex_finderbar_left .formlayout td input[value="Go"]').bind('click',function(){
doSubmit('MYREQUEST');
</script>If you like hide button, add to page HTML header
<script type="text/javascript">
$(function(){
$('.apex_finderbar_left .formlayout td input[value="Go"]').hide();
</script>Remember load jQuery javascript library also.
Here is one guide how install jQuery
http://www.danielmcghan.us/2008/06/jquery-in-application-express.html
Br,Jari -
Performance tuning of a query in Hyperion Interactive Reporting Studio.
Hi All,
Cud some one please tell me... what are the possible ways that one can enhance the performance of the query in Hyperion interactive Reporting studio.. ??
Thanks & Regards,
RajTopic Order Priority...Data Model Options
Use Hints/Directives
Ask DBA to review the SQL Generated by IR --- TopMenu - View - Query Log -
Increase the Performance of Search In Interactive Report
Hi,
I created a report which has about 10000+ records. To load the report it is not taking much time. But when i make a search in interactive report it is taking lot of time. Please suggest me how to increase the performance of interactive search.
I am using Oracle apex 3.2 and Oracle 10g XE database.
Please suggest me.
Thanks
SudhirHi,
1) I am using Row Ranges Pagination from X to Y
2) To Execute it takes about 1.15 seconds
3) This is the function am using to make a call
FUNCTION FUNC_ORACLE_CONTRACT(P_SERIAL_NUMBER IN VARCHAR2,P_FLAG IN VARCHAR2)
RETURN VARCHAR2
AS
L_LOCATION_ID NUMBER;
L_SYSTEM_ID VARCHAR2(200);
L_ENTITLEMENT_ID VARCHAR2(200);
L_CREATED_DATE DATE;
L_COMPANY_NAME VARCHAR2(500);
L_LEGAL_NAME VARCHAR2(500);
SELECT DISTINCT LOCATION_ID, SYSTEM_ID, ENTITLEMENT_ID, CREATED_DATE
FROM CUSTOMER_LICENSES
WHERE PRODUCT_SERIAL_NUMBER = P_SERIAL_NUMBER OR
ENTITLEMENT_ID = P_SERIAL_NUMBER OR
ACTIVATION_ID = P_SERIAL_NUMBER ;
BEGIN
OPEN C1;
FETCH C1 INTO L_LOCATION_ID, L_SYSTEM_ID, L_ENTITLEMENT_ID, L_CREATED_DATE;
IF P_FLAG = 'COMPANY_ID' THEN
SELECT COMPANY_NAME || ' (C)' INTO L_COMPANY_NAME
FROM CUSTOMER_LOCATIONS
WHERE LOCATION_ID = L_LOCATION_ID;
IF L_COMPANY_NAME IS NULL THEN
SELECT LEGAL_NAME || ' (P)' INTO L_LEGAL_NAME
FROM PARTNER_LOCATIONS
WHERE ID = L_LOCATION_ID;
RETURN L_LEGAL_NAME ;
ELSE
RETURN L_COMPANY_NAME ;
END IF;
ELSIF P_FLAG = 'SYSTEM_ID' THEN
RETURN L_SYSTEM_ID;
ELSIF P_FLAG = 'ENTITLEMENT_ID' THEN
RETURN L_ENTITLEMENT_ID;
ELSIF P_FLAG = 'LOCATION_ID' THEN
RETURN L_LOCATION_ID;
END IF;
CLOSE C1;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
WHEN OTHERS THEN
RETURN NULL;
END FNC_ORACLE_CONTRACTS;Edited by: Sudhir_Meru on Apr 9, 2013 4:11 PM -
Open document from interactive report
Application Express version 4.0.2.00.07.
In apex I am trying to accomplish the following:
1. create a link to a pdf or Word document stored on local network using the file browse button.
2. store the link to that file in my table but not store the actual document in the oracle table.
3. open the document from link in interactive report.
My dba does not want to store anymore documents into oracle because of performance issues we are experiencing with current applications that do this. Does anyone know the where to find sample code that will accomplish this task or will load the linked document into the oracle table but delete the document from the blob when the document is closed.You're probably looking to use the BFILE functionality - a pointer to a LOB on the filesystem.
Try looking at some of the following sources for guidance
http://docs.oracle.com/cd/B10501_01/appdev.920/a96591/adl12bfl.htm
APEX BFILE
http://monkeyonoracle.blogspot.com.au/2009/10/storing-images-outside-oracle-xe-with.html
Scott -
Problems with Page Break in an Interactive Reporting report
Hello everybody,
Platform: Hyperion System 9.3.1.
I have serious problems in managing the 'page break' in an Interactive Reporting report.
The report shows sales data by store, with article and colour details and it is organized like this:
group 1: geographic area
group 2: country
group 3: city
group 4: store
columns: article, colour
facts: quantity, price, value
My client's request is to perform a page break at the store group level, meaning that apart from the first store occurance, any change in the store value shoul start a new page.
The requested result is like this:
page1: geographic area1
country1
city1
store1
data store1...
page 2: store2
data store2...
page3: store3
data store3...
I tried several combinations of using Break After and Break Before on the store group, with Keep Next / Keep Together and it was impossible to obtain the desired result.
If I use Break Before the result is as follows:
page 1: geographic area1
country1
city1
page 2: store1
data store1...
page 3: store2
data store2...
If I use Break After the result is as follows:
page 1: geographic area1
country1
city1
store 1
page 2: data store1...
store 2
page 3: data store2...
even if I specify 'Keep with next' or 'Keep together' for store group and the store data table.
Any help will be very very appreciated because I've been trying for weeks to figure out this issue.
DanielaFirst start without using any of the Keep with Next and Keep together.
Second. try putting the Page Break in the Group Footer. You do not need to keep it visible
Then you may want to repeat headers on Store in case the Store's Detail rolls onto next page
Hope this helps
Wayne -
How to create a classical report for this requirements,
1) purchase documents and vendor.
2) vendor performance report that lists vendor name, materials
Supplied and actual delivery times, payments terms and prices
Purchase.
3) Requisitions with details like MRP controller, release date, unit
to Measure along with the standard details
4) list of customer number, Credit limit To the given Customer.
Thanks and Regards,
Sivaguru.Joel,
I have checked the report attributes and the "Save Report" checkbox is checked.
I as a developer, can save a default report selection and this is understood.
The problem is, when signing in as a user, no save icon is visible.
I thought maybe it was something with the install, so I created the Demo application and if I create an interactive report there, it works fine for the end user.
They do act differently in development modes between the two applications.
In Demo, if I save as a developer, "Save Report" choice, I get a window where I can name the report or select from drop down, "As default Report Settings".
In my application, if I save as a developer, "Save Report*" choice, I get a window that just states:
"The current report settings will be used as the default for all users" and my choice is Cancel or Apply.
The choice in developer mode is also different, one has an asterisk and the other doesn't.
I think it might have something to do with authentication?
The Demo application prompts for user name and password and my application doesn't have authentication because user is authenticated done before getting into the application.
Without authentication, it probably won't save reports for each user.
I do have access to each users id, would need to know where I can use it to tell the application this and that they are authenticated already.
Thanks for your help,
Rick -
I Need Interactive Report for displaying vendor information. Based on the s
Interactive Report for displaying vendor information. Based on the selection made by the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along with the secondary list.
hi
Hi
Use the Table LFA1 and LFB1 in the basic list
and LFBK table details in the secondary list
see the sample code related to customer Sales orders
modify it with the Vendor tables
REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
HEADING.
*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 < 1 OR CUST_NO-HIGH > 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.
<b>Vendor performance report</b>
See this sample code
*"Table declarations...................................................
TABLES:
EKKO, " Purchasing Document Header
CDHDR, " Change document header
SSCRFIELDS. " Fields on selection screens
*"Selection screen elements............................................
SELECT-OPTIONS:
S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
S_EKGRP FOR EKKO-EKGRP, " Purchasing group
S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
S_UDATE FOR CDHDR-UDATE. " Creation date of the change
" document
*" Data declarations...................................................
Field String to hold Purchase Document Number *
DATA:
BEGIN OF FS_EBELN,
EBELN(90) TYPE C, " Purchase Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
" the Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EBELN,
Field String to hold Purchase Document Header *
BEGIN OF FS_EKKO,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EKKO,
Field String to hold Account Number and name of the Vendor *
BEGIN OF FS_LFA1,
LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
NAME1 TYPE LFA1-NAME1, " Name1
END OF FS_LFA1,
Field String to hold Change date and the name of the user *
BEGIN OF FS_CDHDR,
OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
OBJECTID TYPE CDHDR-OBJECTID, " Object value
CHANGENR TYPE CDHDR-CHANGENR, " Document change number
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
END OF FS_CDHDR,
Field String to hold Change document items *
BEGIN OF FS_CDPOS,
OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
OBJECTID(10) TYPE C, " Object Value
CHANGENR TYPE CDPOS-CHANGENR, " Document change number
TABNAME TYPE CDPOS-TABNAME, " Table Name
FNAME TYPE CDPOS-FNAME, " Field Name
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_CDPOS,
Field String to hold Date Element Name *
BEGIN OF FS_DATAELE,
TABNAME TYPE DD03L-TABNAME, " Table Name
FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
END OF FS_DATAELE,
Field String to hold Short Text of the Date Element *
BEGIN OF FS_TEXT,
ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
END OF FS_TEXT,
Field String to hold data to be displayed on the ALV grid *
BEGIN OF FS_OUTTAB,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
WERKS TYPE LFA1-WERKS, " Plant
NAME1 TYPE LFA1-NAME1, " Name1
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_OUTTAB,
Internal table to hold Purchase Document Number *
T_EBELN LIKE STANDARD TABLE
OF FS_EBELN,
Internal table to hold Purchase Document Header *
T_EKKO LIKE STANDARD TABLE
OF FS_EKKO,
Temp Internal table to hold Purchase Document Header *
T_EKKO_TEMP LIKE STANDARD TABLE
OF FS_EKKO,
Internal table to hold Account number and Name of the Vendor *
T_LFA1 LIKE STANDARD TABLE
OF FS_LFA1,
Internal Table to hold Change date and the name of the user *
T_CDHDR LIKE STANDARD TABLE
OF FS_CDHDR,
Internal Table to hold Change document items *
T_CDPOS LIKE STANDARD TABLE
OF FS_CDPOS,
Temp. Internal Table to hold Change document items *
T_CDPOS_TEMP LIKE STANDARD TABLE
OF FS_CDPOS,
Internal Table to hold Data Element Name *
T_DATAELE LIKE STANDARD TABLE
OF FS_DATAELE,
Temp. Internal Table to hold Data Element Name *
T_DATAELE_TEMP LIKE STANDARD TABLE
OF FS_DATAELE,
Internal Table to hold Short Text of the Date Element *
T_TEXT LIKE STANDARD TABLE
OF FS_TEXT,
Internal Table to hold data to be displayed on the ALV grid *
T_OUTTAB LIKE STANDARD TABLE
OF FS_OUTTAB.
C L A S S D E F I N I T I O N *
CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
*" Data declarations...................................................
Work variables *
DATA:
W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
W_VALUE TYPE EKKO-EBELN, " Reflected Value
W_SPACE VALUE ' ', " Space
W_FLAG TYPE I, " Flag Variable
W_VARIANT TYPE DISVARIANT, " Variant
*--- ALV Grid
W_GRID TYPE REF TO CL_GUI_ALV_GRID,
*--- Event Handler
W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
*--- Field catalog table
T_FIELDCAT TYPE LVC_T_FCAT.
AT SELECTION-SCREEN EVENT *
AT SELECTION-SCREEN ON S_EBELN.
Subroutine to validate Purchase Document Number.
PERFORM VALIDATE_PD_NUM.
AT SELECTION-SCREEN ON S_LIFNR.
Subroutine to validate Vendor Number.
PERFORM VALIDATE_VEN_NUM.
AT SELECTION-SCREEN ON S_EKGRP.
Subroutine to validate Purchase Group.
PERFORM VALIDATE_PUR_GRP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
Subroutine to select all Purchase orders.
PERFORM SELECT_PO.
CHECK W_FLAG EQ 0.
Subroutine to select Object values.
PERFORM SELECT_OBJ_ID.
CHECK W_FLAG EQ 0.
Subroutine to select Changed values.
PERFORM SELECT_CHANGED_VALUE.
CHECK W_FLAG EQ 0.
Subroutine to Select Purchase Orders.
PERFORM SELECT_PUR_DOC.
Subroutine to select Vendor Details.
PERFORM SELECT_VENDOR.
Subroutine to select Text for the Changed values.
PERFORM DESCRIPTION.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
IF NOT T_EKKO IS INITIAL.
Subroutine to populate the Output Table.
PERFORM FILL_OUTTAB.
Subroutine to build Field Catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
CALL SCREEN 100.
ENDIF. " IF NOT T_EKKO...
CLASS LCL_EVENT_HANDLER DEFINITION
Defining Class which handles events
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
HANDLE_HOTSPOT_CLICK
FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID.
ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION
Implementing the Class which can handle events
CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
*---Handle Double Click
METHOD HANDLE_HOTSPOT_CLICK .
Subroutine to get the HotSpot Cell information.
PERFORM GET_CELL_INFO.
SET PARAMETER ID 'BES' FIELD W_VALUE.
CALL TRANSACTION 'ME23N'.
ENDMETHOD. " HANDLE_HOTSPOT_CLICK
ENDCLASS. " LCL_EVENT_HANDLER
*& Module STATUS_0100 OUTPUT
PBO Event
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'OOPS'.
SET TITLEBAR 'TIT'.
Subroutine to fill the Variant Structure
PERFORM FILL_VARIANT.
IF W_GRID IS INITIAL.
CREATE OBJECT W_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = CL_GUI_CONTAINER=>SCREEN0
I_APPL_EVENTS =
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT = W_VARIANT
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = T_OUTTAB
IT_FIELDCATALOG = T_FIELDCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0.
ENDIF. " IF W_GRID IS INITIAL
CREATE OBJECT W_EVENT_CLICK.
SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
PAI Event
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form PREPARE_FIELD_CATALOG
Subroutine to build the Field catalog
<--P_T_FIELDCAT Field Catalog Table
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT.
Purchasing group...
LS_FCAT-FIELDNAME = 'EKGRP'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Number...
LS_FCAT-FIELDNAME = 'EBELN'.
LS_FCAT-REF_TABLE = 'EKKO' .
LS_FCAT-EMPHASIZE = 'C411'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-HOTSPOT = 'X'.
APPEND LS_FCAT TO PT_FIELDCAT .
CLEAR LS_FCAT .
Name of Person who Created the Object...
LS_FCAT-FIELDNAME = 'ERNAM'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-OUTPUTLEN = '15' .
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Date...
LS_FCAT-FIELDNAME = 'BEDAT'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Vendor's account number...
LS_FCAT-FIELDNAME = 'LIFNR'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Account Number of Vendor or Creditor...
LS_FCAT-FIELDNAME = 'NAME1'.
LS_FCAT-REF_TABLE = 'LFA1'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Vendor Name'(001).
LS_FCAT-SELTEXT = 'Vendor Name'(001).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Creation date of the change document...
LS_FCAT-FIELDNAME = 'UDATE'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Change Date'(002).
LS_FCAT-SELTEXT = 'Change Date'(002).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
User name of the person responsible in change document...
LS_FCAT-FIELDNAME = 'USERNAME'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Modified by'(003).
LS_FCAT-SELTEXT = 'Modified by'(003).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Short Text Describing R/3 Repository Objects...
LS_FCAT-FIELDNAME = 'DDTEXT'.
LS_FCAT-REF_TABLE = 'DD04T'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '15'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Old contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_OLD'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
New contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_NEW'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
ENDFORM. " PREPARE_FIELD_CATALOG
*& Form SELECT_PO
Subroutine to select all the Purchase Orders
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PO .
SELECT EBELN " Purchasing Document Number
ERNAM " Name of Person who Created
" the Object
LIFNR " Vendor's account number
EKGRP " Purchasing group
BEDAT " Purchasing Document Date
FROM EKKO
PACKAGE SIZE 10000
APPENDING TABLE T_EBELN
WHERE EBELN IN S_EBELN
AND BEDAT IN S_BEDAT.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S401(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " SELECT_PO
*& Form SELECT_OBJ_ID
Subroutine to select Object ID
There are no interface parameters to be passed to this subroutine.
FORM SELECT_OBJ_ID .
IF NOT T_EBELN IS INITIAL.
SELECT OBJECTCLAS " Object Class
OBJECTID " Object value
CHANGENR " Document change number
USERNAME " User name
UDATE " Creation date
FROM CDHDR
INTO TABLE T_CDHDR
FOR ALL ENTRIES IN T_EBELN
WHERE OBJECTID EQ T_EBELN-EBELN
AND UDATE IN S_UDATE
AND TCODE IN ('ME21N','ME22N','ME23N').
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Header Not Found'(031).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EBELN IS INITIAL
ENDFORM. " SELECT_OBJ_ID
*& Form SELECT_CHANGED_VALUE
Subroutine to select Changed Values
There are no interface parameters to be passed to this subroutine.
FORM SELECT_CHANGED_VALUE .
IF NOT T_CDHDR IS INITIAL.
SELECT OBJECTCLAS " Object class
OBJECTID " Object value
CHANGENR " Document change number
TABNAME " Table Name
FNAME " Field Name
VALUE_NEW " New contents of changed field
VALUE_OLD " Old contents of changed field
FROM CDPOS
PACKAGE SIZE 10000
APPENDING TABLE T_CDPOS
FOR ALL ENTRIES IN T_CDHDR
WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
AND OBJECTID EQ T_CDHDR-OBJECTID
AND CHANGENR EQ T_CDHDR-CHANGENR.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Item Not Found'(032).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_CDHDR IS INITIAL
T_CDPOS_TEMP[] = T_CDPOS[].
ENDFORM. " SELECT_CHANGED_VALUE
*& Form SELECT_PUR_DOC
Subroutine to select Purchase Order Details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PUR_DOC .
IF NOT T_CDPOS IS INITIAL.
SORT T_EBELN BY EBELN.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
FS_CDPOS-OBJECTID BINARY SEARCH.
IF SY-SUBRC NE 0.
DELETE TABLE T_EBELN FROM FS_EBELN.
ENDIF. " IF SY-SUBRC NE 0.
ENDLOOP. " LOOP AT T_CDPOS...
LOOP AT T_EBELN INTO FS_EBELN.
MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
APPEND FS_EKKO TO T_EKKO.
ENDLOOP. " LOOP AT T_EBELN...
T_EKKO_TEMP[] = T_EKKO[].
ENDIF. " IF NOT T_CDPOS IS INITIAL
ENDFORM. " SELECT_PUR_DOC
*& Form SELECT_VENDOR
Subroutine to select Vendor details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_VENDOR .
IF NOT T_EKKO IS INITIAL.
SORT T_EKKO_TEMP BY LIFNR.
DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
SELECT LIFNR " Account Number of Vendor or
" Creditor
NAME1 " Name 1
FROM LFA1
INTO TABLE T_LFA1
FOR ALL ENTRIES IN T_EKKO_TEMP
WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
IF SY-SUBRC NE 0.
MESSAGE S002(M8) WITH 'Master Details'(033).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EKKO IS INITIAL
ENDFORM. " SELECT_VENDOR
*& Form DESCRIPTION
Subroutine to get the description
There are no interface parameters to be passed to this subroutine.
FORM DESCRIPTION .
IF NOT T_CDPOS IS INITIAL.
SORT T_CDPOS_TEMP BY TABNAME FNAME.
DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
SELECT TABNAME " Table Name
FIELDNAME " Field Name
ROLLNAME " Data element
FROM DD03L
INTO TABLE T_DATAELE
FOR ALL ENTRIES IN T_CDPOS_TEMP
WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
IF NOT T_DATAELE IS INITIAL.
T_DATAELE_TEMP[] = T_DATAELE[].
SORT T_DATAELE_TEMP BY ROLLNAME.
DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
SELECT ROLLNAME " Data element
DDTEXT " Short Text Describing R/3
" Repository Objects
FROM DD04T
INTO TABLE T_TEXT
FOR ALL ENTRIES IN T_DATAELE_TEMP
WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
AND DDLANGUAGE EQ SY-LANGU.
IF SY-SUBRC NE 0.
EXIT.
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_DATAELE IS INITIAL.
ENDIF. " IF NOT T_CDPOS IS INITIAL.
ENDFORM. " DESCRIPTION
*& Form FILL_OUTTAB
Subroutine to populate the Outtab
There are no interface parameters to be passed to this subroutine.
FORM FILL_OUTTAB .
SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
SORT T_EKKO BY EBELN.
SORT T_LFA1 BY LIFNR.
SORT T_DATAELE BY TABNAME FIELDNAME.
SORT T_TEXT BY ROLLNAME.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
OBJECTCLAS = FS_CDPOS-OBJECTCLAS
OBJECTID = FS_CDPOS-OBJECTID
CHANGENR = FS_CDPOS-CHANGENR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
READ TABLE T_EKKO INTO FS_EKKO WITH KEY
EBELN = FS_CDHDR-OBJECTID
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
LIFNR = FS_EKKO-LIFNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
TABNAME = FS_CDPOS-TABNAME
FIELDNAME = FS_CDPOS-FNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
READ TABLE T_TEXT INTO FS_TEXT WITH KEY
ROLLNAME = FS_DATAELE-ROLLNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
APPEND FS_OUTTAB TO T_OUTTAB.
CLEAR FS_OUTTAB.
ENDLOOP.
ENDFORM. " FILL_OUTTAB
*& Form GET_CELL_INFO
Subroutine to get the Cell Information
--> W_VALUE Holds the value of Hotspot clicked
FORM GET_CELL_INFO .
CALL METHOD W_GRID->GET_CURRENT_CELL
IMPORTING
E_ROW =
E_VALUE = W_VALUE
E_COL =
ES_ROW_ID =
ES_COL_ID =
ES_ROW_NO =
ENDFORM. " GET_CELL_INFO
*& Form VALIDATE_PD_NUM
Subroutine to validate Purchase Document Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PD_NUM .
IF NOT S_EBELN[] IS INITIAL.
SELECT EBELN " Purchase Document Number
FROM EKKO
INTO W_EBELN
UP TO 1 ROWS
WHERE EBELN IN S_EBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E717(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EBELN[]...
ENDFORM. " VALIDATE_PD_NUM
*& Form VALIDATE_VEN_NUM
Subroutine to validate Vendor Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_VEN_NUM .
IF NOT S_LIFNR[] IS INITIAL.
SELECT LIFNR " Vendor Number
FROM LFA1
INTO W_LIFNR
UP TO 1 ROWS
WHERE LIFNR IN S_LIFNR.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E002(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_LIFNR[]...
ENDFORM. " VALIDATE_VEN_NUM
*& Form VALIDATE_PUR_GRP
Subroutine to validate the Purchase Group
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PUR_GRP .
IF NOT S_EKGRP[] IS INITIAL.
SELECT EKGRP " Purchase Group
FROM T024
INTO W_EKGRP
UP TO 1 ROWS
WHERE EKGRP IN S_EKGRP.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E622(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EKFRP[]...
ENDFORM. " VALIDATE_PUR_GRP
*& Form FILL_VARIANT
Subroutine to fill the Variant Structure
There are no interface parameters to be passed to this subroutine
FORM FILL_VARIANT .
Filling the Variant structure
W_VARIANT-REPORT = SY-REPID.
W_VARIANT-USERNAME = SY-UNAME.
ENDFORM. " FILL_VARIANT
<b>Reward if usefull</b> -
Interactive report: third screen not displaying
Hi Experts,
I am doing a interactive report in ALV grid...and my requirement is
when the user clicks on SPMON which is displayed on the initial screen the first screen
should display and in first screen when the user clicks LIFNR second screen should display..
I am able to display initial and first screen but second screen is not displaying...I am
pasting a pinch of my code please have a look and advice me..
FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.
DATA : OK_CODE TYPE SY-UCOMM.
OK_CODE = P_UCOMM.
CASE OK_CODE.
WHEN '&IC1'.
IF R_SELFIELD-FIELDNAME = 'SPMON'.
READ TABLE IT_TAB INDEX R_SELFIELD-TABINDEX.
REFRESH IT_TAB_1[].
CLEAR IT_TAB_1.
LOOP AT IT_FIRST WHERE WERK EQ IT_TAB-WERK AND SPMON EQ IT_TAB-SPMON
AND ART = IT_TAB-ART.
MOVE IT_FIRST-WERK TO IT_TAB_1-WERK.
MOVE IT_FIRST-LIFNR TO IT_TAB_1-LIFNR.
MOVE IT_FIRST-MEANQ TO IT_TAB_1-MEANQ.
MOVE IT_FIRST-BASME_QM TO IT_TAB_1-BASME_QM.
APPEND IT_TAB_1.
CLEAR: IT_FIRST, IT_TAB_1.
ENDLOOP.
REFRESH IT_FIELDCAT1[].
S_LAYOUT-ZEBRA = 'X' .
S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1
USING:
'IT_TAB_1' 'WERK' ' ' 'PLANT' ' ' ' ',
'IT_TAB_1' 'LIFNR' ' ' 'VENDOR NUMBER' ' ' ' ',
'IT_TAB_1' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
'IT_TAB_1' 'BASME_QM' ' ' 'BuM' ' ' ' ',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_USER_COMMAND = 'USER_COMM_1'
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = IT_FIELDCAT1[]
TABLES
T_OUTTAB = IT_TAB_1[]
ENDIF.
ENDCASE.
ENDFORM. "USER_COMM
For second screen : which is not working
FORM USER_COMM_1 USING P_UCOMM LIKE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.
DATA : OK_CODE TYPE SY-UCOMM.
OK_CODE = P_UCOMM.
CASE OK_CODE.
WHEN '&IC2'.
IF R_SELFIELD-FIELDNAME = 'LIFNR'.
READ TABLE IT_TAB_1 INDEX R_SELFIELD-TABINDEX.
REFRESH IT_TAB_2[].
CLEAR IT_TAB_2.
LOOP AT IT_SECOND WHERE WERK EQ IT_TAB_1-WERK AND
SPMON EQ IT_TAB_1-SPMON AND ART = IT_TAB_1-ART AND LIFNR = IT_TAB_1-LIFNR.
MOVE IT_SECOND-ART TO IT_TAB_2-ART.
MOVE IT_SECOND-SPMON TO IT_TAB_2-SPMON.
MOVE IT_SECOND-MATNR TO IT_TAB_2-MATNR.
APPEND IT_TAB_2.
CLEAR: IT_SECOND, IT_TAB_2.
ENDLOOP.
REFRESH IT_FIELDCAT2[].
S_LAYOUT-ZEBRA = 'X' .
S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT2
USING:
'IT_TAB_2' 'MATNR' ' ' 'MATERIAL NUMBER' ' ' ' ',
'IT_TAB_2' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
'IT_TAB_2' 'BASME_QM' ' ' 'BuM' ' ' ' ',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = IT_FIELDCAT2[]
TABLES
T_OUTTAB = IT_TAB_2[]
ENDIF.
ENDCASE.
ENDFORM. "USER_COMM_1
Please advice
Karthik
Edited by: Karthik R on Apr 29, 2009 12:22 PMUse both conditions in USER_COMM.
FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.
DATA : OK_CODE TYPE SY-UCOMM.
OK_CODE = P_UCOMM.
CASE OK_CODE.
WHEN '&IC1'.
IF R_SELFIELD-FIELDNAME = 'SPMON'. " Field name SPMON
READ TABLE IT_TAB INDEX R_SELFIELD-TABINDEX.
REFRESH IT_TAB_1[].
CLEAR IT_TAB_1.
LOOP AT IT_FIRST WHERE WERK EQ IT_TAB-WERK AND SPMON EQ IT_TAB-SPMON
AND ART = IT_TAB-ART.
MOVE IT_FIRST-WERK TO IT_TAB_1-WERK.
MOVE IT_FIRST-LIFNR TO IT_TAB_1-LIFNR.
MOVE IT_FIRST-MEANQ TO IT_TAB_1-MEANQ.
MOVE IT_FIRST-BASME_QM TO IT_TAB_1-BASME_QM.
APPEND IT_TAB_1.
CLEAR: IT_FIRST, IT_TAB_1.
ENDLOOP.
REFRESH IT_FIELDCAT1[].
S_LAYOUT-ZEBRA = 'X' .
S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1
USING:
'IT_TAB_1' 'WERK' ' ' 'PLANT' ' ' ' ',
'IT_TAB_1' 'LIFNR' ' ' 'VENDOR NUMBER' ' ' ' ',
'IT_TAB_1' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
'IT_TAB_1' 'BASME_QM' ' ' 'BuM' ' ' ' ',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_USER_COMMAND = 'USER_COMM_1'
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = IT_FIELDCAT1[]
TABLES
T_OUTTAB = IT_TAB_1[]
ELSEIF R_SELFIELD-FIELDNAME = 'LIFNR'. " ELSE FIELDNAME LIFNR
READ TABLE IT_TAB_1 INDEX R_SELFIELD-TABINDEX.
REFRESH IT_TAB_2[].
CLEAR IT_TAB_2.
LOOP AT IT_SECOND WHERE WERK EQ IT_TAB_1-WERK AND
SPMON EQ IT_TAB_1-SPMON AND ART = IT_TAB_1-ART AND LIFNR = IT_TAB_1-LIFNR.
MOVE IT_SECOND-ART TO IT_TAB_2-ART.
MOVE IT_SECOND-SPMON TO IT_TAB_2-SPMON.
MOVE IT_SECOND-MATNR TO IT_TAB_2-MATNR.
APPEND IT_TAB_2.
CLEAR: IT_SECOND, IT_TAB_2.
ENDLOOP.
REFRESH IT_FIELDCAT2[].
S_LAYOUT-ZEBRA = 'X' .
S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .
PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT2
USING:
'IT_TAB_2' 'MATNR' ' ' 'MATERIAL NUMBER' ' ' ' ',
'IT_TAB_2' 'MEANQ' ' ' 'MEANQSCORE' ' ' ' ',
'IT_TAB_2' 'BASME_QM' ' ' 'BuM' ' ' ' ',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = IT_FIELDCAT2[]
TABLES
T_OUTTAB = IT_TAB_2[]
ENDIF.
ENDCASE.
ENDFORM. "USER_COMM
Regards,
Gurpreet
Maybe you are looking for
-
SD report for the open sales orders with items
Hi, Is there any standard SAP report which display open sales order togeather with the open items. I want to have columns target quantity, delivered quantity and open quantity. Any tip? BR Saso
-
How can I get a button to open a specific folder instead of opening a file?
I am using CS3 and ultimately outputting an interactive PDF file that I will be the "landing page" to launch files and folder structures. I have no problem launching the files but I am not a successful getting it to open a folder. I have tried seve
-
JDBC - looking for 3rd party vendor of toolkit
NI sells an SQL toolkit for interacting with ODBC-compliant database software on Windows systems, but does not make make an analogous product for Unix systems, where database software (generally) uses the JDBC protocol. We are looking for the latter.
-
Smartform for Statement of Account F.27
Hi all, I was searching for the way to print the statement of account using smartforms instead of the standard script. I found that the report program RFKORD10 is used for report printing with event SAP08. Now, is there a way where i can modify the
-
Displaying internal image on a push button
Hi, I am running oracle forms 11.1.2.0.0. I create a push button and under object property make it an iconic yes and under iconic file name I have "java/oracle/forms/icons/save.gif" During run-time it displays a image but it is not of save, it is an