How to populate the dropdown in selection widget from a file?
i am using a cq:widget of xtype selection and type select. I got lot of values as my options.i want a simple procedure to populate them. They have mentioned that they can be populated from a json response. Can you explain how to do the same? or is ther any other method for the same
Steve,
You can check OOTB List component at below location.
/libs/foundation/components/list/dialog/items/list/items/displayAs
Here dispalyAs tab having cq:widget of xtype selection in which values are populating through displayoptions.json.jsp which is referenced by options property set on displayAs tab.
Regards
Briejsh Yadav.
Similar Messages
-
How to get the values of Select-options from the screen.
The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.
Hi,
Refer this following code..this will solve your problem...
"Following code reads value entered in s_po select options and willprovide search
"help for s_item depending upon s_po value.
REPORT TEST.
TABLES : ekpo.
DATA: BEGIN OF itab OCCURS 0,
ebelp LIKE ekpo-ebelp,
END OF itab.
SELECT-OPTIONS s_po FOR ekpo-ebeln.
SELECT-OPTIONS s_item FOR ekpo-ebelp.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
DATA:
dyn_field TYPE dynpread,
temp_fields TYPE TABLE OF dynpread,
zlv_dynpro TYPE syst-repid.
zlv_dynpro = syst-repid.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = zlv_dynpro
dynumb = syst-dynnr
request = 'A'
TABLES
dynpfields = temp_fields
EXCEPTIONS
OTHERS = 0.
LOOP AT temp_fields INTO dyn_field.
IF dyn_field-fieldname EQ 'S_PO-LOW'.
SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
WHERE ebeln EQ dyn_field-fieldvalue.
EXIT.
ENDIF.
ENDLOOP. -
How to populate one dropdown on select of other dropdown in a table
Hi
My requirement is that I want to populate one dropdown on selection of some value in other drop down.The two dropdown are present in two columns of a Table.
Can any body help for the same.
Regards
NitinHi,
Try This
Bind "enable" properties of Both DD1 and DD2 to
context attributes of type boolean. DD1Enable,DD2Enable
1: set their value to false intially
wdContext.currentContextElement.setDD1Enable(false);
wdContext.currentContextElement.setDD2Enable(false);
Bind the selected property of the table to a
Context attribute of type boolean(Initially false), say "selected"
2: Then use check box in the table to get current lead selection
write in "onToggle" action of checkBox
int len=wdContext.nodeTable().size();
for(int i=0;i<len;i++)
if(wdContext.currentTableElement().getSelected()==true)
wdContext.currentDD1Element().setDD1Enabled(true);
wdContext.currentDD2Element().setDD2Enabled(true);
}else
wdContext.currentDD1Element().setCountryEnabled(false);
wdContext.currentDD2Element().setStateEnabled(false);
This is how u get leadselection and able to change particular row in the table
Regards
Lakshmi -
How to Populate the Dropdown from the xml file ?
Hi,
According to my requirement, Drop down has to be populated in a form, on selecting an element in the first drop down list, corresponding second drop down values has to be loaded dynamically.
I am using the ReferenceData file, which consists of the Dropdown list values in the form of Key,Value pair. I can able to populate one drop down,but I don't know how to populate the second dropdown dynamically.
can any one please help me to finish this task.Thanxs john.
My requirement is onChange of a value from the first drop down, particular values needs to load in the second drop down. Values that needs to pull are designed in XML Object as Map entries Key,Pair Values.
I already did all the things, what you have told.But,I don't know How to populate the second drop down, and where to write the condition.
If u don't mind can u send me the sample code to check the condition. -
Populate the JSP's select box from database on jsp load
hai all,
can any one help me in knowing how to populate the select box of a jsp
with data from the database?
thanks and regards,
ravikiran<%
String sQuery = "select id,Name from tablename";
rs = stmt.executeQuery(sQuery);
%>
<select name="sltName">
<%
while(rs.next()){
String sId = rs.getString(1);
String sName = rs.getString(2);
%>
<option value="<%=sId %>" > <%=sName %> </option>
<%
%>
</select> -
How to populate the dropdown key values as shown in the below screen shot
Hi
i am trying to populate the drop down by key value for trader , for Trader we have few values i need to populate the Those values in values columns . as shown in the below screen shot .Hi,
Follow below steps
Step 1 - Create basic wdp table
Step 2 - Create context to store dropdown values Within your web dynpro application table
Now you need to create a context node to store the dropdown values, but this needs to be within the context node of your table.
For this example I will use fields CARRID and CARRNAME from structure SCARR to create the dropdown list within the table context.
Choose the attributes to represent the id and the text values
The finished context should now look like this
Step 3 - Update context mapping within VIEW
Within the Context tab of your view update the context node you have just modified (CARRIERS) right click and select 'Update Mapping'. Alternatively if this is a new context drag it from the right hand window and drop it onto the context node in the left window,
Step 4 - Update table field
Within the layout tab of the view, field the table field you want to replace with with a dropdown and remove the UI element associated with it
Now insert new dropdownbyindex UI cell element
Step 5 - Assign Dropdown Ui element to Context
Click on your UI element within the Layout tab, you will now see all the properties for this element which can be changed. You now need to assign the field within the context which you want to be displayed in the drop down i.e. it will be the CARRNAME field within context element DROPDOWN_CARR. To do this simply click on the button at the end of the 'texts' property (the one with a yellow square and circle on it) and select the correct context field.
Step 6 - ABAP code to populate dropdown list and set correct initial value
Insert the following ABAP code into the appropriate place. For this example it will go within the WDDOMODIFYVIEW method of the view.
Data: it_scarr type standard table of scarr, wa_scarr like line of it_scarr, context_node type ref to if_wd_context_node. Data: it_ddcarr type STANDARD TABLE OF if_main=>element_DROPDOWN_CARR, wa_ddcarr like line of it_ddcarr, lr_element TYPE REF TO if_wd_context_element, ld_tabix type sy-tabix, ld_index type sy-index, it_carriers type STANDARD TABLE OF if_main=>element_CARRIERS, wa_carriers like line of it_ddcarr. select * from scarr into table it_scarr. sort it_scarr by carrid. * select * from scarr into table it_scarr. context_node = wd_context->get_child_node( name = 'CARRIERS' ). * Get all rows of table and values stored in each cell currently displayed to user context_node->get_static_attributes_table( importing table = it_carriers ). if sy-subrc eq 0. loop at it_carriers into wa_carriers. free lr_element. ld_tabix = ld_tabix + 1. * assign context_node to table context context_node = wd_context->get_child_node( name = 'CARRIERS'). * assign lr_element to row of table lr_element = context_node->get_element( ld_tabix ). * assign data to dropdown of the row context_node = lr_element->get_child_node( name = 'DROPDOWN_CARR'). context_node->BIND_TABLE( it_scarr ). * Set correct initial value read table it_scarr into wa_scarr with key carrid = wa_carriers-carrid. ld_index = sy-tabix. context_node->set_lead_selection_index( index = ld_index ). endloop. endif.
Step 6 - Save, Activate and Run
Save and activate your abap web dynpro, now when you execute it you should see a drop down object similar to the following: -
How do I move photos from iPhoto back to the SD card on my camera? I can move them from the camera to the computer easily. How do I do the reverse?
Select the photos in IPhoto and export to a desktop folder, mount the SD card and drag the folder to it
LN -
How to populate the value of SHUTTLE item from MULTISELECT item
Hi,
I am have following 2 items
P1_TEXT1 - multiselect
P1_TEXT2 - shuttle
I have populated the value of P1_TEXT1(multiselect) and then want to assign the same value to P1_TEXT12 (shuttle)
I am using following Javascript function to assign the value of P1_TEXT1 to P1_TEXT2 but it's not working??
$x('P1_TEXT2').value = $x('P1_TEXT1').valuethanks,
Deepak
Edited by: Deepak_J on Dec 4, 2009 3:28 PMHi Jari,
I modified the earlier script as shown below. It's working perfectly fine as per my requirement.
Pl let me know if these changes are fine OR is there is any modification we need.
<script>
var ob = $x('P1_TEXT1');
var ob2 = $x('P1_TEXT2_LEFT');
var ob3 = $x('P1_TEXT2_RIGHT');
// added this piece as per your suggestion..
var g_myShuttle = null;
if(!flowSelectArray){
var flowSelectArray = [];
flowSelectArray[flowSelectArray.length] = "P1_TEXT2_RIGHT";
g_myShuttle = new dhtml_ShuttleObject
("P132_HDWR_DEVCE_ID_LEFT","P1_TEXT2_RIGHT");
// Remove all values
g_myShuttle.remove_all();
// added this FOR LOOP, which will make every thing on the LEFT side unselected initially
for (var j = 0; j < ob2.options.length; j++)
ob2.options[j].selected = false;
for (var i = 0; i < ob.options.length; i++)
for (var j = 0; j < ob2.options.length; j++)
if(ob2.options[j].value == ob.options.value)
ob2.options[j].selected = true;
var g_myShuttle = null;
if(!flowSelectArray){
var flowSelectArray = [];
flowSelectArray[flowSelectArray.length] = "P1_TEXT2_RIGHT";
g_myShuttle = new dhtml_ShuttleObject
("P1_TEXT2_LEFT","P1_TEXT2_RIGHT");
g_myShuttle.move();
</script>
Thanks,
Deepak -
How to populate the values based on different selections in Dashboard Promp
Hi,
I have a group prompt, which has 2 drop downs. The DropDown1 decides the values of DropDown2.
I have used a SQL query in the "Show" values which will populate the dropdowns.
When a value is 'selected" from DropDown1, the selected value decided the values of DropDown2 which is again a SQL query.
But I see that when a new value is selected from DropDown1, the values in DropDown2 will not change until I click on GO.Even after clicking GO, the previously selcted value is retained.
As an illustration:
animals,plants are the choices in the first drop down, which if, animal is selected would populate the dropdown2 with cow,sheep, tiger.
Assume animal is selected. The second drop down now is populated with cow,sheep and tiger. Assume you chose sheep.This resulted in display of sheep related info on the BI page.
Now if I go back to the first dropdown and select plants, I would expect the second drop down to be populated with fig, palm, coconut.
However in my case I see only the proviously popluated animals in the DropDown2.
If I click on Go, I see that the DropDown2 is populated with Sheep,,fig, palm, coconut. Ideally I should not have seen the prevously selected value in DropDown2.
Here there are 2 problems stated for a group promt having 2 DropDowns where item chosen from one decides the values of the other dropdown
1. On selecting an item from DropDown1, is not populating with the corresponding values in DropDown2
2. When 'Go' is clicked, DropDown2 is populated with the corresponding values for DropDown1 + the previously selected value in DropDown2 is retained.
Any input to get out of this problem will help
thanks
ShubhaHi
I am using group prompt and has 4 drop downs.
Value of one decides the other. Values for the dropdowns will be populated by SQL results.
'Constrain' will not be available for sql results..
How to go about this?
thanks
Shubha -
How to populate the ranges using FM for the SELECTs
Hi,
I am still working on the FM to create a generic extractor. I went through the debugger but I am still unable to determine how the ranges are populated. RSA3 always gives me zero values for the results.
There is a RANGE statement in the sample FM and the following statements for SELECTs
RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
L_R_CONNID FOR SFLIGHT-CONNID.
and...
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
APPEND L_R_CARRID.
ENDLOOP.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
APPEND L_R_CONNID.
ENDLOOP.
My question is how is L_R_CONNID and L_R_CARRID populated with low and high values for the SELECT statements? I tried to find the DS 0SAPI_SFLIGHT_SIMPLE to run and see how it is set up but there is no such DS.
Would someone take the time to say something about this in several sentences? I have my own code and it seems that it is not populating the values for the SELECTs when I debug from RSA3 when I provide the low and high values.
Would I normally populate the low and high values from the InfoPackage 'Data Selection' tab once I have implemented in BW or ready to test in BW? That would mean I have to choose those fields as selections from RSO2. Anyway, I think I have asked about this but I am hoping to get an answer to get this going...
Appreciate any replies.Hi
Here is an example of an extractor that uses
both method's, if the InfoPackage selection exist's
it overrides the TVARV selection (which is the default).
FUNCTION ZBW_TC_FORECAST_SO_EXTRACTOR.
""Local interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_DSOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE OPTIONAL
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" VALUE(I_CALLMODE) TYPE ROARCHD200-CALLMODE OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE ZBW_TC_FORECASTING_EXT_STR OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*" HIERARCHY_NOT_FOUND
Change History *
Mod. # | Date | Developer | Description *
*RD3K915762|06/21/2005| SRangaraj | Change selection of open SO *
| | | data to include deleted matls *
| | | and obsolete items too *
RD3K915888|06/29/2005| SRANGARAJ | Add ext matl grp and lab offce
| | | filters for data-selection *
The input parameter I_DATAPAKID is not supported yet !
Auxiliary Selection criteria structure
DATA: L_S_SELECT TYPE SBIWA_S_SELECT.
Maximum number of lines for DB table
STATICS L_MAXSIZE TYPE SBIWA_S_INTERFACE-MAXSIZE.
Parameter I_PRIVATE_MODE:
Some applications might want to use this function module for other
purposes as well (e.g. data supply for OLTP reporting tools). If the
processing logic has to be different in this case, use the optional
parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
(I_PRIVATE_MODE = X).
If the message handling has to be different as well, define Your own
messaging macro which interprets parameter I_PRIVATE_MODE. When
called by BIW, it should use the LOG_WRITE macro, otherwise do what
You want.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF I_INITFLAG = SBIWA_C_FLAG_ON.
Initialization: check input parameters
buffer input parameters
prepare data selection
The input parameter I_DATAPAKID is not supported yet !
Invalid second initialization call -> error exit
IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
IF 1 = 2. MESSAGE E008(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDIF.
Check InfoSource validity
CASE I_DSOURCE.
WHEN 'ZBW_TC_SO_EXTRACT'.
WHEN OTHERS.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_DSOURCE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
Check for supported update mode
CASE I_UPDMODE.
WHEN 'F'.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
Check for obligatory selection criteria
READ TABLE I_T_SELECT INTO L_S_SELECT WITH KEY FIELDNM = 'PGMID'.
IF SY-SUBRC <> 0.
IF 1 = 2. MESSAGE E010(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'010' "message number
'PGMID' "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDIF.
APPEND LINES OF I_T_SELECT TO G_T_SELECT.
Fill parameter buffer for data extraction calls
G_S_INTERFACE-REQUNR = I_REQUNR.
G_S_INTERFACE-ISOURCE = I_DSOURCE.
G_S_INTERFACE-MAXSIZE = I_MAXSIZE.
G_S_INTERFACE-INITFLAG = I_INITFLAG.
G_S_INTERFACE-UPDMODE = I_UPDMODE.
G_S_INTERFACE-DATAPAKID = I_DATAPAKID.
G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
Fill range tables for fixed InfoSources. In the case of generated
InfoSources, the usage of a dynamical SELECT statement might be
more reasonable. BIW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT G_T_SELECT INTO L_S_SELECT.
CASE L_S_SELECT-FIELDNM.
WHEN 'PRDHA'.
WGF_PRDHA_LENGTH = STRLEN( L_S_SELECT-LOW ).
IF WGF_PRDHA_LENGTH = 6. "PARTIAL PRDHA
WGF_PRDHA = L_S_SELECT-LOW.
CONCATENATE WGF_PRDHA '%' INTO WGF_PRDHA.
ELSEIF WGF_PRDHA_LENGTH = 12. "FULL PRDHA
MOVE-CORRESPONDING L_S_SELECT TO L_R_PRDHA.
APPEND L_R_PRDHA.
ENDIF.
WHEN 'MATKL'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_MATKL.
APPEND L_R_MATKL.
ENDCASE.
ENDLOOP.
reset the index of where we are in the gt_header table
g_tabix = 0.
perform populate_default_variables.
perform get_data.
perform build_detail.
EXIT.
ENDIF. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
First data package -> OPEN CURSOR
IF G_COUNTER_DATAPAKID = 0.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between InfoSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
DESCRIBE TABLE LT_DATA LINES l_count.
IF g_tabix GE l_count.
RAISE no_more_data.
ENDIF.
*CLEAN UP THE OUTPUT TABLE
refresh E_T_DATA.
LOOP AT LT_DATA FROM G_TABIX INTO LS_DATA.
APPEND LS_DATA TO E_T_DATA.
Set global counter
g_tabix = g_tabix + 1.
ENDLOOP.
G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
Forms
***INCLUDE LZBW_TC_FORECAST_SO_EXTF01 .
*& Form populate_default_variables
text
--> p1 text
<-- p2 text
FORM populate_default_variables.
data: wlf_name like tvarv-name.
clear: R_prdh3[], wlf_name.
*get the exclusion range from tvarv for the product hierarchy in
*question
concatenate 'ZBW_EXL_' WGF_PRDHA(6) INTO WLF_NAME.
SELECT LOW FROM TVARV INTO R_prdh3-low WHERE
NAME = WLF_NAME.
move: 'I' to R_prdh3-sign,
'EQ' to R_prdh3-option.
append R_prdh3.
clear R_prdh3.
ENDSELECT.
{Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
CLEAR L_R_LABOR[].
SELECT LOW FROM TVARV INTO L_R_LABOR-Low WHERE
NAME = 'ZBW_TC_FORECAST_LAB_OFF'.
move: 'I' to L_R_LABOR-sign,
'EQ' to L_R_LABOR-option.
append L_R_LABOR.
clear L_R_LABOR.
ENDSELECT.
}End of insert by SRangaraj on June 29, 2005 >>RD3K915888
ENDFORM. " populate_default_variables
*& Form get_data
text
--> p1 text
<-- p2 text
FORM get_data.
data: wlf_lmeng like vbep-lmeng.
*get all deliveries for date range for either a range of product hrchy
*or a like value
refresh int_records1.
if wgf_prdha ne space.
select ivbeln iposnr iKLMENG jvkorg i~werks
imatnr imeins mprdha mmatkl
from vbap as i
INNER JOIN VBAK AS j
ON ( jvbeln = ivbeln
and j~vbtyp = 'C' )
INNER JOIN vbuk AS k
ON ( kvbeln = ivbeln
and k~lfgsk <> 'C'
and k~gbstk <> 'C' )
INNER JOIN vbup AS l
ON ( lvbeln = ivbeln and
lposnr = iposnr
and l~lfgsa <> 'C'
and l~gbsta <> 'C' )
INNER JOIN mara AS m
ON ( mmatnr = imatnr
{Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
and m~lvorm eq ' '
and m~mstae ne '99'
{Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
and m~extwg = '080' )
}End of insert by SRangaraj on June 29, 2005 >>RD3K915888
INNER JOIN marc AS n
ON ( nmatnr = imatnr
and nwerks = iwerks
and n~lvorm eq ' ' )
}End of insert by SRangaraj on June 21, 2005 >>RD3K915762
into table int_records1 where ( i~abgru = ' '
and i~klmeng > 0
and m~prdha like wgf_prdha
and m~matkl in l_r_matkl
{Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
and m~labor in l_r_labor ).
}End of insert by SRangaraj on June 29, 2005 >>RD3K915888
elseif not l_r_prdha[] is initial and wgf_prdha = space.
select ivbeln iposnr iKLMENG jvkorg i~werks
imatnr imeins mprdha mmatkl
from vbap as i
INNER JOIN VBAK AS j
ON ( jvbeln = ivbeln
and j~vbtyp = 'C' )
INNER JOIN vbuk AS k
ON ( kvbeln = ivbeln
and k~lfgsk <> 'C'
and k~gbstk <> 'C' )
INNER JOIN vbup AS l
ON ( lvbeln = ivbeln and
lposnr = iposnr
and l~lfgsa <> 'C'
and l~gbsta <> 'C' )
INNER JOIN mara AS m
ON ( mmatnr = imatnr
{Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
and m~lvorm eq ' '
and m~mstae ne '99'
{Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
and m~extwg = '080' )
}End of insert by SRangaraj on June 29, 2005 >>RD3K915888
INNER JOIN marc AS n
ON ( nmatnr = imatnr
and nwerks = iwerks
and n~lvorm eq ' ' )
}End of insert by SRangaraj on June 21, 2005 >>RD3K915762
into table int_records1 where ( i~abgru = ' '
and i~klmeng > 0
and m~prdha in l_r_prdha
and m~matkl in l_r_matkl
{Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
and m~labor in l_r_labor ).
}End of insert by SRangaraj on June 29, 2005 >>RD3K915888
endif.
sort int_records1 by vbeln posnr.
delete adjacent duplicates from int_records1 comparing
vbeln posnr.
*remove unnecessary records
if not r_prdh3[] is initial.
DELETE INT_RECORDS1 WHERE PRDHA+6(3) IN r_prdh3.
endif.
*get the schedule lines for all of the above records and
*get the lowest schedule line date per so line item
if not int_records1[] is initial.
refresh int_records3.
select vbeln posnr etenr mbdat into table int_records3
from vbep for all entries in int_records1
where vbeln = int_records1-vbeln and
posnr = int_records1-posnr and
lmeng > 0.
sort int_records3 by vbeln posnr etenr mbdat ascending.
loop at int_Records1.
loop at int_records3 where vbeln = int_records1-vbeln
and posnr = int_records1-posnr.
int_records1-mbdat = int_records3-mbdat.
modify int_records1.
exit.
endloop.
endloop.
refresh int_records3. free int_records3.
refresh int_records2.
*get the deliveries and calculate the open quantities
select vbelv posnv vbeln posnn rfmng plmin
from vbfa into table int_records2
for all entries in int_Records1
where vbelv = int_records1-vbeln
and posnv = int_records1-posnr
and VBTYP_N = 'J'. "Dels
*calculate open quantities next
loop at int_records1.
clear wlf_lmeng.
clear int_records2.
loop at int_records2 where vbelv = int_records1-vbeln
and posnv = int_records1-posnr.
case int_records2-plmin.
when '-'.
wlf_lmeng = wlf_lmeng - int_records2-rfmng.
when others. "just add
wlf_lmeng = wlf_lmeng + int_records2-rfmng.
endcase.
endloop.
int_records1-klmeng = int_records1-klmeng - wlf_lmeng.
int_records1-vbeln_dl = int_records2-vbeln.
int_records1-posnr_dl = int_records2-posnn.
modify int_records1.
endloop.
endif.
delete int_records1 where klmeng le 0.
refresh int_records2. free int_Records2.
ENDFORM. " get_data
*& Form build_detail
text
--> p1 text
<-- p2 text
FORM build_detail.
LOOP AT int_records1.
*DO INDIVIDUAL MOVES - ITS FASTER THAN MOVE-CORRESPONDING
move: int_records1-vkorg to LS_DATA-VKORG,
int_records1-werks to LS_DATA-WERKS,
int_records1-matnr to LS_DATA-MATNR,
int_records1-klmeng to LS_DATA-KLMENG,
int_records1-mbdat(6) to LS_DATA-YEARMONTH,
int_records1-meins TO LS_DATA-MEINS,
int_records1-vbeln TO LS_DATA-VGBEL,
int_records1-posnr TO LS_DATA-VGPOS,
int_records1-vbeln_dl TO LS_DATA-VBELN,
int_records1-posnr_dl TO LS_DATA-POSNR,
int_records1-mbdat to LS_DATA-WADAT_IST,
int_records1-PRDHA to LS_DATA-PRDHA,
int_records1-matkl to LS_DATA-MATKL.
APPEND LS_DATA TO LT_DATA.
clear: LS_DATA.
ENDLOOP.
ENDFORM. " build_detail -
How to Populate the JTable Object programatically with SQL Results
I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
Thanks in advance and God bless! (",)
* frmMain.java
* Created on October 4, 2006, 6:15 AM
package tds;
import java.io.*;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.imageio.*;
import javax.swing.JFrame;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
* @author Dexter.Carlit
public class frmMain extends javax.swing.JFrame {
private Connection connection = null;
private DefaultTableModel model;
/** Creates new form frmMain */
public frmMain() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jSplitPane = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane();
jPanel3 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
jGrid = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
getAccessibleContext().setAccessibleName("frmMain");
jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jSplitPane.setDividerLocation(200);
jSplitPane.setDividerSize(10);
jScrollPane2.setViewportView(jTree1);
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
jScrollPane1.setViewportView(jPanel3);
jSplitPane.setLeftComponent(jScrollPane1);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jLabel1.setText("First Name:");
jLabel2.setText("Last Name:");
jLabel3.setText("Position :");
jLabel4.setText("Department:");
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
jGrid.setColumnSelectionAllowed(true);
jGrid.setName("");
jGrid.setTableHeader(jGrid.getTableHeader());
jScrollPane3.setViewportView(jGrid);
jScrollPane3.getAccessibleContext().setAccessibleName("rset");
org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
jButton1.setText("Find");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
jButton2.setText("Clear");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.add(1, 1, 1))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel4)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
.add(jPanel4Layout.createSequentialGroup()
.add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(jTextField1))
.add(18, 18, 18)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jTextField2))
.add(16, 16, 16)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField3)
.add(jLabel4)
.add(jTextField4))
.add(14, 14, 14)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
.addContainerGap())
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
jTabbedPane1.addTab("Search", jPanel1);
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 458, Short.MAX_VALUE)
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 401, Short.MAX_VALUE)
jTabbedPane1.addTab("Directory", jPanel2);
jSplitPane.setRightComponent(jTabbedPane1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane)
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null}
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.updateUI();
}//GEN-LAST:event_jButton2MouseClicked
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
try {
//Load and register SQL Server driver
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//Establish a connection
Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
//Create a Statement object
Statement sql_stmt = connection.createStatement();
//Create a ResultSet object, execute the query and return a
// resultset
ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
// Populates a JTABLE Object
int i=0;
while (rset.next()){
String LName = rset.getString(1);
String FName = rset.getString(2);
String Position = rset.getString(3);
String Dept_Code = rset.getString(4);
String OffPhoneNo = rset.getString(5);
String LocalNo = rset.getString(6);
String OffMobileNo = rset.getString(7);
String HomePhoneNo = rset.getString(8);
String MobileNo = rset.getString(9);
String Email = rset.getString(10);
jGrid.updateUI();
jGrid.setValueAt(rset.getString(1).trim(),i,0);
jGrid.setValueAt(rset.getString(2).trim(),i,1);
jGrid.setValueAt(rset.getString(3).trim(),i,2);
jGrid.setValueAt(rset.getString(4).trim(),i,3);
jGrid.setValueAt(rset.getString(5).trim(),i,4);
jGrid.setValueAt(rset.getString(6).trim(),i,5);
jGrid.setValueAt(rset.getString(7).trim(),i,6);
jGrid.setValueAt(rset.getString(8).trim(),i,7);
jGrid.setValueAt(rset.getString(9).trim(),i,8);
jGrid.setValueAt(rset.getString(10).trim(),i,9);
i++;
//Close the ResultSet and Statement
rset.close();
sql_stmt.close();
//Close the database connection
connection.close();
System.out.println(Integer.toString(i) + " rows found");
} catch(Exception e) {
System.out.println("Failed to connect; Please view Stack Trace");
e.printStackTrace();
}//GEN-LAST:event_jButton1MouseClicked
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
}//GEN-LAST:event_formWindowOpened
public static void run(){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
frmMain frmMain = new frmMain();
frmMain.setLocationRelativeTo(null); // Center the JFrame on the
frmMain.setVisible(true);
private void exitApplication() {
// try {
// //gui.putStatus("Closing the connection....please wait.....");
// if(connection != null) {
// // connection.close(); //Closing the connection object.
// } catch(SQLException ex) { //Trap SQLException
// //gui.putStatus(ex.toString());
System.exit(0); //Exit the aplication
* @param args the command line arguments
public static void main(String args[]) {
run();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JTable jGrid;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JSplitPane jSplitPane;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTree jTree1;
// End of variables declaration//GEN-END:variables
}Use code tags.
Don't mix GUI and JDBC together. Split them out into separate classes.
You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings -
How to populate the Quering data into Excel sheet in Oracle
Dear Guys,
How to populate the Quering data into Excel sheet in oracle.
Please provide a solution.
Thanks & Regards,
Senthil K KumarHi
To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
Here's an example.
Example
<code>
SET LINESIZE 4000
SET VERIFY OFF
SET FEEDBACK OFF
SET PAGESIZE 999
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SPOOL c:\test_xls.xls
SELECT object_type
, SUBSTR( object_name, 1, 30 ) object
, created
, last_ddl_time
, status
FROM user_objects
ORDER BY 1, 2
SPOOL OFF
SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
SET LINESIZE 2000 VERIFY ON FEEDBACK ON
</code> -
Filtering A Dataset Using the Spry Validation Select Widget
Given the code below, how can I filter the rows in the
ds_BestConvertingByCategory dataset (in the spry:repeat area) that
match the product category (prodcat_id) selected in the Spry
Validation select widget?
// product categories table: columns - prodcat_id,
prodcat_desc
var ds_ProductCategories = new
Spry.Data.XMLDataSet("category_qry2xml.php", "product/category",
{useCache:false});
// has prodcat_id column
var ds_BestConvertingByCategory = new
Spry.Data.XMLDataSet("product_qry2xml.php", "special/deals[type =
'Best Converting']", {useCache:false});
// Spry regions inside a TabbedPanel
<div class="TabbedPanelsContent">
<form id="formOffersByCategory" class="frmsprysel"
name="formOffersByCategory" method="post" action="">
<strong>Select a Product Category: </strong>
<span spry:region="dsProductCategories"
id="spryselectProductByCategory">
<select spry:repeatchildren="ds_ProductCategories"
name="offersByCategory" id="offersByCategory"
onChange="ds_ProductCategories.setCurrentRowNumber(this.selectedIndex);">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
value="{prodcat_id}"
selected="selected">{prodcat_desc}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}"
value="{prodcat_id}">{prodcat_desc}</option>
</select>
</span>
</form>
<div id="offersbycategory"
spry:region="ds_BestConvertingByCategory"
class="SpryHiddenRegion">
<table id="offersByCategoryTbl" width="100%">
<tr class="colhdr">
<th width="50%">Offer</th>
<th width="50%">Code</th>
</tr>
<tr spry:repeat="ds_BestConvertingByCategory">
<td width="50%">{displaytext}</td>
<td width="50%">{offer_code}</td>
</tr>
</table>
</div>
</div>
// Spry validation select widget
var spryselectProductByCategory = new
Spry.Widget.ValidationSelect("spryselectProductByCategory");Hi flipone01,
To do this, make your region depend on both
ds_ProductCategories and ds_BestConvertingByCategory, then use the
spry:test attribute in conjunction with spry:repeat to weed out
items that don't have the same product id:
<div id="offersbycategory"
spry:region="ds_BestConvertingByCategory ds_ProductCategories"
<tr spry:repeat="ds_BestConvertingByCategory"
spry:test="{ds_BestConvertingByCategory::productcat_id} ==
{ds_ProductCategories::productcat_id}">
</div>
Remember that if you make a region depend on more than one
data set, you need to switch to using fully qualified data
references as the example above does (using the :: notation). If
you don't do that the data references default to the first data set
in the spry:region attribute.
--== Kin ==-- -
How to populate the data into the newly added infoobjects?
Hi,
how to populate the data into the newly added infoobjects?
Thanx in advance,
Ravi.hi ravi,
here is one example how to enhance.
Goto RSA6- select the 0Material.- Click on Enhance extract structure-> it will take u to the next screen there u need to create the field material group1. and append it to 0Material.
Goback to RSA6-- RC on 0material-- it will take you to customer version edit screen- here unchk the Hide and Field only known in exit options n save it.
Next Go back to RSA6-- 0material- click on Function enhancement it will take you to CMOD Screen( here we need to enter the project name and click create if not created on click display)
In the next screen we find the function exits Like EXIT_SAPLRSAP_001 FOR T DATA AND EXIT_SAPLRSAP_002 FRO Master Data,_003 for Text n _004 for Hierarchies.
select the appropriate function exit and double clikc on it. It will take you to Function builder screen.
D Click on defn of Include ZXRSAU01. it will take you to abap editor screen.
here u need to include the code for the enhanced fields n also write the code to populate the dat for that particular field.
save it and avtivate the code.
Hope this Is helpz,
partha -
How to populate the time component of a cube?
We have a question regarding how to populate the time component of a cube. Let me explain:
We are using OWB 10gR2. We have created a cube with several dimensions. We are now building the mapping to load the cube. The cube operator has two columns for every dimension (e.g., "customer" and "customer_id" for the "customer" dimension).
We understand that, in this case, "customer_id" stands for the dimension business key, so we create an arrow from the business key in the source table to the "customer_id" column in the cube operator.
So far so good. The mapping works all right, and the cube is loaded correctly.
Now we need to do the same for the time dimension. We have already created the time dimension and we have loaded it. We have also included it in the cube, so now we have two new columns in it: "time_day_code" and "time", both NUMBER data type.
We have the "sale_date" column (DATE data type), in the source system and, of course, now we want to populate the date column in the cube. We suppose that, somehow, we have to translate the "sale_date" field into the numeric column of the surrogate key of the time dimension. How should do we do this? I suppose that OWB must do the translation for us, just as it does for the other dimensions, but how? We have been looking into the manuals, and we have found no explanation on how to go about this.
Any help would be appreciated.
Best regards
Juan AlgabaHi Juan
You are right this should have been in the manuals, checked and there is only a brief mention (Using a Time Dimension in a Cube Mapping section)
The identifier format should have been documented for each level and will involve creating the formatted attribute for input to the cube operator's time dimension reference attribute.
The time dimension business keys are stored as follows;
Day Level - YYYYMMDD
Month Level - YYYYMM
Week Level - YYYYWW
Quarter - YYYYQ
Year - YYYY
If you have a source that has a SQL date datatype for example and want to construct the key for a cube's time dimension at the day level something like the following expression can be used to construct the time reference from a SQL date...
to_number(to_char( time_key, 'YYYYMMDD'))
The result of this expression can be used as input to the cube's time dimension attribute.
Cheers
David
Maybe you are looking for
-
What is the best approach to caching if I expect data base triggers to often change the data on the back end? Also a similar scenario but two seperate systems updating data in database independently. Thanks. p.s. SoftCacheWeakIdentity does not suppor
-
Using FF 9.0.1 www.corp.delaware.gov gets me a "Connection Untrusted" note. Error code : ssl_error_cert_domain. Never happened before. Just used my wives desktop and it went through normally.
-
How to burn multiple files on a DVD-R
I'm new to the disc-burning business. Throught the Apple support chat, they told me I could "multisession burn" by using Disk Utility instead of Finder. The webpage support sent me was for an older OS (not OS X 10.4). This didn't translate to the new
-
How to make an update command efficient, "it is urgent"
i have a table with with 891350 records, and the other table also have the same number or records, i have indexed both tables, and used this query to update the table, UPDATE tt A SET (A.SUBURB_FORM, A.DATASET_FORM, A.STATE_FORM)= (SELECT B.SUBURB, B
-
Hi all, i just created structure node without document using Txn SIMGH and save and transport it, when i check it in different client nodes are there but node text is missing and default text ('Node text not found') is there . please suggest me h