How to execute multiple records in table control
HI.
I have a requirement that in table control user will select more than one row and when he clicks 'SAVE' it should go and sit in a custom table. how to pass more than one records.
thanks & regards.
sandeep
Hi Sandeep,
I understand your requirement .......
See this standard program........
<b>" DEMO_DYNPRO_TABCONT_LOOP_AT "</b>
<b>Understand how DELETE button is working,inorder to delete multiple lines....Copy this program if necessary..OK.
Simply,Replace DELETE statement with your INSERT statement to push records into your custom table....very easily you can do it.</b>
<b>Reward all helpful answers.</b><b>
Hope you problem is solved.</b>
Regards,
V.Raghavender.
Similar Messages
-
How to Display multiple records in Table in VC without using BAPI.
Hi All,
I am working on Visual composer (NW2004s SP10). I am trying to display Poitems from BAPI_PO_GETDETAIL. I am creating my front end using VC. I have created one form and one Table where I want to display POItems. I am writing my logic of retrieving data from BAPI in CAF.I am connecting them in Guided procedures.When I run my process in Guided Procedures I am getting single row displayed in table. Can Anyone help me how to display multiple rows in table.
Regards,
SheetalHi Sheetal,
if the BAPI returns a table, then you get multiple rows. From which system is the BAPI, so that I can check the BAPI to give you further information.
Best Regards,
marcel -
How to insert multiple entries in table control
Hi All,
I want to insert multiple entries in table control in BDC program.Can any body help in this regard.
Thanks,
Satish.Hi,
Go through the following 2 example programs:
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
ABAP Name : ZMM_PR_UPLOAD_MAT
Description : PR Upload BDC Program(With Material)
Created by : Anji Reddy V
Created on : 04/11/2004
Description : This Program is used to Upload the Purchase
Requisition data Using the Transaction ME51N.
Modification Log:
Date Programmer Correction Description
04/11/2004 Anji Reddy Initial
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
reward for useful answers.
Regards,
Anji -
Hi All How 2 add empty record to table control
Hi All,
If my table control has 10 records , and I want to add an empty record when i click a push button for that what is the procedure to do it. please send me the source code for that its Urgent.
Thanks&Regards.
Bharat Kumar .Hi..
In the PBO Module which is called before the LOOP on Table control .
Give the code like this..
DESCRIBE TABLE ITAB.
if OK_CODE = 'ADD'.
TABCON-LINES = SY-TFILL + 1.
ELSE.
TABCON-LINES = SY-TFILL .
ENDIF.
This will give the Additional line always when you click the ADD(some) button.
<b>Reward if Helpful</b> -
How to color the records in table control.
Hi,
I have created a table control in which i want to add colors to it.
It is possible in reporting,but is it possible in table control.You can do it,
Just follow the code,...
In PBO...
PROCESS BEFORE OUTPUT.
MODULE STATUS.
LOOP WITH CONTROL TABCTRL.
MODULE MODIFY_100.
ENDLOOP.
MODULE MODIFY_100 OUTPUT.
DATA wa_tabctrl TYPE cxtab_column .
LOOP AT TABCTRL-COLS INTO WA_TABCTRL.
IF WA_TABCTRL-INDEX = '1'. "1- Your Respective Field Column's index
WA_TABCTRL-SCREEN-COLOR = '2'. "Give your colour
MODIFY TABCTRL-COLS FROM WA_TABCTRL.
ENDIF.
ENDLOOP.
ENDMODULE. -
How to add multiple records in table thru form via Submit button
Hi all
i have small requirement as follows.
i have a view in which i have 3 UI elements one is webdynpro form,Table UI element and third one is submit button.
now at runtime when i will enter the details in the form and click on the submit button then those record details has been stored in Table. then next time again when i submit the form with details then the table contains all records of current and existing ...so table has to maintain mutile records thru form via submit form..
i need sample code on the same.
points are always rewardable
Thanks
SunilHi,
Create one context attribute and map it to the Inputfiled and one submit button, create a node with a valueattribute map it to a Table and in onActionsubmit write this code
public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionsubmit(ServerEvent)
String str=wdContext.currentContextElement().getInputfiledattribute();
IPrivateTableformView.ITablenodeNode node=wdContext.nodeTablenode();
IPrivateTableformView.ITablenodeElement ele=node.createTablenodeElement();
ele.setNodeattribute(str);
node.addElement(ele);
//@@end
thanx,
ramani.p -
How to input multiple records in tables in web dynpro
Hi
In web dynpro table I am able to input data in first row only. How to input data in other rows.
Thanks,
Saurabhhi, okay..
I summarize in 3 aspects:
1.You want make the Table row play like "Input field"
The solution is :
In the table column, you set the cell editor as "Input field"
2.You want to use the FILTER function
The solution is :
set Filter Value property and realize "OnFilter" event...
3.You want to add Ready for Input rows to your table
The solution is :
You should make use of the Context Node bound to the table. The EXAMPLE coding:
DATA lo_nd_flights TYPE REF TO if_wd_context_node.
DATA lo_el_flights TYPE REF TO if_wd_context_element.
* append the element with initial attribute value
lo_nd_flights = wd_context->get_child_node( name = wd_this->wdctx_flights ).
lo_el_flights = lo_nd_flights->CREATE_ELEMENT( ).
* bind the newly created element
lo_nd_flights->BIND_ELEMENT( new_item = lo_el_flights
set_initial_elements = abap_false ).
4.You want to set N rows ready for input initially
The solution is :
Set the Row visible property..
Best wishes. -
To delete multiple entries in table control in module pool
Hi,
Please help me out to know , <b>how to delete multiple entries from table control</b> when multiple lines in table control are selected.
Regards,
Irfan Hussainhai,
you can do it inthis way.
in the PAI event.
loop at <table control name>
module del_itab.
endloop.
in the nodule,write the folowing code.
if <tablecontrol>-fieldname = 'X'.
delete <tablecontrol-itab>
endif.
cheers -
How to get multiple records using fn-bea:execute-sql()
Hi,
I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
Regards,
Nagaraju
Edited by: user10373980 on Sep 29, 2008 6:11 AMHi,
Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
For example:
fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
Id Name
01 XXX
02 YYY
03 ZZZ
I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
<student>
<Name>XXX</Name>
</student>
I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
Please suggest.
regards,
Venkat -
How to select multiple records from a TREE in the table
HI,
I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
Regards
-SandipRashmi/Kukku,
First of all, Thanks for your help!
Is there any other way in which we can access tables other than using BAPIs or RFCs?
In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
Krishna Murthy -
How to update record in Table control
Dear Friends,
I have table control that has space for 10 records but i need to update 15 record from the flat file which is getting into the table how can i do this.
Regards,
MAHENDRA.Hi,
you record for an item and then click on page down and save it.use the loop on this bdc to populate the the bdc table no need to do manually.
LOOP AT l_i_dettab_item INTO l_wa_dettab_item..
l_cursor = l_cursor + 1.
IF l_cursor GT 1.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
ENDIF.
PERFORM cursor_pos_notation USING 'V_EAN_DET001- GTIN_VARIANT_TYP'
l_cursor
CHANGING l_cursor_notation.
PERFORM cursor_pos_notation USING 'V_EAN_DET001-VTWEG'
l_cursor
CHANGING l_cursor_notation.
PERFORM bdc_field USING l_cursor_notation
l_wa_dettab_item-vtweg.
PERFORM cursor_pos_notation USING 'V_EAN_DET001-DATEFROM'
l_cursor
CHANGING l_cursor_notation.
PERFORM bdc_field USING l_cursor_notation
l_v_date.
PERFORM bdc_field USING 'BDC_CURSOR'
l_cursor_notation.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
ENDLOOP.
Here my ok code for page down is =P+ so i am looping on the table control data and then populating the bdc table after this i will populate the remaing info required for the call transaction and refresh bdcdata.
thats it no need to do recording 1000 times.
now if u do like this it doesn't depend on the number of records on table control.
it will take all the records.
Reward if useful.
Regards,
sasi
Regards,
sasi -
How can we do the validation for non visible records in table control.
Hi Experts,
I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
How can we do the validation for non visible records in table control.
Regards,
BujjiHi,
try validating material before displaying it in table control...'
Rgds/Abhhi -
How to save the selected records from Table control in dialog programming
Hiiiiiiii Every1
Actually the problem is like this:-
I have to select some records from table control and then want to save the selected records in DB table.
Example
I have some rows having inforamtion bout employees...
Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
Sachin Dhingrasee below example, I have added INSERT option after DELETE option.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA cols LIKE LINE OF flights-cols.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
WHEN 'INSERT'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
itab1 = itab.
modify itab1.
ENDLOOP.
ENDIF.
if not itab1 is initial.
INSERT dbtab FROM TABLE itab1.
endif.
ENDCASE.
ENDMODULE. -
How to show multiple records in JDeveloper automatically
Hi, you guys,
May I ask you how to show multiple records, say consecutive three records, of a View object in JDeveloper?
I know that we can just drag and drop a view object as a child (Table) of a scrollPane.
Are there any other approaches?
Thanks a lot for your time.
damonThanks for your reply.
You are right.
Table binding is the best solution for that.
But in my mind, a record in a table is always shown in one row (or one line), am I right?
If so, it is not convient to show records with multitple columns.
Let's say, there are 20 columns to show for each record. Then we should display a record in, say 3 lines.
How can we do that?
Are there any suggestions?
I am thinking that maybe I can use secondary row set iterators for that since we can create two or more row set iterators for the same view object.
Assume I want to show three consecutive records. I can use attribute binding to show the current record in three lines by dragging attributes one by one from Data Control Palette to Design Window as Child | TextField;
But I do not know how to use a secondary row set iterator for the next record. Where shall I create a secondary row set ietrator such that I can use it to create and synchronize the bindings.
Thanks a lot
Damon
Message was edited by:
user599641 -
How to Save Multiple Records In Data Block
Hi All,
I Have Two Blocks --> Control Block,Database Block
Please Any Idea How to Save Multiple Records In Data Block when User changed Data in Control Block.
Thanks For Your Help
SaNow i have to use each record of control block(ctl_blk) as where condition in data base block(dat_blk)and display 10 records from database table.>
Do you want this coordination to be automatic/synchronized or only when the user clicks a button or something else to signal the coordination? Your answer here will dicate which trigger to put your code in.
As to the coordination part, as the user selects a record in the Control Block (CB), you will need to take the Key information and modify the Data Block's (DB) "DEFAULT_WHER E" block property. The logical place to put this code is the CB When-New-Record-Instance (WNRI) trigger. You code will look something like the following:
/* Sample WNRI trigger */
/* This sample assumes you do not have a default value in the BLOCK WHER E property */
DECLARE
v_tmp_dw VARCHAR2(250);
BEGIN
v_tmp_dw := ' DB_Key_Column1 = '||:CONTROL.Key_Column1||' AND DB_Key_Column2 = '||:CONTROL.Key_Column_2;
Set_Block_Property('DATA_BLOCK', DEFAULT_WHER E, v_tmp_df);
/* If you want auto coordination to occur, do the following */
Go_Block('DATA_BLOCK');
Execute_Query;
/* Now, return to the Control Block */
Go_Block('CONTROL_BLOCK');
END;
The Control block items are assigned with values in Form level (Key_exeqry).If your CD is populated from a single table, it would be better to create a Master - Detail relationship (as Abdetu) describes.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.
Maybe you are looking for
-
IPod 60GB Color - Dock Connector Issue
I've just been given a 60GB Color Display iPod, and I'm having the weirdest problem. According to the literature I can find, this iPod should be the same in all respects as the 40GB 4G iPods we already own. However, when I put it in my Bose Sound Doc
-
Web Authentication with MS IAS Server
I'm trying to configure my 2106 WLC to authenticate with an MS IAS Radius Server. I had this working, but my boss did not want to do any configuration on the client side and now wants to do all authentication through Web authentication with the Radiu
-
Top-of-page for list display thru ALV
Hi All, I was suppose to write a detail report thru ALV, this I have handled thru hotspot and in the user_command,I am have the below code.. for ALv I am using FM REUSE_ALV_GRID_DISPLAY FORM User_command. WHEN '&IC1'. PERFORM LIST_DISPLAY using RS_SE
-
Building executables when using LV and MATRIXx
Hi! With respect to Building executables when using LV and MATRIXx, I need clarification on following: 1) Pre-requisites to use MATRIXx? We have LV 7.1 FDS with application builder. 2) Licensing scheme? We would like to have MATRIX on 3 development s
-
Shared JNDI view among security role
Hi, We're working on project which needs to expose EJB across different Apps( EAR) in the same OC4J. To my knowledge, in order for those Apps to be able to access the JNDI entry for the exposed EJB, there could be follwing options. * To enable JNDI e