How to write select option 'onchange' to sort by?
From a previous thread, David Powers helped me write an array to use to sort from a list/menu of columns from a recordset
$permitted = array('price', 'area');
// check whether the sort_menu variable contains a valid column name
if (isset($_GET['sort_menu']) && in_array($_GET['sort_menu'], $permitted)) {
$sort = $_GET['sort_menu'];
} else {
// set a default column for sorting
$sort = 'price';
?>
This assumes that the columns for sorting are called price and area.
Change these values to suit your setup.
Now you can add ORDER BY $sort to the SQL in the recordset.
I use this with a submit button.
i want to use the 'onchange' feature of the select option and do away with the submit button.
what goes after onchange=" what goes here? "
this is the sql query
"SELECT * FROM rentals_info WHERE rentals_info.active = 'yes' ORDER BY $sort ASC";
That's a JavaScript problem. A quick Google search for "sort table columns javascript" brought up the following tutorial that seems to do very much what you want: http://www.kryogenix.org/code/browser/sorttable/.
Similar Messages
-
How to write select options with extension in module pool program
hi,
M having the following fields through screen painter.
1. sales offfice
2.sales district
3.customer no
for those three fields no extension is not provided and no search help is there.
i want write seletion options to get extension in that module pool
screen.
plese send coding for me , please let me know how to get that
select options with the above all three fields.
Thanks & Regards
RajiCheck it
In top include
DATA: number(4) TYPE n VALUE '9005',
PROCESS BEFORE OUTPUT.
MODULE status_9001.
CALL SUBSCREEN AREA1 INCLUDING SY-REPID number.
PROCESS AFTER INPUT.
MODULE user_command_9001.
CALL SUBSCREEN AREA1.
*& Module status_9001 OUTPUT
text
MODULE status_9001 OUTPUT.
SELECTION-SCREEN BEGIN OF SCREEN 9005 AS SUBSCREEN.
PARAMETER pa_bukrs TYPE t001-bukrs.
select-options matnr for wa_matnr.
SELECTION-SCREEN END OF SCREEN 9005.
ENDMODULE. " status_9001 OUTPUT -
How to write select statement in XSL-FO type XML program
Hi All,
Could you please anyone explain briefly how to write select statement in XSL-FO XML Program.
Requirement:
In the seeded program, OAF page is creating one XML file and through XSL-FO type XML Pulisher loading data and generating PDF output. as per the requirement some of the informations are missing in the XML file and for modifing the OAF page will be taking someting. we are planing to write a select query inside the XSL-FO program to get the required information.
Could you please help me how to write a select statement inside the XSL-FO type programs.
Please give me some example program for this...
Thanks in Advance.
Regards,
SenthilHi ,
Please check the below code and modified plant as select-option
Check the below code :
tables : mara,
mast.
data : begin of i_data occurs 0,
matnr like mara-matnr,
end of i_data.
select-options : s_matnr for mara-matnr,
<b>S_werks for mast-werks.</b>
start-of-selection.
select a~matnr into table i_data
from mara as a inner join mast as b on amatnr = bmatnr
where <b>b~werks in s_werks</b>
and a~matnr in s_matnr
and a~mtart = 'AA'
or a~mtart = 'UT'
and b~stlan = '1'.
loop at i_data.
write:/ i_data-matnr.
endloop.
Hope you got it.
Thanks
Seshu -
How to create select-options in module pool program
Hi
i am structed at this point could you please tell me
how to create select-options in module pool programSteps to get SELECT-OPTIONS in module pool programs.
<li>. Start one dialog program with SAPZ_TEST.
<li>. Place the below code in the TOP include of the dialog program.
PROGRAM SAPMZ_TEST.
TABLES mara.
SELECTION-SCREEN BEGIN OF SCREEN 2100 AS SUBSCREEN.
SELECT-OPTIONS: matnr FOR mara-matnr.
SELECTION-SCREEN END OF SCREEN 2100.
<li>. Create one screen 2000 .
<li>. Go to Layout of the screen and Define subscreen area on the screen and Name it as g_subscreen.
<li>. Place the below code in the Flow logic of the screen.
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN g_subscreen INCLUDING 'SAPMZ_TEST' '2100'.
PROCESS AFTER INPUT.
CALL SUBSCREEN g_subscreen.
<li>. Activate all.
<li>. Create Transaction code for the dialog program SAPZ_TEST.
<li>. Execute the transaction code. You will see the select-option like we see on Selection-screen.
I hope that it gets u clear idea.
Thanks
Venkat.O -
How to write Select statement for this codition
I need to check whether SGTXT contains BELNR value.
SGTXT is a text field and It should be matched with BELNR
How to write select statement for this.
Select AUGBL AUGDT into t_BSAD
from BSAD
where SGTXT should have the given BELNR Value.
Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.Hi,
data temp(12).
concatenate '%' belnr '%' into temp.
Select AUGBL AUGDT into t_BSAD
from BSAD
where SGTXT like temp.
If belnr is having multiple values,just create a internal table as follows.
types : begin of ty,
belnr....
temp(12),
end of ty.
data itab_ type standard table of ty.
data wa type ty.
loop at itab into wa.
concatenate '%' wa-belnr '%' into wa-temp.
modify itab from wa index sy-tabix transporting temp.
endloop.
Change your select statement accordingly.
Kindly reward poits if it helps. -
How to make Select Options Mandatory?
Hi Guys,
Can anybnody tell me how to Declare Selection Options for some of them mandatory.
Select-Options : v_PurOrg for EKKO-EKORG default '2000',
v_GRDate for Sy-Datum ,
v_GRPrd for MSEG-GJAHR.
In these i have to make v_PurOrg Manadatory.
Thanks,
Gopi.Hi Gopi,
In order to make select-options mandatory we add OBLIGATORY in the statement like the below.
Selection-Screen.
Select-Options : v_PurOrg for EKKO-EKORG default '2000' OBLIGATORY.
In this case, only the first option will have the default value of 2000.But if you want both the options low and high of select-options, means you have to add the below code in your program in the initialization event.
Initialization.
v_PurOrg-low = 1000.
v_PurOrg-high = 2000.
append v_PurOrg.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
How to creat select-option on module pool screen???
Hi All,
please tell me how to creat select-option on module pool screen???
Regards
DeepakHi Deepak Kumar Sharma,
There are Two ways to achieve it...
1) How to create a select-options in a module pool screen.
Method 1
a) Create a subscreen area in your screen layout where you want to create the select options.
b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
select-options s_matnr for mara-matnr.
SELECTION-SCREEN END OF SCREEN.
c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
CALL SUBCREEN sub_area INCLUDING <program> <screen>
This call subscreen statement is necessary for transport of values between screen and program.
Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
Method 2
a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
struc_tab_and_field-tablename = con_kna1. " 'KNA1'.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = ' '
text = g_titl1 " 'Customers'
tab_and_field = struc_tab_and_field
TABLES
RANGE = rng_kunnr
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.
IF NOT rng_kunnr[] IS INITIAL.
Read the very first entry of the range table and pass it to
dynpro screen field
READ TABLE rng_kunnr INDEX 1.
IF sy-subrc = 0.
g_cust = rng_kunnr-low.
ENDIF.
You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
Also have a look on below threads
how to make select option in module pool
select option in module pool program
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7 -
How to pass select-option filed to Function Module Exporting Parameter
Hi,
How to pass select-option filed to Function Module Exporting Parameter.
ThanksHi,
DATA: BEGIN OF ITAB5_WRK OCCURS 0,
KUNNR TYPE KNKK-KUNNR, "CUSTOMER #
SBGRP TYPE KNKK-SBGRP, "CREDIT REP
KLIMK TYPE KNKK-KLIMK, "CREDIT LIMIT
NAME1 TYPE KNA1-NAME1, "CUSTOMER NAME
SKFOR TYPE KNKK-SKFOR, "TOTAL A/R
AMT1 TYPE KNKK-SKFOR, "CURRENT
AMT2 TYPE KNKK-SKFOR, "01-30
AMT3 TYPE KNKK-SKFOR, "31-60
AMT4 TYPE KNKK-SKFOR, "61-90
AMT5 TYPE KNKK-SKFOR, "91-120
AMT6 TYPE KNKK-SKFOR, "OVR 120
BZIRK TYPE KNVV-BZIRK,
END OF ITAB5_WRK.
SELECT-OPTIONS P_COMP FOR T001-BUKRS
SELECT KUNNR SBGRP FROM KNKK
INTO TABLE ITAB5_WRK
WHERE SBGRP IN P_REP
AND KUNNR GE '0001000000'
AND SKFOR NE 0.
LOOP AT ITAB5_WRK.
DELETE ADJACENT DUPLICATES FROM ITAB5_WRK COMPARING KUNNR.
ENDLOOP.
PERFORM GET_CREDIT_LIMITS.
*=======================================================================
IF P_DIST NE SPACE.
LOOP AT ITAB5_WRK.
SELECT SINGLE * FROM KNVV WHERE KUNNR EQ ITAB5_WRK-KUNNR
AND VKORG EQ P_COMP
AND VTWEG EQ '20'
AND SPART EQ '10'
AND BZIRK IN P_DIST.
IF SY-SUBRC EQ 0.
MOVE KNVV-BZIRK TO ITAB5_WRK-BZIRK.
MODIFY ITAB5_WRK.
ELSE.
DELETE ITAB5_WRK.
ENDIF.
ENDLOOP.
ENDIF.
*==============================================================
LOOP AT ITAB5_WRK.
MOVE: 'F/S' TO WRK-KKBER,
ITAB5_WRK-KUNNR TO WRK-KUNNR.
PERFORM AGING.
ADD: W_SNFAE TO ITAB5_WRK-AMT1,
W_SFAE1 TO ITAB5_WRK-AMT2,
W_SFAE2 TO ITAB5_WRK-AMT3,
W_SFAE3 TO ITAB5_WRK-AMT4,
W_SFAE4 TO ITAB5_WRK-AMT5,
W_SFAE5 TO ITAB5_WRK-AMT6,
W_SFAEL TO ITAB5_WRK-SKFOR,
W_SNFAE TO ITAB5_WRK-SKFOR.
MOVE: 'SPEC' TO WRK-KKBER,
ITAB5_WRK-KUNNR TO WRK-KUNNR.
*PERFORM AGING.*
ADD: W_SNFAE TO ITAB5_WRK-AMT1,
W_SFAE1 TO ITAB5_WRK-AMT2,
W_SFAE2 TO ITAB5_WRK-AMT3,
W_SFAE3 TO ITAB5_WRK-AMT4,
W_SFAE4 TO ITAB5_WRK-AMT5,
W_SFAE5 TO ITAB5_WRK-AMT6,
W_SFAEL TO ITAB5_WRK-SKFOR,
W_SNFAE TO ITAB5_WRK-SKFOR.
MODIFY ITAB5_WRK.
ENDLOOP.
FORM AGING.
*CALL FUNCTION 'CUSTOMER_DUE_DATE_ANALYSIS'*
EXPORTING
BUKRS = P_COMP
KKBER = WRK-KKBER
KUNNR = WRK-KUNNR
RASID = 'FEND'
KLIMP = 'X'
IMPORTING
SFAE1 = W_SFAE1
SFAE2 = W_SFAE2
SFAE3 = W_SFAE3
SFAE4 = W_SFAE4
SFAE5 = W_SFAE5
SFAE6 = W_SFAE6
SFAEL = W_SFAEL
SNFA1 = W_SNFA1
SNFA2 = W_SNFA2
SNFA3 = W_SNFA3
SNFA4 = W_SNFA4
SNFA5 = W_SNFA5
SNFA6 = W_SNFA6
SNFAE = W_SNFAE
EXCEPTIONS
NO-AGING_SCHEDULE = 1
NO_TABLE_INPUT = 2.
CASE SY-SUBRC.
WHEN 1.
MESSAGE E999 WITH 'PLEASE ENTER AGING SCHEDULE'.
WHEN 2.
MESSAGE E999 WITH 'DO NOTHING ??'.
ENDCASE.
ENDFORM. "AGING
Thanks -
How to provide select-option in module pool programming
Hi all,
How to provide select-option in module pool programming.
If any body knows let me immediately.
Thanks
sudheerHi Sudheer,
Unfortunately there is no standard way of having a select-option in a module pool program.
What you can try is having two fields and creating a range in your program and populating the range at runtime with respective value and trying to simulate some functionality of the select-option.
Hope it helps.
Thanks, Debasish -
How to use select options whitout ranges ie like parameter
how to use select options whitout ranges ie like parameter and pls send me the code on that
thanks
raja.hi,
SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b>
eg: code
<b>SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b></b>
data: itab type table of kna1 with header line.
select * from kna1 into table itab where kunnr IN s_kunnr.
rgds
Anver -
HOW TO PASS SELECT-OPTIONS AS IMPORT PARAMETER TO A CLASS
Hi experts,how to pass select options value as a export parameters to a zclass.
can give me some idea.
Thanks
saiAs Sachin already said, selection options are stored in an internal table. You can reconstruct the table type without the corresponding input fields using the type addition RANGE OF.
So - assuming you have the following in your program:
DATA: wa TYPE sflight.
SELECT-OPTIONS so_car FOR sflight-carrid.
you can create a publically-visible type in your class using direct type entry and the code
TYPES: my_selectoption TYPE RANGE OF sflight-carrid.
and use this to define the importing parameter of the method.
The only other thing you have to remember is that select-options generates an internal table with header line. Thereore, to pass the table to the method, you would use (in the above example) so_car[], and not just the name of the select-option.
Hope this helps.
Regards
Jon. -
How to assign select-option values to internal table
hi all,
how to assign select-option values to internal table
thanks in advance.Hi,
You just need to loop at your select-option field and take the values from low and high fields.
for. e.g
loop at s_werks .
move:s_werks-low to <your itab>
if not s_werks-high is initial .
move: s_werks-high to <youritab>
endif .
append <your itab>
endloop .
OR use select statement.
regards,
Omkar.
Message was edited by:
Omkaram Yanamala
Message was edited by:
Omkaram Yanamala -
How to write SELECT statement using tables ekko,ekpo and eket?
Hi,
I got a problem in performance tuning using below tables?
how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause) use only fields
ekko~ebeln IN ebeln
ekko~loekz EQ ' '
ekko~lifnr IN lifnr
ekko~ekorg IN ekorg
ekko~ekgrp IN ekgrp
ekpo~werks IN werks
ekpo~pstyp EQ '3'
ekpo~loekz EQ space
ekpo~elikz EQ space
ekpo~menge NE 0
eket~rsnum NE space.
Thanks in Advance.
bye.Hi,
ekko~ebeln IN ebeln
ekko~loekz EQ ' '
ekko~lifnr IN lifnr
ekko~ekorg IN ekorg
ekko~ekgrp IN ekgrp
ekpo~werks IN werks
ekpo~pstyp EQ '3'
ekpo~loekz EQ space
ekpo~elikz EQ space
ekpo~menge NE 0 " Remove this from where clause
eket~rsnum NE space. " Remove this from where clause
' instead delete the entries after fetching into the table
DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
Regards
Bala Krishna -
How will use Select-Options in Read table Concept.
Hi All,
How will use Select-Options in Read table. For example,
Select-Options : test for bseg-prctr.
Select * from bseg into table ITAB.
Read table ITAB with key prctr in test.
Last line is showing error. If any way to read ITAB as conditions given per select options.
Thankx Advance,,,HI,
you cannot use " IN " with read statement , read statement is used as:
READ TABLE it_collect ASSIGNING <fs_collect>
WITH KEY rbpl = <fs_wkdet>-arbpl
ufnr = <fs_wkdet>-aufnr.
anyways you can use loop at statement before read to use " into " statement as:
LOOP AT it_master INTO l_master
WHERE werks = l_werks
hope it will help you
regards
rahul
Edited by: RAHUL SHARMA on Dec 30, 2008 9:14 AM -
How to transfer select options variable
Hello:
I can pass parameter to parameter id such as p_fikrs, but how to transfer select options parameter to parameter id such s_fictr.
SET PARAMETER ID 'FIK' FIELD p_fikrs.
SET PARAMETER ID 'FIS' FIELD s_fictr.
SET PARAMETER ID 'FPS' FIELD s_fipex.
SET PARAMETER ID 'GJR' FIELD p_year.
CALL TRANSACTION 'FMRP_RFFMEP1BX' AND SKIP FIRST SCREEN.
Thank you very much!Use SUBMIT with the following option
SUBMIT... USING SELECTION-SCREEN scr
Effect
When you execute the report, the system uses the selection screen number that you specify in the scr field. This must be a selection screen defined using the SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN statements.If you omit the addition, the system uses the standard selection screen 1000.
This addition allows you to start the same report in different situations, using a different selection screen each time.
Notes
The addition VIA SELECTION SCREEN determines whether the report is processed in the foreground or the background.
What happens if the required screen does not exist or is not a selection screen?
Screen 1000:
If you want to use the standard selection screen (... USING SELECTION-SCREEN 1000 or do not specify a ... USING SELECTION-SCREEN) addition, the system does not process a selection screen.
Other selection screens:
The system triggers a runtime error.
Hope dis helps,
Reward if it does
Maybe you are looking for
-
RIDC check in the file name encoding issue
Hi, When I use the RIDC to upload the chinese file name, the native file field become ??.pdf. TransferFile tf = new TransferFile(new File("c:/中文.pdf"), "application/pdf"); dataBinder.addFile("primaryFile", tf); Thanks!
-
Console.app not updates in LOG DATABASE
After a forced shutdown of the MacBook Pro, the console.app displays all logfiles and also LOG DATABASE QUERIES, but the content of the LOG DATABASE only date back to the fored shutdown point in time. Afterwards, system.log, etc are updated, but the
-
Error on the cosole of WebLogic6.0.
guys, i am getting the following error on the cosole of WebLogic6.0. Error WAE-020: ERROR: No option set for where to go next. <Jun 18, 2001 12:28:47 PM CDT> <Error> <HTTP> <WebAppServletContext(5175025,Defa
-
No primary key in database table.Need help with ODS keys.
Hi , I am pulling data from a database table where there in no primary key . So when I designed my ODS and loaded the data , the records got overwritten...(If there are 5000 records only 4000 got transfered) . So Now the only option I can think of is
-
Time machine keeps OSX from updating to Mavericks - how do I fix?
Keep trying to update my old computer to Mavericks. It's currently at 10.6.8 and totally updated. Everytime I go to install Mavericks, when it gets to the window where you choose where to save it, I try to pick my Hard Drive but I get an error messag