Select single checkbox in table
i have displayed checkbox column in a table
i want want user to select only one chkbox at a time like radio button plz tell me how to do it
hi,
at selection-screen.
loop at screen.
if chkbox_1 eq 'x'.
SCREEN-INPUT = 0.
modify screen.
else.
if chkbox_2 eq 'x'.
SCREEN-INPUT = 0.
modify screen.
if chkbox_3 eq 'x'.
SCREEN-INPUT = 0.
modify screen.
endif.
endif.
endif.
endloop.
reward some points if useful.
with regards,
suresh babu aluri.
Similar Messages
-
How to add selected values from table(selected using checkbox)to table?
Hi All,
i have created simple page with search panel with table in table i have created one column as check box for selecting.
here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
i used same code and able to see selected row in console, as object array how to add these into table.
please help me out
Thanks in advance
siva shankarThank you for a quick reply
i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
my usecase after make some searches I will select some roles from different categories at finally i ll submit.
i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
thanks
Siva Sankar -
How to Enable a Selected single record from Table control...
Hi,
I have 5 records in my table control and in screen Painter in Made all the fields in Table control as Output field.
and successfully all my Table control fields are disabled...
Now Now i want to enable the record which i selected n rest all the 4 records should be in Disable.
what i did is:
in PBO.
loop at itab into wa with contol TBC1 .
Module XYZ.
endloop.
Module XYZ.
loop at screen.
if screen-group = 'x'.
screen-input = 1.
modify screen.
endif.
End Module.
Please help me....
Thanks,hi
in the layout of the screen u might have dragged and dropped the table control
double click on it u will get attributes screen in that u select MULTIPLE or SINGLE under Line-Selection
under attributes tab based on ur requirement.
table control declaration:
controls : control type tableview using screen 8000.
the internal table in table control must be like
data : begin of itab occurs 0,
empno type .......,
empname......,
empcity.....,
check(1), " for tab selection"
end of itab.
data : itab1 like itab occurs 0 with header line.
data : flag.
data : wk_init type i.
data : lines type i.
in the attributes screen of the table control
pass the value ITAB-CHECK to the field W/SELECTION
in SE51
PBO
Module_status_0800
loop with control table_control_name.
module_fill_tcontrol.
endloop.
PAI
Module_user_command_0800
loop with control table_control_name.
module_read_tcontrol.
endloop.
in se38
Module_status_0800.
describe table itab1 lines lines.
control-lines = lines.
endmodule.
Module_fill_tcontrol.
describe table itab1 lines wk_init.
if wk_init is not initial.
read table itab1 into itab index control-current_line.
endif.
for enabling a row in the table control:
if sy-ucomm = 'EDIT'.
loop at screen.
if flag is initial.
screen-input = 0.
elseif ( flag eq 'Y' ).
if ( ( screen-name = 'ITAB-EMPNO' or
screen-name = 'ITAB-EMPNAME' or
screen-name = 'ITAB-EMPCITY' )
and control-line_selector eq itab-check
and control-current_line le lines ).
screen-input = 1.
else.
endif.
endif.
modify screen.
endloop.
endif.
endmodule.
Module_read_tcontrol.
READ TABLE itab1 INDEX control-current_line.
IF sy-subrc EQ 0.
MODIFY itab1 FROM itab INDEX control-current_line.
ELSE.
MOVE-CORRESPONDING itab TO itab1.
APPEND itab1.
CLEAR itab1.
ENDIF.
endmodule.
module_user_command.
case sy-ucomm.
when 'EDIT'. -
> Function Code assigned to the pushbutton to enable the field
flag = 'Y'.
endcase.
endmodule.
Regards
Murali.M -
Select single problem...
hi all,
i have to take first value of table BSIS according to condition. i m using select single statement in table BSIS, but problem is that i m getting the value only in header by which i m not able to apply loop at itab. can anyone please help me?
code.
SELECT single bukrs hkont gjahr monat shkzg prctr FROM bsis INTO itab
WHERE hkont IN hkont
AND bukrs IN bukrs
AND prctr IN prctr
AND gjahr IN gjahr
AND monat IN monat.
here sy-subrc is 0. but value is only in header.
regards saurabh.Hi Saurabh,
i don't know what your program does but if you process the data you retrieve from table bsis more than once, it may be useful to create your internal table identical to table bsis;
data: itab like bsis occurs 0 with header line.
then get all the data from table bsis to your internal table at once.
select * from bsis
into table itab.
then process itab with your selection criteria as you wish.
avoid using the statement ...into corresponding fields of table (i assume you already are not using this)
well i don't know what else you can do..
regards;
Murat Kaya -
Trapping the selected row in the table using boolean checkbox
Hi,
I am using Jdev 11.1.1.2.0 with ADF 11g.
I have a screen that has a table with an additional column of 'Select boolean checkbox'. I have assigned a valuechangelistener method that helps me know which row has been selected. But the issue is it gets fired for all the rows in the table once I select/de-select a checkbox of 1 single row.
How can I handle this? Yes I can iterate through the table rows and check the values of the checkbox. But that is not I want, I also want to trap the de-select event.
What is the way to achieve this?Timo Hahn wrote:
I don't see a bug in this behavior. This is because each row gets stamped when they render.
The way to do this is to use an attribute (which can be transient) to hold the status of the check box. Exactly this does the link I gave.
TimoHi,
Why I am saying it as a bug is because it is not firing the event for the record where the event has occurred. instead the event is fired for each row which should definitely not what is expected. And because of this we have to add an additional variable.
Now it becomes more complex if I have to handle de-selection as well, b'coz if the valuchangelistener is going to fire for all the records then I need to know which row was previously selected and now de-selected as now the de-selected record will also return a false.
So any better solution, anyone? -
Hi Experts,
I need single column to be selected from a ALV table...selected in da sense to be highlighted....as it happens..by default for a row.....
I hope u understood my query...
Please help me out in this..
I know u all will surely help me...
Thks and Regards,
Runali.Hi Runali,
Get the reference to the column settings of your ALV Model. Then you can get the reference of each column by passing the column ID. There is a method set_selected_state in the column class, but that does not highlight the column as it does for a row. So what you can use is a cell design for a column that will highlight the column with a color or whatever.
lr_column = lr_column_settings->get_column( ID = id ).
lr_column->set_cell_design( preferred design ).
Hope this helps. Please award points if it solves your purpose.
Regards,
Nithya -
How to make row selection by checkbox in ADF table
hello,
using jdev11g TP4 , fusion web application
when i drag my view object as ADF table into jsf page,
i want to know how to make row selection by checkbox
thanks
greenApple
Edited by: greenApple on Nov 10, 2008 11:33 AMHi,
the tree component has changed compared to 10.1.3. You no longer have a tableSelectmany component that renders as checkboxes. Instead you use the ctrl key and select the table rows
Frank -
How to convert select-options table into single field internal table
Hi,
My requirement is to convert select-options table into single internal table which has one field.
e.g. select-options: s_matnr for mara-matnr.
select-options table can have options 'BT',"EQ", "NE", "GE", "GT", "LE", "LT", "CP" etc. select-options table
have Sign:I ,Option:BT, Low: 1, High.10.The new internal table records should be 1,2,3,4,5,6,7,8,9,10.
Please suggest any function module available for this scenario in SAP.
Thanks,
Somi.
Edited by: somi reddy satti on Sep 15, 2009 3:18 PMHi Sowmya,
Here is the answer if I understand well of your question.
Data: begin of gt_mon OCCURS 0,
mon(2) TYPE n,
end of gt_mon.
Data: begin of gt_year OCCURS 0,
year(4) TYPE n,
end of gt_year.
Select-options: s_period FOR ptdw_pws_db-kmonth NO-EXTENSION
DEFAULT sy-datum(6)
TO sy-datum(6).
For example according to above statement period is 201110 is 201201.
Period field does n't exists in SAP for selection. If your selection is on date based on period which is given on the selection-screen then you need to convert the period to date by concatenating ( or using FM to convert )01 at the end of each period . You need to declare one range table for date to select the data from table.
loop at s_period.
gr_date-sign = s_period-sign.
gr_date-option = s_period-option.
COncatenate s_period-low
'01'
into gr_date-high.
COncatenate s_period-high
'01'
into gr_date-low
append gr_date.
ENDloop.
Thanks,
Satheesh -
I know this is not a javscript forum.. (WISH THERE WAS ONE On SUN.COM)..and i am sorry to post it here.. but the problem is JSP and javascript
I have multiple checboxes.. Something like Yahoo mail.. When the inbox is opened the number of checkboxes correspond to the number of mails on that page..along with an extra one at the very top(called it Header_checkbox).. If header_checkbox is selected.. all the mails are selected and one can either delete or move the mails..
My form is kinda similar.. I have multiple rows.. and depending on the number of rows, the checkboxes are displayed.. the Javascript function works fine if there are more than one checkboxes...It doesnt work if theres a single one.. well not a big deal since the user can click on the single checkbox and it shld be fine.. but i am curious to know why it isnt working for a single one. When i try to display the checkbox.length it gives me "undefined" (this is incase theres only one chekcbox)... for multiple chekcboxes it gives the rite number.
Heres the code if anyone has suggestions
Thank you
function toggle(frm)
var checkbox_length = frm.checks.length;
alert(checkbox_length);
for( var i = 0; i < checkbox_length; i++ )
frm.checks.checked = frm.tog.checked;
[HTML CODE]
<FORM name="editFormatForm" method="post" action="edit_delete_filetype_format.jsp">
<tr class="titleitem">
<td><input type="checkbox" name="tog" onclick="javascript:toggle(this.form);"></td>
<td>Fieldname��</td>
<td>Format��</td>
<td>Unique?</td>
<td>Optional?</td>
<td>Description</td>
<td></td><td></td>
</tr>
<%
if (fileTypeList.size() > 0)
for (int k = 0; k < fileTypeList.size(); k++)
formatObject = (FiletypeFormatObject) fileTypeList.get(k);
id = formatObject.getId();
columnName = formatObject.getColumnName();
columnFormat = formatObject.getColumnFormat();
uniqueness = formatObject.getColumnUnique();
description = formatObject.getDescription();
optional_int = formatObject.getColumnOptional();
count++;
%>
<tr class="<%=htmlObj.getClassString(count)%>">
<td><input type="checkbox" name="checks" value="<%=id%>"></td>
<td><input type="text" name="columnName" value="<%=columnName%>"></td>
<td><input type="text" name="columnFormat" size='30' value="<%=columnFormat%>"></td>
<td><input type="checkbox" name="unique" <% if(uniqueness == 1) { %> checked <%}%>></td>
<td><input type="checkbox" name="optional" <% if (optional_int == 1) { %> checked <%} %>></td>
<td><input type="text" name="description" value="<%=description%>"></td>
</tr>
<% } } count++; %>
<tr class="<%=htmlObj.getClassString(count)%>"><td></td><td><input type="submit" value="Submit Changes"></td>
<td colspan="12"><input type="submit" value="delete"></td></tr>
<% count++; %>
<tr class="<%=htmlObj.getClassString(count)%>"><td></td><td colspan="12">�</td></tr>
<% count++; %>
<tr class="<%=htmlObj.getClassString(count)%>"><td></td><td><input value="Enter New Field..."></td>
<td><input value=""></td><td><input type="checkbox"></td><td><input type="checkbox"></td>
<td><input type="submit" value="Add Field"></td><td></td></tr>
</FORM>
[END OF HTML CODE]The browser creates a DOM (Document Object Model) of the document and the elements in the document. In this DOM it references the elements on the page by name. If there is more than one element with the same name it creates an array of these elements and puts the array in the DOM but if there is only one element it places this element in the array.
If there is only one checkbox with the name "checks" this will be the object referred to as "rm.checks" and this element doesn't have an length property.
function toggle(frm)
var checkbox_length = frm.checks.length;
if (checkbox_length != undefined) {
for( var i = 0; i < checkbox_length; i++ )
frm.checks.checked = frm.tog.checked;
} else {
frm.checks.checked = frm.tog.checked; -
Shall I use SELECT SINGLE??
Iu2019ve retrieved MSEG-MATNR for the condition mseg-mblnr = material doc no. and mseg-mjahr = mat doc year and mseg-zeile = mat doc item.
And my retrieved data mseg data in i_mseg is like below:
Mblnru2026u2026u2026..mjahru2026..zeilen.u2026u2026.matnr
0049000242....1995......0003........YY-110
0049000242u2026.1995u2026u20260004u2026u2026.YY-120
0049000248....1995u2026u20260001u2026u2026..40-110C
0049000248u2026.1995u2026u20260002........40-200C
0049000248u2026.1995u2026u20260003........40-210
0049000248u2026.1995u2026u20260004........L-40C
Now Iu2019ll have to fetch:
MAKT-MAKTX for the condition MAKT-MATNR=MSEG-MATNR and MAKT-SPRAS = u2018ENu2019.
Shall I use select single or normal select queries for makt-maktx retrieval?
If select single, then why and if not, then why?
Can anyone please guide?
Regards.Hi,
It depends of how many records you expect to read. If you have a reduced amount of records I would expect for the join statement to underperform, even if the access to the data bank is faster.
But at a considerable amount of data the join might be a lot faster. Use the tc SM30 to test your code.
This is a test script (for development system):
TABLES: mseg, makt.
SELECT-OPTIONS: s_mblnr FOR mseg-mblnr,
s_mjahr FOR mseg-mjahr,
s_zeile FOR mseg-zeile.
PARAMETERS p_join AS CHECKBOX.
DATA: BEGIN OF l_mseg,
mblnr LIKE mseg-mblnr,
maktx LIKE makt-maktx,
END OF l_mseg.
START-OF-SELECTION.
DO 10000 TIMES.
IF p_join IS INITIAL.
SELECT mblnr INTO l_mseg-mblnr FROM mseg WHERE mblnr IN s_mblnr
AND mjahr IN s_mjahr AND zeile IN s_zeile.
SELECT SINGLE maktx INTO l_mseg-maktx FROM makt
WHERE matnr EQ mseg-matnr AND spras = sy-langu.
ENDSELECT.
ELSE.
SELECT mblnr maktx INTO l_mseg
FROM mseg JOIN makt ON makt~matnr = mseg~matnr
WHERE mblnr IN s_mblnr AND mjahr IN s_mjahr AND zeile IN s_zeile
AND spras = sy-langu.
ENDSELECT.
ENDIF.
ENDDO.
regards,
Edgar -
Hi experts,
i have to develop a alv grid report where i will be having 2 check-boxes. my issue is i have to select only 1 at-a-time.
if i select the other,i just get the pop-up message 'Please select only one check box'.
please help me
thanku,
anushai have done with my code, but am not able to check single checkbox at a time..
please help me....
BEGIN OF TY_FINAL,
BANFN TYPE BANFN, "
BNFPO TYPE BNFPO,
MATNR TYPE MATNR,
MENGE TYPE BAMNG,
MVGR4 TYPE MVGR4, "
LABST TYPE LABST,
QTYDEL TYPE OMENG,
QTYORD TYPE OMENG,
AVAILQTY TYPE BAPRE,
CHECKBOX TYPE CHAR01,
CHECKBOX1 TYPE CHAR01,
END OF TY_FINAL,
*Internal Table CreationS
DATA : LT_EBAN TYPE TABLE OF TY_EBAN,
LT_EBAN_TEMP TYPE TABLE OF TY_EBAN,
LT_MVKE TYPE TABLE OF TY_MVKE,
LT_MARD TYPE TABLE OF TY_MARD,
LT_VBBE TYPE TABLE OF TY_VBBE,
LT_VBBE_TEMP TYPE TABLE OF TY_VBBE,
LT_FINAL TYPE TABLE OF TY_FINAL,
LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV. "Fieldcat for GRID display
*Work Area Declaration
DATA : WA_EBAN TYPE TY_EBAN,
WA_MVKE TYPE TY_MVKE,
WA_MARD TYPE TY_MARD,
WA_VBBE TYPE TY_VBBE,
WA_VBBE_TEMP TYPE TY_VBBE,
WA_FINAL TYPE TY_FINAL,
WA_FIELDCAT LIKE LINE OF LT_FIELDCAT.
DATA : L_LABST TYPE BAPRE,
L_MENGE TYPE BAPRE,
L_QTYORD TYPE BAPRE,
L_AVAILQTY TYPE BAPRE.
*Constants Declaration
CONSTANTS : C_STATUS TYPE C VALUE 'N',
C_WERKS TYPE WERKS VALUE 'TBMS',
C_VKORG TYPE VKORG VALUE 'BMS',
C_VTWEG TYPE VTWEG VALUE '50',
C_WERKS1 TYPE WERKS VALUE 'TENN',
C_LGORT TYPE LGORT_D VALUE 'TJUS'.
**START-OF-SELECTION
START-OF-SELECTION.
REFRESH : LT_EBAN,LT_MVKE,LT_MARD,LT_VBBE,LT_FINAL.
*Fetching Data From EBAN Table Into Internal Table EBAN
SELECT BANFN
BNFPO
STATU
MATNR
MENGE
INTO TABLE LT_EBAN
FROM EBAN
WHERE STATU = C_STATUS
AND WERKS = C_WERKS.
IF LT_EBAN IS NOT INITIAL.
LT_EBAN_TEMP[] = LT_EBAN[].
SORT LT_EBAN_TEMP BY MATNR.
DELETE ADJACENT DUPLICATES FROM LT_EBAN_TEMP COMPARING MATNR.
*Fetching Data From MVKE Table Into Internal Table MVKE
SELECT MATNR
MVGR4
INTO TABLE LT_MVKE
FROM MVKE
FOR ALL ENTRIES IN LT_EBAN_TEMP
WHERE MATNR = LT_EBAN_TEMP-MATNR
AND VKORG = C_VKORG
AND VTWEG = C_VTWEG .
*Fetching Data From MARD Table Into Internal Table MARD
SELECT MATNR
LABST
INTO TABLE LT_MARD
FROM MARD
FOR ALL ENTRIES IN LT_EBAN_TEMP
WHERE MATNR = LT_EBAN_TEMP-MATNR
AND WERKS = C_WERKS1
AND LGORT = C_LGORT.
*Fetching Data From VBBE Table Into Internal Table VBBE
SELECT MATNR
VBELN
VBTYP
OMENG
FROM VBBE
INTO TABLE LT_VBBE
FOR ALL ENTRIES IN LT_EBAN_TEMP
WHERE MATNR = LT_EBAN_TEMP-MATNR
AND WERKS = C_WERKS1
AND LGORT = C_LGORT.
ENDIF.
LT_VBBE_TEMP[] = LT_VBBE[].
SORT LT_VBBE_TEMP BY MATNR.
LOOP AT LT_EBAN INTO WA_EBAN.
WA_FINAL-BANFN = WA_EBAN-BANFN.
WA_FINAL-BNFPO = WA_EBAN-BNFPO.
WA_FINAL-MATNR = WA_EBAN-MATNR.
WA_FINAL-MENGE = WA_EBAN-MENGE.
READ TABLE LT_MVKE INTO WA_MVKE WITH KEY MATNR = WA_EBAN-MATNR.
IF SY-SUBRC = 0.
WA_FINAL-MVGR4 = WA_MVKE-MVGR4.
ENDIF.
READ TABLE LT_MARD INTO WA_MARD WITH KEY MATNR = WA_EBAN-MATNR.
IF SY-SUBRC = 0.
WA_FINAL-LABST = WA_MARD-LABST.
L_LABST = WA_MARD-LABST.
ENDIF.
LOOP AT LT_VBBE_TEMP INTO WA_VBBE_TEMP WHERE MATNR = WA_EBAN-MATNR AND VBTYP = 'J'.
AT END OF MATNR.
SUM.
WA_FINAL-QTYDEL = WA_VBBE_TEMP-OMENG.
L_MENGE = WA_VBBE_TEMP-OMENG.
ENDAT.
ENDLOOP.
LOOP AT LT_VBBE_TEMP INTO WA_VBBE_TEMP WHERE MATNR = WA_EBAN-MATNR AND VBTYP = 'C'.
AT END OF MATNR.
SUM.
WA_FINAL-QTYORD = WA_VBBE_TEMP-OMENG.
L_MENGE = WA_VBBE_TEMP-OMENG.
ENDAT.
ENDLOOP.
L_AVAILQTY = L_LABST - L_MENGE - L_QTYORD.
WA_FINAL-AVAILQTY = L_AVAILQTY.
IF L_AVAILQTY GT WA_EBAN-MENGE.
WA_FINAL-CHECKBOX = 'X'.
ELSE.
WA_FINAL-CHECKBOX1 = 'X'.
ENDIF.
COLLECT WA_FINAL INTO LT_FINAL.
ENDLOOP.
REFRESH : LT_FIELDCAT.
*Preparing Fieldcat
PERFORM BUILD_FIELDCAT.
IF LT_EBAN IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IT_FIELDCAT = LT_FIELDCAT
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = LT_FINAL.
IF SY-UCOMM = 'BACK' OR SY-UCOMM = 'EXIT' OR SY-UCOMM = 'CANCEL'.
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
FREE : LT_EBAN.
*FORM BUILD_FIELDCAT
FORM BUILD_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'BANFN'.
WA_FIELDCAT-SELTEXT_M = TEXT-001.
WA_FIELDCAT-OUTPUTLEN = 15.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'BNFPO'.
WA_FIELDCAT-SELTEXT_M = TEXT-002.
WA_FIELDCAT-OUTPUTLEN = 12.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-SELTEXT_M = TEXT-003.
WA_FIELDCAT-OUTPUTLEN = 10.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MENGE'.
WA_FIELDCAT-SELTEXT_M = TEXT-004.
WA_FIELDCAT-OUTPUTLEN = 10.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MVGR4'.
WA_FIELDCAT-SELTEXT_M = TEXT-005.
WA_FIELDCAT-OUTPUTLEN = 10.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'LABST'.
WA_FIELDCAT-SELTEXT_M = TEXT-006.
WA_FIELDCAT-OUTPUTLEN = 15.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'QTYDEL'.
WA_FIELDCAT-SELTEXT_M = TEXT-007.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-EDIT = ' '.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'QTYORD'.
WA_FIELDCAT-SELTEXT_M = TEXT-008.
WA_FIELDCAT-OUTPUTLEN = 14.
WA_FIELDCAT-EDIT = ' '.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'AVAILQTY'.
WA_FIELDCAT-SELTEXT_M = TEXT-009.
WA_FIELDCAT-OUTPUTLEN = 12.
WA_FIELDCAT-EDIT = ' '.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'CHECKBOX'.
WA_FIELDCAT-SELTEXT_M = TEXT-010.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-CHECKBOX = 'X'.
WA_FIELDCAT-EDIT = 'X'.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'CHECKBOX1'.
WA_FIELDCAT-SELTEXT_M = TEXT-011.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-CHECKBOX = 'X'.
WA_FIELDCAT-EDIT = 'X'.
*Filling The Fieldcatalog
APPEND WA_FIELDCAT TO LT_FIELDCAT.
CLEAR : WA_FIELDCAT.
ENDFORM. " BUILD_FIELdcat
*& Form SET_PF_STATUS
text
FORM SET_PF_STATUS USING EXCLUDETAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZSTA' EXCLUDING EXCLUDETAB.
ENDFORM. "SET_PF_STATUS
*& Form HANDLE_USER_COMMAND
text
FORM HANDLE_USER_COMMAND USING FU_UCOMM LIKE SY-UCOMM
FU_SELFIELD TYPE SLIS_SELFIELD.
DATA : REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
CASE FU_UCOMM.
WHEN '&RELEASE'.
CLEAR GT_SELECTED.
REFRESH GT_SELECTED.
to reflect the data changed into internal table
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA.
ENDIF.
WHEN '&IC1'.
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA.
ENDIF.
READ TABLE LT_FINAL INTO WA_FINAL INDEX FU_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
CASE FU_SELFIELD-FIELDNAME.
WHEN 'CHECKBOX'.
IF WA_FINAL-CHECKBOX = ' ' AND WA_FINAL-CHECKBOX1 = 'X'.
WA_FINAL-CHECKBOX = 'X'.
WA_FINAL-CHECKBOX1 = ' '.
MODIFY LT_FINAL FROM WA_FINAL INDEX FU_SELFIELD-TABINDEX TRANSPORTING CHECKBOX CHECKBOX1.
ELSEIF WA_FINAL-CHECKBOX = 'X' AND WA_FINAL-CHECKBOX = ' '.
WA_FINAL-CHECKBOX = ''.
WA_FINAL-CHECKBOX1 = 'X '.
MODIFY LT_FINAL FROM WA_FINAL INDEX FU_SELFIELD-TABINDEX TRANSPORTING CHECKBOX CHECKBOX1.
ENDIF.
WHEN 'CHECKBOX1'.
IF WA_FINAL-CHECKBOX1 = ' ' AND WA_FINAL-CHECKBOX = 'X'.
WA_FINAL-CHECKBOX = ' '.
WA_FINAL-CHECKBOX1 = 'X'.
MODIFY LT_FINAL FROM WA_FINAL INDEX FU_SELFIELD-TABINDEX TRANSPORTING CHECKBOX CHECKBOX1.
ELSEIF WA_FINAL-CHECKBOX = 'X' AND WA_FINAL-CHECKBOX1 = ' '.
WA_FINAL-CHECKBOX = 'X'.
WA_FINAL-CHECKBOX1 = ''.
MODIFY LT_FINAL FROM WA_FINAL INDEX FU_SELFIELD-TABINDEX TRANSPORTING CHECKBOX CHECKBOX1.
ENDIF.
FU_SELFIELD-REFRESH = 'X'.
ENDCASE.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND -
ADF master-detail master selection not updating detail tables properly
Hi All,
I am using JDev version : 11.1.2.0.0
I created new Fusion Web Application Module. In that module I created a master-detail data model and added them to a page fragment with a query panel. When I run it as a separate module, It works perfectly and Master selection correctly updates detail tables.
But when I integrate that module to another Fusion Application(Add application jar file to the Master Application libraries), Master-details master selection not updating detail tables properly. This problem occurred sequentially.
The problem is that.
After the page load, first selection of the Master Table works correctly and detail tables update correctly.
But second selection doesn't work, means detail table doesn't get update according to the Master table.
And again in the third selection works correctly.
This happens in a sequential manner. I monitor the behavior using Firebug. Observations are as follows,
When running correctly, Response of the Post Definition is
<?xml version="1.0" ?> <partial-response><changes><update id="pt1:t1"><![CDATA[<div tabindex="0" id="pt1:t1" class="xpa xpi" _leafColClientIds="['pt1:t1:c1','pt1:t1:c2','pt1:t1:c3','pt1:t1:c4','pt1:t1:c5','pt1:t1:c6','pt1:t1:c7','pt1:t1:c8','pt1:t1:c9','pt1:t1:c10','pt1:t1:c11','pt1:t1:c12','pt1:t1:c13']"><div id="pt1:t1::ch" style="overflow:hidden;position:relative;width:1365px;" _afrColCount="13" class="xz4"><table class="xz6" summary="This table contains column headers corresponding to the data body table below" id="pt1:t1::ch::t" style="position:relative;table-layout:fixed;width:1365px" cellspacing="0"><tr><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th></tr><tr><th id="pt1:t1:c1" _d_index="0" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c1::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">DateFormat</div></th><th id="pt1:t1:c2" _d_index="1" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c2::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">DefinisionId</div></th><th id="pt1:t1:c3" _d_index="2" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c3::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldId</div></th><th id="pt1:t1:c4" _d_index="3" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c4::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldLabel</div></th><th id="pt1:t1:c5" _d_index="4" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c5::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldLength</div></th><th id="pt1:t1:c6" _d_index="5" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c6::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldOffset</div></th><th id="pt1:t1:c7" _d_index="6" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c7::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldOrder</div></th><th id="pt1:t1:c8" _d_index="7" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c8::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldStatus</div></th><th id="pt1:t1:c9" _d_index="8" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c9::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldType</div></th><th id="pt1:t1:c10" _d_index="9" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c10::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">FieldTypeLen</div></th><th id="pt1:t1:c11" _d_index="10" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c11::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">IgnoreField</div></th><th id="pt1:t1:c12" _d_index="11" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c12::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">IsMandatory</div></th><th id="pt1:t1:c13" _d_index="12" _afrLeaf="true" _afrRoot="true" align="left" class="xz7"><div style="position:relative; float:right"><table id="pt1:t1:c13::afrSI" _afrHoverable="true" style="display:none" class="xzs" cellpadding="0" cellspacing="0"><tr><td _afrSortAsc="1"><a tabIndex="-1" class="xza" title="Sort Ascending"></a></td><td _afrSortDesc="1"><a tabIndex="-1" class="xzb" title="Sort Descending"></a></td></tr></table></div><div class="x19d">RecordType</div></th></tr></table></div><div id="pt1:t1::db" class="xyx" style="position:relative;width:100%;overflow:hidden" _afrColCount="13"></div><div id="pt1:t1::sm" class="xzt" style="position:absolute;display:none"></div><div id="pt1:t1::ri" class="xyz" style="position:absolute;display:none;overflow:hidden"></div><div id="pt1:t1::dataW" style="display:none"></div></div>]]></update><update id="f1::postscript"><![CDATA[<span id="f1::postscript"><span id="f1::postscript:st"><input type="hidden" name="javax.faces.ViewState" value="!-75cc188st"></span></span>]]></update><update id="d1::iconC"><![CDATA[<span id="d1::iconC" style="display:none"><span id="af_table::disclosed-icon"></span><span id="af_table::undisclosed-icon"></span></span>]]></update><update id="javax.faces.ViewState"><![CDATA[!-75cc188st]]></update><eval><![CDATA[AdfPage.PAGE.__handleRichResponseAction('/MillenniumCSD-ViewController-context-root/faces/FileDefinition?_adf.ctrl-state=cmpl0ptfg_7');]]></eval><eval><![CDATA[AdfPage.PAGE.sendStreamingRequest("pt1:t1");]]></eval><extension id="adf-script-library">/MillenniumCSD-ViewController-context-root/afr/partition/gecko/default/opt/dnd-SHERMAN-1147.js</extension><extension id="adf-script-library">/MillenniumCSD-ViewController-context-root/afr/partition/gecko/default/opt/nav-SHERMAN-1147.js</extension><extension id="adf-script-library">/MillenniumCSD-ViewController-context-root/afr/partition/gecko/default/opt/menu-SHERMAN-1147.js</extension><extension id="adf-script-library">/MillenniumCSD-ViewController-context-root/afr/partition/gecko/default/opt/table-SHERMAN-1147.js</extension><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/JarLoaderPages/jquery-1.7.1.min.js');</eval><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/JarLoaderPages/dis_contx.js');</eval><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/js/floating_bar_bottom.js');</eval><eval>if(self.window.name != "MillenniumDepository"){ self.location = "mcsd.html"; }</eval><eval><![CDATA[AdfDhtmlLookAndFeel.addSkinProperties({"af|table-tr-column-scroll-animation-duration":"300","af|table-tr-column-reorder-animation-duration":"600","af|table-tr-hover-highlight-row":"true"});AdfPage.PAGE.addComponents(new AdfRichTable('pt1:t1',{'rowSelection':'single','rowBandingInterval':0,'editingMode':'none','afrSelListener':true}),new AdfRichColumn('pt1:t1:c1',{'sortProperty':'DateFormat','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c2',{'sortProperty':'DefinisionId','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c3',{'sortProperty':'FieldId','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c4',{'sortProperty':'FieldLabel','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c5',{'sortProperty':'FieldLength','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c6',{'sortProperty':'FieldOffset','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c7',{'sortProperty':'FieldOrder','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c8',{'sortProperty':'FieldStatus','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c9',{'sortProperty':'FieldType','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c10',{'sortProperty':'FieldTypeLen','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c11',{'sortProperty':'IgnoreField','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c12',{'sortProperty':'IsMandatory','sortable':true,'minimumWidth':12,'rowHeader':false}),new AdfRichColumn('pt1:t1:c13',{'sortProperty':'RecordType','sortable':true,'minimumWidth':12,'rowHeader':false}));AdfPage.PAGE.__recordSessionTimeout(1800000, 120000, "http://127.0.0.1:7101/MillenniumCSD-ViewController-context-root/faces/FileDefinition");AdfPage.PAGE.__initPollingTimeout(600000);AdfPage.PAGE.clearMessages();AdfPage.PAGE.clearSubtreeMessages('pt1:t1');AdfPage.PAGE.clearSubtreeMessages('pt1:resId1');]]></eval></changes></partial-response>
When not running correctly, Response of the Post Definition is
<?xml version="1.0" ?> <partial-response><changes><update id="f1::postscript"><![CDATA[<span id="f1::postscript"><span id="f1::postscript:st"><input type="hidden" name="javax.faces.ViewState" value="!-75cc188st"></span></span>]]></update><update id="javax.faces.ViewState"><![CDATA[!-75cc188st]]></update><eval><![CDATA[AdfPage.PAGE.__handleRichResponseAction('/MillenniumCSD-ViewController-context-root/faces/FileDefinition?_adf.ctrl-state=cmpl0ptfg_7');]]></eval><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/JarLoaderPages/jquery-1.7.1.min.js');</eval><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/JarLoaderPages/dis_contx.js');</eval><eval>AdfPage.PAGE.addResource('javascript','/MillenniumCSD-ViewController-context-root/js/floating_bar_bottom.js');</eval><eval>if(self.window.name != "MillenniumDepository"){ self.location = "mcsd.html"; }</eval><eval><![CDATA[AdfPage.PAGE.__recordSessionTimeout(1800000, 120000, "http://127.0.0.1:7101/MillenniumCSD-ViewController-context-root/faces/FileDefinition");AdfPage.PAGE.__initPollingTimeout(600000);AdfPage.PAGE.clearMessages();AdfPage.PAGE.clearSubtreeMessages('pt1:t1');AdfPage.PAGE.clearSubtreeMessages('pt1:resId1');]]></eval></changes></partial-response>
I could not figure out what went wrong when integrating to another module.
Can you please help me to rectify this problem.
Thanks
dkHi,
sound to be an implementation specific issue that is hard to comment on without knowing how to reproduce it. If you have a rerooducible test case based on the Oracle HR schema using JDeveloper 11.1.1.6, zip it up, rename the "zip "extension to "unzip" and sent it to the mail address you find in my OTN profile. If you don't have that test case, explain how this can be reproduced
Frank -
Hi Abapers,
What is the diff b/w Select single * from.... and select * ...up to 1 row.
Thanks in advance.
Subbu.Select SINGLE...
SINGLE
The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
... UP TO n ROWS
Effect
The set of results is restricted to a maximum of nrows.
Example
To output a list of the 3 business customers with the greatest discount:
DATA WA_SCUSTOM TYPE SCUSTOM.
SELECT * FROM SCUSTOM INTO WA_SCUSTOM UP TO 3 ROWS
WHERE CUSTTYPE = 'B'
ORDER BY DISCOUNT DESCENDING.
WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME, WA_SCUSTOM-DISCOUNT.
ENDSELECT.
Notes
If you use an UP TO n ROWS addition in an ORDER-BY clause , the lines read are sorted into the correct order. The first n lines are then displayed. The system may need to read more than n lines from the database to be able to do this.
If n = 0, all selected lines are displayed.
n < 0 results in a runtime error.
<b>Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS</b>
A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
<b>So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?</b>
If you're considering the statements
SELECT SINGLE field INTO w_field FROM table.
and
SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
Why is this ?? The answer is simple.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Get the difference ??
If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
Then run the program shown below:
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
You should see the output:
Select single: 000001
Up to 1 rows : 000010
The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !!
Message was edited by:
Judith Jessie Selvi -
Difference between Select * and Select single ?
difference between Select * and Select single ?
HI,
DATA : IT TYPE TABLE OF MARA,
WA TYPE MARA.
Here it selects all the record and keeps in internal table it.
Select * from mara into corresponding fields of table <b> it</b>.
Here it slects only one record that to first record.
If you wnat any specific record then use where condition.
Select single * from mara into corresponding fields of <b>wa</b>.
Message was edited by:
Purshothaman P -
ABAPer's ,
Does anyone can guide me to select single row only in ALV grid , without OO.Hello,
I did not get u.
But check the below code it may help u.
tables: mara.
TYPE-POOLS: SLIS.
data:repid like sy-repid.
data: itb type mara occurs 0 with header line,
IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
selection-screen begin of block b.
parameters: p_matnr type matnr.
selection-screen end of block b.
select * from mara into table itb where matnr = p_matnr.
SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
I_STRUCTURE_NAME = 'MARA'
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itb
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CLEAR IT_FIELDCAT[].
IF RS_SELFIELD-FIELDNAME = 'MATNR'.
READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
WRITE: / ITB1-MAKTX.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
Regards
Maybe you are looking for
-
Can anyone help?! Please... :)
Hello Everyone! Just wondering if anyone can help me with something...so, i should say i am pretty much completely new to this whole "Apple" phase...literally! i don't and have never owned an iPhone but about 6 months ago i was going overseas and dec
-
How do I make a 3-d rotating text in Flash cs4?
Hi, Thunder BoomCat PowWow here. I'm a student in this Virtual Enterprise class and am in charge of learning flash and making a kick-butt commercial for our firm: Uncommon Ground. I was wanted to make some text rotate AROUND a sphere in flash (the sp
-
I updated and it iTunes won't recognize my iPhone
It says IMEI: 01 174200 347866 0 and to connect iPhone to iTunes... I did...!!! And it won't recognize it!
-
Windows Roles & Features "error" issue.
Hi, I have a virtual server windows 2008 R2 Standard ed. it was working fine earlier. Now I had a task to install .net framework 4.5 and MSMQ on this server. When I tried to install, I found Roles & Feature option in Server manager displays "error" a
-
i have a macbook pro 2011 and one of the USB ports doesnt work