Print line number only on item lines (not text lines)
Hi everyone,
I need to print the line number on a document only for the item lines, not the text lines.
I also want the line number serie to be in a straight ascending serie, not just to skip the numbering on the text lines.
Like this
Item Description Price
1 123 Item 123 100 EUR
This is a special offer for you!
2 456 Item 456 275 EUR
3 678 Item 678 300 EUR
This item is not on stock.
4 888 Item 888 350 EUR
Any hints?
Thank you!
//Susanna
Hi Susanna,
You probably need an UDF to achieve your goal. There is no formula supporting your requirement.
Thanks,
Gordon
Similar Messages
-
My contact number is red, I can not text or iMessage. I message is on
my contact number is red, I can not text or iMessage. iMessage is on. This is using iPad and iPhone.
MMH100,
The article linked below details a number of steps that can help restore your ability to send messages from your iPad and iPhone.
If you can't send or receive messages on your iPhone, iPad, or iPod touch
http://support.apple.com/en-us/HT204065
All my best,
Allen -
Delivery schedule line number in sales order is not populated in production
Hi all,
i am doing make to order scenario with 20 strategy group. In sales order we r defining the different delivery schedule lines.when i run the MRP and getting the plan orders for all the FG material and semifinished material, the sale order number and sale order item number is getting updated in production order . Beside these two , delivery schedule line number is not populated in production order.
please give your valuable suggestion .
i would be highly thankful to u
Will reward points.
Regards
KumaraguruHi Kumar,
Some changes done in your PRD server.If yes then contact abap consultant regarding the same.
Because these type of problem comes when you do transport or changes done in the system.
Regards,
Anil -
Delivery schedule line number in sales order is not populated in productio
Hi all,
i am doing make to order scenario with 20 strategy group. In sales order we r defining the different delivery schedule lines.when i run the MRP and getting the plan orders for all the FG material and semifinished material, the sale order number and sale order item number is getting updated in production order . Beside these two , delivery schedule line number is not populated in production order.
please give your valuable suggestion .
i would be highly thankful to u
Regards
KumaraguruHi Kumar,
Some changes done in your PRD server.If yes then contact abap consultant regarding the same.
Because these type of problem comes when you do transport or changes done in the system.
Regards,
Anil -
How to update PO Price only for a single line item and not other Line Item
Hi
My requirement is not to update Price of PO from PIR if the Final Invoice Indiactor is not set and it is not a return PO. I am trying to do this using
BAPI_PO_CHANGE to update price automatically from Pricing record using
POITEM-PO_ITEM = '00001'
POITEM-CALCTYPE = 'B'.
POITEMX-PO_ITEM = '00001'
POITEMX-CALCTYPE = 'X'.
The price gets updated for the line item 1 as well as other line item which I do not want. Please can you tell how to restrict that.
Is it possible to restrict through configuration if this indicator is set there should be no price update. I tried to check in ME22n and if I update the condition item by pressing the update button the other item price also gets updated.
Thanks
ArghadipTimestamp is date and time together in one field..
Search for data element TIMESTAMP.
If you are getting this in your table.
If you are getting time and date in different fields then you can use the function module
given below....
CALL FUNCTION 'DELTA_TIME_DAY_HOUR'
EXPORTING
t1 =
t2 =
d1 =
d2 =
IMPORTING
MINUTES =
Then you can convert minutes into seconds..
Function module credit to BrightSide it works....but only it will give difference in minutes
Regards,
Lalit Mohan Gupta. -
How can I sync only checked items and not the whole album?
I only want say three songs out of an album but it syncs the whole thing. How do I change that?
Don't create a playlist for three songs.
Either uncheck those songs or a much better way is to create a playlist (or a few) of songs you want on the iPod the sync only those playlists.
To add/delete from the iPod, simply add/delete from those playlists. -
help anybody
Sorry, this can't be done.
This is the only thing you can do:
Reporting a lost or stolen Apple product -
How can I only send imessages and not texts on my iphone 4S
I have turned OFF Send as SMS on the settings of my iphone. However the phone still allows me to send text messages using the message facility. I am aware that green equals text and blue equals imessage.
I would however like to disable or at least have a reminder before sending a text in order that I do not get billed for sending photos attached to text instead of as imessages
I thought that turning OFF Send as SMS in the settings field would prevent me sending texts and only allow imessages to go out, but this does not seem to be the case
Regards
DaveYou can turn off sending pictures messages except as iMessages by going to Settings>Messages>MMS Messaging and setting it to "Off".
-
I want messages to be delivered to the other person only through iMessages . Is there a way to disable text messages being sent to the other iphone .
In message settings, disable the send as SMS setting. That does mean any message sent to a non-iMessage enabled device will just not get sent.
-
Until about a week ago I could read all my iCloud email. Lately some subscription items come in with the email header but the body is blank. When I checked the same messages on my iPhone via iCloud email the full body text is available. Any ideas how I can get my Mac Pro to see the text? I've rebooted the Mac Pro and closed the iCloud and reconnected but no change.
Thanks
PaulI think you need mountain lion. I am having the same issue. Here is the system requirements for iCloud to work properly. I hope this helps.
http://support.apple.com/kb/HT4759 -
MIRO / - Can it match on item number instead of line number?
Hello,
I am bringing in INVOICE01 iDocs and posting them (same as manual MIRO) against 2 Way Purchase Orders with function module IDOC_INPUT_INVOIC_MRM. Since the PO's are 2 Way PO's we don't do receipts against them.
My Issue: This vendor does not always have accurate line numbers on their invoice.
My question: Can I set up MIRO (and IDOC_INPUT_INVOIC_MRM) to match on item number instead of line number?
Thank youYou can only pass the PO number to post invoice in MIRO transaction. The caveat here is that this workes perfectly if your POs are single line POs. If not then there is no way of posting a correct invoice without the line number.
The item/material number you are referring is not part of the MIRO parameter selection process for the same item/material there can be many POs with the same vendor or even multiple vendors. -
Item does not match schdule line ( program error ) message no . V1427
*Item does not match schdule line ( program error ) message no . V1427 .* This is the message I am getting when I am trying to display a quotation through VA23 . From here system exits the transaction .
As per my observation , when I compared VBAP and VBEP tables, there are 2 items in VBEP table with schedule lines but the same items are not present in VBAP table. User says he tried to delete these items because there is no quanity , Inspite of that these items appear in VBEP table .
The document is a reservation document where in schedule line category does TOR and availability check.
I checked various related notes - 442831 , 401463 , 389687 etc . These are quite old notes and I am in release ECC 5.0 .
What is the best way as this doc has nearly 30 items and nearly all of them have quanity confirmed .
Please provide your valuble inputs ...
Regards
Raghav..Nitin,
Below are the steps to check
Transaction SE18
Definition name: BADI_SD_SALES
Menu: Implementation -> Overview
double-click on implementation: IM_CORE_CHECK
Now you will get an overview on the methods.
check whether implementation IM_CORE_CHECK is active or not.
If not Press the change button and activate
looking at the your system pack level this should be active. If it is active then the inconsistency must be modified directly at database level through Z report.
Ramesh -
Hi Experts;
How do I add a caret listener on this code so that it will just add a number
when the user goes to the next line.
import java.awt.*;
import javax.swing.*;
public class LineNumber extends JComponent
private final static Color DEFAULT_BACKGROUND = new Color(213, 213, 234);
private final static Color DEFAULT_FOREGROUND = Color.white;
private final static Font DEFAULT_FONT = new Font("arial", Font.PLAIN, 11);
// LineNumber height (abends when I use MAX_VALUE)
private final static int HEIGHT = Integer.MAX_VALUE - 1000000;
// Set right/left margin
private final static int MARGIN = 5;
// Line height of this LineNumber component
private int lineHeight;
// Line height of this LineNumber component
private int fontLineHeight;
// With of the LineNumber component
private int currentRowWidth;
// Metrics of this LineNumber component
private FontMetrics fontMetrics;
* Convenience constructor for Text Components
public LineNumber(JComponent component)
if (component == null)
setBackground( DEFAULT_BACKGROUND );
setForeground( DEFAULT_FOREGROUND );
setFont( DEFAULT_FONT );
else
setBackground( DEFAULT_BACKGROUND );
setForeground( DEFAULT_FOREGROUND );
setFont( component.getFont() );
setPreferredSize( 99 );
public void setPreferredSize(int row)
int width = fontMetrics.stringWidth( String.valueOf(row) );
if (currentRowWidth < width)
currentRowWidth = width;
setPreferredSize( new Dimension(2 * MARGIN + width, HEIGHT) );
public void setFont(Font font)
super.setFont(font);
fontMetrics = getFontMetrics( getFont() );
fontLineHeight = fontMetrics.getHeight();
* The line height defaults to the line height of the font for this
* component. The line height can be overridden by setting it to a
* positive non-zero value.
public int getLineHeight()
if (lineHeight == 0)
return fontLineHeight;
else
return lineHeight;
public void setLineHeight(int lineHeight)
if (lineHeight > 0)
this.lineHeight = lineHeight;
public int getStartOffset()
return 4;
public void paintComponent(Graphics g)
int lineHeight = getLineHeight();
int startOffset = getStartOffset();
Rectangle drawHere = g.getClipBounds();
g.setColor( getBackground() );
g.fillRect(drawHere.x, drawHere.y, drawHere.width, drawHere.height);
g.setColor( getForeground() );
int startLineNumber = (drawHere.y / lineHeight) + 1;
int endLineNumber = startLineNumber + (drawHere.height / lineHeight);
int start = (drawHere.y / lineHeight) * lineHeight + lineHeight - startOffset;
for (int i = startLineNumber; i <= endLineNumber; i++)
String lineNumber = String.valueOf(i);
int width = fontMetrics.stringWidth( lineNumber );
g.drawString(lineNumber, MARGIN + currentRowWidth - width, start);
start += lineHeight;
setPreferredSize( endLineNumber );
} Thanks for your time . . .
The_DeveloperHere's what I use. It behaves correctly WRT wrapped lines, and should work equally well with a JTextArea or a JTextPane.
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.SizeSequence;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Element;
import javax.swing.text.JTextComponent;
* LineNumberView is a simple line-number gutter that works correctly
* even when lines are wrapped in the associated text component. This
* is meant to be used as the RowHeaderView in a JScrollPane that
* contains the associated text component. Example usage:
*<pre>
* JTextArea ta = new JTextArea();
* ta.setLineWrap(true);
* ta.setWrapStyleWord(true);
* JScrollPane sp = new JScrollPane(ta);
* sp.setRowHeaderView(new LineNumberView(ta));
*</pre>
* @author Alan Moore
public class LineNumberView extends JComponent
// This is for the border to the right of the line numbers.
// There's probably a UIDefaults value that could be used for this.
private static final Color BORDER_COLOR = Color.GRAY;
private static final int WIDTH_TEMPLATE = 99999;
private static final int MARGIN = 5;
private FontMetrics viewFontMetrics;
private int maxNumberWidth;
private int componentWidth;
private int textTopInset;
private int textFontAscent;
private int textFontHeight;
private JTextComponent text;
private SizeSequence sizes;
private int startLine = 0;
private boolean structureChanged = true;
* Construct a LineNumberView and attach it to the given text component.
* The LineNumberView will listen for certain kinds of events from the
* text component and update itself accordingly.
* @param startLine the line that changed, if there's only one
* @param structureChanged if <tt>true</tt>, ignore the line number and
* update all the line heights.
public LineNumberView(JTextComponent text)
if (text == null)
throw new IllegalArgumentException("Text component cannot be null");
this.text = text;
updateCachedMetrics();
UpdateHandler handler = new UpdateHandler();
text.getDocument().addDocumentListener(handler);
text.addPropertyChangeListener(handler);
text.addComponentListener(handler);
setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
* Schedule a repaint because one or more line heights may have changed.
* @param startLine the line that changed, if there's only one
* @param structureChanged if <tt>true</tt>, ignore the line number and
* update all the line heights.
private void viewChanged(int startLine, boolean structureChanged)
this.startLine = startLine;
this.structureChanged = structureChanged;
revalidate();
repaint();
/** Update the line heights as needed. */
private void updateSizes()
if (startLine < 0)
return;
if (structureChanged)
int count = getAdjustedLineCount();
sizes = new SizeSequence(count);
for (int i = 0; i < count; i++)
sizes.setSize(i, getLineHeight(i));
structureChanged = false;
else
sizes.setSize(startLine, getLineHeight(startLine));
startLine = -1;
/* Copied from javax.swing.text.PlainDocument */
private int getAdjustedLineCount()
// There is an implicit break being modeled at the end of the
// document to deal with boundary conditions at the end. This
// is not desired in the line count, so we detect it and remove
// its effect if throwing off the count.
Element map = text.getDocument().getDefaultRootElement();
int n = map.getElementCount();
Element lastLine = map.getElement(n - 1);
if ((lastLine.getEndOffset() - lastLine.getStartOffset()) > 1)
return n;
return n - 1;
* Get the height of a line from the JTextComponent.
* @param index the line number
* @param the height, in pixels
private int getLineHeight(int index)
int lastPos = sizes.getPosition(index) + textTopInset;
int height = textFontHeight;
try
Element map = text.getDocument().getDefaultRootElement();
int lastChar = map.getElement(index).getEndOffset() - 1;
Rectangle r = text.modelToView(lastChar);
height = (r.y - lastPos) + r.height;
catch (BadLocationException ex)
ex.printStackTrace();
return height;
* Cache some values that are used a lot in painting or size
* calculations. Also ensures that the line-number font is not
* larger than the text component's font (by point-size, anyway).
private void updateCachedMetrics()
Font textFont = text.getFont();
FontMetrics fm = getFontMetrics(textFont);
textFontHeight = fm.getHeight();
textFontAscent = fm.getAscent();
textTopInset = text.getInsets().top;
Font viewFont = getFont();
boolean changed = false;
if (viewFont == null)
viewFont = UIManager.getFont("Label.font");
changed = true;
if (viewFont.getSize() > textFont.getSize())
viewFont = viewFont.deriveFont(textFont.getSize2D());
changed = true;
viewFontMetrics = getFontMetrics(viewFont);
maxNumberWidth = viewFontMetrics.stringWidth(String.valueOf(WIDTH_TEMPLATE));
componentWidth = 2 * MARGIN + maxNumberWidth;
if (changed)
super.setFont(viewFont);
public Dimension getPreferredSize()
return new Dimension(componentWidth, text.getHeight());
public void setFont(Font font)
super.setFont(font);
updateCachedMetrics();
public void paintComponent(Graphics g)
updateSizes();
Rectangle clip = g.getClipBounds();
g.setColor(getBackground());
g.fillRect(clip.x, clip.y, clip.width, clip.height);
g.setColor(getForeground());
int base = clip.y - textTopInset;
int first = sizes.getIndex(base);
int last = sizes.getIndex(base + clip.height);
String text = "";
for (int i = first; i <= last; i++)
text = String.valueOf(i+1);
int x = MARGIN + maxNumberWidth - viewFontMetrics.stringWidth(text);
int y = sizes.getPosition(i) + textFontAscent + textTopInset;
g.drawString(text, x, y);
class UpdateHandler extends ComponentAdapter
implements PropertyChangeListener, DocumentListener
* The text component was resized. 'Nuff said.
public void componentResized(ComponentEvent evt)
viewChanged(0, true);
* A bound property was changed on the text component. Properties
* like the font, border, and tab size affect the layout of the
* whole document, so we invalidate all the line heights here.
public void propertyChange(PropertyChangeEvent evt)
Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue();
String propertyName = evt.getPropertyName();
if ("document".equals(propertyName))
if (oldValue != null && oldValue instanceof Document)
((Document)oldValue).removeDocumentListener(this);
if (newValue != null && newValue instanceof Document)
((Document)newValue).addDocumentListener(this);
updateCachedMetrics();
viewChanged(0, true);
* Text was inserted into the document.
public void insertUpdate(DocumentEvent evt)
update(evt);
* Text was removed from the document.
public void removeUpdate(DocumentEvent evt)
update(evt);
* Text attributes were changed. In a source-code editor based on
* StyledDocument, attribute changes should be applied automatically
* in response to inserts and removals. Since we're already
* listening for those, this method should be redundant, but YMMV.
public void changedUpdate(DocumentEvent evt)
// update(evt);
* If the edit was confined to a single line, invalidate that
* line's height. Otherwise, invalidate them all.
private void update(DocumentEvent evt)
Element map = text.getDocument().getDefaultRootElement();
int line = map.getElementIndex(evt.getOffset());
DocumentEvent.ElementChange ec = evt.getChange(map);
viewChanged(line, ec != null);
} -
Echoing line number in php?
My php code is full of diagnostic lines like:
echo ('<p>L266 $foo = '.$foo.', $xx ......</p>');
Normally these are commented out, but when I get into trouble
I remove the
comment flag from the nearest such statement, so that it
lists the current state
of the variables involved. Unfortunately when I go to comment
them out again I
usually find that I have added or removed code since I
originally wrote them, so
that the printed line number bears no resemblance to the
actual line number, and
I have to hunt for the statement.
Is there a function that allows me to echo the true line
number?
Thank you,
ClancyOn Tue, 08 May 2007 15:32:11 +1000, Clancy
<[email protected]> wrote:
>Is there a function that allows me to echo the true line
number?
There may be an easier way, but the only thing that comes to
mind is to
use the error handling functions. Say, for example, you place
this code
at the very top of your file:
<?php
$old_handler=set_error_handler('tracer');
function tracer($code, $message, $file, $line){
print "<p>Line: $line, $message</p>\n";
return;
?>
Then, instead of using echo to output the values, use the
trigger_error() function:
trigger_error(sprintf('$foo = %s, $xx = %s', $foo, $xx));
Gary -
Reset file name and line number in preprocessor
We are using Sun Studio 12u1 on Solaris x86 10u9.
For one of our large projects our make file copies many C++ source files into one large allsource.cpp file. This results in significantly faster compilation and better inter-procedural optimizations.
Unfortunately, when the compiler generates warning or error messages they refer to allsource.cpp. Also when it comes time to debug, dbx is looking for debugging information for the original source file instead of looking for allsource.o.
On Windows (MSVC), we use the #line directive to reset the line number and filename so that the error messages point to the correct line and number, and so that the debugger knows that the debugging information for myfile.cpp is actually in allsource.o.
Does the Sun compiler have anything similar to the #line directive?To reset the preprocessor to the start of a new file:
#1 "filename"
where filename is the name or complete path name of the file.
To change the line number within the current file:
#N
or
#line N
where N is an integer
Example:
% cat z.cc
struct S { X x; };
#1 "/foo/bar.h"
Int I;
#500
Float F;
#line 1000
Double D;
88% CC -c z.cc
"z.cc", line 1: Error: Type name expected instead of "X".
"/foo/bar.h", line 1: Error: Int is not defined.
"/foo/bar.h", line 500: Error: Float is not defined.
"/foo/bar.h", line 1000: Error: Double is not defined.
4 Error(s) detected.BTW, you might get a similar improvement in compile time by using precompiled headers.
The -xipo option provide inter-procedural optimization across compilation units. Refer to the C++ Users Guide for details.
We seem to have a bug in the Forum software. My original source code and the compiler output have double quotes ("...") but they show as single quotes in the code brackets.
Edited by: clamage45 on Apr 13, 2010 1:13 PM
Maybe you are looking for
-
SQL*Loader importing problem, with file with eastern european files
Hello, on Oracle 11g with UTF-8 encoding, I tried to import a csv file into a table via sqlload, the separator is the semicolon ";" all work fine except for some lines witch are not well integrated (the concerned files come from Eastern European coun
-
Hi all, Does anyone know what this error means LOG: [0x0000000041b33950] JVM_IsNaN: IMPLEMENT ME! ? Thanks in advance Sam
-
So I have an interesting question to ask to anyone that may have an answer. I had purchased a pair of Polk Tsi100 speakers that I love. The speakers are currently hooked up to a 2-Channel 100W JVC Receiver from 1988. I am looking into adding a sub
-
how can i get my POP email pushed to my iphone5 instantly (not every 15 minutes) like my old blackberry did?
-
I have installed iSync 1.5 and iSync Palm Conduit 1.2. I want to sync My Treo 650 with iCal and Address Book. Then, I want to switch from Palm Desktop to Studiometry 5, which appears to be what the Management Doctor ordered for total studio managemen