Explain me this Code , bold one to explain me detail
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.*
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
Thanks
Hi,
here you can find the information that you need:
[Determining the Attributes of Data Objects|http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3145358411d1829f0000e829fbfe/frameset.htm]
And take also a look at the class documentation of the classes CL_ABAP_*DESCR. The classes are documentated very well.
Regards Rudi
Similar Messages
-
Help me with this code...! Thank�s
Hello, i made this code to explore the machine and copy the file from one place to another! Ok.. it works.. but whem i compile the code.. 3 FileCopy.classes are generated... in fact, are four.. one named FileCopy.class, other named FileCopy$1.class, other FileCopy$2.class, other FileCopy$3.class..
i�m not sure but, if i compile this code,, only one FileCopy.class could be generated.. i�m right? if i�m not, i will be happy if somebody tells me what is happen with my code! if it�s wrong or something like that...!
Thank�s.
Here is the code!
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.applet.*;
public class FileCopy extends Applet
implements ActionListener{
//declara��o das vari�veis e seus respectivos tipos
private JTextField enter;
private JTextArea t1;
private Button btnCopia;
private JTextField origem;
private JTextField destino;
private String origemArq;
private String destinoArq;
public FileCopy(){
setLayout(new BorderLayout(5, 5));
enter = new JTextField (
"Procurar em...");
enter.addActionListener(this);
origem = new JTextField("Origem do Arquivo");
origem.addActionListener(new ActionListener() {
public void actionPerformed (ActionEvent e)
destino = new JTextField("Destino do arquivo");
destino.addActionListener(new ActionListener() {
public void actionPerformed (ActionEvent e)
btnCopia = new Button("Copiar");
btnCopia.addActionListener(new ActionListener () {
public void actionPerformed (ActionEvent e) {
try{
origemArq = origem.getText();
destinoArq = destino.getText();
File inputFile = new File(origemArq);
File outputFile = new File(destinoArq);
FileInputStream in = new FileInputStream(inputFile);
FileOutputStream out = new FileOutputStream(outputFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
catch (IOException e2)
JOptionPane.showMessageDialog(null, "File Error", "File Error", JOptionPane.ERROR_MESSAGE);
t1 = new JTextArea(10, 15);
t1.setEditable(false);
Box b = Box.createHorizontalBox();
b.add(new JScrollPane(t1));
Box b1 = Box.createHorizontalBox();
b1.add(enter);
b1.add(origem);
b1.add(destino);
add(b, BorderLayout.CENTER);
add(b1, BorderLayout.NORTH);
add(btnCopia, BorderLayout.SOUTH);
public void actionPerformed (ActionEvent e)
String actionCommand = e.getActionCommand();
if("Copiar".equals(actionCommand))
t1.setText(enter.getText());
File name = new File (e.getActionCommand());
if (name.exists()) {
t1.setText(
name.getName() + " existe\n" +
(name.isFile() ? " i um arquivo\n" : " nbo i um arquivo\n" ) +
(name.isDirectory() ? " i um diretsrio\n" : " nbo i um diretsrio\n" ) +
(name.isAbsolute() ? " i um caminho absoluto\n" : " nco i um caminho absoluto\n" ) +
"ultima modificagco: " + name.lastModified() + "\nTamanho: " + name.length() +
"\ncaminho: " + name.getPath() + "\nCaminho Absoluto: " + name.getAbsolutePath() +
"\nPai: " + name.getParent());
if ( name.isFile()) {
try {
RandomAccessFile r = new RandomAccessFile(name, "r");
StringBuffer buf = new StringBuffer();
String text;
t1.append("\n\n");
while (( text = r.readLine()) != null)
buf.append (text + "\n");
t1.append (buf.toString());
catch (IOException e2)
JOptionPane.showMessageDialog(this, "File Error", "File Error", JOptionPane.ERROR_MESSAGE);
else if (name.isDirectory()) {
String directory [] = name.list();
t1.append("\n\nDirectory contents: \n");
for (int i = 0 ; i<directory.length; i++)
t1.append(directory[i] + "\n");
else {
JOptionPane.showMessageDialog(this, e.getActionCommand() + "n�o existe", "File Error", JOptionPane.ERROR_MESSAGE);Hey
There is no problem with your code.
The three files are created by the compiler because you have 3 anonymous classes within in your code.
E.g.
new ActionListener () { .....}
So when using anonymous classes these additional files are required for your app.
Hope thats ok!! -
Why does this code always gotoAndStop at the same frame?
The symbol "alldoor" contains the following six frames in sequential order: "door1","red_door1","door2","red_door2","door3" and "red_door3".
var doors:Array =["door1", "door2", "door3"];
var doorSelector:String = doors[newDoors(0, doors.length - 1)]
function newDoors (min:Number, max:Number):Number
var doorColors:Number = Math.round(Math.random() * (min - max) + max);
return doorColors;
alldoor.gotoAndStop(doorSelector);
alldoor.addEventListener(MouseEvent.CLICK,changeColors );
function changeColors(e:MouseEvent)
if (e.currentTarget.currentLabel == doorSelector)
e.currentTarget.gotoAndStop(currentFrame + 1);
I am attempting to get this code select one of the frames starting with the string "door" at start up. Then, the door should move to the frame
directly following it on the timeline when clicked. However, as the code is written, the frame always jumps to the second frame in the symbol,regardless of what the current label is. What should I change?either:
1. those frames aren't loaded when that code executes or
2. you don't have those labels on the timeline that contains that code or
3. there is other code executing after your goto changing your frame
use the trace() function to debug and find which is your problem. -
Please explain what does this code does exactly
Can any one explain me what does the below code does.
This is the code written in one of the BADI (ME_PO_PRICING_CUST) .This badi will be triggered when a sales order delivery address is changed and while saving it this will be triggered. Over all what i come to know is they re trigerring a new version in this code. Can anyone explain me what exactly they are doing in this.Thanks...
METHOD IF_EX_ME_PO_PRICING_CUST~PROCESS_KOMK.
FIELD-SYMBOLS: <EKKO> TYPE ANY,
<PROCSTAT> TYPE MEPROCSTATE,
<FRGKE> TYPE FRGKE,
<YNAST> TYPE TABLE,
<WA_YNAST> TYPE NAST.
IM_EKKO-PROCSTAT = 02.
*break-point.
ASSIGN ('(SAPLMEPO)EKKO') TO <EKKO>.
ASSIGN ('(SAPLMEPO)YNAST[]') TO <YNAST>.
IF <EKKO> IS ASSIGNED.
ASSIGN COMPONENT 'PROCSTAT' OF STRUCTURE <EKKO> TO <PROCSTAT>.
ASSIGN COMPONENT 'FRGKE' OF STRUCTURE <EKKO> TO <FRGKE>.
IF <FRGKE> = 'R'.
<PROCSTAT> = '02'.
ENDIF.
ENDIF.
IF <YNAST> IS ASSIGNED.
IF <FRGKE> = 'R'.
LOOP AT <YNAST> ASSIGNING <WA_YNAST>.
<WA_YNAST>-AKTIV = 'X'.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.r_htkl must be a range table. check the declaration part of it.
p_htkl is a parameter on selection screen i hope.
so, there are four fields on a range table.(range table are similar to your select options)
1. SIGN ( I or E - Inclusive or Exculsive)
2. OPTION(options like EQ = euqal, BT = Between, CP = contains pattern etc)
3. LOW (value)
4. HIGH (value)
so..
IF NOT p_htkl IS INITIAL. " checks if some thing is being passed to the parameter
r_htkl-sign='I'. " give the sign a value I i.e it make inclusive sign
r_htkl-option='EQ'. " EQ to option means you value will be checked for a equal to condition
r_htkl-low=p_htkl. " the low field in now assigned the same value of the parameter p_hktl
APPEND r_htkl. " the range table is appended.
endif.
so this range table can be used in select statements as :
select * from abcd into gt where xyz in r_hktl. ==> this will check for a EQ condition with value in r_hktl-low in database or
in if statements like : if abc in r_hktl. ==> this will check the EQ condition of abc with the r_hktl-low.
Had it been
r_htkl-sign='E'.
then the condition is same but with a NOT.. that means NOT EQ or NOT BT etc.
as exclusive of the option.
etc.
hope this is clear.
AND PLEASE CLOSE THE OTHER THREAD (duplicate) -
Can anyone explain this code snippet
I'm revising for my exams and this is one of the question that came up in the previous exams. Can someone help answe the questions at the end. Also what object is 'time_t' and how why do they use 'input_time -= 24*60*60;'?
Read the following code carefully before answering the questions.
time_t normalise(time_t input_time)
bool finished;
// This produces a formatted time string like:
// Thu_Nov_24_18:22:48_1986
string str_time = format_time( input_time );
while( str_time.substr(1,3) != "Sun")
input_time -= 24*60*60;
str_time = format_time( input_time );
while( str_time.substr(11,2) != "00" )
input_time -= 60*60;
str_time = format_time( input_time );
while( str_time.substr(14,2) != "00")
str_time = format_time( input_time );
input_time -= 60;
while( str_time.substr(17,2) != "00")
input_time -= 1;
str_time = format_time( input_time );
return input_time;
1) Briefly explain what you think the overall purpose of this function is (do not describe each line of code).
2) There are two bugs in this code that prevent it from functioning correctly; circle them.
3) What would actually happen when this code is run?
(a) as originally written
(b) with the first bug fixed?
4) Discuss the efficiency of the code assuming the bugs have been fixed.Looks like it is trying to increment the time parameter back to represent midnight of the previous Sunday.
-
Can anyone please explain this code to me?
I am a new (junior)programmer?Can anyone please explain this code to me in lame terms? I am working at a client location and found this code in a project.
_file name is AtccJndiTemplate.java_
Why do we use the Context class?
Why do we use the properties class?
package org.atcc.common.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.springframework.jndi.JndiTemplate;
public class AtccJndiTemplate extends JndiTemplate
private static Logger logger = Logger.getLogger(AtccJndiTemplate.class.getName());
private String jndiProperties;
protected Context createInitialContext()
throws NamingException
Context context = null;
InputStream in = null;
Properties env = new Properties();
logger.info("Load JNDI properties from classpath file " + this.jndiProperties);
try
in = AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
env.load(in);
in.close();
catch (NullPointerException e) {
logger.warning("Did not read JNDI properties file, using existing properties");
env = System.getProperties();
} catch (IOException e) {
logger.warning("Caught IOException for file [" + this.jndiProperties + "]");
throw new NamingException(e.getMessage());
logger.config("ENV: java.naming.factory.initial = " + env.getProperty
("java.naming.factory.initial"));
logger.config("ENV: java.naming.factory.url.pkgs = " + env.getProperty
("java.naming.factory.url.pkgs"));
logger.info("ENV: java.naming.provider.url = " + env.getProperty
("java.naming.provider.url") + " timeout=" + env.getProperty("jnp.timeout"));
context = new InitialContext(env);
return context;
public String getJndiProperties()
return this.jndiProperties;
public void setJndiProperties(String jndiProperties)
this.jndiProperties = jndiProperties;
}Hi,
JNDI needs some property such as the
java.naming.factory.initial
java.naming.provider.url
which are needed by the
InitialContext(env);
where env is a properties object
Now if you can not find the physical property file on the class path
by AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
where the String "jndiProperties" get injected by certain IOC ( inverse of control container ) such as Spring framework
if not found then it will take the property from the system which will come from the evniromental variables which are set during the application start up i.e through the command line
java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Danother=value etc..
I hope this could help
Regards,
Alan Mehio
London,UK -
Please explain this code,this is regarding to ODS activation.
Hi,
Please I am unable to understand this code,this exists initial activation of ODS,please can anyone please explain me this
ob started
Step 001 started (program RSPROCESS, variant &0000000055152, user ID ALEREMOTE)
Activation is running: Data target ZYL_O82, from 1.165.349 to 1.165.349
Data to be activated successfully checked against archiving objects
SQL: 20.06.2007 05:34:26 ALEREMOTE
ANALYZE TABLE "/BIC/AZYT_O6240" DELETE STATISTICS
SQL-END: 20.06.2007 05:34:26 00:00:00
SQL: 20.06.2007 05:34:26 ALEREMOTE
BEGIN DBMS_STATS.GATHER_TABLE_STATS ( OWNNAME =>
'SAPR3', TABNAME => '"/BIC/AZYT_O6240"',
ESTIMATE_PERCENT => 1 , METHOD_OPT => 'FOR ALL
INDEXED COLUMNS SIZE 75', DEGREE => 1 ,
GRANULARITY => 'ALL', CASCADE => TRUE ); END;
Thanks & Regards,
ManoHi,
Please I am unable to understand this code,this exists initial activation of ODS,please can anyone please explain me this
ob started
Step 001 started (program RSPROCESS, variant &0000000055152, user ID ALEREMOTE)
Activation is running: Data target ZYL_O82, from 1.165.349 to 1.165.349
Data to be activated successfully checked against archiving objects
SQL: 20.06.2007 05:34:26 ALEREMOTE
ANALYZE TABLE "/BIC/AZYT_O6240" DELETE STATISTICS
SQL-END: 20.06.2007 05:34:26 00:00:00
SQL: 20.06.2007 05:34:26 ALEREMOTE
BEGIN DBMS_STATS.GATHER_TABLE_STATS ( OWNNAME =>
'SAPR3', TABNAME => '"/BIC/AZYT_O6240"',
ESTIMATE_PERCENT => 1 , METHOD_OPT => 'FOR ALL
INDEXED COLUMNS SIZE 75', DEGREE => 1 ,
GRANULARITY => 'ALL', CASCADE => TRUE ); END;
Thanks & Regards,
Mano -
Can soemone explain this code to me
can someone explain this code to me
import javax.swing.*;
import BreezySwing.*;
import java.util.Random;
public class PennyPinch extends GBFrame
private JButton enterButton;
private JTextArea outputArea;
private int[][] board = {{1,1,1,1,1},{1,2,2,2,1},{1,2,3,2,1},{1,2,2,2,1},{1,1,1,1,1}};
private boolean[][] landing = new boolean[5][5];
private int total;
public PennyPinch()
enterButton = addButton ("Pitch",2,1,1,1);
outputArea = addTextArea("",4,1,3,4);
public void pitch()
Random generator = new Random();
int randomRow = generator.nextInt(5);
int randomColumn = generator.nextInt(5);
total += board[randomRow][randomColumn];
landing[randomRow][randomColumn] = true;
public void buttonClicked (JButton buttonObj)
pitch();
displayList(board, outputArea);
private void displayList(int a[][], JTextArea output)
output.setText("");
for (int row = 0; row < 5; row++)
for (int col = 0; col < 5; col++){
if(landing[row][col] ==true)
output.append(Format.justify('r',"P", 3) + " ");
if (col == 4)
output.append("\n");
else
output.append(Format.justify('r', a[row][col], 3) + " ");
if (col == 4)
output.append("\n"); }
output.append("the total is " + total);
public static void main (String[] args)
PennyPinch theGUI = new PennyPinch();
theGUI.setSize (300, 300);
theGUI.setVisible(true);
}Knowing toilets or studying under George?What kind pervert are you?
What is written in public toilets o/c!Ah yes I see, I found example questions.
2:3.4 please complete the following well known saying
by filling in the blank
Whilst you are reading what I put
You are blank on your foot
2:3.5 Upon seeing the announcement 'Toilet
tennis' and following the instruction ' please
see other wall for details' what is the standard
message on the other wall.2:3.4. is the correct answer 'micturating' ?
2:3.5. I believe the answer is Ibidem. -
Can someone explain me this code?
Hi... pls explain me this code if possible.
try {
wdContext.nodeStateList().bind( (Z_Hress_P0006_State_Input)model.createModelObject(Z_Hress_P0006_State_Input.class));
wdContext.currentStateListElement().setI_Withemptyline(true);
wdContext.currentStateListElement().setI_Countrykey(
wdContext.currentCountryRecordsElement().getLand());
wdContext.currentStateListElement().modelObject().execute();Pankak,
wdDoInit is a method in Web Dynpro controllers that ie executed when controller code is executed first time (initialized) its never run again in the lifespan of that controller (view controller, component controller, custom controller).
You can get some more introductory material about Web Dynpro here
https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/063bc942-0a01-0010-e7ae-d138e97acb5a [original link is broken]
Also I would suggest you to buy the Inside Web Dynpro book.
http://www.sappressbooks.com/product.cfm?account=&product=H983
This book will help to make your web dynpro concepts solid. I am assuming you know java.
Regarding the point, i don't have much idea how to give the points, I assume when you close the question you can assign the points.
Regards,
Anand -
HI,
CAN SOMEONE EXPLAIN TO ME THIS CODE:
FUNCTION DISP_QATD return VARCHAR2 is
BEGIN
SRW.REFERENCE(:P_CURRENCY_CODE);
SRW.REFERENCE(:P_QATD1);
SRW.USER_EXIT('FND FORMAT_CURRENCY
CODE = ":P_CURRENCY_CODE"
DISPLAY_WIDTH = "19"
AMOUNT = ":P_QATD1"
DISPLAY = ":DISP_QATD"
PRECISION = "STANDARD"');
RETURN(:DISP_QATD);
END;Hello,
For details about SRW.REFERENCE :
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/builtins/srw/srw_reference.htm?tp=true
Regards -
Please explain loop in this code
in this below code,what more is to be added as i am getting the values from the fields of table eban in the output but not from ekko,ekpo,eket.
where to put the loop or what else is reqd?
please suggest as i m new to this and not understanding.
LOOP AT IT_EBAN.
WA_FINAL-PURREQ = IT_EBAN-BANFN.
WA_FINAL-RITEM = IT_EBAN-BNFPO.
WA_FINAL-CRTDBY = IT_EBAN-ERNAM.
WA_FINAL-REQDT = IT_EBAN-BADAT.
WA_FINAL-REQSR = IT_EBAN-AFNAM.
WA_FINAL-SHTXT = IT_EBAN-TXZ01.
WA_FINAL-QTYREQ = IT_EBAN-MENGE.
WA_FINAL-UNITS = IT_EBAN-MEINS.
WA_FINAL-VALPR = IT_EBAN-PREIS.
WA_FINAL-CURR = IT_EBAN-WAERS.
WA_FINAL-PER = IT_EBAN-PEINH.
WA_FINAL-TPRICE = IT_EBAN-RLWRT.
WA_FINAL-TPRICE$ = IT_EBAN-RLWRT.
WA_FINAL-DELRQ = IT_EBAN-LFDAT.
WA_FINAL-REQREL = IT_EBAN-FRGDT.
WA_FINAL-PO = IT_EBAN-EBELN.
WA_FINAL-ITEM = IT_EBAN-EBELP.
WA_FINAL-PODATE = IT_EBAN-BEDAT.
WA_FINAL-QTYORD = IT_EBAN-BSMNG.
CLEAR IT_EKPO.
read table it_ekpo into wa_ekpo with key meins = wa_final-UNITS1
binary search.
WA_FINAL-UNITS1 = IT_EKPO-MEINS.
WA_FINAL-VALPR1 = IT_EKPO-NETPR.
WA_FINAL-PER1 = IT_EKPO-PEINH.
WA_FINAL-TPRICE1 = IT_EKPO-NETWR.
CLEAR IT_EKKO.
READ TABLE IT_EKKO WITH KEY waers = WA_FINAL-CURRPO
BINARY SEARCH.
WA_FINAL-CURRPO = IT_EKKO-WAERS.
CLEAR IT_EKET.
READ TABLE IT_EKET WITH KEY EINDT = WA_FINAL-DELPO
BINARY SEARCH.
WA_FINAL-DELPO = IT_EKET-EINDT.
APPEND WA_FINAL TO IT_FINAL.
CLEAR WA_FINAL.
endloop.CLEAR IT_EKPO.
read table it_ekpo into wa_ekpo with key meins = wa_final-UNITS1
binary search.
WA_FINAL-UNITS1 = IT_EKPO-MEINS.
WA_FINAL-VALPR1 = IT_EKPO-NETPR.
WA_FINAL-PER1 = IT_EKPO-PEINH.
WA_FINAL-TPRICE1 = IT_EKPO-NETWR.
In this code it_ekpo never gets populated. wa_ekpo gets filled if the read is succcessfull but wa_ekpo is not used..
CLEAR IT_EKKO.
READ TABLE IT_EKKO WITH KEY waers = WA_FINAL-CURRPO
BINARY SEARCH..
In this read WA_FINAL-CURRPO never has a value so the read will always fail
WA_FINAL-CURRPO = IT_EKKO-WAERS.
CLEAR IT_EKET.
READ TABLE IT_EKET WITH KEY EINDT = WA_FINAL-DELPO
BINARY SEARCH..
In this read WA_FINAL-DELPO never has a value so the read will always fail
Regards
Greg Kern -
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "PRICE") {
total = total + fields.item(i).rawValue;
this.rawValue = total;Hi Ankesh,
Basically this code is calculating the SUM of the PRICE fields contained in the Previous Page. Please see my comments in the code below:
//Get all fields contained in the Previous page (xfa.layout.page(this)-1 means previous page)
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
//Loop through all the fields
for (var i=0; i <= fields.length-1; i++) {
//If the field name is PRICE
if (fields.item(i).name == "PRICE") {
//Then add the value of the field to the Total
total = total + fields.item(i).rawValue;
//Set the calculated Total value in "this" field. "This" field is referring to the field that is actually calling this code.
this.rawValue = total;
Hope this helps,
harman -
I do not understand the following code. Especially, why this code use v_status_date(unassigned variable value)?
First, IF V_TSS.STATUS_DATE > V_STATUS_DATE OR V_STATUS_DATE IS NULL THEN
Second, ELSIF V_TSS.STATUS_DATE = V_STATUS_DATE THEN
How come compare v_status_date with v_tss.status_date?
I couldn't find any assigned value for v_status_date in this code.
----------original code----------
FUNCTION GET_TS_STATUS(P_ETS_ID NUMBER)
RETURN VARCHAR2 IS
CURSOR C_TSS IS
SELECT TSS.STATUS_CODE, TSS.STATUS_DATE
FROM STATUS TSS, SHEETS ETS
WHERE ETS.ID = P_ETS_ID
AND ETS.ID = TSS.ID;
V_STATUS_CODE VARCHAR2(10) := NULL;
V_STATUS_DATE DATE;
BEGIN
FOR V_TSS IN C_TSS LOOP
IF V_TSS.STATUS_DATE > V_STATUS_DATE OR V_STATUS_DATE IS NULL THEN
V_STATUS_CODE := V_TSS.STATUS_CODE;
V_STATUS_DATE := V_TSS.STATUS_DATE;
ELSIF V_TSS.STATUS_DATE = V_STATUS_DATE THEN
IF V_TSS.STATUS_CODE = 'APPROVED' THEN
V_STATUS_CODE := 'APPROVED';
ELSIF V_TSS.STATUS_CODE = 'VERIFIED' AND V_STATUS_CODE <> 'APPROVED' THEN
V_STATUS_CODE := 'VERIFIED';
ELSIF V_TSS.STATUS_CODE = 'SUBMIT' AND V_STATUS_CODE NOT IN ('APPROVED', 'VERIFIED') THEN
V_STATUS_CODE := 'SUBMIT';
ELSIF V_TSS.STATUS_CODE = 'WORKING' AND V_STATUS_CODE NOT IN ('SUBMIT', 'APPROVED', 'VERIFIED') THEN
V_STATUS_CODE := 'WORKING';
END IF;
END IF;
END LOOP;
RETURN NVL(V_STATUS_CODE, 'NONEXIST');
END;The function returns the status for a given id with the highest priority for the maximum date
As far as I can see, you could simplify this code to something like this
FUNCTION GET_TS_STATUS(P_ETS_ID in SHEETS.ID%type) RETURN STATUS.STATUS_CODE%type
IS
CURSOR C_TSS IS
SELECT TSS.STATUS_CODE,
TSS.STATUS_DATE
FROM STATUS TSS,
SHEETS ETS
WHERE ETS.ID = P_ETS_ID
AND ETS.ID = TSS.ID
ORDER BY TSS.STATUS_DATE desc,
decode( TSS.STATUS_CODE, 'APPROVED', 4
'VERIFIED', 3
'SUBMIT' , 2
'WORKING' , 1
, 0) asc
V_STATUS_CODE STATUS.STATUS_CODE%type;
BEGIN
OPEN c_tss;
FETCH c_tss_ INTO v_status_code;
CLOSE c_tss;
RETURN NVL(V_STATUS_CODE, 'NONEXIST');
END GET_TS_STATUS; -
Please explain this code to me (in English)! Thanks.
Hello everyone,
I am working with some AS3 code that someone else has written. The code creates datatables and populates them by pulling from a .NET webservice using SOAP and DataTables.
I have copied and pasted the code below. Most of it makes sense and I understand it, however, there are some things I've never seen before and have not been able to find on the internet. Most of the things I have a problem with, I've created comments in ALL CAPS with my questions.
If someone could take a look at it and tell me what is going on I would appreciate it.
Thanks.
//Load result data into XMLList structure
var xmlData:XML = XML(myService.GetViewResults.lastResult);
//gets the DataTables data, length of tableXML is the number of Tables you got
var tableXML:XMLList = xmlData.GetViewResultsResult.DataTables.children();
//gets the number of tables returned in the result
var numTables:int = tableXML.children().length();
//seperates out the data for each table
var tempXMLArray:Array = new Array();
var tempXML:XML;
for (var i:int=0; i<numTables; i++)
tempXML = tableXML[i];
tempXMLArray.push(tempXML);
//create a datagrid for each table
var datagrid1:DataGrid, datagrid2:DataGrid, datagrid3:DataGrid;
//create array collections to feed datagrids
var ac1:ArrayCollection, ac2:ArrayCollection, ac3:ArrayCollection;
var currentTableXML:XML;
var columns:Array = new Array();
var dgc:DataGridColumn;
var obj:Object; // WHY IS THIS OBJECT NEEDED?
//CREATING TABLE 1
currentTableXML = tempXMLArray[0];
datagrid1 = new DataGrid();
datagrid1.width = 1000;
datagrid1.height = 200;
datagrid1.y = 0;
columns = new Array();
for (i=0; i<currentTableXML.Columns.children().length(); i++)
dgc = new DataGridColumn(currentTableXML.Columns.NHRCViewResultColumn.ColumnName[i].toString());
dgc.dataField = currentTableXML.Columns.NHRCViewResultColumn.ColumnName[i];
columns.push(dgc);
datagrid1.columns = columns;
ac1 = new ArrayCollection;
// looping through each piece of data in the row
for (i=0; i<currentTableXML.Rows.children().length(); i++)
trace("table 1:creating row " + i);
// I HAVE NO IDEA WHATS GOING ON HERE... WHAT IS THIS OBJECT DOING EXACTLY?
obj = {
// I DON'T UNDERSTAND THIS SYNTAX - WHAT ARE THE COLONS FOR??? AND WHY STORE IN AN OBJECT???
((datagrid1.columns[0] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[0]),
((datagrid1.columns[1] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[1]),
((datagrid1.columns[2] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[2]),
((datagrid1.columns[3] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[3]),
((datagrid1.columns[4] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[4]),
((datagrid1.columns[5] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[5])
ac1.addItem(obj);
datagrid1.dataProvider = ac1;
this.addChild(datagrid1); //Adding populated datagrid to the screeenThe following code creates a variable obj of type Object. You need to declare the variable, and you don't want to do that inside the loop where the object is constructed, because then it will be scoped within the loop block, so it is first declared outside the loop.
var obj:Object; // WHY IS THIS OBJECT NEEDED?
Now you are constructing the object. Here is the logic of what is going on.
Objects of this type in Flex are constructed as follows:
objName = {
fieldName1: fieldVal1,
fieldName2: fieldVal2,
fieldName3: fieldVal3
In this code, the field names are:
(datagrid1.columns[0] as DataGridColumn).dataField.toString()
and you need to cast as DataGridColumn first.
The field values are:
(currentTableXML.Rows.NHRCViewResultRow.Values[i].string[0])
So here it seems you are taking the first item in the string element of the ith element of Values, which is obtained by parsing into the currentTableXML, Rows element, NHRCViewResultRow element.
// I HAVE NO IDEA WHATS GOING ON HERE... WHAT IS THIS OBJECT DOING EXACTLY?
obj = {
// I DON'T UNDERSTAND THIS SYNTAX - WHAT ARE THE COLONS FOR??? AND WHY STORE IN AN OBJECT???
((datagrid1.columns[0] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[0]),
((datagrid1.columns[1] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[1]),
((datagrid1.columns[2] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[2]),
((datagrid1.columns[3] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[3]),
((datagrid1.columns[4] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[4]),
((datagrid1.columns[5] as DataGridColumn).dataField.toString()):(currentTableXML.Rows.NHRCViewResultRow.V alues[i].string[5]) -
Change this code to retrieve more than one row in the drop out menu
How I can change this code, it only works when the cursor retrieves one row
like this
201410
Fall 2013
If it returns 2 rows, I only get the fir one in the drop out menu
201410
Fall 2013
201420
Spring 2014
I try to put a loop but it does not work..
I need to be able to display any term that is retrieve by the cursor (can be more than one)
Term Fall 2013
Spring 2014
PROCEDURE p_enter_term
IS
v_code stvterm.stvterm_code%TYPE;
v_desc stvterm.stvterm_desc%TYPE;
CURSOR select_term_c IS
SELECT
stvterm_code,
stvterm_desc
from
stvterm,
sobterm
where
sobterm_dynamic_sched_term_ind = 'Y'
and sobterm_term_code = stvterm_code;
select_term_rec select_term_c%rowtype;
BEGIN
--check for open cursor
if select_term_c%isopen
then
close select_term_c;
end if;
open select_term_c;
fetch select_term_c into v_code,v_desc;
HTP.p ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
HTP.p ('<FORM ACTION="/test/btsewl.p_sel_crse" METHOD="POST" onSubmit="return checkSubmit()">');
HTP.p ('<TABLE CLASS="dataentrytable" summary="This layout table is used for term selection."width="50%"><CAPTION class="captiontext">Search by Term: </CAPTION>');
HTP.p ('<TR>');
HTP.p ('<TD class="dedefault"><LABEL for=term_input_id><SPAN class="fieldlabeltextinvisible">Term</SPAN></LABEL>');
HTP.p ('<SELECT NAME="p_term" SIZE="1" ID="term_input_id">');
HTP.p ('<OPTION VALUE="'||v_code||'">');
HTP.p (v_desc);
HTP.p ('</OPTION>');
HTP.p ('</SELECT>');
HTP.p ('</TD>');
HTP.p ('</TR>');
HTP.p ('</TABLE>');
HTP.p ('<BR>');
HTP.p ('<BR>');
HTP.p ('<INPUT TYPE="submit" VALUE="Submit">');
HTP.p ('<INPUT TYPE="reset" VALUE="Reset">');
HTP.p ('</FORM>');
END;You are using the Eclipse Dali plugin to generate tables from your entities, not the EclipseLink JPA provider at runtime, so the settings in your persistence.xml are ignored. The documentation for the Dali table Wizards state it will drop and create tables. If you want to use the EclipseLink persistence settings to just create tables, access your persistence unit in a test case or deployment.
Maybe you are looking for
-
How can I import CDs and mp3s from my externals device to Itunes?
Hello, I have got a real problem with ITunes. It does not import any data neither from CDs nor externals drives (mp3-drive). It is nearly impossible to do so because I haven't got the access rights. Thank you for your help. Mathias
-
hai gurus i have problem for me2m,me2n report, it shows net price only now i verified me80fn report then i got net order value , but i want total 10 line items value in one line like Po No, Vendor, Po Org, Plant, Stog, Net order value, and also verif
-
DataGid or? (to display data)
I have a data array [5][4] (Strings) how can i disply it in DataGrid in the way that each contnt of an element will be in a separate row/column ? The user should be able to modify it. If the DataGrid a right Tool or there are other ways ? Thanks
-
Invalid Color Management in Lightroom? (RAW)
I've noticed the strange thing, how Adobe Camera RAW 4.1.1 displays the same image differently in Photoshop CS3 & Lightroom 1.4.1 Here are the screenshots from both programs: What I've got in Lightroom/develop mode: http://www.imagebam.com/image/956c
-
FlasCC clang++ crash while compiling boost/asio/ssl.hpp
Hi all, I guess the title's quite descriptive. I have Crossbridge_1.1.0.devbuild.fdb5425, and boost_1_54_0, and I'm trying to compile an otherwise empty c++ file that just has an #include <boost/asio/ssl.hpp> at the top. I invoke clang++ as follows o