Multiple Record Selection through Check Boxes
Using 10g Forms. I have a tabular data block with 10 record displayed one item is a checkbox. each check box has diffrent id like (1,2,3,....) now with a button press i want to get all the records checked (or selected).
i always get last check box value etc :(
Thanx in advance
Hello,
You have to loop through your records:
go_block('the_block');
Fisrt_record;
Loop
-- check the checkbox value ;
exit when :system.last_record = 'TRUE' ;
next_record ;
End loop;
First_record;
...Francois
Similar Messages
-
Updation/insertion of multiple records simultaneously using check box
Hi,
I am using Jdev11.1.1.2.0 version. I have the following scenario.
There is a table in the view.At run time, I need to select multiple records and update those records in the database. So i took check Box as a column in the table.*(I did not associate check box to any of the attributes (columns) in the table.)* After running the application, I selected multiple records using checkbox and submitting them. The check box is returning value as 'false' even for the selected records also instead of 'true'. Because of this we are facing the issue in updating only the selected records. Please suggest your valuable inputs.
I have written the following code in the backing bean to get the selected rows.
BindingContainer bindings =BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIter= (DCIteratorBinding) bindings.get("PttDeliverabvleTrackerEOView2Iterator");
RowSetIterator depRSIter = dcIter.getRowSetIterator();
depRSIter.setRangeSize(depRSIter.getRowCount());
Integer key = depRSIter.getRowCount();
System.out.println("No of rows is "+ key);
int rowIndex =0;
for(int i =0; i<key; i++){
PttDeliverabvleTrackerEOViewRowImpl row = (PttDeliverabvleTrackerEOViewRowImpl) depRSIter.getRowAtRangeIndex(i);
System.out.println("Check box value2 "+ this.getSbc1().isSelected());
if(this.getSbc1().isSelected()){
rowIndex = i;
System.out.println("Row Index: "+ rowIndex);
Please let me know if it is it possible to associate a checkbox to any of the attributes while dragging and dropping the table in the view and update the records?
I tried selecting the option 'Row Selection' while dragging and dropping the table and changed the property RowSelection->multiple. But it is not serving the purpose of updating multiple records.
Please suggest if there is any other solution to update multiple records.
Regards,
Sreelatha.Hi,
if you added checkboxes to a table, then at runtime the checkbox is stamped, which means that a call to this.getSbc1().isSelected() just returns the state of the last checkbox that is rendered. I don't want to go into the details of ADF Faces table rendering here, but point yu to a blog article that does what you are aiming for using ADF BC: http://sameh-nassar.blogspot.com/2009/12/use-checkbox-for-selecting-multiple.html
Frank -
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 PMI'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 -
Enable to select a check box in ALV while accessing it through portal
Hi All,
Currently I have given a link on portal to run a transaction code. The output of the program is ALV report, where user any select the check boxes.
Now when I try to select a check box, it is not getting selected. I click on the checkbox, the tick appear and then the screen refreshes itself and the tick goes off. This is happening only when accessing it through portal. If i run the program in R/3 directly, I am able to select the check box.
Please advice on this.
Thanks
NamitReported to SAP for the same.
-
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 -
Re- Single click in the check box ensure to select all check boxes
Hi All,
I have an issue to notify the urgency of the cart to the buyer while creating the cart.For that scenario we have a check box in the Basic data of shopping cart.I added the check box in the basic data. Now the quote check box is available for all the line items.
The requestor can select any check box in any line items,so whenever he selects the check box- automatically all the check box should get selected , if any of the check box get deselected then imediatelely all the check box in different line items also should get deselected.Hi Batchu,
Thanks for your reply, See if you add any custom field it will come one by one in the basic data section. Adding one more check box doesnot work for this case.
Moreover the problem is change to any particular line item can be captured in DOC_CHANGE_BADI but i cannot bring the same change to all line items (ie) If 3 rd line item check box is marked then immediately rest of the line item also should get marked.
In the case of DOC_CHECK_BADI to identify the line on which the change happens is tough.
SO thats is the problem for me to bring the logic in the code.
Please if any one come across similar kind of issue please give your suggestion.
Thanks,
Sibi -
"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 -
Multiple Record (Selection) ASAP..
Hi,
I have 2 blocks which do have 4 rows displayed (Multiple Rows - no. of records to be diaplay = 5). Now from One Block which has 4 records in it along with check Box, whenevr I click on Check Box, that record or records has to be display in the other Block. User can either select one record or multiple records using Check Box.
I would be much thankful to u if u could revert me ASAP.
Thanx in advance
BhaveshDon't really understand your question but I gather that you want to know how to populate the 2nd block when you mark the checkbox in the 1st block ?
If this is the case, then I guess that you can create a WHEN-CHECKBOX-CHANGED trigger in the first block and inside the trigger, put in the logic that will move the cursor to the 2nd block, execute the query to populate the block and return back to the 1st block. -
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. -
Hi all,
I've a tabular database block that normally queries a large number of records, this block has the following items:
- col1
-col2
-chkbox : check box item.
my requirement is that whenevr i click the checkbox of any record i want all records thta have similar value in col1 to be checked as well, i can't navigate through all records because it'll cause flickering due to large number of records displayed, any solution?Hi,
what do you mean when you say "i can't navigate through all records because it'll cause flickering due to large number of records displayed, any solution"...
navigate by programmig code or manually?
A first solution could be add code to the WHEN-CHECK-BOX-CHANGED to check all values of all records programatically and updating the check-box item of each record if it applies...
Other solution could be do it in a temporary table/structure and "re-fill" the block once it is done... but of course..it would depend of the neture of your block... If it's based on database table..it won't be a good solution due to the possible changes made to the block...
Well.. they are just a few ideas... Hope it helps
Jose L. -
Multiple Inserts based on check box?
I have an insert form that depending on if checkboxes are
checked, inserts the data. How can I insert a record for the number
of check boxes checked?
Example:
CB 1 = Checked
CB 2 = Not Checked
CB 3 = Checked
So I need to insert a record for CB 1 and CB 3. How can I do
this?
What I'm doing is tying a sales lead to the sales man
selected. I'm using check boxes because I figured it was easiest
but I'm open to suggestions.In your example, CB 1 and CB 3 are checked. But your
explanation states you need to insert a record for CB 1 and CB 2.
What am I missing?
Keep in mind that you will not see the variable FORM.CB2,
since unchecked checkboxes to not pass their name to the action
page. Maybe the code below will help. By naming all the check boxes
the same, you receive a comma-delimited list of the values of only
the checked checkboxes. You can then put this in a list loop and
update your database. -
Selection using check box in std ALV grid!
Hi all,
I have written a custom report to show the O/p in ALV grid.
This is my code:
TABLES :zpo_loi.
TYPE-POOLS : slis.
TYPE-POOLS: icon.
TABLES : sscrfields.
DATA : ls_composer TYPE ssfcompop,
ls_control TYPE ssfctrlop.
DATA : wa_return TYPE TABLE OF bapiret2 ,
wa_address TYPE bapiaddr3.
DATA : wa_crmd_orderadm_h TYPE zpo_loi,
it_po TYPE TABLE OF crmd_orderadm_h,
wa_po TYPE bbp_pds_header.
DATA : it_tab TYPE TABLE OF zpo_loi.
DATA : it_data TYPE TABLE OF crmd_orderadm_h,
wa_data TYPE bbp_pds_header,
et_data TYPE bbps_sf_po_output.
DATA : w_formname TYPE tdsfname ,
w_sfname TYPE rs38l_fnam.
DATA :it_po_no TYPE TABLE OF select_be_obj_id,
wa_it_po_no LIKE LINE OF it_po_no.
DATA :r_itab TYPE ddshretval OCCURS 0.
DATA : it_output LIKE TABLE OF zloi,
wa_output TYPE zloi.
DATA : w_answer TYPE c.
DATA : g_repid LIKE sy-repid,
g_title TYPE lvc_title,
g_set_pf_stat TYPE slis_formname VALUE 'SET_PF_STATUS',
g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
g_layout TYPE slis_layout_alv,
g_print_alv TYPE slis_print_alv,
g_variant LIKE disvariant,
c_char_a(1) VALUE 'A',
c_char_x(1) VALUE 'X',
itab_alv_sort TYPE slis_t_sortinfo_alv,
itab_alv_fcat TYPE slis_t_fieldcat_alv.
* Internal tables Begin with IT_ *
DATA : it_fcat TYPE slis_t_fieldcat_alv, "---ALV
it_disp TYPE TABLE OF zloi.
* Work Area for Internal tables Begin with WA_ *
DATA : wa_fcat TYPE slis_fieldcat_alv , "---ALV
wa_layout TYPE lvc_s_layo, "---ALV
wa_it_disp LIKE LINE OF it_disp.
DATA : it_sf_po TYPE TABLE OF crmd_orderadm_h,
wa_sf_po TYPE bbp_pds_header.
*SELECTION-SCREEN:
* BEGIN OF SCREEN 500 AS WINDOW TITLE title,
* END OF SCREEN 500.
*DATA : functxt TYPE smp_dyntxt.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS sel_po FOR zpo_loi-zobject_id.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : pr_loi RADIOBUTTON GROUP grp1 USER-COMMAND ucom,
pr_fondo RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK b2.
* At selection-screen output *
AT SELECTION-SCREEN OUTPUT.
IF pr_fondo = 'X'.
REFRESH sel_po.
LOOP AT SCREEN.
IF screen-name = text-003 OR screen-name = text-004.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF pr_loi = 'X'.
LOOP AT SCREEN.
IF screen-name = text-003 OR screen-name = text-004.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
* At selection-screen on radiobutton *
AT SELECTION-SCREEN ON RADIOBUTTON GROUP grp1.
IF pr_fondo = 'X'.
REFRESH sel_po.
LOOP AT SCREEN.
IF screen-name = text-003 OR screen-name = text-004.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF pr_loi = 'X'.
LOOP AT SCREEN.
IF screen-name = text-003 OR screen-name = text-004.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_po-low.
PERFORM populate_table.
PERFORM f4_help.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_po-high.
PERFORM populate_table.
PERFORM f4_help.
* At selection-screen *
AT SELECTION-SCREEN.
*---CHECKING THE INPUT >>>
IF sy-ucomm = 'ONLI'.
PERFORM f002-check_input.
PERFORM f001-check.
ENDIF.
*& Form POPULATE_TABLE
* text
* --> p1 text
* <-- p2 text
FORM populate_table .
SELECT zobject_id
description
FROM zpo_loi
INTO CORRESPONDING FIELDS OF TABLE it_tab.
SORT it_tab BY zobject_id ASCENDING.
ENDFORM. " POPULATE_TABLE
*& Form F4_HELP
* text
* --> p1 text
* <-- p2 text
FORM f4_help .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = ' '
retfield = 'ZOBJECT_ID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'A'
value_org = 'S'
TABLES
value_tab = it_tab
return_tab = r_itab.
ENDFORM. " F4_HELP
*& Form F001-CHECK
* text
* --> p1 text
* <-- p2 text
FORM f001-check .
IF pr_fondo = 'X'.
PERFORM display_expiring_fondos.
ELSEIF pr_loi = 'X'.
PERFORM fetch_po_det.
PERFORM build_fcat.
PERFORM alv_display.
ENDIF.
ENDFORM. " F001-CHECK
*& Form F002-CHECK_INPUT
* text
* --> p1 text
* <-- p2 text
FORM f002-check_input .
IF pr_loi = 'X'.
REFRESH it_po.
IF sel_po-low IS NOT INITIAL.
SELECT object_id
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE it_po
WHERE object_type = 'BUS2201'
AND object_id = sel_po-low.
IF sy-subrc NE 0.
IF sel_po-high IS NOT INITIAL.
SELECT object_id
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE it_po
WHERE object_type = 'BUS2201'
AND object_id = sel_po-high.
IF sy-subrc NE 0.
MESSAGE e009(zsrm).
ENDIF.
ENDIF.
MESSAGE e007(zsrm).
ENDIF.
ELSE.
MESSAGE e010(zsrm).
ENDIF.
IF sel_po-high IS NOT INITIAL.
SELECT object_id
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE it_po
WHERE object_type = 'BUS2201'
AND object_id = sel_po-high.
IF sy-subrc NE 0.
MESSAGE e008(zsrm).
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " F002-CHECK_INPUT
*& Form FETCH_PO_DET
* text
* --> p1 text
* <-- p2 text
FORM fetch_po_det .
REFRESH it_po.
it_po_no[] = sel_po[].
DATA : w_count TYPE i,
w_lines TYPE c,
wa_header TYPE bbp_pds_po_header_d.
REFRESH : it_po,it_output.
IF sel_po-high IS NOT INITIAL.
SELECT object_id
description
posting_date
created_by
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE it_po
WHERE object_type = 'BUS2201'
AND object_id BETWEEN sel_po-low AND sel_po-high.
ELSE.
SELECT object_id
description
posting_date
created_by
FROM crmd_orderadm_h
INTO CORRESPONDING FIELDS OF TABLE it_po
WHERE object_type = 'BUS2201'
AND object_id = sel_po-low.
ENDIF.
w_lines = sy-dbcnt.
w_count = 1.
DO.
IF w_count LE w_lines.
READ TABLE it_po INTO wa_po INDEX w_count.
MOVE wa_po-object_id TO wa_output-zzpono.
MOVE wa_po-description TO wa_output-zzpodesc.
MOVE wa_po-posting_date TO wa_output-zzpodate.
MOVE wa_po-created_by TO wa_output-zzpocreator.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_object_id = wa_output-zzpono
IMPORTING
e_header = wa_header.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = wa_output-zzpocreator
IMPORTING
address = wa_address
TABLES
return = wa_return.
CLEAR wa_output-zzpocreator.
CONCATENATE wa_address-firstname ' ' wa_address-lastname INTO wa_output-zzpocreator .
MOVE wa_header-total_value TO wa_output-zzpoval.
MOVE wa_header-currency TO wa_output-zzpocur.
APPEND wa_output TO it_output.
w_count = w_count + 1.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " FETCH_PO_DET
*& Form BUILD_FCAT
* text
* --> p1 text
* <-- p2 text
FORM build_fcat .
g_repid = sy-repid.
g_title = 'Print LOI details'.
g_print_alv-no_print_listinfos = 'X'.
g_variant-report = sy-repid.
g_variant-variant = sy-title.
CLEAR g_layout.
g_layout-f2code = ' '.
wa_layout-zebra = 'X'.
g_layout-flexible_key = 'X'.
g_layout-colwidth_optimize = 'X'.
g_layout-detail_initial_lines = 'X'.
g_layout-box_fieldname = 'ZZCHECK'.
REFRESH it_fcat.
*Po no
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPONO' .
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-seltext_m = 'Purchase Order'.
*wa_fcat-seltext_s = 'Purchase Order.
wa_fcat-icon = 'X'.
wa_fcat-col_pos = '2'.
wa_fcat-outputlen = 10.
APPEND wa_fcat TO it_fcat.
*Description
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPODESC' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'Description'.
wa_fcat-seltext_m = 'Description'.
*wa_fcat-seltext_s = 'Description'.
wa_fcat-col_pos = '3'.
wa_fcat-outputlen = 10.
APPEND wa_fcat TO it_fcat.
*Posting date
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPODATE' .
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-seltext_l = 'Posting Date'.
wa_fcat-seltext_m = 'Posting Date'.
*wa_fcat-seltext_s = 'Posting Date'.
wa_fcat-col_pos = '4'.
wa_fcat-outputlen = 8.
APPEND wa_fcat TO it_fcat.
*value
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPOVAL' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'PO value'.
wa_fcat-seltext_m = 'PO value'.
*wa_fcat-seltext_s = 'PO value'.
wa_fcat-col_pos = '5'.
wa_fcat-outputlen = 15.
wa_fcat-no_zero = 'X'.
APPEND wa_fcat TO it_fcat.
*Currency
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPOCUR' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'PO Currency'.
wa_fcat-seltext_m = 'PO Currency'.
*wa_fcat-seltext_s = 'PO Currency'.
wa_fcat-col_pos = '6'.
wa_fcat-outputlen = 5.
APPEND wa_fcat TO it_fcat.
*Creator
CLEAR wa_fcat.
wa_fcat-fieldname = 'ZZPOCREATOR' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'Buyer'.
wa_fcat-seltext_m = 'Buyer'.
*wa_fcat-seltext_s = 'Buyer'.
wa_fcat-col_pos = '7'.
wa_fcat-outputlen = 12.
APPEND wa_fcat TO it_fcat.
ENDFORM. " BUILD_FCAT
*& Form ALV_DISPLAY
* text
* --> p1 text
* <-- p2 text
FORM alv_display .
SORT it_output BY zzpono.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_pf_status_set = g_set_pf_stat
i_callback_user_command = g_user_command
i_grid_title = g_title
is_layout = g_layout
it_fieldcat = it_fcat[]
is_variant = g_variant
is_print = g_print_alv
TABLES
t_outtab = it_output[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELD text
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
DATA: gd_repid LIKE sy-repid, "Exists
ref_grid TYPE REF TO cl_gui_alv_grid.
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.
rs_selfield-refresh = 'X'.
CASE r_ucomm.
WHEN 'PRINTLOI'.
PERFORM call_sf.
WHEN 'BACK'.
CALL SELECTION-SCREEN 1000.
WHEN 'CANCEL'.
CALL SELECTION-SCREEN 1000.
WHEN 'EXIT'.
CALL SELECTION-SCREEN 1000.
ENDCASE.
ENDFORM. "user_command
*& Form set_pf_status
* text
* -->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZALV' EXCLUDING rt_extab.
SET TITLEBAR 'ZALV'.
ENDFORM. "set_pf_status
*& Form CALL_SF
* text
* --> p1 text
* <-- p2 text
FORM call_sf .
REFRESH it_sf_po.
LOOP AT it_output INTO wa_output WHERE zzcheck = 'X'.
wa_sf_po-object_id = wa_output-zzpono.
APPEND wa_sf_po TO it_sf_po.
ENDLOOP.
w_formname = 'ZSR_EBP_DOCU_LETTEROFINTENT1'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_formname
IMPORTING
fm_name = w_sfname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ls_composer-tdnewid = 'X'.
ls_control-no_dialog = 'X'.
LOOP AT it_sf_po INTO wa_sf_po.
CALL FUNCTION w_sfname
EXPORTING
control_parameters = ls_control
output_options = ls_composer
wa_object = wa_sf_po
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
ENDLOOP.
ENDFORM. " CALL_SF
*& Form DISPLAY_EXPIRING_FONDOS
* text
* --> p1 text
* <-- p2 text
FORM display_expiring_fondos .
SET PF-STATUS 'ZLOI'.
SET TITLEBAR 'ZLOI'.
TYPES : BEGIN OF ty_output1,
guid TYPE bbp_guid,
object_id TYPE crmt_object_id_db,
description TYPE crmt_process_description,
posting_date TYPE crmt_posting_date,
zzfondo_dat TYPE zfondo_dat,
created_by TYPE crmt_created_by,
END OF ty_output1.
DATA : it_output1 TYPE TABLE OF ty_output1,
wa_output1 TYPE ty_output1,
w_lines,
w_count,
it_fondo TYPE TABLE OF zsr_fondo,
it_temp_fondo TYPE TABLE OF zsr_fondo,
wa_temp_fondo TYPE zsr_fondo,
wa_fondo TYPE zsr_fondo,
w_diff TYPE p,
wa_header1 TYPE bbp_pds_po_header_d.
CONSTANTS : c_otype(8) VALUE 'BUS2201'.
REFRESH : it_output1,it_temp_fondo,it_fondo.
SELECT b~zzfondo_dat
a~guid
a~object_id
a~description
a~posting_date
a~created_by
INTO CORRESPONDING FIELDS OF TABLE it_output1
FROM bbp_pdhsc AS b
LEFT OUTER JOIN crmd_orderadm_h AS a ON b~guid = a~guid
AND a~object_type = c_otype.
LOOP AT it_output1 INTO wa_output1.
CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'
EXPORTING
date1 = sy-datum
date2 = wa_output1-zzfondo_dat
IMPORTING
datediff = w_diff
EXCEPTIONS
invalid_datetime = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
IF w_diff <= '7'.
wa_temp_fondo-zzpono = wa_output1-object_id.
APPEND wa_temp_fondo TO it_temp_fondo.
ENDIF.
ENDLOOP.
*select the final entries for PO whose FONDO is expiring
DESCRIBE TABLE it_temp_fondo LINES w_lines.
w_count = 1.
DO.
IF w_count LE w_lines.
READ TABLE it_temp_fondo INTO wa_temp_fondo INDEX w_count.
IF sy-subrc = 0.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_object_id = wa_temp_fondo-zzpono
IMPORTING
e_header = wa_header1.
wa_fondo-zzpono = wa_temp_fondo-zzpono.
wa_fondo-zzpodesc = wa_header1-description.
wa_fondo-zzpodate = wa_header1-posting_date.
wa_fondo-zzexpdate = wa_header1-zzfondo_dat.
wa_fondo-zzpoval = wa_header1-total_value.
wa_fondo-zzpocur = wa_header1-currency.
wa_fondo-zzpocreator = wa_header1-created_by.
CLEAR : wa_address.
REFRESH wa_return.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = wa_header1-created_by
IMPORTING
address = wa_address
TABLES
return = wa_return.
CLEAR wa_fondo-zzpocreator.
CONCATENATE wa_address-firstname ' ' wa_address-lastname INTO wa_fondo-zzpocreator .
w_count = w_count + 1.
APPEND wa_fondo TO it_fondo.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = 'ZSR_FONDO'
i_grid_title = 'EXPIRING FONDOS'
TABLES
t_outtab = it_fondo[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " DISPLAY_EXPIRING_FONDOS
Now in my ALV grid o/p i can see the check box but if i select one row and then try to select another the first one gets deselected.
Can anybody tell me what is missing?Hi,
Try like changing this
insted of
g_layout-f2code = ' '.
use this
g_layout-f2code = 'DISP'. " Sets fcode for when double
and
g_layout-f2code = '&ETA'. " it will display POPUP screen
Best Regards
Ranga
Edited by: Ranga Swamy on Nov 1, 2008 11:07 PM
Edited by: Ranga Swamy on Nov 1, 2008 11:17 PM -
Select all check box at some time
Hi all,
I have a search display .jsp page, which have some checked box, allow the users to check the box and download data from database, righr now the use need to checked the checked the box one by one,
bu tthey want to add other button, which allow them to select all the checked box by click the box, not ideal how to handle.
any adviseHi ,
thank you for the reply,
I finally have time to finish this part
the code is <script language="JavaScript" type="text/javascript">
function checkAll(field)
for (i = 0; i < field.length; i++)
field.checked = true ;
function uncheckAll(field)
for (i = 0; i < field.length; i++)
field[i].checked = false ;
<input type="button" name="b1" value="Check All" onClick="checkAll(document.form1.mybox)">
<input type="button" name="b12" value="Uncheck All" onClick="uncheckAll(document.form1.mybox)">
</form>
</script>
Maybe you are looking for
-
How do I import an unpublished site from one computer to another?
Hello all, I prepared my website on my computer at home, which is not configured to publish the site into my university's public folder. So I copied the website onto a memory card and now I would like to open the site on my work computer's iweb to ad
-
Hi all, Iam working with a jdbc-to-jdbc scenario.In this I am having 3 tables on source side called t1 , t2 & t3. On target side I am having 2 tables called tb1 & tb2. Now I have to retrieve data from 3 tables and insert into 2 tables using one type
-
How can I get Elements 10 incremental backup to work?
I've done the full backup to an external drive. When attempting to do the incremental backup I follow the prompt to select the destication and do the browse to locate the previous backup folder. I double click on it expecting it to be loaded into t
-
User Folder in Finder does not retain arrangement
I have selected the files and folders in my User Folder to be arranged by Name but they always get messed up each time I open it. How to make them stick? All of the other folders retain the settings.
-
How to handle link to Remote Desktop
How do you handle a link to remote desktop--it's to a server that the user needs to use in the event of a shutdown to a system.