What's the error in this code?
I keep getting an error message at "line 1 column 97" which is the letter "i" in the second "if."
begin if :P23_START_DATE is null or :P23_START_DATE = ' ' then :P23_START_DATE:= '01-JAN-2001';
if :P23_END_DATE = is null or :P23_END_DATE = ' ' then
:P23_END_DATE = '31-DEC-2099';
select 'http://apexdevapp1.ci.raleigh.nc.us:7777',
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE <= to_char(to_date(:P23_END_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
and ACTIVITY_DATE >= to_char(to_date(:P23_START_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
group by
user_name,
'http://apexdevapp1.ci.raleigh.nc.us:7777'
end;
Honestly, I don't see where the problem is. Help me please.
Steve "the n00b" in Raleigh NC
ackness wrote:
You could forgo the IF statements altogether by doing using NVL and TRIM this:
begin
select
'http://apexdevapp1.ci.raleigh.nc.us:7777',
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099');
group by
user_name,
'http://apexdevapp1.ci.raleigh.nc.us:7777';
end;
also you can simplify the GROUP BY by
begin
select
MAXX('http://apexdevapp1.ci.raleigh.nc.us:7777') URL,
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE BETWEEN NVL(TRIM((:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM((:P23_END_DATE), '31-DEC-2099');
group by
user_name;
end;Ackness, I tried your first suggestion, and got this when I applied the changes.
1 error has occurred
Failed to parse SQL query:
BEGIN SELECT 'http://apexdevapp1.ci.raleigh.nc.us:7777', user_name, count(ID) total FROM eba_ver2_cust_activity where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099'); group by user_name, 'http://apexdevapp1.ci.raleigh.nc.us:7777'; end
ORA-06550: line 5, column 115: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
I can't for the life of me figure out where the invalid character is after "begin." All I can see is a blank character. Thanks for your help.
Steve "the n00b"
Similar Messages
-
What is the error with this code ??
i'm trying to execute the following AS3 code:
var itemsArr:Array = new Array ();
var i:int;
var loaderAds:URLLoader = new URLLoader();
loaderAds.load(new URLRequest("ads.txt"));
loaderAds.addEventListener(Event.COMPLETE, completeHandlerAds);
function completeHandlerAds(eventAds:Event):void {
var loaderAds:URLLoader = URLLoader(eventAds.target);
var varsAds:URLVariables = new URLVariables(loaderAds.data);
itemsArr = varsAds.names.split(";");
for (i = 0; i < (itemsArr.length); i++) {
trace("itemsArr, Processing: " + itemsArr[i]);
var loaderProps:URLLoader = new URLLoader();
loaderProps.load(new URLRequest(itemsArr[i]+".txt"));
loaderProps.addEventListener(Event.COMPLETE, completeHandlerProps);
trace("one: " + itemsArr[i]);
function completeHandlerProps(eventProps:Event):void {
trace("two: " + itemsArr[i]);
}// end of fn for props
}//end of "for" loop of ads names
}//end of fn for ads names
But i get the following output:
adsNames Array: ad0,ad1
adsNames, Processing: ad0
ad0
adsNames, Processing: ad1
ad1
null
TypeError: Error #2007: Parameter name must be non-null.
at flash.display::DisplayObject/set name()
at MethodInfo-279()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
null
TypeError: Error #2007: Parameter name must be non-null.
at flash.display::DisplayObject/set name()
at MethodInfo-279()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
As you see, the "red text" is errors, Can you tell me the reason for it ?
And also, tracing "itemsArr[i]" in the second time, always give "null", also in the first time, it give the correct value, Why ?the red text not appear after i posted the topic, but you can see the errors on the output
and, you've to create to text files, first called "ads.txt" and put in it "names=ad0;ad1"
second one called "ad0.txt" and put anything in it, and another called "ad1.txt" and put anything in it
all these files should be in the same dir of flash file -
What is the error in this code
hi everone
I write this code in push button
declare
x varchar2(222);
begin
x:=get_application_property(:system.mode);
message(x);
end;
to know the system mode
but the resullt was exeception ora-06502simple write
x := :system.mode;
or
message(:system.mode);
message(:system.mode);Best way to resolve the issue is always check Forms online help first -
Vector, what is the problem with this code?
Vector, what is the problem with this code?
63 private java.util.Vector data=new Vector();
64 Vector aaaaa=new Vector();
65 data.addElement(aaaaa);
74 aaaaa.addElement(new String("Mary"));on compiling this code, the error is
TableDemo.java:65: <identifier> expected
data.addElement(aaaaa);
^
TableDemo.java:74: <identifier> expected
aaaaa.addElement(new String("Mary"));
^
TableDemo.java:65: package data does not exist
data.addElement(aaaaa);
^
TableDemo.java:74: package aaaaa does not exist
aaaaa.addElement(new String("Mary"));Friends i really got fed up with this code for more than half an hour.could anybody spot the problem?I can see many:
1. i assume your code snip is inside a method. a local variable can not be declare private.
2. if you didn't import java.util.* on top then you need to prefix package on All occurance of Vector.
3. String in java are constant and has literal syntax. "Mary" is sufficient in most of the time, unless you purposly want to call new String("Mary") on purpose. Read java.lang.String javadoc.
Here is a sample that would compile...:
public class QuickMain {
public static void main(String[] args) {
java.util.Vector data=new java.util.Vector();
java.util.Vector aaaaa=new java.util.Vector();
data.addElement(aaaaa);
aaaaa.addElement(new String("Mary"));
} -
What's the problem in this code
import java.lang.reflect.*;
import java.awt.*;
class ABC
public Integer i;
ABC()
public void setInt(Integer t)
i = t;
public class SampleName {
public static void main(String[] args)
ABC g1 = new ABC();
g1.setInt(new Integer(10));
printFieldNames(g1);
static void printFieldNames(Object o) {
Class c = o.getClass();
Field[] publicFields = c.getDeclaredFields();
for (int i = 0; i < publicFields.length; i++)
try {
Object ref = publicFields.get(c);
System.out.println(" ref.toString() : " + ref.toString());
}catch(Exception e)
e.printStackTrace();
What is the problem with this code,at run time Iam getting this exception
java.lang.IllegalArgumentException: object is not an instance of declaring class
How can we get the value of field of an objectNow it got this exception
java.lang.IllegalAccessException
at java.lang.reflect.Field.get(Native Method)That's strange - I didn't! ;-)
Are you running exactly the same code as the code you posted (except for the one line I said to change)? -
Please tell me what is the problem with this code
Hai,
Iam new to Swings. can any one tell what is the problem with this code. I cant see those controls on the frame. please give me the suggestions.
I got the frame ,but the controls are not.
this is the code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex2 extends JFrame
JButton b1;
JLabel l1,l2;
JPanel p1,p2;
JTextField tf1;
JPasswordField tf2;
public ex2()
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Another example");
setSize(500,500);
setVisible(true);
b1=new JButton(" ok ");
p1=new JPanel();
p1.setLayout(new GridLayout(2,2));
p2=new JPanel();
p2.setLayout(new BorderLayout());
l1=new JLabel("Name :");
l2=new JLabel("Password:");
tf1=new JTextField(15);
tf2=new JPasswordField(15);
Container con=getContentPane();
con.add(p1);
con.add(p2);
public static void createAndShowGUI()
ex2.setDefaultLookAndFeelDecorated(true);
public static void main(String ar[])
createAndShowGUI();
new ex2();
}import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex2 extends JFrame
JButton b1;
JLabel l1,l2;
JPanel p1,p2;
JTextField tf1;
JPasswordField tf2;
public ex2()
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Another example");
b1=new JButton(" ok ");
p1=new JPanel();
p1.add(b1);
p2=new JPanel();
p2.setLayout(new GridLayout(2,2));
l1=new JLabel("Name :");
l2=new JLabel("Password:");
tf1=new JTextField(15);
tf2=new JPasswordField(15);
p2.add(l1);
p2.add(tf1);
p2.add(l2);
p2.add(tf2);
Container con=getContentPane();
con.add(p1, BorderLayout.NORTH);
con.add(p2, BorderLayout.CENTER);
pack();
setVisible(true);
public static void createAndShowGUI()
ex2.setDefaultLookAndFeelDecorated(true);
public static void main(String ar[])
createAndShowGUI();
new ex2();
} -
What's the point of this code?
Hi, I'm getting an error in a program.
So I went to look in the code where the error is displayed.
And I found this:
z_nbjr = sy-datum - z_fromdt.
if z_nbjr > 1.
message is displayed.
Now, z_fromdt is the value TVARV-LOW for 'ZVDL_VBUK_LAST_RUN', and the message that is displayed is 'Please rebuild index file ZVDL_VBUK'.
Can anyone explain to me what is the point of this? What is TVARV-LOW?
And why do they make this check? And how do I rebuild the index file?>
christophe latinne wrote:
> Can anyone explain to me what is the point of this? What is TVARV-LOW?
> And why do they make this check? And how do I rebuild the index file?
As Pushpraj has already pointed out correctly, TVARV is where the variants are stored. It's rather strange that you've never seen fields like LOW and HIGH, because they're also used in the ABAP range tables (see Help for command RANGES).
Since this is all your custom development, we, unfortunately, cannot know what is the point of all this. I'm guessing that the message to "rebuild the index" is also custom and, therefore, you would need to find a documentation for the program in question or ask your colleagues what this could mean. Also check if there is a long text available for the message (although I doubt that).
Most likely it's some kind of an internal process of running some other program. -
What's the error in this package
dear all,
can you plz tell me what's the erro in this package plz
SQL> CREATE OR REPLACE PACKAGE discounts
2 IS
3 g_id NUMBER := 7839;
4 discount_rate NUMBER := 0.00;
5 PROCEDURE display_price (p_price NUMBER);
6 END discounts;
7 /
Package created.
SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY discounts
2 IS
3 PROCEDURE display_price (p_price NUMBER)
4 IS
5 BEGIN
6 DBMS_OUTPUT.PUT_LINE ( 'Discounted '
7 ||TO_CHAR(p_price*NVL(discount_rate, 1)));
8 END ;
9 discount_rate:= 0.10;
10 END ;
11 /
Warning: Package Body created with compilation errors.
SQL>
SQL> show errors;
Errors for PACKAGE BODY DISCOUNTS:
LINE/COL ERROR
9/1 PLS-00103: Encountered the symbol "DISCOUNT_RATE" when expecting
one of the following:
begin end function package pragma procedure form
The symbol "begin" was substituted for "DISCOUNT_RATE" to
continue.
SQL>if you want declare a private variable you need to declare at package body and remove from the package specification
something like this
@10g> CREATE OR REPLACE PACKAGE discounts
2 IS
3 g_id NUMBER := 7839;
4 PROCEDURE display_price (p_price NUMBER);
5 END discounts;
6 /
Package created.
@10g>
@10g> CREATE OR REPLACE PACKAGE BODY discounts
2 IS
3 discount_rate NUMBER := 0.10; /* Private declaration */
4
5 PROCEDURE display_price (p_price NUMBER)
6 IS
7 BEGIN
8 DBMS_OUTPUT.PUT_LINE ( 'Discounted '
9 ||TO_CHAR(p_price*NVL(discount_rate, 1)));
10 END ;
11 END ;
12 /
Package body created.You can't assign values to variables out of procedure unless you declare and assign a initial value.
Edited by: dask99 on Oct 26, 2009 8:23 AM -
Where's the error in this code...
the following snippet of code throws a SQLException with a 'Invalid Handle' message.
What's does this 'Invalid Handle' mean? And, which line of code is causing the problem?
try {
//RETRIEVE CITYLIST FROM DB
cityList = statement.executeQuery("SELECT CityCode, CityName FROM CityList");
while (cityList.next()) {
//ADD CODES AND NAMES OF CITIES TO ARRAYLISTS
String code = cityList.getString(1);
String name = cityList.getString(2);
codes.add(code);
names.add(name);
cityList.close();
} catch (SQLException sql) {
System.out.println("2-checkForAvailability.jsp..err->" + sql);
Any help will be appreciated..
regards
UshantaYes, you don't declare the ResultSet inside that try block, so I'll assume that it's a data member of your class. I'd suggest that you make the ResultSet a local variable in that method and not try to hang onto it. Same for the statement:
Statement statement = null;
ResultSet cityList = null;
try
statement = connection.createStatement();
cityList = statement.executeQuery("SELECT CityCode, CityName FROM CityList");
while (cityList.next())
String code = cityList.getString(1);
String name = cityList.getString(2);
codes.add(code);
names.add(name);
} catch (SQLException sql)
sql.printStackTrace();
System.err.println("SQL state: " + sql.getSQLState());
System.err.println("SQL error: " + sql.getErrorCode());
finally
try
if (cityList != null)
cityList.close();
if (statement != null)
statement.close();
catch (SQLException ignoreException) -
What is the problem in this code
hi
im tring to ftech mutliple reords to tabuler form text item
i write this code but its only fetch values for first record in the text item and do not fetch to other records in the same text item
Declare
cursor c is
select distinct group_a from sc_mast; <here i select all values
in my database that they are 63 values>
begin
for r in c loop
next_record;
:visib_groups.group_a:=r.group_a;<it assign vakues only for first record>
end loop;
end;This?
Go_block('>your_block<')
first_record;
begin
for r in c loop
:visib_groups.group_a:=r.group_a;<it assign vakues only for first record>
next_record;
end loop;Ros -
Please help in finding the error in this code
Dear Friends,
I am trying to make the value of 'Shift' on the basis of BLDAT CPUDT & CPUTM of MKPF but I am doing something wrong. Kindly have a look at the following code, especially the IF..ELSEIF section and help me in finding the error.
Regards,
Alok.
SELECT MBLNR MJAHR BKTXT BUDAT BLDAT CPUDT CPUTM USNAM
INTO CORRESPONDING FIELDS OF TABLE I_MKPF1
FROM MKPF
WHERE
BUDAT EQ S_BUDAT AND
TCODE2 EQ 'MFBF'.
********************************************************ALOK 01.02.07
LOOP AT I_MKPF1.
I_MKPF-MBLNR = I_MKPF1-MBLNR.
I_MKPF-MJAHR = I_MKPF1-MJAHR.
I_MKPF-BKTXT = I_MKPF1-BKTXT.
I_MKPF-BUDAT = I_MKPF1-BUDAT.
I_MKPF-BLDAT = I_MKPF1-BLDAT.
I_MKPF-CPUDT = I_MKPF1-CPUDT.
I_MKPF-CPUTM = I_MKPF1-CPUTM.
I_MKPF-USNAM = I_MKPF1-USNAM.
IF ( ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM < '160000' )
AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'A'.
ELSEIF ( ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM <= '110000' )
AND ( I_MKPF1-BLDAT <> I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'C'.
ELSEIF ( ( I_MKPF1-CPUTM >= '160000' AND I_MKPF1-CPUTM < '000000' )
AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'B'.
ENDIF.
APPEND I_MKPF.
CLEAR I_MKPF.
ENDLOOP.Hi.
IF ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM < '160000' )
AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'A'.
ELSEIF ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM <= '110000' )
AND ( I_MKPF1-BLDAT <> I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'C'.
ELSEIF ( I_MKPF1-CPUTM >= '160000' AND I_MKPF1-CPUTM < '000000' )
AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'B'.
ENDIF.
Try the above code ..
Regards
Sudheer -
What's the error of this file-upload code?
hi,
I have written following code for file selection:
<form action="display.jsp" method="POST" enctype="multipart/form-data">
<input type="file" name="File1">
<input type="submit" name = "button" value="Submit">
</form>And my project another file display.jsp which code is:
<%@ page import="org.apache.commons.fileupload.*"%>
<%@page import="java.io.*" %>
<%@page import="java.util.*" %>
<%
out.println("Content Type: "+request.getContentType());
boolean isMultipart=FileUpload.isMultipartContent(request);
DiskFileUpload upload=new DiskFileUpload();
List items=upload.parseRequest(request);
Iterator iter=items.iterator();
while(iter.hasNext()){
FileItem item=(FileItem)iter.next();
if(item.isFormField()){
out.println("SIZE: "+item.getSize());
File fNew= new File(application.getRealPath("/"), item.getName());
out.println(fNew.getAbsolutePath());
item.write(fNew);
else
out.println("Field ="+item.getFieldName());
%>After that, i put on common-fileupload-1.1..jar on the project's /WebConcontent/WEB-INF/lib/ directory. And i have also add the common--fileupload-1.1.1. jar in the project build path. Further that i have got following error:
Error is:
exception
org.apache.jasper.JasperException: org/apache/commons/io/output/DeferredFileOutputStream
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.display_jsp._jspService(display_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:102)
org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
org.apache.jsp.display_jsp._jspService(display_jsp.java:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Why i have got this error? IS there anybody can help me? What will be the solution?Please Help me?
With regards
Binajava.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
Means you are missing a class file from the class path. Most likely cause is a missing jar file. The Apache Commons utilities often have dependancies on other Commons projects. This looks like it is looking for the Apache Commons IO jar file. Download the jar file and add it to the WEB-INF/lib directory. -
What is the error in this one line of code!
s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
I am using this line of code in my programe but i am getting the following error.
C:\shahzad\Easter.java:28: illegal start of expression
s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
Please help me solvingg this problem
thanks.s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
[] brakets ae used to index arrays, are you using an array somewhere????
arr=5; for example....
in either event youl need to make changes.
assuming no array is involved simply change [] to ()
if still causing problems try adding extara()
s= (s-(s/28))*( (1-(s/28)) * ( (29/s)+1) * (21-(q/11)) ); -
What is the problem with this code?
dear sirs...
i have a page that does not contain any binding, it contains the following event:
public void onCheck(DataActionContext ctx)
ViewObject V=ctx.getBindingContext.findDataControl("AppModuleDataControl").getApplicationModule.findViewObject("empview1");
V.setWhereClause("");
V.executeQuery();
V.first();
note that the above code works if the table emp is on the page, however, if the page is not bound to the page (it does not contains the table) the statement in the bold will fire an exception saying that there is no binding. i am sure the V is not set to null.
another problem appears, if i put the table and execute it within jdeveloper, it works correctly, however, if i run if i deploy the application into application server, the code never runs as if there is some kind of an error.
i hope that you can anser me about the following;
1- if the code above correct?
2- how can i view the log for the application?
3- System.out.println("test"); in jdeveloper works okay, in the application server, does it cause some kind of an error?
thanks for any help & best regardsIf you don't close the ResultSet, different things happen based on which database you're running. You can keep read locks that you don't need. It wastes resources, and as different databases react differently to it, you might have weird bugs down the road that result from your practices of not properly closing ResultSets, PreparedStatements, and Connections. Put this in a loop like you've got here, and the effects may or may not get amplified.
I write a close() for a ResultSet just as soon as I open it, just to make sure I don't forget. In a situation like this one, I would write something like so:
for(int i = 0;i<someValue;i++)
try
//some code
rs = pstmt.executeQuery();
//some code that uses rs
catch(Exception e)
finally
if (rs != null)
rs.close();
if (pstmt != null)
pstmt.close();
} -
What is the problem in this code (problem in select query)
Just need your help in solving one issue. In the below code one query which is highlighted
Select statement not working means cursor directly goes to the endselect .means these two statements not executed.
CLASS cl_abap_container_utilities DEFINITION LOAD.
CALL METHOD cl_abap_container_utilities=>read_container_c
I am attaching that code with this mail. Please do the needful help.
*& Report ZEOU_RG1 *
REPORT zeou_rg1 LINE-SIZE 400.
Purpose : RG1 Report driver
Remarks :
constants
INCLUDE j_2icons.
type declerations
INCLUDE j_2isdef.
table definitions and internal tables
INCLUDE j_2iddef.
INCLUDE <icon>.
DATA: $plant TYPE bp_addr_typ,
$lincnt LIKE sy-linct,
m_date LIKE j_1ipart2-budat,
m_chapid LIKE j_1iexcdtl-chapid,
m_matform LIKE j_1irg1-matform,
m_bedrate LIKE j_1irg1-bedrate,
tot_op_bal LIKE j_1irg1-menge,
tot_qty_mnfr LIKE j_1irg1-menge,
tot_total_qty_mnfr LIKE j_1irg1-menge,
tot_remv_home LIKE j_1irg1-menge,
tot_remv_hval LIKE j_1irg1-exbas,
tot_remv_expr LIKE j_1irg1-menge,
tot_remv_eval LIKE j_1irg1-exbas,
tot_remv_expb LIKE j_1irg1-menge,
tot_remv_othr LIKE j_1irg1-menge,
tot_remv_opur LIKE j_1irg1-menge,
tot_duty_amt LIKE j_1irg1-exbed,
tot_cb_fr LIKE j_1irg1-exbed,
tot_cb_br LIKE j_1irg1-exbed.
DATA: t_rg1_cons TYPE rg1_typ OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS: <x_extrctdata> TYPE c,
<x_rg1> TYPE rg1_typ,
<x_part1typ> TYPE part1_typ.
DATA : it_j_1iexchdr TYPE j_1iexchdr OCCURS 0 WITH HEADER LINE,
wa_j_1iexchdr TYPE j_1iexchdr,
it_j_1iexcdtl TYPE j_1iexcdtl OCCURS 0 WITH HEADER LINE,
wa_j_1iexcdtl TYPE j_1iexcdtl.
selection screen
PARAMETERS: p_exgrp LIKE j_1iexchdr-exgrp OBLIGATORY MEMORY ID j2i,
p_stdate LIKE sy-datum OBLIGATORY,
p_endate LIKE sy-datum OBLIGATORY.
*SELECTION-SCREEN SKIP 1.
*SELECTION-SCREEN BEGIN OF BLOCK 4 WITH FRAME TITLE TEXT-001.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN POSITION 01.
*PARAMETERS: P_INDI RADIOBUTTON GROUP 57F4 DEFAULT 'X'.
*SELECTION-SCREEN COMMENT (25) TEXT-002.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN POSITION 01.
*PARAMETERS: P_CONS RADIOBUTTON GROUP 57F4.
*SELECTION-SCREEN COMMENT (25) TEXT-003.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN END OF BLOCK 4.
INITIALIZATION.
AT SELECTION-SCREEN.
SELECT SINGLE *
FROM j_1iexgrps
WHERE j_1iexcgrp = p_exgrp.
IF sy-subrc NE 0.
MESSAGE e399(8i) WITH p_exgrp.
ENDIF.
*check company code
SELECT SINGLE *
FROM t001k
WHERE bwkey = j_1iexgrps-j_1iwerks.
IF sy-subrc NE 0.
MESSAGE e518(8i) WITH 'the' 'plant' j_1iexgrps-j_1iwerks.
ENDIF.
<b>START-OF-SELECTION.
CLEAR: j_1irg1, j_2icomp.
retrieve layout name and details
SELECT SINGLE *
FROM J_2ILAYCTR
WHERE BUKRS = T001K-BUKRS
AND REGISTER = C_RG1
AND LAYOUTNR = 1.
IF SY-SUBRC NE 0.
MESSAGE E635(8I) WITH T001K-BUKRS C_RG1.
ENDIF.
SET COUNTRY 'IN'.
REFRESH t_reciepts.
report driver logic
SELECT *
FROM j_2iextrct
WHERE exgrp = p_exgrp
AND budat >= p_stdate
AND budat <= p_endate
AND register = c_rg1
ORDER BY budat keyid.
assign J_2IEXTRCT-EXTRCTDATA to <x_extrctdata> casting.
assign T_RG1 to <x_rg1> casting.
<x_rg1> = <x_extrctdata>.
CLASS cl_abap_container_utilities DEFINITION LOAD.
CALL METHOD cl_abap_container_utilities=>read_container_c
EXPORTING
im_container = j_2iextrct-extrctdata
IMPORTING
ex_value = t_rg1
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
MOVE J_2IEXTRCT-EXTRCTDATA TO T_RG1.
APPEND t_rg1.
ENDSELECT.
DESCRIBE TABLE t_rg1 LINES $lincnt.
IF $lincnt = 0.
MESSAGE e548(8i) WITH p_stdate p_endate.
ENDIF.</b>
PERFORM PLANT_AND_EXCISE_DTLS USING P_WERKS.
PERFORM plant_and_excise_dtls USING j_1iexgrps-j_1iwerks.
MOVE : 'ZJ_2I_RG1' TO j_2ilayctr-layoutname.
SORT t_rg1 BY chapid matnr cpudt .
open form
PERFORM open_form USING j_2ilayctr-layoutname j_2ilayctr-noofcopies "J_2ILAYCTR-LAYOUTNAME
j_2ilayctr-outdevice true.
process extract data and write
IF P_INDI = 'X'.
PERFORM get_data_and_write.
ELSEIF P_CONS = 'X'.
PERFORM RG1_PRINT_CONS.
PERFORM GET_DATA_AND_WRITE_CONS.
ENDIF.
close form
PERFORM close_form.
F O R M S
INCLUDE j_2ilayo.
*& Form GET_DATA_AND_WRITE
Purpose : Logic to print RG1 report
FORM get_data_and_write.
DATA: save_matnr LIKE mara-matnr.
CLEAR: j_1irg1, j_2icomp, save_matnr.
SELECT * FROM j_1iexchdr INTO TABLE it_j_1iexchdr
WHERE exgrp = p_exgrp
AND budat >= p_stdate
AND budat <= p_endate.
SORT it_j_1iexchdr BY cpudt docno.
LOOP AT it_j_1iexchdr.
SELECT * FROM j_1iexcdtl INTO wa_j_1iexcdtl
WHERE docno = it_j_1iexchdr-docno.
APPEND wa_j_1iexcdtl TO it_j_1iexcdtl.
ENDSELECT.
ENDLOOP.
clear wa_j_1iexcdtl.
SORT it_j_1iexcdtl BY chapid matnr cpudt docno.
LOOP AT t_rg1.
CLEAR: j_1irg1, j_2icomp.
assign header fields
j_2icomp-stdate = p_stdate.
j_2icomp-endate = p_endate.
IF save_matnr NE t_rg1-matnr.
fill header line with matnr, description, chapterid and unit
j_1irg1-chapid = t_rg1-chapid.
mara-matnr = t_rg1-matnr.
marav-maktx = t_rg1-maktx.
mara-meins = t_rg1-meins.
save_matnr = t_rg1-matnr.
IF sy-tabix NE 1.
j_2icomp-new_page = true.
ELSE.
j_2icomp-new_page = false.
ENDIF.
ELSE.
j_2icomp-new_page = false.
ENDIF.
PERFORM write_form USING element-spac function-set
typ-body window-main .
determine line to display viz. manufacture entry/removal entry
IF t_rg1-matform = c_packed.
j_2icomp-rg1_p_l = c_packed.
ELSEIF t_rg1-matform = c_loose.
j_2icomp-rg1_p_l = c_loose.
ENDIF.
j_1irg1-cpudt = t_rg1-cpudt.
j_2icomp-op_qty = t_rg1-op_bal.
j_2icomp-mf_qty = t_rg1-qty_mfr.
j_2icomp-to_qty = t_rg1-total.
j_2icomp-cl_fin = t_rg1-cl_bal_fn.
j_2icomp-cl_bon = t_rg1-cl_bal_bn.
j_2icomp-remarks = t_rg1-remarks.
j_2icomp-h_menge = t_rg1-h_menge.
j_2icomp-h_value = t_rg1-h_value.
j_2icomp-e_menge = t_rg1-e_menge.
j_2icomp-e_value = t_rg1-e_value.
j_2icomp-e_menge_bn = t_rg1-e_menge_bond.
j_2icomp-o_menge = t_rg1-o_menge.
j_2icomp-o_purpose = t_rg1-o_purpose.
j_2icomp-o_pur_meng = t_rg1-o_pur_menge.
j_1irg1-bedrate = t_rg1-bedrate.
j_1irg1-exbed = t_rg1-bedamt.
j_2icomp-cl_fin = t_rg1-cl_bal_fn.
j_2icomp-cl_bon = t_rg1-cl_bal_bn.
j_2icomp-remarks = t_rg1-remarks.
READ TABLE it_j_1iexcdtl WITH KEY cpudt = t_rg1-cpudt
chapid = t_rg1-chapid
matnr = t_rg1-matnr.
IF sy-subrc = 0.
get duties for issues only.
IF t_rg1-rcptissrsn = 'IPD'
OR t_rg1-rcptissrsn = 'IWD'
OR t_rg1-rcptissrsn = 'IDH'
OR t_rg1-rcptissrsn = 'IDE'
OR t_rg1-rcptissrsn = 'IWE'
OR t_rg1-rcptissrsn = 'IWT'
OR t_rg1-rcptissrsn = 'IWO'.
READ TABLE it_j_1iexchdr WITH KEY exnum = t_rg1-rdoc1
trntyp = 'DLFC'
cpudt = t_rg1-cpudt.
READ TABLE it_j_1iexcdtl WITH KEY docno = it_j_1iexchdr-docno
cpudt = it_j_1iexchdr-cpudt
trntyp = 'DLFC'
matnr = t_rg1-matnr.
docyr = it_j_1iexchdr-docyr
IF IT_j_1iexchdr-expind <> 'B'
and it_j_1iexchdr-expind <> 'U'
and it_j_1iexchdr-expind <> 'D'
and it_j_1iexchdr-expind <> 'N'
AND T_RG1-h_menge > 0.
and it_j_1iexchdr-expind IS INITIAL.
IF it_j_1iexchdr-censtat = 'P'.
wa_j_1iexcdtl-ecs = it_j_1iexcdtl-ecs.
ENDIF.
IF it_j_1iexchdr-censtat = 'C'.
wa_j_1iexchdr-exbed = it_j_1iexchdr-exbed.
wa_j_1iexchdr-ecs = it_j_1iexchdr-ecs.
wa_j_1iexchdr-censtat = it_j_1iexchdr-censtat.
wa_j_1iexchdr-cpudt = it_j_1iexchdr-cpudt.
wa_j_1iexcdtl-rgplaser = it_j_1iexcdtl-rgplaser.
wa_j_1iexcdtl-rg23aser = it_j_1iexcdtl-rg23aser.
ENDIF.
ENDIF.
endif.
ENDIF.
PERFORM write_form USING element-d function-append
typ-body window-main .
CLEAR : wa_j_1iexchdr, wa_j_1iexcdtl.
ENDLOOP.
ENDFORM. " GET_DATA_AND_WRITE
*& Form GET_DATA_AND_WRITE_CONS
text *
--> p1 text
<-- p2 text
FORM get_data_and_write_cons.
DATA: save_chapid LIKE j_1iexcdtl-chapid.
CLEAR: j_1irg1, j_2icomp, save_chapid.
LOOP AT t_rg1_cons.
CLEAR: j_1irg1, j_2icomp.
assign header fields
j_2icomp-stdate = p_stdate.
j_2icomp-endate = p_endate.
IF save_chapid NE t_rg1_cons-chapid.
fill header line with chapterid
j_1irg1-chapid = t_rg1_cons-chapid.
save_chapid = t_rg1_cons-chapid.
IF sy-tabix NE 1.
j_2icomp-new_page = true.
ELSE.
j_2icomp-new_page = false.
ENDIF.
ELSE.
j_2icomp-new_page = false.
ENDIF.
PERFORM write_form USING element-spac function-set
typ-body window-main .
determine line to display viz. manufacture entry/removal entry
IF t_rg1_cons-matform = c_packed.
j_2icomp-rg1_p_l = c_packed.
ELSEIF t_rg1_cons-matform = c_loose.
j_2icomp-rg1_p_l = c_loose.
ENDIF.
j_1irg1-cpudt = t_rg1_cons-cpudt.
j_2icomp-op_qty = t_rg1_cons-op_bal.
j_2icomp-mf_qty = t_rg1_cons-qty_mfr.
j_2icomp-to_qty = t_rg1_cons-total.
j_2icomp-cl_fin = t_rg1_cons-cl_bal_fn.
j_2icomp-cl_bon = t_rg1_cons-cl_bal_bn.
j_2icomp-remarks = t_rg1_cons-remarks.
j_2icomp-h_menge = t_rg1_cons-h_menge.
j_2icomp-h_value = t_rg1_cons-h_value.
j_2icomp-e_menge = t_rg1_cons-e_menge.
j_2icomp-e_value = t_rg1_cons-e_value.
j_2icomp-e_menge_bn = t_rg1_cons-e_menge_bond.
j_2icomp-o_menge = t_rg1_cons-o_menge.
j_2icomp-o_purpose = t_rg1_cons-o_purpose.
j_2icomp-o_pur_meng = t_rg1_cons-o_pur_menge.
j_1irg1-bedrate = t_rg1_cons-bedrate.
j_1irg1-exbed = t_rg1_cons-bedamt.
j_2icomp-cl_fin = t_rg1_cons-cl_bal_fn.
j_2icomp-cl_bon = t_rg1_cons-cl_bal_bn.
j_2icomp-remarks = t_rg1_cons-remarks.
PERFORM write_form USING element-d function-append
typ-body window-main .
*for grand totals
tot_remv_hval = tot_remv_hval + t_rg1_cons-h_value.
tot_remv_eval = tot_remv_eval + t_rg1_cons-e_value.
tot_duty_amt = tot_duty_amt + t_rg1_cons-bedamt.
ENDLOOP.
*for grand totals
j_2icomp-amount1 = tot_remv_hval.
j_2icomp-amount2 = tot_remv_eval.
j_2icomp-amount3 = tot_duty_amt.
PERFORM write_form USING element-t function-append
typ-body window-footer.
ENDFORM. " GET_DATA_AND_WRITE_CONS
*& Form RG1_PRINT_CONS
text *
--> p1 text
<-- p2 text
FORM rg1_print_cons.
DATA : first_time VALUE on.
SORT t_rg1 BY chapid cpudt.
LOOP AT t_rg1.
IF first_time = on.
m_chapid = t_rg1-chapid.
m_date = t_rg1-cpudt.
m_matform = t_rg1-matform.
m_bedrate = t_rg1-bedrate.
first_time = off.
ENDIF.
IF m_chapid <> t_rg1-chapid.
PERFORM chapid_break.
ELSEIF m_date <> t_rg1-cpudt.
PERFORM date_break.
ENDIF.
Accumulate totals
tot_op_bal = tot_op_bal + t_rg1-op_bal.
tot_qty_mnfr = tot_qty_mnfr + t_rg1-qty_mfr.
tot_total_qty_mnfr = tot_total_qty_mnfr + t_rg1-total.
tot_remv_home = tot_remv_home + t_rg1-h_menge.
tot_remv_hval = tot_remv_hval + t_rg1-h_value.
tot_remv_expr = tot_remv_expr + t_rg1-e_menge.
tot_remv_eval = tot_remv_eval + t_rg1-e_value.
tot_remv_expb = tot_remv_expb + t_rg1-e_menge_bond.
tot_remv_othr = tot_remv_othr + t_rg1-o_menge.
tot_remv_opur = tot_remv_opur + t_rg1-o_pur_menge.
tot_duty_amt = tot_duty_amt + t_rg1-bedamt.
tot_cb_fr = tot_cb_fr + t_rg1-cl_bal_fn.
tot_cb_br = tot_cb_br + t_rg1-cl_bal_bn.
ENDLOOP.
PERFORM chapid_break.
ENDFORM. " RG1_PRINT_CONS
*& Form DATE_BREAK
text *
--> p1 text
<-- p2 text
FORM date_break.
CLEAR t_rg1_cons.
t_rg1_cons-chapid = m_chapid.
t_rg1_cons-cpudt = m_date.
t_rg1_cons-op_bal = tot_op_bal.
t_rg1_cons-qty_mfr = tot_qty_mnfr.
t_rg1_cons-total = tot_total_qty_mnfr.
t_rg1_cons-h_menge = tot_remv_home.
t_rg1_cons-h_value = tot_remv_hval.
t_rg1_cons-e_menge = tot_remv_expr.
t_rg1_cons-e_value = tot_remv_eval.
t_rg1_cons-e_menge_bond = tot_remv_expb.
t_rg1_cons-o_menge = tot_remv_othr.
t_rg1_cons-o_pur_menge = tot_remv_opur.
t_rg1_cons-bedamt = tot_duty_amt.
t_rg1_cons-cl_bal_fn = tot_cb_fr.
t_rg1_cons-cl_bal_bn = tot_cb_br.
t_rg1_cons-matform = m_matform.
t_rg1_cons-bedrate = m_bedrate.
APPEND t_rg1_cons.
tot_op_bal = 0.
tot_qty_mnfr = 0.
tot_total_qty_mnfr = 0.
tot_remv_home = 0.
tot_remv_hval = 0.
tot_remv_expr = 0.
tot_remv_eval = 0.
tot_remv_expb = 0.
tot_remv_othr = 0.
tot_remv_opur = 0.
tot_duty_amt = 0.
tot_cb_fr = 0.
tot_cb_br = 0.
m_date = t_rg1-cpudt.
m_matform = t_rg1-matform.
m_bedrate = t_rg1-bedrate.
ENDFORM. " DATE_BREAK
*& Form CHAPID_BREAK
text
--> p1 text
<-- p2 text
FORM chapid_break.
PERFORM date_break.
m_chapid = t_rg1-chapid.
ENDFORM. " CHAPID_BREAKhi rakesh,
in your first select single * statement you have given WHERE BUKRS = T001K-BUKRS..but at the point of execution, what will be the value stored in t001k-bukrs...i doubt it will be initial....so, store bukrs in a variable or hardcode it.....
in the second select, you hve not given any target work area for the into class...that's y your subrc is 4...specify a target area, where you want the data to be stored...
Maybe you are looking for
-
IFs on Solaris/8.1.6
I am trying to run the final script ifssetup as root after installing and configuring iFS this is the error that I am receiving. lbdev-db-1 4# ifssetup Setting up iFS jws directory Enter the password for the iFS schema named ifssys: ifssys ERROR: ORA
-
System Prefs not showing all disks
It's been some time since I backed up and I've just copied over to my Lacie 500 drive the contents of my main drive. On checking with Startup Drive in System Prefs I note that I don't see the Lacie nor my second HD which I use with FCP editing conten
-
Hi experts, Can anybody share ADM115 Hardware Sizing for SAP with me? If you have this document then please share with me, Thanks, Sudip Saha
-
Bnoir V6 finally working!
Bnoir, Just wanted to update you and let you know that I finally got iTunes working. I am using V6. The only bad thing is that it will not work NIS 2005. I have to turn NIS off every time but if that is the only thing then I will take it for now. My
-
Installed Maverics but App Store shows I still need to download it?
I installed Maverics over the weekend and by most accounts things went well. However, when I log into the App Store to check for updates it shows that I still need to download Maverics (full 5.2GB download not just an update). Anyone else seeing this