WLP00 / WTP00 fields int RPSCO
Hi gurus,
What's the difference between this 2 fields in the RPSCO table ?
- WLP*
- WTP*
Thanks in advance
Aleksi
OK founed
Edited by: Aleksi on Feb 1, 2008 4:14 PM
Similar Messages
-
Query related to amt. displayed in field Int. Cal. Numerator in FBL5N
Hi All,
I am working on specific client requirements for which I need the information related to the field int. Calculation Numerator.
Scenario:
Customer IV amt = 100
Days in Arrears =396 days
int. calculation Numerator value displayed in FBL5N= 1.08
As per the information given, this numerator value gets calculated by formula, Amount*days in arrears/100.
However, If I calculate the numerator value as per this formula then it does not match with the value being displayed in FBL5N.
As per my analysis the value of 1.08 must be getting calculated as mentioned below
(1001%)/365396 =1.08
The rate of 1% is same for all the line items for all the customers. I have also checked the Int. Indicator field in Customer Master. This field is blank for all the customers.
I am not able to find out the source from which the system is fetching the rate of 1% for above calculation.
I need your expert guidance for finding out how this value is being calculated.
Thanks and Regards,
PradnyaHello All,
I have found out the source of the calculation of this Int. Calculation Indicator.
this calculation is defined in the program SAPLFI_ITEMS.
However, I am currently trying to find out whether I can change the calculation defined in the program.
Pls help me on this.
The details are as under
Program name is SAPLFI_ITEMS
Include LFI_ITEMSU08. In this include, in function module ITEM_DERIVE_FIELDS, this calculation is defined.
Looking forward for expert advise from u all..
Thanks,
Pradnya -
How do u make a text field for int only
Hi I wanted to make the text Field int only
I.e
int temp = 0;
temp = testField.getText();
Thanks in advanceRarna, I think this is what you are asking. This is a bare-bones TextField that only accepts keys that are numeric. I found that the left and right arrows still work. Backspace and delete do not so you would have to add additional case statements and code to handle these if you want to support them. I added a main method to try this out.
import java.awt.*;
import java.awt.event.*;
public class NumericTextField extends TextField implements KeyListener {
public NumericTextField() {
super();
this.initField();
public NumericTextField(int columns) {
super(columns);
this.initField();
public NumericTextField(String text) {
super(text);
this.initField();
public NumericTextField(String text,int columns) {
super(text,columns);
this.initField();
private void initField() {
setEditable(false);
addKeyListener(this);
public void keyPressed(KeyEvent e) {
int key=e.getKeyCode();
switch(key) {
case KeyEvent.VK_0:
case KeyEvent.VK_1:
case KeyEvent.VK_2:
case KeyEvent.VK_3:
case KeyEvent.VK_4:
case KeyEvent.VK_5:
case KeyEvent.VK_6:
case KeyEvent.VK_7:
case KeyEvent.VK_8:
case KeyEvent.VK_9:
setText(getText()+e.getKeyChar());
public void keyReleased(KeyEvent e) {;}
public void keyTyped(KeyEvent e) {;}
public static void main(String[] args) {
Frame f=new Frame();
NumericTextField ntf=new NumericTextField();
f.add(ntf);
f.pack();
f.setVisible(true); -
Hello
Is there a way to use the field label in the header of a ALV grid?
I am currently using a hard coded solution, and i know it's not good.
form buildfieldcat .
clear wa_fcat.
refresh it_fcat.
wa_fcat-col_pos = '1'.
wa_fcat-tabname = 'KNA1'.
wa_fcat-fieldname = 'KUNNR'. " I want to use the field label of this field in the header...
wa_fcat-seltext_l = 'Customer Number'. " ...To not use this line.
wa_fcat-outputlen = 15.
wa_fcat-key = 'X'.
wa_fcat-no_zero = 'X'.
I hope my query was clear. Thanks a lot!Hi,
If you want header columns from Dictionary field labels, instead of hardcoding, you can follow what fellow SDNs mentioned.
Here is the solution.
<li>define internal table like this.
TYPES:
BEGIN OF t_mard,
werks TYPE mard-werks,
lgort TYPE mard-lgort,
matnr TYPE mard-matnr,
insme TYPE mard-insme,
einme TYPE mard-einme,
speme TYPE mard-speme,
END OF t_mard.
DATA:
w_mard TYPE t_mard.
DATA:
i_mard TYPE STANDARD TABLE OF t_mard.
<li>Buidl fieldcatalog internal table like below . It works
PERFORM build_fcat USING:
"Field Int Tab ref field ref table
'WERKS' 'I_MARD' 'WERKS' 'MARD',
'LGORT' 'I_MARD' 'LGORT' 'MARD',
'MATNR' 'I_MARD' 'MATNR' 'MARD',
'INSME' 'I_MARD' 'INSME' 'MARD',
'EINME' 'I_MARD' 'EINME' 'MARD',
'SPEME' 'I_MARD' 'SPEME' 'MARD'.
*& Form BUILD_FCAT
FORM build_fcat USING l_field l_tab ref_field ref_tab.
w_fieldcat-fieldname = l_field.
w_fieldcat-tabname = l_tab.
w_fieldcat-ref_fieldname = ref_field.
w_fieldcat-ref_tabname = ref_tab.
* w_fieldcat-seltext_m = l_text.
APPEND w_fieldcat TO i_fieldcat.
CLEAR w_fieldcat.
ENDFORM. " BUILD_FCAT
<li> You can check program [here|http://hr-abap-freeeducation.blogspot.com/2008/04/alv-list-display_17.html]
I hope that it solves your problem.
Thanks
Venkat.O -
Color for a Field in alv output
Hi All,
I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
Thanks.Hi
1. add one more field to ur final internal table say COLOR(4)
2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
wa_layout-style_fieldname = 'COLOR'. "if its list
3. read table itab index 3.
itab-color = 'C410'.
modify itab index 3
4. see program SHOWCOLO for all color codes
1. Add a field of data type CHAR(3) to the internal output table.
2. Enter the color code in the appropriate field of the row to be colored in the internal
output table:
Code: 'Cxy'
C = Color (all codes begin with 'C')
x = color number ('1' - '9')
y = highlight ('0' = off, '1' = on)
3. Assign the internal output table color code field name to the IS_LAYOUT importing
structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
interface.
To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, lets modify declaration of our list data table gt_list.
you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field INFO_FNAME of the layout structure.
e.g.
ps_layout-info_fname = <field_name_containing_color_codes>. e.g. ROWCOLOR
You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
You can color an entire row as described in the next section. However, this method is less time consuming.
Coloring Individual Cells
This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by more is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
The structure that should be included must be of type LVC_T_SCOL. If you want to color the entire row, this inner table should contain only one row with field fname is set to space, some color value at field col, 0 or 1 at fields int (intensified) and inv (inverse).
If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field fname. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
Reward points if useful
Regards
Anji -
Access to fields of a form through IAC
Hello everyone!
I created with Adobe LiveCycle Designer ES2 (included with Adobe Acrobat X Pro) an example form with several fields.
After that I wanted to access the fields through the Acrobat SDK's Interapplication Communication (IAC) capability by using OLE.
As programming language I choose C# from the .NET framework. But the only field that I could access was the signature field and only when it was signed. I could not figure out the mistake. Is my code wrong? Or is the created form wrong? Can somebody help?
The code that I used:
Acrobat.AcroApp app = null;
Acrobat.AcroAVDoc avdoc;
AFORMAUTLib.AFormApp formApp;
AFORMAUTLib.IFields fields;
app = new Acrobat.AcroApp();
avdoc = new Acrobat.AcroAVDocClass();avdoc.Open(@"Form.pdf", null);
formApp = new AFORMAUTLib.AFormApp();
fields = formApp.Fields;
int fieldsCount = fields.Count;
foreach (var item in fields)
AFORMAUTLib.IField field = (AFORMAUTLib.IField)item;
result = field.Name + " = " + field.Value + "[" + field.Type + "]";Yes, if the form is Reader Enabled, then a Reader user can add a graphic as the icon of a button via scripting to an AcroForm.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Tue, 27 Sep 2011 00:31:26 -0700
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: Access to fields of a form through IAC
Re: Access to fields of a form through IAC
created by gatch<http://forums.adobe.com/people/_gatch_> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/3939773#3939773 -
ASP & Clob fields in the Oracle Database 8i
Hi All,
This is the first time I am posting a question. We are having a problem interfacing ASP pages with Clob fields int he Oracle Database.
We are trying to display clob fields in an oracle database from ASP PAge. The ASP Page does a select to a clob field from a table. But we lose the formatting od the data inside the clob field when we display it out using ASP. We display it as a
single stream of data. But when we display the clob using SQLPLUS we do see the formatted data.
How can we solve this issue or circumvent it ?
We are not looking to parse through the clob field in ASP, rather we already have a stored procedure that parses the data for us. The parsed data is then stored in a clob field already formatted the way we need it. The problem occurs when the ASP
page reads the clob field. The ASP page reads it as one continuos string instead of the formatted data that exists in the clob field.
I imported the data from Oracle to Access in order to view the raw data. The data is shown formatted properly in Access, so we know our stored procedure is doing what it supposed to do. As far as getting the data to display. The only way to retrieve (as far as I know) a clob field using ASP is by a built in function called GetChunk(). Is there a better method of displaying the formatted data aside from parsing on the client side, using ASP?
Let me know if anyone has a solution to this problem.
Thanks for your help and time. Sanjiv.Sanjiv, you might want to try some of the Windows development forums:
ODBC: http://forums.oracle.com/forums/forum.jsp?id=763957
New .NET provider forum: http://forums.oracle.com/forums/forum.jsp?id=1015160
Oracle Objects for OLE: http://forums.oracle.com/forums/forum.jsp?id=763961
Oracle Provider for OLE DB: http://forums.oracle.com/forums/forum.jsp?id=763961
Oracle Services for MTS: http://forums.oracle.com/forums/forum.jsp?id=763960
You'll reach a more appropriate audience than just the Web services audience.
Mike. -
Colour to field in an internal table
how to colour a particular data in a particular field of an internal table.
See this
1. add one more field to ur final internal table say COLOR(4)
2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
wa_layout-style_fieldname = 'COLOR'. "if its list
3. read table itab index 3.
itab-color = 'C410'.
modify itab index 3
4. see program SHOWCOLO for all color codes
1. Add a field of data type CHAR(3) to the internal output table.
2. Enter the color code in the appropriate field of the row to be colored in the internal
output table:
Code: 'Cxy'
C = Color (all codes begin with 'C')
x = color number ('1' - '9')
y = highlight ('0' = off, '1' = on)
3. Assign the internal output table color code field name to the IS_LAYOUT importing
structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
interface.
To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, lets modify declaration of our list data table gt_list.
you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field INFO_FNAME of the layout structure.
e.g.
ps_layout-info_fname = <field_name_containing_color_codes>. e.g. ROWCOLOR
You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
You can color an entire row as described in the next section. However, this method is less time consuming.
Coloring Individual Cells
This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by more is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
The structure that should be included must be of type LVC_T_SCOL. If you want to color the entire row, this inner table should contain only one row with field fname is set to space, some color value at field col, 0 or 1 at fields int (intensified) and inv (inverse).
If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field fname. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
If it is in ALv refer the following code:
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic ALV grid, Enhanced to display each row in a different *
*& colour *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4) type c, "Used to store row color attributes
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
Set layout field for row attributes(i.e. color)
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
data: ld_color(1) type c.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
*Populate field with color attributes
loop at it_ekko into wa_ekko.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
ld_color = ld_color + 1.
Only 7 colours so need to reset color value
if ld_color = 8.
ld_color = 1.
endif.
concatenate 'C' ld_color '10' into wa_ekko-line_color.
wa_ekko-line_color = 'C410'.
modify it_ekko from wa_ekko.
endloop.
endform. " DATA_RETRIEVAL
Please give me reward points... -
Field Symbol not assigned Error SAP R3 46c
Good day,
so what i want is:
assigning a component of a field symbol to another field-symbol to access its values.
This works very well in SAP 47 releases but doesn t work in sap 46c or do i do something wrong?
REPORT Z_GL_FIELDSYMBOLS .
Data:
begin of mytest,
int type i,
int2 type i,
end of mytest,
l type string.
Field-Symbols: <f> type any,
<g> type any.
Start-of-selection.
assign mytest to <f>.
l = '<f>-int'.
assign (l) to <g>.
<g> = '1'.
write :/ <g>.
end-of-selection.
Is there any way to do what i want to do apart from the statement "CREATE SUBROUTINE POOL"?the only problem is:
i know the components of the structure only at runtime, i.e.
i don´t know if my field 'int' exists. perhaps its name is 'intsomewhat', you know?
so i have to do a dynamic assign...
You have to know,
in my actual coding i assigned a reference to a data object to the field symbol..
thus,
something like
assign dref->* to <fs>
was done.
now i want to access single components of the field symbol.
the name of the components are known and are stored in a string.
hmmmm.
so the string contains something like '-MATNR'.
if i assign this string to a field-symbol nothing happens
in my system.
the same coding works without an error in a 47 system.
Message was edited by: Gideon Lenz -
MIGO Screen No. of Containers field
Now while doing GR i have to enter in how many pcs the material came
No Basic unit of measure is in Metres
In my GR screen under quanity tab No of containers field is there,
There i have to enter in how many pieces i received the Material, there i checked possible entries i could not find PCS
How to make PCS unit of measure
I checked in SPRO> Inventory mgmt>GR
i could not find
Pls guide me.........Hi,
Use T-Code CUNI to create new UoMs.
First create an ISO Code as PCS and then click on "Unit of Measurement" button with no dimensions and then double click on UoM "EA" and there click "Copy" button and replace EA by PCS in following fields;
Int. meas. unit - PCS
Commercial - PCS
Technical - PCS
ISO code - PCS (Already created)
Also change Long and Short Description
And Save.
Now you can use UoM "PCS". -
Erecruitment-Errors in creating a drop down field
Hi all
I need to enhance the candidate work experience tab. I have added my required fields int he customer include and they correctly show up.
A field-> Organization type needs to be a drop down/ have values in it.
I have tried attaching a search help to it as well as attaching a check table to it. Both these actions do not correctly work, they instead show blank spaces in the drop downs. I see blank entries within it.
Now when i put in a domain with fixed values, they show up properly in the dropdown. The standard though has an attached check table to the fields and the drop downs work properly
Could someone help me in this matter? . How to add a dropdown to the work experience
1)Add fields in the customer include
2)Create a ztable for the field entries and save the entries
3)Create a search help and attach to the field in the customer include?
4)Create a domain and set the ztable as the checktable for it and use it in the customer include?Hi,
To get the drop down values for the steps:
Step 1: In R/3 system under SAP erecruitment->Settings for User interfcases with BSP -> Assign Parameters to Parameter types ( define the name hrrcf_qa_screen and the parameter should be max_rdb_ and the Parameter type should be defined(if u want to give less than 6 i.e: the drop down values - if it is more than 6 then the values will display in drop down values)
Step 2: In R/3 system under SAP recruitment->Applicant trcking->Questionnaire - should execute Setup Categories/Update Categories & Transport categories.Only then the Pre-defined scales will get displayed in eRec.Admin Questionnaire creation (i.e:Portal)
Once it it transported to the target system check in the portal - while creating the questionnaire whether drop down are appearing for the predefined scales. -
Putting the values of a reflection int[] in to a jtree
i did the reflect of a class and in this class i have int�s, string, integer, double and others and i am able to put their names in nodes of a jtree but... the problem is: in this class that i am making the reflection i have a int[ ] and i want to print his values in the tree but i�m not able to pick then
please someone help me
tanxhi sylviae, tanx for trying to help me but your lines doesn�t work
- first we can�t attribute some fields to a field but to a field[] yes;
- and we can�t casting from field -> int[]
buts okz
tanx for your help -
This works on WinXP but not Linux. Why? It takes the first frame of an animated gif and writes a thumbnail.
GifDecoder d = new GifDecoder();
try {
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
log.debug("reading gif");
d.read(bis);
log.debug("reading framecount");
int n = d.getFrameCount();
log.debug("read framecount" + n);
for (int i = 0; i < 1; i++) {
BufferedImage frame = d.getFrame(i); // frame i
int t = d.getDelay(i); // display duration of frame in milliseconds
log.debug("resizing frame");
File gifoutputfile = new File("gif" + i + outputthumbFilename);
BufferedImage bdest = new BufferedImage(60, 60, BufferedImage.TYPE_INT_RGB);
Graphics2D g = bdest.createGraphics();
AffineTransform at = AffineTransform.getScaleInstance((double) 60 / frame.getWidth(), (double) 60 / frame.getHeight());
g.drawRenderedImage(frame, at);
ImageIO.setUseCache(false);
ImageIO.write(bdest, "GIF", new File(outputthumbFilename));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
* Class GifDecoder - Decodes a GIF file into one or more frames. <br>
* <pre>
* Example:
* GifDecoder d = new GifDecoder();
* d.read("sample.gif");
* int n = d.getFrameCount();
* for (int i = 0; i < n; i++) {
* BufferedImage frame = d.getFrame(i); // frame i
* int t = d.getDelay(i); // display duration of frame in milliseconds
* // do something with frame
* </pre>
* No copyright asserted on the source code of this class. May be used for any
* purpose, however, refer to the Unisys LZW patent for any additional
* restrictions. Please forward any corrections to [email protected].
* @author Kevin Weiner, FM Software; LZW decoder adapted from John Cristy's
* ImageMagick.
* @version 1.03 November 2003
public class GifDecoder {
* File read status: No errors.
public static final int STATUS_OK = 0;
* File read status: Error decoding file (may be partially decoded)
public static final int STATUS_FORMAT_ERROR = 1;
* File read status: Unable to open source.
public static final int STATUS_OPEN_ERROR = 2;
protected BufferedInputStream in;
protected int status;
protected int width; // full image width
protected int height; // full image height
protected boolean gctFlag; // global color table used
protected int gctSize; // size of global color table
protected int loopCount = 1; // iterations; 0 = repeat forever
protected int[] gct; // global color table
protected int[] lct; // local color table
protected int[] act; // active color table
protected int bgIndex; // background color index
protected int bgColor; // background color
protected int lastBgColor; // previous bg color
protected int pixelAspect; // pixel aspect ratio
protected boolean lctFlag; // local color table flag
protected boolean interlace; // interlace flag
protected int lctSize; // local color table size
protected int ix, iy, iw, ih; // current image rectangle
protected Rectangle lastRect; // last image rect
protected BufferedImage image; // current frame
protected BufferedImage lastImage; // previous frame
protected byte[] block = new byte[256]; // current data block
protected int blockSize = 0; // block size
// last graphic control extension info
protected int dispose = 0;
// 0=no action; 1=leave in place; 2=restore to bg; 3=restore to prev
protected int lastDispose = 0;
protected boolean transparency = false; // use transparent color
protected int delay = 0; // delay in milliseconds
protected int transIndex; // transparent color index
protected static final int MaxStackSize = 4096;
// max decoder pixel stack size
// LZW decoder working arrays
protected short[] prefix;
protected byte[] suffix;
protected byte[] pixelStack;
protected byte[] pixels;
protected ArrayList frames; // frames read from current file
protected int frameCount;
static class GifFrame {
public GifFrame(BufferedImage im, int del) {
image = im;
delay = del;
public BufferedImage image;
public int delay;
* Gets display duration for specified frame.
* @param n
* int index of frame
* @return delay in milliseconds
public int getDelay(int n) {
delay = -1;
if ((n >= 0) && (n < frameCount)) {
delay = ((GifFrame) frames.get(n)).delay;
return delay;
* Gets the number of frames read from file.
* @return frame count
public int getFrameCount() {
return frameCount;
* Gets the first (or only) image read.
* @return BufferedImage containing first frame, or null if none.
public BufferedImage getImage() {
return getFrame(0);
* Gets the "Netscape" iteration count, if any. A count of 0 means repeat
* indefinitiely.
* @return iteration count if one was specified, else 1.
public int getLoopCount() {
return loopCount;
* Creates new frame image from current data (and previous frames as specified
* by their disposition codes).
protected void setPixels() {
// expose destination image's pixels as int array
int[] dest = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
// fill in starting image contents based on last image's dispose code
if (lastDispose > 0) {
if (lastDispose == 3) {
// use image before last
int n = frameCount - 2;
if (n > 0) {
lastImage = getFrame(n - 1);
} else {
lastImage = null;
if (lastImage != null) {
int[] prev = ((DataBufferInt) lastImage.getRaster().getDataBuffer()).getData();
System.arraycopy(prev, 0, dest, 0, width * height);
// copy pixels
if (lastDispose == 2) {
// fill last image rect area with background color
Graphics2D g = image.createGraphics();
Color c = null;
if (transparency) {
c = new Color(0, 0, 0, 0); // assume background is transparent
} else {
c = new Color(lastBgColor); // use given background color
g.setColor(c);
g.setComposite(AlphaComposite.Src); // replace area
g.fill(lastRect);
g.dispose();
// copy each source line to the appropriate place in the destination
int pass = 1;
int inc = 8;
int iline = 0;
for (int i = 0; i < ih; i++) {
int line = i;
if (interlace) {
if (iline >= ih) {
pass++;
switch (pass) {
case 2:
iline = 4;
break;
case 3:
iline = 2;
inc = 4;
break;
case 4:
iline = 1;
inc = 2;
line = iline;
iline += inc;
line += iy;
if (line < height) {
int k = line * width;
int dx = k + ix; // start of line in dest
int dlim = dx + iw; // end of dest line
if ((k + width) < dlim) {
dlim = k + width; // past dest edge
int sx = i * iw; // start of line in source
while (dx < dlim) {
// map color and insert in destination
int index = ((int) pixels[sx++]) & 0xff;
int c = act[index];
if (c != 0) {
dest[dx] = c;
dx++;
* Gets the image contents of frame n.
* @return BufferedImage representation of frame, or null if n is invalid.
public BufferedImage getFrame(int n) {
BufferedImage im = null;
if ((n >= 0) && (n < frameCount)) {
im = ((GifFrame) frames.get(n)).image;
return im;
* Gets image size.
* @return GIF image dimensions
public Dimension getFrameSize() {
return new Dimension(width, height);
* Reads GIF image from stream
* @param BufferedInputStream
* containing GIF file.
* @return read status code (0 = no errors)
public int read(BufferedInputStream is) {
init();
if (is != null) {
in = is;
readHeader();
if (!err()) {
readContents();
if (frameCount < 0) {
status = STATUS_FORMAT_ERROR;
} else {
status = STATUS_OPEN_ERROR;
try {
is.close();
} catch (IOException e) {
return status;
* Reads GIF image from stream
* @param InputStream
* containing GIF file.
* @return read status code (0 = no errors)
public int read(InputStream is) {
init();
if (is != null) {
if (!(is instanceof BufferedInputStream))
is = new BufferedInputStream(is);
in = (BufferedInputStream) is;
readHeader();
if (!err()) {
readContents();
if (frameCount < 0) {
status = STATUS_FORMAT_ERROR;
} else {
status = STATUS_OPEN_ERROR;
try {
is.close();
} catch (IOException e) {
return status;
* Reads GIF file from specified file/URL source (URL assumed if name contains
* ":/" or "file:")
* @param name
* String containing source
* @return read status code (0 = no errors)
public int read(String name) {
status = STATUS_OK;
try {
name = name.trim().toLowerCase();
if ((name.indexOf("file:") >= 0) || (name.indexOf(":/") > 0)) {
URL url = new URL(name);
in = new BufferedInputStream(url.openStream());
} else {
in = new BufferedInputStream(new FileInputStream(name));
status = read(in);
} catch (IOException e) {
status = STATUS_OPEN_ERROR;
return status;
* Decodes LZW image data into pixel array. Adapted from John Cristy's
* ImageMagick.
protected void decodeImageData() {
int NullCode = -1;
int npix = iw * ih;
int available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, count, i, datum, data_size, first, top, bi, pi;
if ((pixels == null) || (pixels.length < npix)) {
pixels = new byte[npix]; // allocate new pixel array
if (prefix == null)
prefix = new short[MaxStackSize];
if (suffix == null)
suffix = new byte[MaxStackSize];
if (pixelStack == null)
pixelStack = new byte[MaxStackSize + 1];
// Initialize GIF data stream decoder.
data_size = read();
clear = 1 << data_size;
end_of_information = clear + 1;
available = clear + 2;
old_code = NullCode;
code_size = data_size + 1;
code_mask = (1 << code_size) - 1;
for (code = 0; code < clear; code++) {
prefix[code] = 0;
suffix[code] = (byte) code;
// Decode GIF pixel stream.
datum = bits = count = first = top = pi = bi = 0;
for (i = 0; i < npix;) {
if (top == 0) {
if (bits < code_size) {
// Load bytes until there are enough bits for a code.
if (count == 0) {
// Read a new data block.
count = readBlock();
if (count <= 0)
break;
bi = 0;
datum += (((int) block[bi]) & 0xff) << bits;
bits += 8;
bi++;
count--;
continue;
// Get the next code.
code = datum & code_mask;
datum >>= code_size;
bits -= code_size;
// Interpret the code
if ((code > available) || (code == end_of_information))
break;
if (code == clear) {
// Reset decoder.
code_size = data_size + 1;
code_mask = (1 << code_size) - 1;
available = clear + 2;
old_code = NullCode;
continue;
if (old_code == NullCode) {
pixelStack[top++] = suffix[code];
old_code = code;
first = code;
continue;
in_code = code;
if (code == available) {
pixelStack[top++] = (byte) first;
code = old_code;
while (code > clear) {
pixelStack[top++] = suffix[code];
code = prefix[code];
first = ((int) suffix[code]) & 0xff;
// Add a new string to the string table,
if (available >= MaxStackSize)
break;
pixelStack[top++] = (byte) first;
prefix[available] = (short) old_code;
suffix[available] = (byte) first;
available++;
if (((available & code_mask) == 0) && (available < MaxStackSize)) {
code_size++;
code_mask += available;
old_code = in_code;
// Pop a pixel off the pixel stack.
top--;
pixels[pi++] = pixelStack[top];
i++;
for (i = pi; i < npix; i++) {
pixels[i] = 0; // clear missing pixels
* Returns true if an error was encountered during reading/decoding
protected boolean err() {
return status != STATUS_OK;
* Initializes or re-initializes reader
protected void init() {
status = STATUS_OK;
frameCount = 0;
frames = new ArrayList();
gct = null;
lct = null;
* Reads a single byte from the input stream.
protected int read() {
int curByte = 0;
try {
curByte = in.read();
} catch (IOException e) {
status = STATUS_FORMAT_ERROR;
return curByte;
* Reads next variable length block from input.
* @return number of bytes stored in "buffer"
protected int readBlock() {
blockSize = read();
int n = 0;
if (blockSize > 0) {
try {
int count = 0;
while (n < blockSize) {
count = in.read(block, n, blockSize - n);
if (count == -1)
break;
n += count;
} catch (IOException e) {
if (n < blockSize) {
status = STATUS_FORMAT_ERROR;
return n;
* Reads color table as 256 RGB integer values
* @param ncolors
* int number of colors to read
* @return int array containing 256 colors (packed ARGB with full alpha)
protected int[] readColorTable(int ncolors) {
int nbytes = 3 * ncolors;
int[] tab = null;
byte[] c = new byte[nbytes];
int n = 0;
try {
n = in.read(c);
} catch (IOException e) {
if (n < nbytes) {
status = STATUS_FORMAT_ERROR;
} else {
tab = new int[256]; // max size to avoid bounds checks
int i = 0;
int j = 0;
while (i < ncolors) {
int r = ((int) c[j++]) & 0xff;
int g = ((int) c[j++]) & 0xff;
int b = ((int) c[j++]) & 0xff;
tab[i++] = 0xff000000 | (r << 16) | (g << 8) | b;
return tab;
* Main file parser. Reads GIF content blocks.
protected void readContents() {
// read GIF file content blocks
boolean done = false;
while (!(done || err())) {
int code = read();
switch (code) {
case 0x2C: // image separator
readImage();
break;
case 0x21: // extension
code = read();
switch (code) {
case 0xf9: // graphics control extension
readGraphicControlExt();
break;
case 0xff: // application extension
readBlock();
String app = "";
for (int i = 0; i < 11; i++) {
app += (char) block;
if (app.equals("NETSCAPE2.0")) {
readNetscapeExt();
} else
skip(); // don't care
break;
default: // uninteresting extension
skip();
break;
case 0x3b: // terminator
done = true;
break;
case 0x00: // bad byte, but keep going and see what happens
break;
default:
status = STATUS_FORMAT_ERROR;
* Reads Graphics Control Extension values
protected void readGraphicControlExt() {
read(); // block size
int packed = read(); // packed fields
dispose = (packed & 0x1c) >> 2; // disposal method
if (dispose == 0) {
dispose = 1; // elect to keep old image if discretionary
transparency = (packed & 1) != 0;
delay = readShort() * 10; // delay in milliseconds
transIndex = read(); // transparent color index
read(); // block terminator
* Reads GIF file header information.
protected void readHeader() {
String id = "";
for (int i = 0; i < 6; i++) {
id += (char) read();
if (!id.startsWith("GIF")) {
status = STATUS_FORMAT_ERROR;
return;
readLSD();
if (gctFlag && !err()) {
gct = readColorTable(gctSize);
bgColor = gct[bgIndex];
* Reads next frame image
protected void readImage() {
ix = readShort(); // (sub)image position & size
iy = readShort();
iw = readShort();
ih = readShort();
int packed = read();
lctFlag = (packed & 0x80) != 0; // 1 - local color table flag
interlace = (packed & 0x40) != 0; // 2 - interlace flag
// 3 - sort flag
// 4-5 - reserved
lctSize = 2 << (packed & 7); // 6-8 - local color table size
if (lctFlag) {
lct = readColorTable(lctSize); // read table
act = lct; // make local table active
} else {
act = gct; // make global table active
if (bgIndex == transIndex)
bgColor = 0;
int save = 0;
if (transparency) {
save = act[transIndex];
act[transIndex] = 0; // set transparent color if specified
if (act == null) {
status = STATUS_FORMAT_ERROR; // no color table defined
if (err())
return;
decodeImageData(); // decode pixel data
skip();
if (err())
return;
frameCount++;
// create new image to receive frame data
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
setPixels(); // transfer pixel data to image
frames.add(new GifFrame(image, delay)); // add image to frame list
if (transparency) {
act[transIndex] = save;
resetFrame();
* Reads Logical Screen Descriptor
protected void readLSD() {
// logical screen size
width = readShort();
height = readShort();
// packed fields
int packed = read();
gctFlag = (packed & 0x80) != 0; // 1 : global color table flag
// 2-4 : color resolution
// 5 : gct sort flag
gctSize = 2 << (packed & 7); // 6-8 : gct size
bgIndex = read(); // background color index
pixelAspect = read(); // pixel aspect ratio
* Reads Netscape extenstion to obtain iteration count
protected void readNetscapeExt() {
do {
readBlock();
if (block[0] == 1) {
// loop count sub-block
int b1 = ((int) block[1]) & 0xff;
int b2 = ((int) block[2]) & 0xff;
loopCount = (b2 << 8) | b1;
} while ((blockSize > 0) && !err());
* Reads next 16-bit value, LSB first
protected int readShort() {
// read 16-bit value, LSB first
return read() | (read() << 8);
* Resets frame state for reading next image.
protected void resetFrame() {
lastDispose = dispose;
lastRect = new Rectangle(ix, iy, iw, ih);
lastImage = image;
lastBgColor = bgColor;
int dispose = 0;
boolean transparency = false;
int delay = 0;
lct = null;
* Skips variable length blocks up to and including next zero length block.
protected void skip() {
do {
readBlock();
} while ((blockSize > 0) && !err());
Niklas wrote:
This works on WinXP but not Linux. Why? Please don't just post reams of code without providing more context and information.
How is it failing on Linux? Wrong results? What are they? Error messages? What do they say? You need to give us some place to start looking. -
Why the graphics doesn't show on screen?
I wrote the code using AWT to draw an Arc2D to window after received input numbers but it draws nothing to screen. I tried to debug and found nothing. Can someone help me on this?
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
public class PieChart extends JFrame implements ActionListener
private JPanel inputP;
private DrawPanel drawP;
private JLabel instruct, prompt1, prompt2, prompt3, prompt4; //all prompt labels
private JTextField num1, num2, num3, num4; //input text field
int value1, value2, value3, value4, total;
//Graphics2D g2d;
public PieChart()
super( "Drawing 2D PieChart" );
Container c = getContentPane();
c.setLayout(new FlowLayout());
inputP = new JPanel();
inputP.setLayout(new GridLayout(4,2));
//initial text prompts
instruct = new JLabel("Enter the number at each prompt and press enter");
prompt1 = new JLabel("First Number:");
prompt2 = new JLabel("Second Number:");
prompt3 = new JLabel("Third Number:");
prompt4 = new JLabel("Fourth Number:");
//initial input fields
num1 = new JTextField(5);
num1.addActionListener(this);
num2 = new JTextField(5);
num2.addActionListener(this);
num3 = new JTextField(5);
num3.addActionListener(this);
num4 = new JTextField(5);
num4.addActionListener(this);
inputP.add(prompt1);
inputP.add(num1);
inputP.add(prompt2);
inputP.add(num2);
inputP.add(prompt3);
inputP.add(num3);
inputP.add(prompt4);
inputP.add(num4);
c.add(inputP, BorderLayout.NORTH);
drawP = new DrawPanel(350,180);
drawP.add(instruct);
c.add(drawP, BorderLayout.CENTER);
setSize( 350, 560 );
show();
public void actionPerformed(ActionEvent e)
String getInput;
if(e.getSource() == num1)
getInput = num1.getText();
value1 = Integer.parseInt(getInput);
num2.grabFocus();
if(e.getSource() == num2)
getInput = num2.getText();
value2 = Integer.parseInt(getInput);
num3.grabFocus();
if(e.getSource() == num3)
getInput = num3.getText();
value3 = Integer.parseInt(getInput);
num4.grabFocus();
if(e.getSource() == num4)
getInput = num4.getText();
value4 = Integer.parseInt(getInput);
drawP.setPie(value1, value2, value3,value4);
The main function will generate the new PieChart object and Overridden so we can exit when window is closed.*********************/
public static void main( String args[] )
PieChart app = new PieChart();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
System.exit( 0 );
}//endmain
class DrawPanel extends JPanel {
//private int currentChoice = -1; // don't draw first time
private int width = 100, height = 100;
private int vl1, vl2, vl3, vl4, total ;
Graphics2D g2d;
public DrawPanel( int w, int h )
width = ( w >= 0 ? w : 100 );
height = ( h >= 0 ? h : 100 );
public void paintComponent( Graphics g )
super.paintComponent( g );
// create 2D by casting g to Graphics2D
g2d = ( Graphics2D ) g;
if(total == 0 )
g2d.setPaint(Color.black);
g2d.setStroke(new BasicStroke(1.0f));
g2d.draw(new Arc2D.Double(250,90,80,100,0,360,Arc2D.PIE));
System.out.print("Done drawing a cirle");
}else // draw 2D pie-shaped arc in white
g2d.setPaint( Color.cyan );
g2d.setStroke( new BasicStroke( 2.0f ) );
g2d.fill(new Arc2D.Double(120,90,80,100,0,(vl1*360/total),Arc2D.PIE));
g2d.setPaint( Color.blue );
g2d.setStroke( new BasicStroke( 2.0f ) );
g2d.fill(new Arc2D.Double(120,90,80,100,(vl1*360/total),(vl2*360/total),Arc2D.PIE));
g2d.setPaint( Color.green );
g2d.setStroke( new BasicStroke( 2.0f ) );
g2d.fill(new Arc2D.Double(120,90,80,100,(vl2*360/total),(vl3*360/total),Arc2D.PIE));
g2d.setPaint( Color.red );
g2d.setStroke( new BasicStroke( 2.0f ) );
g2d.fill(new Arc2D.Double(120,90,80,100,(vl3*360/total),(vl4*360/total),Arc2D.PIE));
System.out.print("End of drawing ");
public void setPie( int v1, int v2, int v3, int v4 )
total = 0;
vl1 = v1;
vl2 = v2;
vl3 = v3;
vl4 = v4;
total = v1 + v2 + v3 + v4;
System.out.print(v1+ " "+ v2+" "+v3+" "+v4+ " Total value: " + total);
repaint();
}The first thing I see is the you have declared 'total' in DrawPanel. As it is never set there, you are testing a variable which is always zero.
-
Get Qualifier value from Qualified table
Hi,
I am trying to get all the qualifier value for a qualified table. What is the best way to do it. Can I use QualifierSearchDimension to search for all the qualifier value.
Re: Lookup [Qualified Flat] type field how to use as a query condition? link gives us a way to do this , but it talk about getting the non - qualifiers only , so How can we get the qualifier values.
The link Search Qualifier Fields : MDM Java APIs gives us a way to this , but it is using old Java API , does anyone know how to do it using MDM API SP06.
Thanks and Regards,
SubhasisHi Subhasis,
The Search API's will only search for a particular value in the qualified tables. In order to read all the qualifier and non qualifier for a record, please follow the below mentioned steps.
Assuming 'rec' is the variable that holds the reference for the current record.
MdmValue lookUpVal = rec.getFieldValuel(<Field Id of the field>);
com.sap.mdm.valuetypes.QualifiedLookupValue val = (com.sap.mdm.valuetypes.QualifiedLookupValue) lookUpVal;
// Get the total number of qualified records present for that field
int size = val.getValuesCount();
// Iterate through each qualified record to fetch the details
for(int i=0;i<size;i++){
MdmValue nqVal = val.getValue(i);
if(nqVal != null){
MdmValue incVal = val.getQualifierFieldValue(i,<Field Id of the qualifier field value>);
Regards,
Ponraj M
Edited by: Ponraj M on Jul 10, 2009 10:12 AM
Maybe you are looking for
-
XCode 3.2.4 - issue after filename or path change
steps to reproduce: this code use to work, it is designed to display a random image in a UIImage field in my app. Trying to troubleshoot an issue where I was getting "all black" displaying occasionally, instead of a random.jpg type image, I changed t
-
How do I hide sub menus in Dreamweaver CS5.5?
Hi - I'm at the very beginning of sorting out my first web site in Dreamweaver CS5.5. I'm using a vertical menu with sub menus. The submenus are permanently visible. I was earlier able to make them only appear when you roll over them with a mouse...b
-
CurrentUISkin problem with LOVs
Hello JheadStart Team I'm using user selected skin by using menuAdminService and setting adf-faces-config to <skin-family>#{jhsDynamicMenu.currentUISkin}</skin-family> but i have problem with LOV's: Error getting property 'currentUISkin' from bean of
-
I stumbled across a folder of sound files collected back in the days of OS 7, 8 and 9. Now on X, these files do not play by clicking on them. They are identified in the Finder as Unix Executable. If I do a Get Info on them, I have the option of playi
-
Why does it have to be so difficult!
OK so I think this started after updating to 10.6.8 or something with Mac OS X after. A lot of applications are just crashing on opening. Crashing applications are: Software Update iTunes iPhoto Safari (I think more but these are things I use often)