URGENT HELP: SQL ordering
Hi there
I have a set of records that I want to order using SQL. I want to sort them ascendingly by a numeric field. The trouble is that I want them ascending excluding the fields equalling zero. The fields with a value of zero should be listed last.
Is there any way to achieve this?
Hope someone can help me soon. It is incredibly urgent!!
Comlink
Hi there
I have a set of records that I want to order using
SQL. I want to sort them ascendingly by a numeric
field. The trouble is that I want them ascending
excluding the fields equalling zero. The fields with
a value of zero should be listed last.
Is there any way to achieve this?This is probably a hack, but I can't figure out the subselect.
SELECT field1, field2 FROM table ORDER BY field1 WHERE field1 != 0;
SELECT field1, field2 FROM table WHERE field1 = 0;
Similar Messages
-
Urgent Help - SQL Statement..
hai everybody,
i need ur help in writing a SQL statement..
i have 2 tables say
CATEGORY
cat_id cat_name
B001 IT
B002 Accounts
B003 Clerk
SUB CATEGORY
sub_cat_id sub_cat_name cat_id
S001 programming B001
S002 Admin B001,B002
S003 HR B001,B002,B003
i want to display one as liek ths
sub_cat_name cat_name
Programming IT
admin IT,Accounts
HR IT,Accounts,Clerk
how to write a qry for this..pl help..
thanx in advance
regards
koelThis is just a natural join between two tables.
The query can be like this:
select b.sub_cat_name, a.cat_name
from category a, sub_category b
where a.cat_id = b.cat_id
Pl. let me know whether this solves your problem. -
Urgent: Help with Order Entry Verification Requirement
Hi,
I have a requirement that must be completed in a few hours. It is as folllow's:
During order entry the program must verify what material groups the customer is allowed to purchase based on license type. If the material belongs to group that the customer is not allowed to buy then the system will need to provide an error and do not create the line in the order.
This is a license type check
This is supposed to be done through the use of a user-exit.
Does anyone have any idea what USER-EXIT this refers to and what data is needed in order for the requirement to be completed?
Responses will be rewarded and greatly appreciated.
Additional Information:
Material groups (MARA-MATKL)
0001 Beer
0002 - Still wine
0003 Sparkling wine/champ
0004 Fortified wine
0005 Spirits
There are other material groups but they are non-alcoholic, so no license is required.
Customer license type (table KNVV, fields: PRAT1, PRAT2, PRAT3, PRAT4). License type is specified in:
Customer master creation
Sales Area Data
Sales Tab
Product attributes
Product Attributes
- PRAT1 - No Spirit License
- PRAT2 - No fortified wine license
- PRAT3 - No wine license
- PRAT4 - No beer license
Although there are 10 product attributes only the first 4 require a license to be able to purchase them.@Lasers_Edge just to avoid confusion: it is not necessary to 'create' variables for TEB's, they are created and assigned by default. I don't like the name of that generic variable because it is identical to the TEB's name but they exist. Good practice to me is to replace those variables by custom user variables, and for that purpose the X button is also available next to the variable name (same button as in the Format accordion for a text container, that allows you to insert a variable)
@choi.M Another approach is to print the content of those associated variables by a JavaScript that you assign to a Print button. If you prefer the approach to insert the variables in a text container, you could try the Print widget included with Captivate as well. -
Urgent HELP required on forming the Matrix of data using PL/SQL
Hi All,
I'm new to this thread and require your urgent help in this regard.
I've got a requirement for building a 5000 X 5000 matrix using PL/SQL. My original data tables have 5000 rows each and I need to do a correlation analysis using this data and need to store in a physical table and not in-memory. Is this feat achievable using mere PL/SQL? I understand that Oracle DB has a limitation of 1000 columns(but not sure) and hence I'd like to know whether there is any work-around for such scenarios. If not, what are the other alternative method(s) to achieve this feat? Do I need to use any 3rd party tools to get this done? An early reply from the experts is highly appreciated.
Thanking you all Gurus in advance.
Rgds
SaiWelcome to OTN!
I'll get to your quesiton in a moment, but first some welcome information. Many OTN posters consider it impolite to mark threads as "urgent". We are volunteers and have jobs of our own to do without people we don't know making demands. You are brand new and deserve some patience but please understand this. It is very likely before I finish this post someone will complain about the word "urgent" in your subject.
On to more interesting things :)
You can do the matrix, but are out of luck with a 5000 x 5000 table because Oracle only allows 1000 columns per table. There are ways to work around this.
How do do the matrix depends on what you want to do. You can do this different ways. You can create a table beforehand and use PL/SQL or simple SQL to populate it, or use the CREATE TABLE AS syntax to create and populate it in one step if you can get the underlying SQL to work the way you want, something like
create table my_table as
select a.*, b.*
from table1 a, table2 bcan populate a matrix from 2 tables with an intentional cartesian join (the WHERE clause was left out intentionally, provided your data is already in the data base.
If not you can use a PL/SQL routine to populate the data.
There are a couple of ways to solve the 1000 column limit. The easiest way might be to have 5 collections of 1000 columns each. A more complicated but more elegant soltion would be to have nested collections, allowing 2 colliections that you can loop through - a collection of collections. Nested collections can be hard to work with. A third way would be to use nested tables in the database but I personally do not like them and the insert, update, and delete statements for nested tables are hard to use.
I'm not going to give a code example because I am not sure which solution is best for you. If you have further questions post them. -
Urgent help needed... PL/SQL Insert statement
Hi...
I need some urgent help on this project. I have a 2 column table with values that need to be inserted into another existing table which has a sequence.
This is the 2 column table:
FUND YEAR
29587 05
29587 07
Existing table:
Name Null? Type
LIST_ID NOT NULL NUMBER(6) -- This is a sequence
WEB_USER_ID NOT NULL VARCHAR2(10)
RESOURCE_TYPE NOT NULL VARCHAR2(8)
LIST_TYPE NOT NULL VARCHAR2(10)
LIST_NAME NOT NULL VARCHAR2(50)
LIST_CODE_1 NOT NULL VARCHAR2(6) -- FUND from table above
LIST_CODE_2 NOT NULL VARCHAR2(6) -- YEAR from table above
LIST_CODE_3 NOT NULL VARCHAR2(6)
LAST_UPDATED_DT NOT NULL DATE
LAST_UPDATED_BY NOT NULL VARCHAR2(10)
LIST_CODE_4 NOT NULL VARCHAR2(20)
The columns from table 1 (FUND, YEAR) correspond to columns (LIST_CODE_1, LIST_CODE_2) in table 2. The column LIST_ID is a sequence. I can put in sysdate for LAST_UPDATED_DT and my initials SN for LAST_UPDATED_BY. This is going to be for 2 unique WEB_USER_IDs which would be in the WHERE clause. I will be inserting 2200 rows for each id. A single insert statement would look like this -
INSERT INTO EXISTING_TBL (list_id,web_user_id,resource_type,list_type,list_name,list_code_1,list_code_2,list_code_3,list_code_4,last_updated_dt,last_updated_by) VALUES ('470027','WEBUSER','GL','FUNDFYF',' FUND BALANCE SUM','12010','01',' ',' ',{ts '2010-5-19 10:16:9'},'SN')
How would I do this to insert the 2200 values from my 2 column table to the existing table?
All help is greatly appreciated!!
SNHello ,
I think this will work
INSERT INTO TABLE2
LIST_ID,
WEB_USER_ID,
RESOURCE_TYPE,
LIST_TYPE,
LIST_NAME,
LIST_CODE_1,
LIST_CODE_2,
LIST_CODE_3,
LIST_CODE_4,
LAST_UPDATED_DT,
LAST_UPDATED_BY
SELECT
SEQ.NEXTVAL,
FUND,
YEAR,
<VALUE FOR RESOURCE_TYPE>,
<VALUE FOR LIST_TYPE>,
<VALUE FOR LIST_NAME>,
<VALUE FOR LIST_CODE_1>,
<VALUE FOR LIST_CODE_2>,
<VALUE FOR LIST_CODE_3>,
<VALUE FOR LIST_CODE_4>,
SYSDATE,
'SN'
FROM
TABLE1
REGARDS
Rahul Sharma -
Urgent help needed for XML Tags using XMLForest()
Folks
I need some urgent help regarding getting use defined tag in your
XML output.
For this I am using XMLElement and XMLForest which seems to work fine
when used at the SQL prompt but when used in a procedure throws and error
SQL> Select SYS_XMLAGG(XMLElement("SDI",
XMLForest(sdi_num)))
From sdi
where sdi_num = 22261;- WORKS FINE
But when used in a procedure,doesnt seem to work
Declare
queryCtx DBMS_XMLQuery.ctxType;
v_xml VARCHAR2(32767);
v_xmlClob CLOB;
BEGIN
v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
XMLFOREST(sdi_num)))
From sdi
where sdi_num = 22261';
queryCtx :=DBMS_XMLQuery.newContext(v_xml);
v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
display_xml(v_xmlClob);
End;
CREATE OR REPLACE PROCEDURE display_xml(result IN OUT NOCOPY CLOB)
AS
xmlstr varchar2(32767);
line varchar2(2000);
BEGIN
xmlstr:=dbms_lob.SUBSTR(result,32767);
LOOP
EXIT WHEN xmlstr is null;
line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
dbms_output.put_line('.'||line);
xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
END LOOP;
end;
SQL> /
.<?xml version = '1.0'?>
.<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
XML tag name.</ERROR>
PL/SQL procedure successfully completed.
SQL>HELP is appreciated as to where I am going wrong?Hi,
if you want to transform something to something else, you should declare, what is your source.
I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
Kind regards,
Hendrik -
Guys i have a v simple question but i cnat get my head around it.....i have a running environment (cluster) of call managers....now i want to relplicate it in my lab same topology....now i m using BARS as well....i have already build the call managers (in lab)...now i dont remenber the SQL passwords or other passwords for the live CCM cluster....now if i take a back up and put it in the lab will it work??? or the the passwords have to be same on lab to th elive environment......guys urgent help is needed.....reagrds
You can restore the node in the lab with the tar file you got from the back up. The restore will override the passwords and assign the ones taken from the back up. I hope that helps!
-
Urgent help needed; Database shutdown issues.
Urgent help needed; Database shutdown issues.
Hi all,
I am trying to shutdown my SAP database and am facing the issues below, can someone please suggest how I can go about resolving this issue and restart the database?
SQL> shutdown immediate
ORA-24324: service handle not initialized
ORA-24323: value not allowed
ORA-01089: immediate shutdown in progress - no operations are permitted
SQL> shutdown abort
ORA-01031: insufficient privileges
Thanks and regards,
IqbalHi,
check SAP Note 700548 - FAQ: Oracle authorizations
also check Note 834917 - Oracle Database 10g: New database role SAPCONN
regards,
kaushal -
I am having problems implementing a username validaion bean for my login system. Every time I click my login icon on my main JSP page the login JSP page does not appear except one of the error JSP pages.
How can I correct this problem?
Does the code below look correct?
Below is the codes for the Username Validation Bean :
LOGIN.JSP
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.mysql.jdbc.*"%>
<%@ page errorPage="badLogin.jsp"%>
<%@ page import="gcd.UserNameValidationBean"%>
<%
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/gcdBB_db");
java.sql.Statement statement = connection.createStatement();
Enumeration parameters = request.getParameterNames();
if(parameters.hasMoreElements())
String usernameValue = request.getParameter("username");
String passwordValue = request.getParameter("password");
statement.executeUpdate("INSERT INTO users (username,password) VALUES ('"+usernameValue+"','"+passwordValue+"')");
%>
GOODLOGIN.JSP
<%@ page errorPage="badLogin.jsp"%>
<%@ page import="gcd.UserNameValidationBean"%>
<% UserNameValidationBean validationBean = new UserNameValidationBean();
if(request.getParameter("username")!=null)
validationBean.validateUserNameBean(request.getParameter("username"));
%>
<%=request.getParameter("username")%>
USERNAMEVALIDATIONBEAN.JAVA
package gcd;
public class UserNameValidationBean
public UserNameValidationBean(){}
public boolean validateUserName(String userName) throws InvalidUserNameException
if(userName.length() < 32)
throw new InvalidUserNameException("User Name Invalid: " + userName);
return true;
INVALIDUSERNAMEEXCEPTION.JAVA
package gcd;
public class InvalidUserNameException extends Exception
public InvalidUserNameException(String message)
super(message);
I need urgent help to get this working!Here is code for badLogin.jsp and badLoginWithExceptonObject:
BADLOGIN.JSP
<HTML><HEAD><TITLE>Login Failure</TITLE></HEAD>
<BODY bgcolor="#FF9900">
<H1></H1>
<font face="Arial" size="3">Sorry but you either entered an incorrect username
or password </font>
<P><font face="Arial" size="3">Try Again</font>
</BODY></HTML>
BADLOGINWITHEXCEPTIONOBJECT.JSP
<HTML><HEAD><TITLE>Check User Login Against Parameters</TITLE></HEAD>
<BODY bgcolor="#FF9900">
<%@ page isErrorPage = "true"%>
<P><font face="Arial" size="3">Error =</font> <%= exception.getMessage()%> <% PrintWriter writer = new PrintWriter(out); %>
<P><font face="Arial" size="3">Stack =</font> <% exception.printStackTrace(writer); %>
<P><font face="Arial" size="3">Try Again</font>
</BODY></HTML> -
hi friends,
Help me how to do this
REPORT ZINTERFACE_SAMPLE.
type-pools:SLIS.
TABLES:knb1, "Customer Master (Company Code)
kna1,
knvp. "Customer Master Partner Functions
TYPES:BEGIN OF T_knb1,
kunnr like knb1-kunnr,
bukrs like knb1-bukrs,
akont like knb1-akont,
END OF T_knb1.
TYPES:BEGIN OF T_kna1,
kunnr like kna1-kunnr, "customer number
NAME1 like KNA1-NAME1, "customer name
stras like KNA1-STRAS, "Customer address
ort01 like KNA1-ORT01, "Customer city
stcd1 like KNA1-STCD1, "Tax id
pstlz like KNA1-PSTLZ, "Postal code
END OF T_kna1.
TYPES:BEGIN OF T_knvp,
kunnr like knvp-kunnr, "customer number
parvw like knvp-parvw,
kunn2 like knvp-kunn2, "Customer number of business partner
END OF T_KNVP.
TYPES:BEGIN OF T_final,
Record_type TYPE c,
Sold_to_cust(10) TYPE c,
Payer(10) TYPE c,
Sequence(5) TYPE n,
Cust_name(35) TYPE c,
Cust_adreess(35) TYPE c,
Cust_city(35) TYPE c,
Tax_id(16) TYPE c,
Postal_code(5) TYPE c,
Branch TYPE c,
Delivery(3) TYPE c,
END OF T_final.
*Internal table declaration
DATA:I_knb1 TYPE STANDARD TABLE OF t_knb1 initial size 0,
i_kna1 TYPE STANDARD TABLE OF t_kna1 initial size 0,
i_knvp TYPE STANDARD TABLE OF t_knvp initial size 0,
i_final TYPE STANDARD TABLE OF t_final initial size 0.
DATA: t_fieldcat_tab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
*Work area declaration
DATA:wa_knb1 TYPE t_knb1,
wa_kna1 TYPE t_kna1,
wa_knvp TYPE t_knvp,
wa_final TYPE t_final.
*variable declaration
data:sequence TYPe n,
g_line TYPE i.
selection screen *
SELECTION-screen begin of block b1 with frame title text-001.
parameters:p_bukrs like knb1-bukrs, "Company code
p_akont like knb1-akont .
selection-screen end of block b1.
SELECTION-screen begin of block b2 with frame title text-002.
PARAMETERS:R1 RADIOBUTTON GROUP G1,
R2 RADIOBUTTON GROUP G1.
Parameters:p_file like rlgrap-filename.
"Recon Account in General Ledger
selection-screen end of block b2.
*AT selection-screen ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_FILE.
START-OF-selection.
PERFORM f_fetchdata.
PERFORM f_prepare_fieldcat.
PERFORM f_display_report.
*END-OF-SELECTION.
*IF R1 EQ 'X'.
*perform F_DOWNLOAD.
*ENDIF.
*IF R2 EQ 'X'.
*OPEN DATASET P_FILE FOR OUTPUT IN text mode ENCODING DEFAULT.
*LOOP AT i_final INTO WA_final.
*TRANSFER WA_final TO P_FILE.
*ENDLOOP.
*CLOSE DATASET P_FILE.
*ENDIF.
*& Form f_fetchdata
FORM f_fetchdata .
select kunnr
bukrs
akont
from knb1
into table i_knb1
where bukrs = p_bukrs
AND akont = p_akont.
DESCRIBE TABLE i_knb1 LINES g_line.
LOOP AT i_knb1 INTO wa_knb1.
SELECT single KUNNR
NAME1
STRAS
ORT01
STCD1
PSTLZ
FROM kna1
INTO wa_kna1
where kunnr = wa_knb1-kunnr.
if sy-subrc <> 0.
*Error KNA1 record not found.
endif.
SELECT single kunnr
parvw
kunn2
FROM KNVP
INTO wa_knvp
where kunnr = wa_knb1-kunnr
AND parvw = 'RG'.
if sy-subrc <> 0.
*Error KNA1 record not found.
endif.
sequence = sequence + 1.
MOVE: 'c' TO wa_final-Record_type,
wa_knvp-kunnr TO wa_final-Sold_to_cust,
sequence TO wa_final-Sequence,
wa_KNA1-NAME1 TO wa_final-Cust_name,
wa_kna1-STRAS TO wa_final-Cust_adreess ,
wa_kna1-ort01 TO wa_final-Cust_city,
wa_kna1-STCD1 TO wa_final-Tax_id,
wa_kna1-PSTLZ TO wa_final-Postal_code,
'1' TO wa_final-branch,
'abc' TO wa_final-Delivery.
INSERT wa_final INTO TABLE i_final.
endloop.
ENDFORM. " f_fetchdata
FORM f_prepare_fieldcat.
t_fieldcat_tab-col_pos = 1.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Record_type'.
t_fieldcat_tab-seltext_l = 'Record type'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 2.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Sold_to_cust'.
t_fieldcat_tab-seltext_l = 'Sold to cust'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 3.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'payer'.
t_fieldcat_tab-seltext_l = 'Payer'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 4.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Sequence'.
t_fieldcat_tab-seltext_l = 'sequence'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 5.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Cust_name'.
t_fieldcat_tab-seltext_l = 'Cust name'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 6.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Cust_adreess'.
t_fieldcat_tab-seltext_l = 'Cust adreess'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 7.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Cust_city'.
t_fieldcat_tab-seltext_l = 'Cust city'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 8.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Tax_id'.
t_fieldcat_tab-seltext_l = 'Tax id'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 9.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Postal_code'.
t_fieldcat_tab-seltext_l = 'Postal code'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 10.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Branch'.
t_fieldcat_tab-seltext_l = 'Branch'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 11.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'KWMENG'.
t_fieldcat_tab-seltext_l = 'Order Qty'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 12.
t_fieldcat_tab-tabname = 'i_final'.
t_fieldcat_tab-fieldname = 'Delivery'.
t_fieldcat_tab-seltext_l = 'Delivery'.
APPEND t_fieldcat_tab.
ENDFORM. " f_prepare_fieldcat
*& Form f_display_report
*To display the ALV Report
FORM f_display_report.
DATA: l_repid LIKE sy-repid.
l_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = l_repid
i_buffer_active = 'X'
IT_FIELDCAT = t_fieldcat_tab[]
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = i_final[].
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." f_display_report
*& Form F_DOWNLOAD
text
--> p1 text
<-- p2 text
FORM F_DOWNLOAD .
*CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = p_file
FILETYPE = 'ASC'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = i_final
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
*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. " F_DOWNLOAD
for this one when i given the proper input
it showing the Runtime error.
Could u please tell me what mistake i have done
Urgent help
Regards
harshavi N.HI,
Run this program..
REPORT ZINTERFACE_SAMPLE.
type-pools:SLIS.
TABLES:knb1, "Customer Master (Company Code)
kna1,
knvp. "Customer Master Partner Functions
TYPES:BEGIN OF T_knb1,
kunnr like knb1-kunnr,
bukrs like knb1-bukrs,
akont like knb1-akont,
END OF T_knb1.
TYPES:BEGIN OF T_kna1,
kunnr like kna1-kunnr, "customer number
NAME1 like KNA1-NAME1, "customer name
stras like KNA1-STRAS, "Customer address
ort01 like KNA1-ORT01, "Customer city
stcd1 like KNA1-STCD1, "Tax id
pstlz like KNA1-PSTLZ, "Postal code
END OF T_kna1.
TYPES:BEGIN OF T_knvp,
kunnr like knvp-kunnr, "customer number
parvw like knvp-parvw,
kunn2 like knvp-kunn2, "Customer number of business partner
END OF T_KNVP.
TYPES:BEGIN OF T_final,
Record_type TYPE c,
Sold_to_cust(10) TYPE c,
Payer(10) TYPE c,
Sequence(5) TYPE n,
Cust_name(35) TYPE c,
Cust_adreess(35) TYPE c,
Cust_city(35) TYPE c,
Tax_id(16) TYPE c,
Postal_code(5) TYPE c,
Branch TYPE c,
Delivery(3) TYPE c,
END OF T_final.
*Internal table declaration
DATA:I_knb1 TYPE STANDARD TABLE OF t_knb1 initial size 0,
i_kna1 TYPE STANDARD TABLE OF t_kna1 initial size 0,
i_knvp TYPE STANDARD TABLE OF t_knvp initial size 0,
i_final TYPE STANDARD TABLE OF t_final initial size 0.
DATA: t_fieldcat_tab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
*Work area declaration
DATA:wa_knb1 TYPE t_knb1,
wa_kna1 TYPE t_kna1,
wa_knvp TYPE t_knvp,
wa_final TYPE t_final.
*variable declaration
data:sequence TYPe n,
g_line TYPE i.
selection screen *
SELECTION-screen begin of block b1 with frame title text-001.
parameters:p_bukrs like knb1-bukrs, "Company code
p_akont like knb1-akont .
selection-screen end of block b1.
SELECTION-screen begin of block b2 with frame title text-002.
PARAMETERS:R1 RADIOBUTTON GROUP G1,
R2 RADIOBUTTON GROUP G1.
Parameters:p_file like rlgrap-filename.
"Recon Account in General Ledger
selection-screen end of block b2.
*AT selection-screen ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_FILE.
START-OF-selection.
PERFORM f_fetchdata.
PERFORM f_prepare_fieldcat.
PERFORM f_display_report.
*END-OF-SELECTION.
*IF R1 EQ 'X'.
*perform F_DOWNLOAD.
*ENDIF.
*IF R2 EQ 'X'.
*OPEN DATASET P_FILE FOR OUTPUT IN text mode ENCODING DEFAULT.
*LOOP AT i_final INTO WA_final.
*TRANSFER WA_final TO P_FILE.
*ENDLOOP.
*CLOSE DATASET P_FILE.
*ENDIF.
*& Form f_fetchdata
FORM f_fetchdata .
select kunnr
bukrs
akont
from knb1
into table i_knb1
where bukrs = p_bukrs
AND akont = p_akont.
DESCRIBE TABLE i_knb1 LINES g_line.
LOOP AT i_knb1 INTO wa_knb1.
SELECT single KUNNR
NAME1
STRAS
ORT01
STCD1
PSTLZ
FROM kna1
INTO wa_kna1
where kunnr = wa_knb1-kunnr.
if sy-subrc <> 0.
*Error KNA1 record not found.
endif.
SELECT single kunnr
parvw
kunn2
FROM KNVP
INTO wa_knvp
where kunnr = wa_knb1-kunnr
AND parvw = 'RG'.
if sy-subrc <> 0.
*Error KNA1 record not found.
endif.
sequence = sequence + 1.
MOVE: 'c' TO wa_final-Record_type,
wa_knvp-kunnr TO wa_final-Sold_to_cust,
sequence TO wa_final-Sequence,
wa_KNA1-NAME1 TO wa_final-Cust_name,
wa_kna1-STRAS TO wa_final-Cust_adreess ,
wa_kna1-ort01 TO wa_final-Cust_city,
wa_kna1-STCD1 TO wa_final-Tax_id,
wa_kna1-PSTLZ TO wa_final-Postal_code,
'1' TO wa_final-branch,
'abc' TO wa_final-Delivery.
INSERT wa_final INTO TABLE i_final.
endloop.
ENDFORM. " f_fetchdata
FORM f_prepare_fieldcat.
t_fieldcat_tab-col_pos = 1.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'RECORD_TYPE'.
t_fieldcat_tab-seltext_l = 'Record type'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 2.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'SOLD_TO_CUST'.
t_fieldcat_tab-seltext_l = 'Sold to cust'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 3.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'PAYER'.
t_fieldcat_tab-seltext_l = 'Payer'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 4.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'SEQUENCE'.
t_fieldcat_tab-seltext_l = 'sequence'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 5.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'CUST_NAME'.
t_fieldcat_tab-seltext_l = 'Cust name'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 6.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'CUST_ADREESS'.
t_fieldcat_tab-seltext_l = 'Cust adreess'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 7.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'CUST_CITY'.
t_fieldcat_tab-seltext_l = 'Cust city'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 8.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'TAX_ID'.
t_fieldcat_tab-seltext_l = 'Tax id'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 9.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'POSTAL_CODE'.
t_fieldcat_tab-seltext_l = 'Postal code'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 10.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'BRANCH'.
t_fieldcat_tab-seltext_l = 'Branch'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 11.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'KWMENG'.
t_fieldcat_tab-seltext_l = 'Order Qty'.
APPEND t_fieldcat_tab.
t_fieldcat_tab-col_pos = 12.
t_fieldcat_tab-tabname = 'I_FINAL'.
t_fieldcat_tab-fieldname = 'DELIVERY'.
t_fieldcat_tab-seltext_l = 'Delivery'.
APPEND t_fieldcat_tab.
ENDFORM. " f_prepare_fieldcat
*& Form f_display_report
*To display the ALV Report
FORM f_display_report.
DATA: l_repid LIKE sy-repid.
l_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = l_repid
IT_FIELDCAT = t_fieldcat_tab[]
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = I_FINAL[].
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." f_display_report
*& Form F_DOWNLOAD
text
--> p1 text
<-- p2 text
FORM F_DOWNLOAD .
*CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = p_file
FILETYPE = 'ASC'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = i_final
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
*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. " F_DOWNLOAD
It is perfectly working for me..
I made the field name and table name as CAPs in the field catalog internal table.
I removed the buffer paramter in the ALV FM.
Thanks,
Naren -
Hello
Urgent Help Required
I am extracting Master data from CRM 5.0.
Infoobject 0BPARTNER is enhanced to accommodate a attribute called NAS(data is filled).
So for every BP no it has NAS no too
For The Revenue of Business partner I am extracting from old Legacy System(through DB Connect).
This legacy table does not BP number it has another Key called NAS.
BP no is additional field in the ODS.
I want to write a routine in the transformation(ODS and Data source). SO that the BP number for corresponding NAS is filled into the ODS.Laura,
Goods issues are linked as you described because components consumed by a production order have reservations (RESB) and are assigned to an operation (AFVC). Goods receipts, on the other hand, do not have reservations and therefore don't have this link to the work center.
If you are using automatic goods receipt, then one of the operations in the production order will have a control key set up for automated goods receipt (PP03 is the standard, and it's usually the last operation). The business would likely see this work center as being logically tied to the goods receipt of the produced material. -
Your urgent help will be very much appreciated
I have a problem whenever I connect my database and need your urgent help. the sample source code is below
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Table extends JFrame
private Connection con;
private JTable table;
public Table()
String url = "jdbc:odbc:Books";
String username="";
String password="";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(url, username, password);
catch(ClassNotFoundException cnfex)
System.err.println("Failed to load JDBC/ODBC driver.");
cnfex.printStackTrace();
System.exit(1);
catch(SQLException sqlex)
System.err.println("Failed to connect");
sqlex.printStackTrace();
getTable();
setSize(45,150);
show();
public void getTable()
Statement state;
ResultSet result;
try{
String query="Select * from Author";
state=con.createStatement();
result=state.executeQuery(query);
displayResult(result);
state.close();
catch(SQLException sqlex)
sqlex.printStackTrace();
public void displayResult(ResultSet rs)throws SQLException
boolean moreRecord=rs.next();
if (!moreRecord)
JOptionPane.showMessageDialog(this, "ResultSet contained no record");
setTitle("No records to display");
return;
setTitle("Author table from Books");
Vector columnHeads=new Vector();
Vector rows=new Vector();
try{
ResultSetMetaData rsmd=rs.getMetaData();
for (int i=1; i<=rsmd.getColumnCount(); i++)
columnHeads.addElement(rsmd.getColumnName(i));
do{
rows.addElement(getNextRow(rs, rsmd));
}while(rs.next());
table=new JTable(rows, columnHeads);
JScrollPane scroller=new JScrollPane(table);
getContentPane().add(scroller,BorderLayout.CENTER);
validate();
catch(SQLException sqlex)
sqlex.printStackTrace();
public Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)
throws SQLException
Vector currentRow=new Vector();
for (int i=1; i<=rsmd.getColumnCount(); i++)
switch (rsmd.getColumnType(i))
case Types.VARCHAR:
currentRow.addElement(rs.getString(i));
break;
case Types.INTEGER:
currentRow.addElement(new Long(rs.getLong(i)));
break;
default:
System.out.println("Type was: "+rsmd.getColumnTypeName(i));
return currentRow;
public void shutDown()
try{
con.close();
catch(SQLException sqlex)
System.err.println("Unable to disconnect");
sqlex.printStackTrace();
public static void main(String args[])
final Table app=new Table();
app.addWindowListener( new WindowAdapter()
public void windowClosing(WindowEvent e)
app.shutDown();
System.exit(0);Thank you for your help. When I compile it, it is fine, the problem happens when run it.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6d448d54
Function name=(N/A)
Library=C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hotspot\jvm.dll
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at sun.jdbc.odbc.JdbcOdbc.driverConnect(Native Method)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Table.<init>(Table.java:26)
at Table.main(Table.java:145)
Dynamic libraries:
0x00400000 - 0x00405000 C:\WINNT\system32\java.exe
0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
0x77D90000 - 0x77DED000 C:\WINNT\system32\ADVAPI32.dll
0x77E60000 - 0x77F35000 C:\WINNT\system32\KERNEL32.DLL
0x786F0000 - 0x78761000 C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
0x60000000 - 0x6003A000 c:\program files\rising\rav\ApiHook.dll
0x05000000 - 0x0502E000 c:\program files\rising\rav\MemMon.dll
0x77DF0000 - 0x77E55000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x75E00000 - 0x75E1A000 C:\WINNT\System32\IMM32.DLL
0x6D420000 - 0x6D4F7000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hotsp
ot\jvm.dll
0x77530000 - 0x77560000 C:\WINNT\system32\WINMM.dll
0x6D220000 - 0x6D227000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hpi.d
ll
0x6D3B0000 - 0x6D3BD000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\verif
y.dll
0x6D250000 - 0x6D266000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\java.
dll
0x6D3C0000 - 0x6D3CD000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\zip.d
ll
0x6D020000 - 0x6D12A000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\awt.d
ll
0x777C0000 - 0x777DE000 C:\WINNT\system32\WINSPOOL.DRV
0x75010000 - 0x75020000 C:\WINNT\system32\MPR.DLL
0x77A30000 - 0x77B25000 C:\WINNT\system32\ole32.dll
0x6D1E0000 - 0x6D21B000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\fontm
anager.dll
0x6DD30000 - 0x6DD36000 C:\WINNT\System32\INDICDLL.dll
0x37210000 - 0x3723D000 C:\WINNT\DOWNLO~1\CnsMin.dll
0x77C50000 - 0x77C9A000 C:\WINNT\system32\SHLWAPI.dll
0x777E0000 - 0x777E7000 C:\WINNT\system32\VERSION.dll
0x75950000 - 0x75956000 C:\WINNT\system32\LZ32.DLL
0x6D290000 - 0x6D29A000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\JdbcO
dbc.dll
0x1F7F0000 - 0x1F825000 C:\WINNT\system32\ODBC32.dll
0x76AF0000 - 0x76B2D000 C:\WINNT\system32\comdlg32.dll
0x77B30000 - 0x77BB9000 C:\WINNT\system32\COMCTL32.DLL
0x78F90000 - 0x791D6000 C:\WINNT\system32\SHELL32.DLL
0x1F8E0000 - 0x1F8F6000 C:\WINNT\system32\odbcint.dll
0x77900000 - 0x77923000 C:\WINNT\system32\imagehlp.dll
0x72960000 - 0x7298D000 C:\WINNT\system32\DBGHELP.dll
0x687E0000 - 0x687EB000 C:\WINNT\system32\PSAPI.DLL
Local Time = Tue Feb 25 21:33:38 2003
Elapsed Time = 7
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002BD
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.3.1_05-b02 mixed mode)
# An error report file has been saved as hs_err_pid1792.log.
# Please refer to the file for further information.
# -
Need urgent help with database startup
dear all,
i am using oracle 10g on windower server 32 bit.
i try to startup my database today, and it give me error, and it is my production database,
i need very urgent help from you.(i have no rman backup , and the data is not so necessory, since it is for student practice.)
SQL> startup open
ORACLE instance started.
Total System Global Area 524288000 bytes
Fixed Size 790180 bytes
Variable Size 250343772 bytes
Database Buffers 272629760 bytes
Redo Buffers 524288 bytes
Database mounted.
ORA-01110: data file 34: 'G:\ORACLE\DATAFILES_ACADEMY\ACADEMY'
ORA-01115: IO error reading block from file 34 (block # 1)
ORA-27070: async read/write failed
OSD-04016: Error queuing an asynchronous I/O request.
O/S-Error: (OS 23) Data error (cyclic redundancy check).regards.Maahjoor wrote:
Hi dears,
i need further assistance from your side, i have restarted the server, but the same problem.
as there a way to drop and re-create a system tablespace? since the file 34 belong to system tablesapce.
regardsNo.
So just create a new database. That will take all of ten minutes. And tell your students to create new tablespaces. That will take them two minutes. -
Urgent help - Unable to open operator
Hello Friends,
Need urgent help and suggestions...
It started since this morning. When we open ODI Dev/Prod instance repositoy operator it gives this message.
Error:
Corrupted module. Unable to connect.
See the license information in the 'About'...'menu and contact your Oracle reseller.
What does this mean?
Regards.We worked with Oracle Support and got it fixed with the following steps:
the steps are the follwoing sql command on the Master repository DELETE FROM SNP_HOST_MOD
DELETE FROM SNP_HOST
UPDATE SNP_MODULE SET CHECKSUM = '902' where I_MODULE = 1
UPDATE SNP_MODULE SET CHECKSUM = '947' where I_MODULE = 2
UPDATE SNP_MODULE SET CHECKSUM = '561' where I_MODULE = 3
UPDATE SNP_MODULE SET CHECKSUM = '932' where I_MODULE = 4
UPDATE SNP_MODULE SET CHECKSUM = '945' where I_MODULE = 5
Please note you should make a backup of the matser repository -
Urgent help. I have upgraded my phone but every few hours the apple appears and stays for 15 min an hour or more?
Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new). Try each of these in order until the issue is resolved.
If the issue persists, take the device to Apple for evaluation.
Maybe you are looking for
-
Dialog work process in stop gui status
Hi, there are lots of dialog work process are stuck status due to stop gui error. stop gui work process are not getting released automatic from the system due to this many users are facing problem and they are getting sap slow problem. to resolve the
-
How do you text an email with the palm pre?
can someone tell me how i would go about texting someone an email that i received. . . i don't want to email it I want to text the email. . . I tried to save it as a memo and then send it as a text but it wouldn't do it and I tried to copy the email
-
SD Released accounting Documents
Hi, Can any body face the problem like this??? There are many (approx 200) that have status billing documents as being released to accounting. However, there are no accounting documents. We are certain there should be. VF02 - Release to Acctg does
-
Can I use the same Oracle Repository for the new FDM App
Hi All, I have to uninstall FDM and install and re-configure FDM again and then restore FDM Apps present previously. For this, Can I resue the same Oracle Repository for restoring the FDM app on newly installed instance. As far as I know, I need to t
-
Word document created by Workflows do not open
We are using Sharepoint Online (2013 version) and sharepoint Designer 2013 We have a requirement by which we would like to update a 'Word template' with the metadata information from a Document Set. A word document is created after the workflow exec