How to Select each check box values in a group of records
Hi,
I have a requirement in forms 10g. In that form there are 10 records are displaying each record has one check box is there if i click the check box on record number one and record number three and do some changes in the text field(adjustment field is number data type) then finally I want to see the total on one field called total amount.
In this my question is how to select particular records in a group of records? and finally these selected records are inserted into one table.
Because I am not able to fetch these records at a time.
Is there any Array to define a record group to fetch each of them individually for example Rec[1],Rec[2]...like that if yes please suggest me the steps how to do this.
Thanks in advance
Prasanna
Edited by: user10315107 on Dec 17, 2008 11:44 PM
I'm sorry, but i didn't get your requirement in detail.
Do you want to do the summing of the selected records in forms ? Or do you just want to know which records are selected and then process them?
If you want to process the selected records in sql you could use an object-type to store the list of id's (of whatever primary key you use), loop over the block to fill it, and then afterwards process them.
For this approach, first create an object-type in the database:
CREATE OR REPLACE TYPE ID_LIST AS TABLE OF NUMBER;
/Then, in forms you could do something like this to fill a list of id's:
DECLARE
lIds ID_LIST:=ID_LIST();
BEGIN
GO_BLOCK('MYBLOCK');
FIRST_RECORD;
LOOP
EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
IF :BLOCK.CHECKBOXITEM="CHECKEDVALUE" THEN
lIds.EXTEND(1);
lIds(lIds.COUNT):=:BLOCK.PRIMARYKEYITEM;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
-- Now you can use the object-list in SQL like :
INSERT INTO MYNEWTABLE (cols..)
SELECT (cols..)
FROM MYOLDTABLE
WHERE ID IN (SELECT COLUMN_VALUE FROM TABLE(lIds));
END;Edited by: Andreas Weiden on 18.12.2008 18:17
Similar Messages
-
How to select the check box automatically
Hi All,
I'm using forms 6i.I have 3 check boxes.If i Select the 2nd and 3rd check box then the fist check box should be selected automatically.The 2nd and 3rd check boxes are mutliarray block attached to each other while the !st check box is not attached to them. while Can someone please tell me how to write the code for this?
With Regards,
Gowtham
Message was edited by:
Gowtham1232
Message was edited by:
Gowtham1232It's not very clear, but I think that having a WHEN-CHECKBOX-CHANGED trigger on checkbox2 and checkbox3 that says
IF :checkbox2 = 'Y' and :checkbox3 = 'Y' THEN
:checkbox1 := 'Y';
ELSE
:checkbox1 := 'N';
END IF;assuming 'Y' is the checked value of each checkbox and 'N' the unchecked. -
How to get dynamic check box value in NW Mobile 7.1
Hi,
i have 5 rows it contains dropdown and checkbox in a row.when i click update button i need the values of checkbox.How to get?
Regards,
Kanagaraj.Hi Vidyadhar,
I have dropdown in first page.based ondropdown value selected navigating to next page.In that i am using row repeater it has label,checkbox and dropdown.here i need to know whether the check box is checked or not while clicking update button.
Drow down value also not able to get.
How to get Checkbox and dropdown values?
can u provide some sample codes??
Regards,
Kanagaraj. -
How to select One Check Box at a time
Dear All
I have 10 records in details blok and also I have 10 check boxes .
I want user can only check one check box at a time .
For example If first record I have checked and i am trying to check the last record then the first record UNCHECKED and the last record will checked .
Like how redio buttons work ..
How can i do that ..?
I have done like this :-
1st I have declare a global variable in PRE_FORM :GLOBAL.CNT := 'N';
Then
WHEN-CHECKBOX-CHANGED trigger
IF CHECKBOX_CHECKED(EMP.CHK') THEN
IF :GLOBAL.CNT != N THEN
:EMP.CHK := Null
HERE what to write ???
RAISE FORM_TRIGGER_FAILURE;
ELSE
:GLOBAL.CNT := Y;
END IF;
ELSE
:GLOBAL.CNT := N;
END IF;Edited by: LuKKa on Aug 29, 2012 1:12 PM
Edited by: LuKKa on Aug 29, 2012 1:13 PMLuKKa,
An easier method would be to use a Calculated Field to summarize the value of your CHECKBOX Item. For example, add a non-table item (call it SUM_CHECKED) to your detail block and do not assign it to canvas - so it will not be displayed. Then set the following properties of the SIM_CHECKED item:
Database Item = No
Calculation Mode = Summary
Summary Function = Sum
Summarized Block = <YOUR DETAIL BLOCK>
Summarized Item = <YOUR CHECKBOX ITEM>
Next, you will need to change your Detail Block property Query All Records to YES (this is required for the Calulated Item).
Now, make sure your checkbox is data type NUMBER and has the following minimum properties set:
Data Type = Number
Maximum Length = 1
Initial Value = 0
Value when Checked = 1
Value when Unchecked = 0
Check Box Mapping of Other Values = Not Allowed or Unchecked
Now, in your Checkbox Item's When-Checkbox-Changed trigger add code similar to this:
IF ( CHECKBOX_CHECKED('YOUR_DETAIL_BLOCK.YOUR_CHECKBOX_ITEM') ) THEN
IF ( :YOUR_DETAIL_BLOCK.SUM_CHECKED > 1 ) THEN
--Reset the checkbox
:YOUR_DETAIL_BLOCK.YOUR_CHECKBOX_ITEM := NULL;
MESSAGE('You can only check one item.');
Message(' ');
RAISE Form_Trigger_Failure;
END IF;
END IF;I have confirmed this method works and it is more efficient than looping through your records to see if other checkboxes are checked.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
How to read the check box value in alv report
hi experts,
i m working on one alv report where i m using the check box for field selection in alv display.
but i don't know how to read the only selected fields.
wa_fieldcat-fieldname = 'BOX'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Box'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AUFNR'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Sales Doc'.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = i_fieldcat[]
i_save = 'A'
it_events = v_events
TABLES
t_outtab = it_header
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
when '&RELEAS'.
endcase
endform.
i gone through some already posted que for same problem i tried options like
loop at it_header.
endloop.
but i m getting box field empty.
is there i missed something? plz sugeest.. if u have any other solution plz post...Have this code in your user command fm:
* For capturing changed data
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = w_grid.
CALL METHOD w_grid->check_changed_data
IMPORTING
e_valid = w_valid.
IF w_valid = 'X'.
loop at itab where mark = 'X'.
endloop.
ENDIF.
Regards,
Ravi -
How to pass the check box values from one view to another view
Hi Experts,
I have a selection screen view which consists of check boxes.
WBS System status.
Release Completed Closed as 3 check boxes.
Note : The above ones are check boxes.
Based on the selection made by the user, those values needs to be passed to second view which retrieves the data and
displays the data accordingly.
At the same time if the user does not make any selection, then WBS System status should contain Released, Completed and Closed values and that needs to be sent to Second view.
Kindly advise.
Regards,
Chitrasenhi ,
make a attribute of type WDY_BOOLEAN to achieve this functionality
u need to follow these steps :
1 in side ur component controller , under the ATTRIBUTES tab , make 3 attributes say attr1 , attr2 and attr3 of type WDY_BOOLEAN
2 create a context node , cn_check and 3 context attribute ca_check1 , ca_check2 and ca_check3 in ur first view for
release , complete and close check boxes
3 inside the DOINIT of ur 1st view , set the attributes attr1 , attr2 and attr3 to blank
wd_comp_controller->attr1 = ' '
wd_comp_controller->attr2 = ' '
wd_comp_controller->attr3 = ' '
4 inside the method , where u r validating , if the check boxes are checked or not , read the attributes ca_check1 , ca_check2 and
ca_check3
DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
DATA ls_cn_check TYPE wd_this->element_cn_check.
DATA lv_ca_check1 LIKE ls_cn_check-ca_check1.
* navigate from <CONTEXT> to <CN_CHECK> via lead selection
lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
* get element via lead selection
lo_el_cn_check = lo_nd_cn_check->get_element( ).
* get single attribute
lo_el_cn_check->get_attribute(
EXPORTING
name = `CA_CHECK`
IMPORTING
value = lv_ca_check1 ).
IF lv_ca_check1 EQ 'X' .
wd_comp_controller->attr1 = ' X'
wd_comp_controller->attr2 = 'X '
wd_comp_controller->attr3 = ' X' -
How to disbale a group of checkboxes when i select one check box WEBDYNPRO
Hi Friends,
Can any body help me how to disbale a group of checkboxes when i select one check box WEBDYNPRO Abap
Also can any body tell me how to handle chain endchain type of scenario in WEBDYNPRO Abap
Thank you..
SaiHi
In the context tab , create 2 context attributes ca_attr1 and ca_attr2 of type WDY_BOOLEAN under a context node cn_node
now in ur Layout , bind the ENABLE property of CheckBoxGroup UI Element with this attribute ca_attr1
bind the ENABLE property of CheckBox UI Element with this attribute ca_attr2
create a action for ur Checkbox , for the OnToggle property of ur checkbox
in OnactionToggle , check if ca_attr2 is 'X' , set ca_attr2 to ' ' ( for disable)
this can be done by code wizard , press control +f7 and use read/set context attributes , use get_attribute and set_attribute methods
// if ca_attr2 is 'X'
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr2.
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* get single attribute
lo_el_cn_node->get_attribute(
EXPORTING
name = `CA_ATTR2`
IMPORTING
value = lv_attr ).
// if lv_attr2 is 'X' , use set_attribute method for ca_attr1
IF lv_Attr EQ 'X' .
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr.
* navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* set single attribute
lo_el_cn_node->set_attribute(
EXPORTING
name = `CA_ATTR1`
value = ' ').
ENDIF.
regards,
amit -
How to get a check box on the selection screen
Hi all
can any body tell me how to get a check box on the selection screenparameter: pa_check as checkbox.
To define the input field of a parameter as a checkbox, you use the following syntax:
PARAMETERS <p> ...... AS CHECKBOX ......
Parameter <p> is created with type C and length 1. In this case, you may not use the additions TYPE and LIKE. Valid values for <p> are ' ' and 'X'. These values are assigned to the parameter when the user clicks the checkbox on the selection screen.
If you use the TYPE addition to refer to a data type in the ABAP Dictionary of type CHAR and length 1 for which 'X' and ' ' are defined as valid values in the domain, the parameter automatically appears as a checkbox on the selection screen.
REPORT DEMO.
PARAMETERS: A AS CHECKBOX,
B AS CHECKBOX DEFAULT 'X'. -
How to insert check box value in table?
Hi all
kindly help me how to insert check box value in database. what code i have to use as i am new in programing.
thanx in advanceHi,
There is no "Check box" in a table, a check box is a GUI (Graphical user interface) item.
What you want is to store a boolean value in a table. For that you can use the varchar2(1) datatype and store Y or N. (or anything else)
(you cannot define boolean as a datatype for a column).
If you're using a front-end application like apex then it might be useful for you to read the documentation about chekc boxes :
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/check_box.htm#CHDDFBFH
(for the rest if it's Oracle Forms then everything is already said).
Edited by: user11268895 on Aug 17, 2010 10:44 AM -
How to find the check box selected while using Class in ALV grid display
hi,
I am displaying the ALV report using Class
For Example: CALL METHOD MYGRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME = 'ACC1'
IS_VARIANT = GS_VARIANT
I_SAVE = 'A' "XSAVE
IS_LAYOUT = LOUT
CHANGING IT_FIELDCATALOG = IT_FIELD
IT_OUTTAB = ACC_NO[].
In output i am getting 10 customer with check box, how do i find that customer number is selected.HI,
Once user selects a check box, he would CLICK on a button ( say PROCESS )inorder to do the processing for the selected records. So in the PAI, under the EVENT ( OK CODE ) of the Button ( say PROCESS ), write the following code.
CALL METHOD MYGRID->check_changed_data.
Now,
Loop at acc_no where check = `X`.
Do the processing.
endloop.
Best regards,
Prashant -
How to disable one check box when another is checked
Hi, I'm a first time user.
i am trying to make text fields appar and dissapaer when check boxes are ticked. but only alow one check box to be active at one time.
I am making a simple form in Acrobat pro 9,
I have two check boxes Checkbox1 & Checkbox2.
I have two text fields Textfield1 & Textfield2
i have added actions to checkbox1 & checkbox2 to 'hide or show' the text fields.
Action --> on focus (checkbox1) show/hide field (textfield1) is hide
Action --> on focus (checkbox1) show/hide field (textfield2) is show
oposite
Action --> on focus (checkbox2) show/hide field (textfield2) is hide
Action --> on focus (checkbox2) show/hide field (textfield1) is show
problem 1 - how to disable checkbox1 when checkbox 2 is ticked.
or disable checkbox2 when checkbox1 is ticked.
my other problem is that this action has the same effect for ticking or unticking the checkbox.
thanks in advance to anyone who can help.
can you please write your answer in simple terms. Basically this is the first time i have used acrobat pro so please dont assume any knowledge at all. thansk very much .First, I would experiment with just check boxes and learn their properties and how they can interact.
Have you tried using the same name for 2 check boxes and assign a different "export value" to each check box.
Have you looked at the values a check box or boxes have when checked or un-checked?
Have you looked at how the various actions for a field work? -
Accessing check box values in to WF
Hi guys,
i am looping through a list to create simple table with some check boxes ( <FieldLoop for='loopvar' in='variables.apps[*]'> ). i have specified checkbox field name - as "loopvar"
<Field name='loopvar'>
<Display class='Checkbox'>
<Property name='label'>
<ref>loopvar</ref>
</Property>
</Display>
</Field>
how shud i pull / get the list of chek boxes selected on the userform in to WF? will the form return a list? and how shud be the name field syntax shud i use a ":varibales."? im confused. please guide me with the best practice to declare and access check box values
Edited by: tea_or_kapi on Nov 20, 2009 10:44 PMHi Raju,
Try this. Create another dataprovider within your web template? This new dataprovider refers to a similar query, but this query definition should restrict values CG1, CG2, CG3 and CG4. Assign this dataprovider to your checkbox. Then make sure the properties of the checkbox affect all other dataproviders.
Also, if this list is static, you could create an HTML checkbox object coding the options (cg1, cg2, cg3, and cg4) programmatically. Then add javascript code to produce the proper filtering based on the users' selections.
Let me know what happens.
Larry -
"Always Use Selected Format" check box in line items report
Hi Experts,
I have an issue in ECC 6.0.
From the transaction code FBL1N (Vendor Line Items) I am trying to export the report to spreadsheet by selecting the option List> Export>Spreadsheet then I have selected "Always Use Selected Format" check box. But if I execute the same report again I am not getting this option "Always Use Selected Format". Please let me how can we retrieve that option. Is there any possibility to get that option again either functionally or technically. I would like to know all the possible ways to get this option again.
Please do the needful.Hello,
In one my thread Mr. Frank has replied as follows. I believe he has solved this.
Hope this may be really helpful.
The problem with the spreadsheet download is at one point, users have selected their default file type.
That said, SAPGUI is working as it should. (gui710)
Question though is how do we reset the values so they get the ?Select Spreadsheet Format? popup again.
The following steps should be performed :
- Call transaction SE38, enter program SALV_BS_ADMIN_MAINTAIN, and press F8.
- Follow the parameters below :
- Select ?DELETE? on the Actions Group
- Select ?DETAILED SELECTION? on the General Data :
- On Client - your number
- User : <user name>
-Hit EXECUTE.
-Press ENTER on the POPUP
- If there is an entry in the report that will need to be deleted. Also, make sure that the entry you will delete (for the user) has a value of GUI_ALV_XML_VER on field ?Parameter? .
- Select the line and hit the DELETE icon .
- Press ?Y? to continue delete. Press ENTER on the popup.
- Then EXIT all the way out of the program.
NOTE : When you run program SALV_BS_ADMIN_MAINTAIN, make sure they are out of any program that they are using for download.
Re: "Always Use Selected Format" check box in line items report
Regards,
Ravi
Edited by: Ravi Sankar Venna on May 15, 2009 2:31 PM -
Dynamic selection of check boxes on selecting a check box
Hi Friends,
I have to select the check boxes which are herarchically lower to a top check box,dynamically.
Eg:
Checkbox1
checkbox2
checkbox3
so if i select check box 1, on the screen both checkbox2 and checkbox3 have to be selected.
I did like below.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_ALL = 'X'.
P_VAT = 'X'.
P_NAME = 'X'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
but values are checked but on screen its not checked.
how to handle this.
Regards,
Simhahi
do like this
paramenter: check_1 type c as check box at user-command ,
check_2 type c as checkbox default X,
check_3 type c as checkbox default X.
At selection Sreen output
if check_1 = 'X'.
loop at screen .
if screen-name = 'check_2'.
screen-invisible = '0'.
endif.
endloop.
loop at screen .
if screen-name = 'check_3'.
screen-invisible = '0'.
endif.
endloop.
else
loop at screen .
if screen-name = 'check_2'.
screen-invisible = '1''.
endif.
endloop.
loop at screen .
if screen-name = 'check_3'.
screen-invisible = '1'.
endif.
endloop.
endif.
this solve ur problem
Cheers
Snehi -
Uncheck one check box when we select other check boxes
Hi All,
This might be very simple question for experts. I just want to unselect one check box (this check box is to select 'ALL' and this will be selected by default) when we select any other check box (for individual categories) on same region. Can any one please suggest me how to implement this?
Thanks in advance.
Regards,
HariHi Shijesh,
Thanks for you reply.
I'm using two items (check boxs), like P1_ALL and P1_TEST. I want to unselect P1_ALL when we select P1_TEST check box.Both the check boxes contains single value in List of values. For this I wrote script like
<script type="text/javascript">
function uncheckAll(pthis)
elm = document.getElementsByName('P1_ALL');
if(pthis.checked)
elm.checked = false;
</script>
And in HTML form element attribute of P1_TEST, I have 'onclick=uncheckAll(this)'. But for some reason when I select 'P1_TEST', P1_ALL check box not getting un-selected.
I would be grateful if you suggest what needs to correct in this one.
Regards,
Hari
Maybe you are looking for
-
How can I see the size and colour of text in DW Cs5?
Hi forum, how do you see the size and colour of a piece of text in Dreamweaver Cs5, I have some text in a dreamweaver file which is a size I like and a colour I like and I want to make a CSS rule with these characteristics. How can you see what size
-
in a serachable dictionnary ( old greek-English) in pdf format the search function works when entering English words but not when entering greek words using the polytonic Greek keyboard from Windows. Why ? Is there a solution to search for Greek word
-
Insert flex component in flash .fla file
hello, Is it possible to dynamically load a flex component, compiled as a swf file into a .fla file. Originally, this flex component can be loaded as a standalone flex application with parameters to connect to the appropriate server. But now a custom
-
How to remove FaceTime from iPad
How to remove FaceTime from iPad
-
Hi. The code that is being run is : message 'check loads' type 'E'. I want it to not send out the message "check loads", but to display the information in the particular table fields and also log it. What would be the syntax to post the data for a p