Display results as String: dosen't work based on the example
Hello,
To understand how to display results as string, I tried to reproduce this:
[http://apex.oracle.com/pls/otn/f?p=31517:84|http://apex.oracle.com/pls/otn/f?p=31517:84]
I have my table emp
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7839 KING PRESIDENT - 81-11-17 5000 - 10
7698 BLAKE MANAGER 7839 81-05-01 2850 - 30
7782 CLARK MANAGER 7839 81-06-09 2450 - 10
7566 JONES MANAGER 7839 81-04-02 2975 - 20
7788 SCOTT ANALYST 7566 82-12-09 3000 - 20
7902 FORD ANALYST 7566 81-12-03 3000 - 20
7369 SMITH CLERK 7902 80-12-17 800 - 20
7499 ALLEN SALESMAN 7698 81-02-20 1600 300 30
7521 WARD SALESMAN 7698 81-02-22 1250 500 30
7654 MARTIN SALESMAN 7698 81-09-28 1250 1400 30
7844 TURNER SALESMAN 7698 81-09-08 1500 0 30
7876 ADAMS CLERK 7788 83-01-12 1100 - 20
7900 JAMES CLERK 7698 81-12-03 950 - 30
7934 MILLER CLERK 7782 82-01-23 1300 - 10 I created with the wizard, on my page, a new REPORT REGION
- selected SQL RESULT -
- Name: Test
- Region Source Type: SQL Query
- Region Template: Report Region
IN Enter SQL Query or PL/SQL function returning a SQL Query, I COPY-PASTE the following code from [http://apex.oracle.com/pls/otn/f?p=31517:84|http://apex.oracle.com/pls/otn/f?p=31517:84]
DECLARE
p_vc_arr2 htmldb_application_global.vc_arr2;
p_string VARCHAR2 (2000);
BEGIN
SELECT ename
BULK COLLECT INTO p_vc_arr2
FROM emp
WHERE deptno = :p84_select_deptno;
p_string :=
HTMLDB_UTIL.table_to_string (p_vc_arr2, ':');
HTP.p (p_string);
END;AND I have this error:
+1 error has occurred+
Invalid query, no select statement found
Is not a PL/SQP functiion??
What do I do wrong?
thanks,
Roseline Paquin
Montreal, Canada
1 error has occurred
Invalid query, no select statement foundWhat if you try
DECLARE
p_vc_arr2 htmldb_application_global.vc_arr2;
p_string VARCHAR2 (2000);
BEGIN
SELECT ename
BULK COLLECT INTO p_vc_arr2
FROM emp
WHERE deptno = :p84_select_deptno;
return 'select ''' || HTMLDB_UTIL.table_to_string (p_vc_arr2, ':') || ''' str from dual';
END;??
Similar Messages
-
IBook G4 "K" Keyboard Key dosen't work without using the "Shift" keyboard key.
Some reason, now my iBook G4's "K" keyboard key won't work inless if i use the "Shift" keyboard key.
Help!When you press it, what speaks and what does it say?
Mine does not do that. Not on my portables nor desktop
Macs. So I wonder what else may be happening.
When did your iBook start doing this? Are there any
other applications open that may have a keyboard
shortcut? The System Preferences> keyboard> may
show a few things that can be set, options. Also see
if there isn't something set in Universal Access. A few
of the preference settings in universal access can be
engaged by just a few keys, and can be shut off there.
{Check into Voice Over Utility, as there is a pile of stuff
in there, which could allow sounds when keyboarding
and capitals can activate. Only if it's been set.}
And the Speech system preference panel can allow
a key to be set for several functions. Mine do not
have any assigned, and by default none should be.
Good luck & happy computing!
edited 2x -
Result table data to be populated based on selection in the result list
Hi,
We have a parent data source "P" containing all the record types. Further we have two child data sources each having filters on exclusive record types(for ex. child1 containing record types X, Y, Z and child2 containing record types A, B).
In our page we have a result list associated with data source child1(record types X, Y, Z) and result table associated with data source child2(record types A, B). There exists common attributes among the attributes present in result list and in the result table.
Rest of the containers in the page namely search, breadcrumbs, guided navigation point to the parent data source("P") containing all the record types.
Whenever we select a value from the guided navigation using the common attributes both the result list and result table are getting filtered.
What we require is that, whenever an attribute(common attribute) is clicked in the result list, the data in the result table needs to get filtered based on the value of the attribute that is clicked.
Is this possible? If so, pl. suggest how.Take a look at the Studio release notes for EID 2.4 http://docs.oracle.com/cd/E35976_01/studio.240/RELNOTES.txt a lot of little bugs like the one you describe have been resolved. If you haven't already done so you should upgrade to 2.4.
-
WebCam Dosen´t Work
Hi I justo buy a computer last week and I have a problem with the web camera. The web camera is already install in the computer, i used one time and it work very well in messenger; but when I try to used for the second time the cam dosen´t work. In the image of messenger only appear a picture of like mountains or something like that and it dosent show myself to the other person. Please answer me if you know what can I do, I will be very grateful. Thank you
Hi Steph,
Can you go to the Quick Setup and verify which camera is selected? You can get there by clicking on the wrench and screwdriver (settings) icon. If the camera is selected then this is a known issue, and there is no workaround at this time. The expected fix for this will be in version 4.8, which has no ETA for release at this time.
Regards,
Jason -
i still hearing song this afternoon
and after a few hours that i turned off my ipod
i couldn't turn it on again.
i think its juz no battery so i plugin the connect wire
for charging.But that dosen't work too.
The apple logo appear. But juz a moment.The Logo disappear.
i tried one more time and it saids "pls wait ...low battery
like this.So i wait.After i waited for a while, it's same happen as be4 and after the logo disappear, there are some sounds come inside my ipod like " doo "and "zeee"
how can i fix it or i must go to the ipod shop?try to put your iPod into disk mode
http://docs.info.apple.com/article.html?artnum=93651 -
When I open Numbers it displays every spreadsheet I have evr worked on! The screen fills with 100 windows showing different spreadsheets. How do I turn this feature off?
As Jerry said, if you close all documents before quitting Numbers or Pages, you won't have them reopening when you launch the app again. If you don't want to have to close everything first try Lion Tweaks or the latest version of TinkerTool. Both have the option to turn off the resume feature for individual applications.
-
Windows 10 Caps Lock and Num Lock dosen`t work
Hi guys,
I have a problem to report, on asus k52de dosen`t work Light from the Caps and num lock .
This problem appered yesterday when windows make the last update.
If anybody is in the same problem like me please answer the solution.
THXI've developed registry settings that both enable the "Filter Keys" feature in the Ease of Access center and use other values for which there are not UI fields to set repeat values to slow things down, but use values a little different
than those provided by the UI.
With this registry file the start of auto-repeat is slowed to 440 milliseconds, and the keys repeat at a reasonable rate of something around 30 per second.
http://Noel.ProDigitalSoftware.com/ForumPosts/Win10/Win10FastKeyboardRepeatFix.reg
Here's what's inside the above:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"Last Valid Wait"=dword:00000000
"Last Valid Delay"=dword:000003e8
"Last Valid Repeat"=dword:000001f4
"Last BounceKey Setting"=dword:00000000
"Flags"="59"
"DelayBeforeAcceptance"="0"
"AutoRepeatRate"="20"
"AutoRepeatDelay"="440"
"BounceTime"="0"
The following registry file disables "Filter Keys" and returns Windows to the default settings. If you employ the above, after the next build drop I suggest running the following and see if Microsoft has fixed the problem (they've acknowledged
it and said it will be fixed in a future build).
http://Noel.ProDigitalSoftware.com/ForumPosts/Win10/Win10KeyboardRepeatReturnToDefault.reg
The above contains:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"Last Valid Wait"=dword:00000000
"Last Valid Delay"=dword:000003e8
"Last Valid Repeat"=dword:000001f4
"Last BounceKey Setting"=dword:00000000
"Flags"="58"
"DelayBeforeAcceptance"="0"
"AutoRepeatRate"="500"
"AutoRepeatDelay"="1000"
"BounceTime"="0"
If you're at all skeptical about running downloaded .reg files from other folks (as you should be), I encourage you to use the text yourself or download them and look inside with an editor before running them.
-Noel
Detailed how-to in my eBooks:
Configure The Windows 7 "To Work" Options
Configure The Windows 8 "To Work" Options -
Multiselect dependant list box based on the database
i have to develop the jsp page with set of 3 list box which should display a field of a table. Based on the event over the list box1 listbox2 should be updated based on the selected item. For example when u click india on the list box 1 it should display all the states of india in the listbox two. Since it is multiselect when u choose pakistan the list box2 should display the states of india and pakistan.
This is my prob i am struggling for this for a long while please help me to solve the problem.
Thanks in advance.
I want to complete it before today evening i am also new to the jsp please help me...............double post http://forum.java.sun.com/thread.jspa?threadID=659520&tstart=0
-
How to display results of a report based on current year
Hi,
Please advice me for the following requirement.
I have a report which is having sales results, which is having year column also. Report has to be displayed based on the current year. Now it is 2013. I should show current year results only i.e 2013.
In 2014, i should show only 2014 results. How to achieve this at a report level.
regards
CK.Hi CK,
You are having Data for 2014 also. If not means, you can use sql query select max(year) from period.
So it will show the final maximum end of the year(2013) from database.
You can use dashboard prompts too. in the prompt also you can have specific year or sql query
http://mkashu.blogspot.com
Regards,
VG -
Display Results Based On Comparison to Input Values
Hello,
I have a utility that is built as a package and allows a user to input either a sku or sku description and receive inventory data (in number format). The utility implicity includes wild card searches and, as a result, may return multiple rows of data to the user.
Currently there are only the two input fields as described above. I want to add another input field allowing the user to indicate the quantity they are needing of the given part.
I would like to change my code so that instead of displaying a number value for the available quantity of each given part, it instead does a comparison between the quantity the user inputs as needing and the quantity currently available - and then returns a text message indicating the number of days the product will be available.
My package accesses a view that contains all of the part information and the current available quantity. I want to take the user inputted required quantity and compare it to the available quantity obtained from the view and then display one of three different text messages depending on how the two values compare.
What is my best course of action to change from displaying a specific available quantity and instead doing my comparison and displaying a text message as indicated?
Thank you.Assuming that p_desired is the quantity required, then I would probably do a query something like:
SELECT CASE WHEN avail - p_desired <= 0 THEN 'Sorry, out of luck'
WHEN avail - p_desired > 0 and <=10 THEN 'You have a day or so'
ELSE 'You can wait a while' END msg
FROM view
WHERE <conditions>You would, of course, implement your own rules in the CASE statement.
John -
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> -
Display results of MySQL query from AMFPHP by ArrayCollection in AS3 (Flash CS4)
Hi, i am using Flash CS4 (AS3) + AMFPHP + MySQL to do own flash frontend for Wordpress CMS. Everything is going fine but i`ve got one problem. Problem with properly display of result of query in AS3 by using ArrayCollection.
When i check my service in "amfphp/browser/" in web browser i`ve got this (with all needed data):
(mx.collections::ArrayCollection)#0
filterFunction = (null)
length = 2
list = (mx.collections::ArrayList)#1
length = 2 source = (Array)#2
That is the reason that i suppose that service work fine. Problem is when i try to display result in AS3. In actionscript i have got this:
function getNewsListHandler(result:Object):void{
trace(result);
This function displays: [object Object].
I know that "result" is an ArrayCollection type but i don`t know how to get rows and columns from this. I know that my data is there but i have no idea how to get it.
Clarify: I don`t know how to get to Arrays and simple data variables which are in ArrayCollection.
Could anyone help me with that problem. I would be gratefull
P.S. I tried also change query type in service.PHP for mysql_fetch_query but in that case i`ve got only one row (not all data).Thanks for fast reply,
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"});
you would get the data like
var resultstr:String = arr_coll[1][1].col2;
trace(resultstr);
//results in data4
could you explain me how it was happen (arr_coll[1][1].col2)? It`s not clear to me. I thought in this case rather something like this :
var resultstr:String = arr_coll[1]['col2'];
It should give me "data4". I know it wasn`t but i don`t understand ArrayCollection in level which is needed to use your advice in my case. Could you clarify "arr_coll[1][1].col2" a bit?
What would it look like when you would have something like this:
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"},{col1:"data5",col2:"data6"},{col1:"data7",col2:"data8"});
and you would want know f.e. position in ArrayCollection of "data6". How would you code this? arr_coll[1][2].col2? -
Excel 2010 – VBA Userforms – Vlookup via Textbox, display result in another textbox
Hi,
Thank you in advance for your time.
I have a multi-page userform and I am having problems getting the result I am after.
I am trying to get the user to enter a four digit (numeric code) into a textbox and display the contents of that code in another textbox when the user clicks in another textbox.
I have 2 textboxes.
One textbox txt_SAC_No is for the user to enter a four digit numeric code, which should return the address in another textbox txt_Site_Address.
The lookup is located in a dynamic named range
as SiteAddress which encompasses 20 columns. The first column has the code and the second column holds the actual address which is what I am after.
Included in the named range, I have set up a code of 0000 (zeros) and instead of having the address in it, I have a message in there to tell the user to manually type the address (overwriting my text message). The code, 0000, means that there is no pre-defined
address and it's a once off entry.
I do not want the address to be updated in the source of the Vlookup as it is a ‘once only’ entry and unlikely to ever be used again.
I have searched on the web and attempted to adapt various codes, but I have been unable to get anything to work.
I have some sample code I have tried, but my attempt to adapt it to my needs has not been successful.
Worksheet where data is transferred is code named: ws_Incident_Details
(which is actually sheet named “Incident Details” – but I’d like to use the ‘coded’ sheet name in case someone changes the name in the tab of the sheet
Private Sub SAC_No_AfterUpdate()
'lookup value based on SacNo
With Me
.txt_Site_Address = Application.WorksheetFunction.VLookup(CLng(Me.txt_SAC_No), wsAlarmResponseList.Range("SiteAddress"), 2, 0)
End With
End Sub
I'd really appreciate any help :) I have tried other avenues for help, but it doesn't seem like anyone wants the challenge :(
Thanking you in advance .... it will indeed be appreciated :)
Kind regards,
ShyButterfly
Hope you have a terrific day, theShyButterflyHi Andreas :)
The above code works like a dream :) Thank you ...
I succeeded on this ocassion on being smart, and was successful in adapting your code to auto-complete textboxes based on the SAC # details.
They ALL work purrrrfectly .... thank you SO much .....
Here's the code that worked (this is based on the Name Range only capturing the 'Column Heading' ... so I created a Named Range for each of the Column Headings (highlighted in bold ... I hope :) )
Private Sub txt_SAC_No_Change()
Dim R As Range
Set R = Range("SAC").EntireColumn.Find(txt_SAC_No.Value, _
LookIn:=xlValues, LookAt:=xlWhole)
If R Is Nothing Then
txt_Site_Address = "(not found)"
ElseIf R.Value = "0000" Then
txt_Site_Address = "(manually type the address)"
Else
txt_Site_Address = Range("SiteAddress").Cells(R.Row).Value
End If
'Manned / UnManned Site:
Set R = Range("SAC").EntireColumn.Find(txt_SAC_No.Value, _
LookIn:=xlValues, LookAt:=xlWhole)
If R Is Nothing Then
txt_Manned_UnManned_Auto = "N/A"
ElseIf R.Value = "0000" Then
txt_Manned_UnManned_Auto = "N/A"
Else
txt_Manned_UnManned_Auto = Range("MannedUnManned").Cells(R.Row).Value
End If
'txt_Business_Owner:
Set R = Range("SAC").EntireColumn.Find(txt_SAC_No.Value, _
LookIn:=xlValues, LookAt:=xlWhole)
If R Is Nothing Then
txt_Business_Owner = "N/A"
ElseIf R.Value = "0000" Then
txt_Business_Owner = "N/A"
Else
txt_Business_Owner = Range("Business").Cells(R.Row).Value
End If
'Site Type:
Set R = Range("SAC").EntireColumn.Find(txt_SAC_No.Value, _
LookIn:=xlValues, LookAt:=xlWhole)
If R Is Nothing Then
txt_Site_Type = "N/A"
ElseIf R.Value = "0000" Then
txt_Site_Type = "N/A"
Else
txt_Site_Type = Range("SiteType").Cells(R.Row).Value
End If
End Sub
With immense gratitude :)
The ShyButterfly
Hope you have a terrific day, theShyButterfly -
String toString not working correctly. Not sure if my getResults method is
this is my error when i try to display the jumper,his club and results.
Thanks in advance for your help.
Name: wayne: Club: sweden: Results: [I@1a758cb
here is my main class:
import java.util.Scanner;
public class LongJumpCompetition
public static void main(String[]args)
Scanner keyboard = new Scanner(System.in);
int choice = 0;
int SIZE =0;
int NumOfJumps =0;
int NumOfJumpers =0;
System.out.print("state amount of jumpers: ");
SIZE=keyboard.nextInt();
System.out.println();
System.out.print("state amount of jumps per each jumper: ");
NumOfJumps=keyboard.nextInt();
keyboard.nextLine();
int [] theResults = new int [NumOfJumps];
LongJumper [] LongJumpers = new LongJumper [SIZE];
System.out.println();
choice = menu(keyboard);
while (choice !=0)
switch (choice)
case 1: addLongjumper (keyboard,LongJumpers,NumOfJumpers);
NumOfJumpers++;
break;
case 2: addResults (keyboard, LongJumpers, NumOfJumpers,theResults,NumOfJumps);
break;
case 3: showAllJumpers(LongJumpers, NumOfJumpers);
break;
System.out.println();
choice = menu(keyboard);
public static int menu(Scanner keyboard)
//Scanner keyboard=new Scanner(System.in);
System.out.println("1. add jumper");
System.out.println("2. add results for choosen jumper");
System.out.println("3. show all jumper and their results");
System.out.println("0. end");
System.out.print("\nYour choice: ");
return keyboard.nextInt();
public static void addLongjumper(Scanner keyboard, LongJumper[]LongJumpers, int NumOfJumpers)
String theName = "";
String theClub = "";
int NumOfJumps = 0;
keyboard.nextLine();
System.out.print(" state jumpers name: ");
theName=keyboard.nextLine();
System.out.print("state the club: ");
theClub=keyboard.nextLine();
LongJumpers[NumOfJumpers]= new LongJumper(theName,theClub,NumOfJumps);
public static void addResults(Scanner keyboard, LongJumper[]LongJumpers, int NumOfJumpers,int []theResults, int NumOfJumps)
//keyboard.nextLine();
String searchname ="";
/* String theName = "";
String theClub = "";
int NumOfJumps =0;
System.out.print("how many jumper per jumper: ");
NumOfJumps=keyboard.nextInt();
keyboard.nextLine();
int [] theResults = new int [NumOfJumps];
System.out.println();*/
System.out.print("state jumpers' name:");
keyboard.nextLine();
searchname = keyboard.nextLine();
int pos = -1;
boolean found = false;
for(int i=0; i<NumOfJumpers;i++)
if(searchname.equals(LongJumpers.getName()))
pos=i;
found=true;
if(pos!=-1)
LongJumpers[pos].setResult(theResults,NumOfJumps);
else if (pos==-1)
System.out.print("No jumper with that name found");
public static void showAllJumpers(LongJumper[] LongJumpers, int NumOfJumpers)
System.out.println();
for(int i=0; i<NumOfJumpers; i++)
System.out.println(LongJumpers[i]);
here is my object class:
import java.util.Scanner;
public class LongJumper
//Instants variables
private String name;
private String club;
int [] result;
//constructors
public LongJumper()
this.name="";
this.club="";
this.result= new int [0];
public LongJumper(String name, String club,int NumOfJumps)
this.name=name;
this.club=club;
this.result= new int [NumOfJumps];
public LongJumper(String name, String club,int []result,int NumOfJumps)
this.name=name;
this.club=club;
this.result= new int [NumOfJumps];
//Metoder
public void setName(String name)
this.name=name;
public void setClub(String club)
this.club=club;
public void setResult(int []result,int NumOfJumps)
Scanner keyboard= new Scanner(System.in);
for(int i=0; i<NumOfJumps;i++)
System.out.print("Ange resultat:");
result[i] = keyboard.nextInt();
keyboard.nextLine();
this.result= result;
public String getName()
return this.name;
public String getClub()
return this.club;
public int [] getResult()
return this.result;
public String toString()
return "Name: " + this.name + ": " + "Club: " + this.club+ ": " + " Results: " + this.result;jverd wrote:
cotton.m wrote:
What jverd wrote
Arrays.toString(that array)
Furthermore, I suggested calling that method...
What you did
Array.toString ();
...but the OP implemented this method. Which actually would be a valid way to approach it if java.util.Arrays doesn't provide what you want. Just reporting back "doesn't work," however, is none too productive.
Actually I think before trying to roll their own the OP tried to call Array.toString and got the expected compile error. At least that's what I decode from
Array.toString but i am getting an error stating a method is missing -
Is column visibility based on the first page of the result set or the entire result set?
I have tried, in vain, to play with the column visibility expression in my report. So where my Business Unit is "MC" or "FM", then I want to display column "HCFA Number"...otherwise hide it. If I run strictly for "MC"
it works! If I run simply for "CO" it works! And doesn't show! But if I combine "CO" and "MC", it is hidden and I would expect it to be visible since "MC" is part of my entire report.
Here's the expression I came up with for Column Visibility...
=IIf((Fields!BUSINESS_UNIT.Value = "MC") OR
(Fields!BUSINESS_UNIT.Value = "FM"),FALSE,TRUE)
Am I missing something here or just being dense late on a Friday???
Thanks for your review and am hopeful for a reply.Hi ITBobbyP,
It seems you have add parameter based on the "Business Unit" which is multiple values and when you select the "CO,MC" the entire column "HCFA Number" is hide, but what you want is to hide the CO related "HCFA Number"
and show the MC related "HCFA Number", right?
The expression you are using to show/hide the column visibility will based on the current filtered entire result set. That is mean the entire column "HCFA Number" will be show when the result set contains "MC" or "FM"
or both, otherwise, it will always hide.
In your scenario, you can set the row visibility using the expression and you will get the result like below:
You can set the visibility of the textbox "[HCFANumber]", but the CO related "HCFANumber" will be blank:
If I have some misunderstanding, please try to provide more details information about the expect result you want.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support
Maybe you are looking for
-
I have a problem that I try to turn on the iPad 2, but he was just lighting up, but nothing is displayed. I do not know what happened, but yesterday did not do this. Thank you for your help.
-
A 'ghost' photo in my camera roll
Good afternoon, today I was connecting my iPhone 6 (iOS 8.2) to my PC (Windows 8.1) to import pictures from the camera roll. When I checked the DCIM folder on the PC there was a sub-folder containing a photo that I took 1 year ago. In that period I h
-
LVM; Advantages vs. Disadvantages
I was just browsing the wiki for some features i would like and i came across LVM. It sounds great!, i have currently three disks in my system. One 640GB, one 750GB and one brand new 1000GB drive and i would like to make them into one large volume. I
-
Migrate Essbase 11.1.2.2 to Shared Services Security
Can anyone point me at a useful guide for this? thanks, Robert.
-
How can I access photos and videos saved to the iCloud?
How can I access photos and videos saved to the iCloud? I backed up my iphone to the Cloud but now the files are nowhere to be found. I had to reset all content and settings in order to troubleshoot an issue. Before I did this, I backed up the iphone