How to change attribute "read_only" of a inputfield in a table?
Hi, experts,
action:
1.Create a table with name " A_TABLE" in the layout in a view.
2.Binding some fields from a structure to the table.
3.Field "Checkbox" is a checkbox type and field "input" is a inputfield type with readonly in the table "A_TABLE" .
4.I hope: When selecting a checkbox in the "Checkbox" colume in a row in the table, the field "input" corresponding will be changed readonly.
The follow is my code: When select Field "Checkbox" , the method is invoked.
method ONACTIONCLICK4DISDESC .
data view type ref to if_wd_view.
DATA input_desc TYPE REF TO CL_WD_INPUT_FIELD.
data tab type if_BIDDING_LIST_VIEW=>elements_ONSURVEY.
data struct type if_BIDDING_LIST_VIEW=>element_ONSURVEY.
I have set "wd_this->m_view = view" in the method wddomodify and add m_view to the attribute of the
"viewBIDDING_LIST_VIEW" .
view ?= wd_this->m_view.
input_desc ?= view->GET_ELEMENT( `TABLE_INPUT_EDITOR` ).
input_desc->SET_READ_ONLY( EXPORTING value = abap_false ).
endmethod.
result:
when I select a checkbox in the "Checkbox" colume in a row in the table, all field "input" is read and write.
How can I do it ?
Best regards,
tao
Hello Wang,
You need to bind the readOnly attribute of the input field to a newly to created attribute beneath the dataSource node of the table within the context. That way, each input field of each row of the table can have a different value for readOnly.
Best regards,
Thomas
Similar Messages
-
How to change attributes of Objects of all windows in a MDI application
Hi,
I have a MDI application to draw Object. In these MDI windows I can modify attributes of Object like color, size... Now I want to create an option, when the user change or modifies attribute of Objects in a window, so it allow to change attributes of objects in all windows. I don't know how I can do it, please help me. ThanksAllow your objects to alias mutable attribute objects.
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.util.*;
import javax.swing.*;
import java.util.List;
public class Example extends JPanel {
private List bangles = new ArrayList();
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
for(Iterator j=bangles.iterator(); j.hasNext(); )
((Bangle)j.next()).paint(g2);
public void addBangle(Bangle bangle) {
bangles.add(bangle);
repaint();
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
Example app = new Example();
JFrame f = new JFrame("Example");
Container cp = f.getContentPane();
cp.add(app, BorderLayout.CENTER);
cp.add(Controller.create(app), BorderLayout.NORTH);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(800,600);
f.setLocationRelativeTo(null);
f.setVisible(true);
class Controller {
private Shade shade1 = new Shade(Color.GREEN), shade2 = new Shade(Color.RED), currentShade=shade1;
private Example modelView;
public static JComponent create(Example modelView) {
return new Controller(modelView).createUI();
private Controller(final Example modelView) {
this.modelView = modelView;
modelView.addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent evt) {
Rectangle shape = new Rectangle(evt.getX(), evt.getY(), 20, 20);
modelView.addBangle(new Bangle(shape, currentShade));
private JComponent createUI() {
ButtonGroup bg = new ButtonGroup();
final JToolBar tb = new JToolBar();
final JRadioButton rb1 = createRadio("Shade 1", true, shade1, bg, tb);
final JRadioButton rb2 = createRadio("Shade 2", false, shade2, bg, tb);
JButton btn = new JButton("Change color of selected shade");
btn.setContentAreaFilled(false);
btn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
Color newColor = JColorChooser.showDialog(tb, "Choose new color", currentShade.getColor());
if (newColor != null) {
currentShade.setColor(newColor);
if (currentShade == shade1)
rb1.setForeground(newColor);
else
rb2.setForeground(newColor);
tb.add(btn);
return tb;
private JRadioButton createRadio(String text, boolean selected, final Shade shade, ButtonGroup bg, JToolBar tb) {
JRadioButton rb = new JRadioButton(text, selected);
rb.setContentAreaFilled(false);
rb.setForeground(shade.getColor());
rb.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
currentShade = shade;
tb.add(rb);
return rb;
class Bangle {
private Shape shape;
private Shade shade;
public Bangle(Shape shape, Shade shade) {
this.shape = shape;
this.shade = shade;
public void paint(Graphics2D g2) {
g2.setColor(shade.getColor());
g2.draw(shape);
class Shade {
private Color color;
public Shade(Color color) {
this.color = color;
public Color getColor() {
return color;
public void setColor(Color color) {
this.color = color;
} -
How to change the Destination URI value of a item table at run time
I'd like to change the Destination URI of item of a table region when a column X of my view is not NULL. Where should I set the new Destination URI value for the item table region for specific row? Is in the RowImpl for the view object or in the Controler of the page?
I'd really appreciate any suggestion.
Thanks in advance.Hi,
Thanks for the help, but I still dont know where I should to use setAttributeValue(DESTINATION_ATTR,OADataBoundValueViewObject());
All examples that I saw till now here, suggestes to change something in the page in Controller but based on something entered in the page. In my case is IN to OUT, I will render some item table with a specific value parameter based what is in the database. Being more specific, I have a html table and one column Col1 has a value and it will have a DESTINATION URL if another column Col2 is Null. I believe I would have to check somewhere if the Col2 is null or not and change the DESTINATION URL property.
Thanks again.. -
How to change attributes of multiple devices ?
This is something I thought would be straightforward but for the life of me I can not see how is it done in ZCM. I just want to set a property for a number of devices - based on a manual selection or maybe search results. E.g. I would like to set a location for all devices added on a given day. I can easily do a search to bring up a list of the devices but can not see a way to set an attribute for those. Am I missing something obvious here ?
While on it, is it possible to set device attributes from bundles ? E.g. as a part of post-imaging process I would like to set the location or the department for that device from a linked bundle.Originally Posted by atrofimov
This is something I thought would be straightforward but for the life of me I can not see how is it done in ZCM. I just want to set a property for a number of devices - based on a manual selection or maybe search results. E.g. I would like to set a location for all devices added on a given day. I can easily do a search to bring up a list of the devices but can not see a way to set an attribute for those. Am I missing something obvious here ?
Guys, "cannot be done" would still be a valid answer :) I doubt it can't be done, after all it seems to me like a pretty basic feature. I would even be happy to change the attribute for a group of devices - e.g. create a dynamic group then change location for the members .. but I can't see a way of doing that either. -
How to change attributs of a piece of Document ?
Hello,
I have a JTextPane and a Document which has inherited of DefaultStyleDocument.
When the user has selected a piece of the text, I want to make him changes a few attributs
I looked at the sample TextComponentDemo, but all attributs are specified in menu items (so they are quite static).
In fact, users want to :
1. Select part of the text
2. Click on a menu item for example "Change Color" which invokes the JColorChooser Class
3. change the text after having selected a color.
More generally, this applies also to font name from the font family, font syle and font size.
I noticed that there is a class name AttributSet, but I don't know how to manipulate this set (especially where to find attribut names).
Thanks in advance for suggestions, examples, or pointers to good documentations
Gegebut all attributs are specified in menu items (so they are quite static).Yes, but the Action is created using a color Object. So just create an action using the color selected from the JColorChooser and then invoke its actionPerformed() method:
Action foreground = new StyledEditorKit.ForegroundAction("", colorFromColorChooser);
foreground.actionPerformed(null); -
How to change attributes of fields ?
hi evryone,
I am new to ERP HCM (HR) . I have used standard services as leave request and all. In Leave Request i want to change the attributes of the fields on user entry. Is this possible to be done? if yes , how? how can i see the structure coming onfront ? Where can we maintain these fields at backend?
thanks in advance.Hi evryone,
Please help me for this. -
How to change attributes of HTML table in HTMLDocument
Hi
I am trying to change background of table cell but unsuccessfully. First of all I did not found any suitable method in API so I have to inherit HTMLDocument and make my own
public static class ExtendedHtmlDocument extends HTMLDocument {
public void replaceAttributes(Element element, AttributeSet attributes, HTML.Tag tag) {
try {
writeLock();
int offset = element.getStartOffset();
int length = element.getEndOffset() - offset;
MutableAttributeSet mutableAttributes = (MutableAttributeSet) element.getAttributes();
mutableAttributes.removeAttributes(attributes.getAttributeNames());
mutableAttributes.addAttributes(attributes);
DefaultDocumentEvent changes = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE);
changes.addEdit(new AttributeUndoableEdit(element, attributes.copyAttributes(), true));
changes.end();
fireChangedUpdate(changes);
fireUndoableEditUpdate(new UndoableEditEvent(this, changes));
finally {
writeUnlock();
}When I usethis code and dump exisiting document I see changes, e.g. I changed background in cell:
private void setCellBackground(Element element) {
SimpleAttributeSet set = new SimpleAttributeSet();
set.addAttribute("bgcolor", "black");
doc.replaceAttributes(element, set, HTML.Tag.TD);
doc.dump(System.out);
//editor.setText(editor.getText());
} and extract from dump
<html
name=html
>
<table
width=100%
<td
bgcolor=black
name=td
>But I do not see changes in the view, cell has the same background. The view is updated only if I uncomment last line "editor.setText(editor.getText())", but I think it is not good to update this way.
Thanks.Here I put an example and you can play with different strange aspects of HTMLDocument implementation
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class TableEditor implements ActionListener {
private JEditorPane editor;
private ExtendedHtmlDocument doc;
public TableEditor(JEditorPane editor, ExtendedHtmlDocument doc) {
this.editor = editor;
this.doc = doc;
public void actionPerformed(ActionEvent e) {
Element element = doc.getCharacterElement(editor.getCaretPosition());
Element parent = element.getParentElement();
while (parent != null && !parent.getName().equals("td")) {
parent = parent.getParentElement();
if (parent == null) {
JOptionPane.showMessageDialog(null, "Select cell to edit properties");
} else {
SimpleAttributeSet attributes = new SimpleAttributeSet();
attributes.addAttribute(HTML.Attribute.BGCOLOR, "gray");
attributes.addAttribute(HTML.Attribute.ALIGN, "right");
doc.replaceAttributes(parent, attributes);
// doc.replaceAttributes(parent, attributes);
// editor.setText(editor.getText());
doc.dump(System.out);
private static class ExtendedHtmlEditorKit extends HTMLEditorKit {
public Document createDefaultDocument() {
StyleSheet styles = getStyleSheet();
StyleSheet styleSheet = new StyleSheet();
styleSheet.addStyleSheet(styles);
ExtendedHtmlDocument doc = new ExtendedHtmlDocument(styleSheet);
doc.setParser(getParser());
return doc;
public static class ExtendedHtmlDocument extends HTMLDocument {
public ExtendedHtmlDocument(StyleSheet styles) {
super(styles);
public void replaceAttributes(Element element, AttributeSet attributes) {
try {
writeLock();
MutableAttributeSet mutableAttributes = (MutableAttributeSet) element.getAttributes();
mutableAttributes.removeAttributes(attributes.getAttributeNames());
mutableAttributes.addAttributes(attributes);
int offset = element.getStartOffset();
int length = element.getEndOffset() - offset;
DefaultDocumentEvent changes = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE);
changes.addEdit(new AttributeUndoableEdit(element, attributes.copyAttributes(), true));
changes.end();
fireChangedUpdate(changes);
fireUndoableEditUpdate(new UndoableEditEvent(this, changes));
finally {
writeUnlock();
public static void main(String args[]) throws Exception {
HTMLEditorKit kit = new ExtendedHtmlEditorKit();
final ExtendedHtmlDocument doc = (ExtendedHtmlDocument) kit.createDefaultDocument();
StringReader reader = new StringReader("<table border='1' width='100%'>\n" +
" <tr>\n" +
" <td>Cell1-1</td>\n" +
" <td>Cell1-2</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td>Cell2-1</td>\n" +
" <td>Cell2-2</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td>Cell3-1</td>\n" +
" <td>Cell3-2</td>\n" +
" </tr>\n" +
"</table><p>paragraph</p>");
kit.read(reader, doc, 0);
final JEditorPane editorPane = new JEditorPane();
editorPane.setIgnoreRepaint(false);
editorPane.setEditable(true);
editorPane.setEditorKit(kit);
editorPane.setDocument(doc);
JScrollPane scrollPane = new JScrollPane(editorPane);
JPanel menu = new JPanel(new FlowLayout(FlowLayout.LEFT));
menu.add(new JButton(new AbstractAction("Cell properties") {
public void actionPerformed(ActionEvent e) {
new TableEditor(editorPane, doc).actionPerformed(e);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
frame.getContentPane().add(menu, BorderLayout.NORTH);
frame.setSize(800, 500);
frame.setVisible(true);
}Look at actionPerformed implemetation I am going to change cell background and alignment - background is changed but alignment is not, when you uncomment second doc.replaceAttributes(parent, attributes) - it will work. In both cases align attribute exists in cell (look at the dump in system.out) -
How to change the column name as bold in adf table
Hi,
How can I change the column name with bolder style and blue colour in adf Table?
I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
can any one have any idea how to do this?
and I have taken panel tabbed layout and in that i'm displaying this table.
but this table has scroll beneath of it to show all columns.
but i want to display all columns (for this, page should have scroll at the bottom side).
how can I achieve this???Hi,
Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
*af|column::column-header-cell{*
color:Blue;
font-weight:bold;
This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
By the way, what version of JDeveloper are you using?
Thanks,
Navaneeth -
How to change the standard Fields short description in KNVV table
Hi All,
Our system is recently upgraded from 4.7 to ECC 6. When we compared both versions we found the KNVV table fields descriptions are changed in 4.7(customer modifications done in 4.7) and same these customer modifications are not copied to ECC 6 from 4.7 version.
So I tried to change the short description at domain level with the help of access key. But the description is not changed. Can you please let me know is there any procedure that how can we change the fields description for standard tables.
KNVV table in 4.7 ECC 6
Fields Short Description Short Description
1. KVGR1 Gen.Bus.Terms print Customer group 1
2. KVGR2 VAT on FOC Customer group 2
3. KVGR3 Confirmation status Customer group 3
4. KVGR4 Collect Billing Customer group 4
5. KVGR5 SC Surchge Excl Customer group 5
Regards,
Jyothi CH.You need not use access key to change field labels
Transaction CMOD -> Go to -> Text Enhancements -> Keyword -> Change.
Here you can change all data element KNVGR1 to KVGR5 -
How to change font while displaying data through an ALV table in WDA?
Hi all,
I am displaying data through and ALV table. Now I want to change the FONT only for few rows. Is this possible?
If so then do the needful to me..
Thanks & Regards,
Yugesh A.I believe as you have found 'LVC_FIELDCATALOG_MERGE' would only work with the classic dynpro (SAPGUI based) version of the ALV.
You won't be able to control the font the same way in the WDA version of the ALV. You will need to create a custom cell editor for the column(s) in question. You can then bind context attributes to the properties of the cell editor. You will need extra attributes in your bound context to control these settings on the row level. Also you will be restricted by the changing the DESIGN property. This means only the values allowed for the DESIGN of the particluar UI element. For a TextView that wouldn't be the font directly (the font of course comes from the Theme).
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data textview type ref to CL_SALV_WD_UIE_TEXT_VIEW.
l_column = l_table->if_salv_wd_column_settings~get_column( 'ADD_PARTICIPANTS' ).
create object textview.
textview->SET_TEXT_FIELDNAME( 'ADD_PARTICIPANTS' ).
textview->set_design_fieldname( 'ADD_DESIGN' ).
textview->set_wrapping( abap_true ).
l_column->set_cell_editor( textview ).
DESIGN supports the following options:
Value
Visual Display
Description
emphasized
Text is highlighted in default size
groupTitle
Header for forms
This enumeration value is deprecated. Instead, use SectionHeader.
header1
Text is highlighted with font size +4 in relation to the default font size.
header2
Text is highlighted with font size +5.08 cm relation to the default font size.
header3
Text is highlighted in default size
header4
Text is highlighted in font size -1 (small) in relation to the default font size (like the legend but highlighted)
label
Text is display in the default font type. A space is always inserted after the text.
label_small
Text is displayed in default font type, as with label, onyl that font size is -1 (like the font size for header4).
legend
Text is displayed with default font type in size -1.
reference
Text is in italics and in default font size.
standard
Text is displayed in default font size. No text attributes are defined for this value.
monospace
Text is displayed in no-proportional font type. Each letter takes up the same space. -
I created my own index.template.html using <object> tag to hold Flex swf file, but it only works for FireFox, not IE.
I did not use the original FlexBuilder's index.template.html and the JavaScripts to generate the HTML wrapper.
Here is my index.template.html:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My App</title>
</head>
<body scroll="yes">
<table cellpadding="0" cellspacing="0" width="982px" border="0">
<tr width="982px"><td>This app is still under development. Currently, you can... </td></tr>
</table>
<p>
<table>
<tr>
<td>
<div style="width:192px;height:130px;border:1px solid rgb(0, 0, 0);">
<!-- div style="border-style:solid;" -->
<table align="left" border="0" >
<tr>
<td >
<span style="color:#242F6D;font-weight:bold;font-size:12px;">Stock:</span>
</td>
</tr>
<tr>
<td>
<select style="font-size:11px;">
<option>ADBE - Adobe</option>
<option>BAC - Bank of America</option
</select>
</td>
</tr>
<tr>
<td >
<span style="color:#242F6D;font-weight:bold;font-size:12px;">Shares:</span>
</td>
</tr>
<tr>
<td>
<input type="text" name="shares" style="font-size:11px;"/>
</td>
</tr>
<tr>
<td>
<button type="button" style="color:#242F6D;font-weight:bold;font-size:10px;">Add To My App</button>
</td>
</tr>
</table>
</div>
<p>
<div style="width:192px;height:310px;border:1px solid rgb(0, 0, 0);">
<table border="0">
<tr>
<td style="color:#242F6D;font-weight:bold;font-size:10px;">
You may enter your values
</td>
</tr>
<tr>
<td >
<textarea id="quoteShare" style="width:186px;font-weight:bold;font-size:11px;" rows="13" >
</textarea>
</td>
</tr>
<tr>
<td>
<button onclick="callFlex()" type="button" style="color:#242F6D;font-weight:bold;font-size:10px;">Get Values of My App</button>
</td>
</tr>
</table>
</div>
<td>
<td>
<table align="left" border="0" >
<tr valign="top">
<td valign="top">
<object type="application/x-shockwave-flash" data="ComponentTester.swf" WIDTH="850" HEIGHT="460" />
</td>
</tr>
</table>
<td>
</tr>
</table>
</body>
</html>I just found 1 tricky solution.
Declare a variable containing the asset URL in the HTML, before the <!--Adobe Edge Runtime--> part. (Sample below.)
In the script (_edge.js), use this variable instead of the asset URL string . (replace the string constant with the variable)
In the server script, generate the HTML by changing the variable definition.
This is ugly...
I would appreciate any help.
Thanks.
=== HTML sample:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<script>
// Define the asset URL
var cardImage = 'card_01.png';
</script>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="animtest_edgePreload.js"></script>
<style>
.edgeLoad-EDGE-1381868 { visibility:hidden; }
</style>
<!--Adobe Edge Runtime End-->
</head>
==== -
hi,
Explain me how to change attributes of the object dynamically?
sarathhi sarath,
Hope u have queried regarding screen attributes..
u can use the loop at screen for changing the attributes dynamicaly..
r1 type radiobutton group a.
loop at screen.
screen-name = 'R1'. " r1 is field name make sure u write in caps
screen-input = 0.
screen-invisible = 0.
endloop.
u can check SCREEN table in se11 u can get the attributes which u can change dynamically..so use the syntax SCREEN-ATTRIBUTE NAME....
hope i have answered u..
regards,
Rajkumar.G -
How to change posting date in J1IH Code
i posted the posting date wrongy for current date, in J1IH t code. how to change that into last march month date in table. what is the table name? how to do?
Hi hi,
Posting date is system date you shoudnt change it.
What is your perticular requirement , why you want to change it?
If you have already post the document then it is not possibe the change the posting date..
Rgds,
Kareena -
How to change table border color in DW CS6
I need to know how to change the color of the border around my tables in Dreamweaver CS6. I saw a article on how to change it on http://forums.adobe.com/message/4451812, but i really couldnt follow because im just starting out using dreamweaver and i dont know anything about code. Is there a simple way to change the border color or can you give me a basic step process on how to change the border color in the code?
Just an FYI, nobody uses Table-based layouts anymore. It's much better to use CSS for layouts. Only use tables for tabular data like spreadsheets and charts.
Dreamweaver has a bunch of pre-built CSS Layouts for you to use as starter pages. Just go to File > New > Blank page > HTML. Pick a layout from the 3rd panel and hit Create button. See screenshot below.
Nancy O. -
HOW TO CHANGE SQL QUERY TO GET SPECIFIC RESULT
I HAVE FOLLOWING QUERY AND ITS FUNCTIONING BUT I WANT ALL THOSE RECORD SHOULD BE DISPLADE WICH HAVE NO TRANSACTION IN SALES ANS SALES RETURN WHILE RETREVING DATA FROM DATABASE.
I TRIED TO USE + OPERATOR BUT I DON'T KNOW HOW TO CHANGE THE QUERY TO GET THE RESULT
MAIN TABLE IS BEING USED TO FETCH RECORD
SALES_HEADER,SALES_DETAIL
SALES_HEADERR,SALES_DETAILR
STOCK_REG
AND THE QUERY IS
select s.item_code,S.DESCR,s.GRAND_TOTAL,
sum(decode(d.dayno,01,NVL(S.QTY,0),0)) DAY1,
sum(decode(d.dayno,02,NVL(S.QTY,0),0)) DAY2,
sum(decode(d.dayno,03,NVL(S.QTY,0),0)) DAY3,
sum(decode(d.dayno,04,NVL(S.QTY,0),0)) DAY4,
sum(decode(d.dayno,05,NVL(S.QTY,0),0)) DAY5,
sum(decode(d.dayno,06,NVL(S.QTY,0),0)) DAY6,
sum(decode(d.dayno,07,NVL(S.QTY,0),0)) DAY7,
sum(decode(d.dayno,08,NVL(S.QTY,0),0)) DAY8,
sum(decode(d.dayno,09,NVL(S.QTY,0),0)) DAY9,
sum(decode(d.dayno,10,NVL(S.QTY,0),0)) DAY10,
sum(decode(d.dayno,11,NVL(S.QTY,0),0)) DAY11,
sum(decode(d.dayno,12,NVL(S.QTY,0),0)) DAY12,
sum(decode(d.dayno,13,NVL(S.QTY,0),0)) DAY13,
sum(decode(d.dayno,14,NVL(S.QTY,0),0)) DAY14,
sum(decode(d.dayno,15,NVL(S.QTY,0),0)) DAY15,
sum(decode(d.dayno,16,NVL(S.QTY,0),0)) DAY16,
sum(decode(d.dayno,17,NVL(S.QTY,0),0)) DAY17,
sum(decode(d.dayno,18,NVL(S.QTY,0),0)) DAY18,
sum(decode(d.dayno,19,NVL(S.QTY,0),0)) DAY19,
sum(decode(d.dayno,20,NVL(S.QTY,0),0)) DAY20,
sum(decode(d.dayno,21,NVL(S.QTY,0),0)) DAY21,
sum(decode(d.dayno,22,NVL(S.QTY,0),0)) DAY22,
sum(decode(d.dayno,23,NVL(S.QTY,0),0)) DAY23,
sum(decode(d.dayno,24,NVL(S.QTY,0),0)) DAY24,
sum(decode(d.dayno,25,NVL(S.QTY,0),0)) DAY25,
sum(decode(d.dayno,26,NVL(S.QTY,0),0)) DAY26,
sum(decode(d.dayno,27,NVL(S.QTY,0),0)) DAY27,
sum(decode(d.dayno,28,NVL(S.QTY,0),0)) DAY28,
sum(decode(d.dayno,29,NVL(S.QTY,0),0)) DAY29,
sum(decode(d.dayno,30,NVL(S.QTY,0),0)) DAY30,
sum(decode(d.dayno,31,NVL(S.QTY,0),0)) DAY31,
sum(S.qty) TU
FROM
(select nvl(sales_detail.qty+sales_detail.bonus,0) as qty,
sales_detail.item_code AS ITEM_CODE,
stock_reg.descr AS descr,
s_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
SALES_DETAIL,SALES_HEADER,STOCK_REG
WHERE SALES_DETAIL.S_ID = SALES_HEADER.S_ID AND
SALES_DETAIL.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
STOCK_REG.COMCODE='C1'
UNION all
select -1*nvl(sales_detailR.qty+sales_detailR.bonus,0) as qty,
sales_detailR.item_code AS ITEM_CODE,
stock_reg.descr AS descr,
RETURN_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
STOCK_REG.COMCODE='C1') S,
(select level as dayno
from dual
connect by level <= 31) d
where d.dayno = to_char(s.sALE_date, 'DD') AND TO_DATE(S.SALE_DATE) BETWEEN '&FROMDATE' AND '&TODATE'
GROUP BY S.ITEM_CODE,S.DESCR,S.GRAND_TOTALwell my query running successfully just the quesion was that i wanted to bring some changes in the query to retrieve the complete record which has no transaction in sales
for exmple
if i write the quey
select dept.deptno,sum(sal) from emp,dept
where dept.deptno = emp.deptno
group by dept.deptno
the recult comes as
DEPTNO SUM(SAL)
10 8750
20 10875
30 9400
though there is another deptno which is deptno no 40
have no sal
and when i use this query
select dept.deptno,sum(sal) from emp,dept
where dept.deptno = emp.deptno(+)
group by dept.deptno
it shows the dept no 40 also
DEPTNO SUM(SAL)
10 8750
20 10875
30 9400
40
so to get this i posted query which was to long to understand easily.
i accept that i sholud post short query to make other understand
so check out this
select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE
AND RETURN_DATE = '01-APR-08'
GROUP BY STOCK_rEG.item_code
ORDER BY TO_NUMBER(ITEM_CODE) ASC
when i execute this query i get the following result
ITEM_CODE QTY
84 2
102 3
108 3
116 6
166 3
170 3
thoug there is other items are aalso available in stock which transaction
yet not been done or not been sold out/
so when i use the outer join i get the same result
select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
FROM
SALES_DETAILR,SALES_HEADERR,STOCK_REG
WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
SALES_DETAILR.STOCKCODE(+) = STOCK_REG.STOCKCODE
AND RETURN_DATE = '01-APR-08'
GROUP BY STOCK_rEG.item_code
ORDER BY TO_NUMBER(ITEM_CODE) ASC
ITEM_CODE QTY
84 2
102 3
108 3
116 6
166 3
170 3
hope i tried to make u understand on better way
Maybe you are looking for
-
Risks associated with digital signatures
We are looking to develop a process to use digital signatures on PDF documents, send them via email to a line manager, who adds his digital signature as a "stamp of approval" who then emails them to a specific department for processing. Are there any
-
Sales credit account and Purchse credit Acc
hi Can any one give the breif introduction of Sales credit account and Purchse credit Acc and there journal entry pass against which documents
-
im planning to buy a new macbookpro retina... in doin architecture. will the graphics and the system specs go well with 3ds max, revit, sketchup,autocad, photoshop, 3d modelling and rendering software like lumion. Im confused. whether its worth to bu
-
Any faq or preferred design tools on OS X? I do not have .Mac account, is that a problem to use iWeb? Thanks
-
Book gone after upgrading Aperture to 3.5.1
I recently upgraded my Aperture version to 3.5.1. In the process, it upgraded my library. Immediately upon opening it back up, I noticed that the pictures and book that I had been working on have disappeared. Unfortunately, I don't have any known