How to log the error/variables info in java classes
We are using the third party jar and the jar is independent to the application. So this is why I am not able to see any errors in the web server log. In that file using the below sample code is using. And my problem is I am not able to print the variables info either in web page or in the terminal. Please can any one suggest how to make it possible(to print the variables info).Just fyi, the methods in this class are calling by Java bean and the java bean in turn calling by servlet.
============================
import SPSecurity.configuration.SecurityConfiguration;
import SPSecurity.exception.NoDataFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
public class BasicUserInformation
public BasicUserInformation()
//intialization
public void initialize(String s, int i)
//some code with variables
public void initialize(HttpServletRequest httpservletrequest)
// some code with variables
private void setUserIdandTypeProperties()
//Some code with variable.
}
The answer is reflection
Read the following tutorial
[http://java.sun.com/docs/books/tutorial/reflect/index.html]
Similar Messages
-
How to get the profile object in simple java class (Property accessor)
Hi All,
Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
a.I dont have request object also to do request.resolvename.
b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
Advance Thanks.Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
getPropertyValue() {
super.getPropertyValue() // Chance of getting value set by Profile A.
// Perform logic
There is a chance that profile B getting the value set by Profile A and hence inconsistency.
How about doing this way??
Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
<attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
getPropertyValue()
//You have Profile item descriptor and also storeId property value.
// Use CustomCatalogTools.findSku();
// Use storeId, profile repository item, sku repository item to perform the logic
Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
-karthik -
How can we a validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.
Please see:
http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis
http://social.msdn.microsoft.com/Forums/en-US/01ce7e4b-5a33-454b-8056-d48341da5eb2/vb-script-to-write-variables-to-text-file -
the email address assoc. with my iTunes account is no longer valid. can't access it. need to change it in iTunes but can't access account. even my birthdate is incorrect in iTunes...so can't log in. any suggestions on how to log in and edit info???
There is nothing that you can do to get rid of the balance on your own. Contact iTunes Store Support and seek their assistance. I believe that they can reset your balance for you.
https://expresslane.apple.com/Issues.action -
Help, How to view the error log of oracle Job
Hi all,
I created a job in my database, which clears the archivelog. After the job is executed, it occurs error.Such as :
RMAN清理归档日志 1 问题 2010-3-19 下午03时11分00秒 GMT+08:00 PTDB 数据库实例 SYSTEM RMAN 脚本
How to view the error log of oracle Job?
Thank you.
Eric ZhouHello,
Besides some views (with the scheduler) that you can get on the link below:
http://download-west.oracle.com/docs/cd/B28359_01/server.111/b28310/scheduse002.htm#CHDGIDFD
You may use the LOG parameter with RMAN so as to generate a logfile on the server.
Also from EM DBConsole (starting with 10g) you may have the RMAN Backup Report.
Hope this help.
Best regards,
Jean-Valentin -
How to catch the error code thrown by Oracle client installation?
Hi everyone,
Recently, I'm writing a bat file to install Oracle 11g client for windows, I know the command line should be below, but how to find the error code it return? like the command line I want to run in Windows, the errorlevel will return 0 if the command line is pass, otherwise it will return no-zero:
oui.exe -silent -waitforcompletion -nowait -force -responseFile ...\response\clientruntime.rsp
BTW, I know I can find the error info under the path ...\Oracle\Inventory\logs, but I think it is better if you can tell me another way to catch the error in command line. I just wish that I can determine whether the Oracle provider installation is pass......
Thanks
Lindsay
Edited by: lindsaywang on Oct 6, 2008 1:28 PMI got it.
Thanks,
TD -
How to rectify the errors through call transaction metod in bdc
how to rectify the errors through call transaction metod in bdc
Hi ,
View the highlited part of the below code.
REPORT ygfrivat1 NO STANDARD PAGE HEADING
LINE-SIZE 165
MESSAGE-ID yif_groc.
Program YGFRIVAT1
Function Report to Upload the VAT Adjustment File.
Author ARENAPU
Date 11.05.2007
PMTS AM12810157
Transport G6DK937834
Description:
Modification log:
1. Changed by :
Changed on :
PMTS :
Transport :
Tag :
Description :
T A B L E S D E C L A R A T I O N S
TABLES: edidc, "Control record (IDoc)
edids, "Status Record (IDoc)
t001w.
Internal Tables Declaration.
Internal table to hold data from table EDIDS
DATA: BEGIN OF t_edids OCCURS 0,
docnum LIKE edids-docnum,
logdat LIKE edids-logdat,
logtim LIKE edids-logtim,
countr LIKE edids-countr,
credat LIKE edids-credat,
uname LIKE edids-uname,
END OF t_edids,
Internal table to hold data from table EDIDC
BEGIN OF t_edidc OCCURS 0,
docnum LIKE edidc-docnum,
rcvprt LIKE edidc-rcvprt,
rcvprn LIKE edidc-rcvprn,
credat LIKE edidc-credat,
END OF t_edidc,
Internal table to hold data from upload file
BEGIN OF t_tab OCCURS 0,
cust(10), "site/customer number
date(10), "transaction date
currency(04), "currency
extnbr(15), "external reference number
pos-cont(05), "POS controler
pos-id(25), "POS id
cashier(10), "cashier name
qualif(04), "qualifier of the article
matnr(25), "article number
qty(10), "quantity
sale(16), "sale value
pos-tr(04), "POS transfert type
paymeth(04), "payment method
final(35), "final price
tarcur(04), "target currency
assign(35), "assignment day
error,
END OF t_tab,
Internal table for Report display.
BEGIN OF t_tab1 OCCURS 0,
cust(10), "site/customer number
date(10), "transaction date
currency(04), "currency
extnbr(15), "external reference number
pos-cont(05), "POS controler
pos-id(25), "POS id
cashier(10), "cashier name
qualif(04), "qualifier of the article
matnr(25), "article number
qty(16) TYPE p DECIMALS 2, "quantity
sale(16) TYPE p DECIMALS 2, "sale value
pos-tr(04), "POS transfert type
paymeth(04), "payment method
final(16) TYPE p DECIMALS 2, "final price
tarcur(04), "target currency
assign(35), "assignment day
END OF t_tab1,
t_tab_temp LIKE t_tab OCCURS 0 WITH HEADER LINE,
Internal table to Validate Customer no.
BEGIN OF t_check OCCURS 0,
werks LIKE t001w-werks,
vkorg LIKE t001w-vkorg,
value(40),
END OF t_check,
t_check_temp LIKE t_check OCCURS 0 WITH HEADER LINE.
Internal table to hold data from table ZCS_PARAM.
DATA: BEGIN OF t_zcs_param OCCURS 0.
INCLUDE STRUCTURE zcs_param.
DATA: vkorg LIKE t001w-vkorg,
END OF t_zcs_param.
*Internal table to hold Messages.
DATA: BEGIN OF t_message OCCURS 0,
msgnum TYPE msgnum,
msgtyp TYPE msgtyp,
msgtxt TYPE msgtext,
END OF t_message.
*Work area for table t_message
DATA : w_message LIKE LINE OF t_message.
Internal table to hold BDC data
DATA: t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,
Internal table to collect error messages
messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
*Internal table to hold messages from call transaction
DATA: BEGIN OF t_text OCCURS 0,
desc(150),
msgtxt(100),
END OF t_text.
D A T A D E C L A R A T I O N S
DATA: n TYPE i,
gv_status(11) TYPE c, "Shows status, Production or Test
gv_exit TYPE c, "Exit Flag
gv_qty(16) TYPE p DECIMALS 2, "Variable to sum Quantity
gv_sale(16) TYPE p DECIMALS 2, "Variable to sum Amount
gv_final(16) TYPE p DECIMALS 2. "Variable to sum Final Amount
DATA: w_text(100),
gv_mode TYPE c,
error TYPE c. "Flag to Indicate error.
CONSTANSTS DECLARATION
CONSTANTS : gc_fieldname LIKE dynpread-fieldname VALUE 'P_FNAME',
gc_seq_no LIKE zcs_param-seq_no VALUE '00110',
gc_object LIKE zcs_param-object VALUE 'YGFVAT',
gc_paraname LIKE zcs_param-paraname VALUE 'VKORG',
gc_back TYPE c VALUE 'N',
gc_error TYPE c VALUE 'E',
gc_all TYPE c VALUE 'A'.
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) text-002 FOR FIELD p_test.
PARAMETERS : p_test AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-006.
PARAMETERS : rb_back RADIOBUTTON GROUP rb1 DEFAULT 'X',
rb_error RADIOBUTTON GROUP rb1,
rb_all RADIOBUTTON GROUP rb1.
SELECTION-SCREEN END OF BLOCK a2.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*Subroutine to provide F4 help for file name
PERFORM fr_get_filename.
I N I T I A L I Z A T I O N
INITIALIZATION.
*Subroutine to check authorization.
PERFORM fr_authority_check.
T O P - O F - P A G E
TOP-OF-PAGE.
*Subroutine to diplay header
PERFORM fr_display_header.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
*Subroutine to upload data from presentation server.
PERFORM fr_upload_data.
*Subroutine to validate records from uploaded file.
PERFORM fr_validate_data.
*Subroutine to build report internal table.
PERFORM fr_build_rep.
E N D - O F - S E L E C T I O N
END-OF-SELECTION.
*Subroutine to display report.
PERFORM fr_write_report.
F O R M S U B R O U T I N E S
*& Form fr_get_filename
text
FORM fr_get_filename.
DATA : lv_repid LIKE sy-repid, " Report id
lv_file LIKE ibipparms-path. " File Path
lv_repid = sy-repid.
F4 help for file path.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = lv_repid
dynpro_number = syst-dynnr
field_name = gc_fieldname " p_fname1
IMPORTING
file_name = lv_file.
IF NOT lv_file EQ space.
p_fname = lv_file.
ELSE.
MESSAGE e999 WITH 'Invalid Path'(005).
ENDIF.
ENDFORM. " fr_get_filename
*& Form fr_upload_data
text
FORM fr_upload_data.
DATA: lv_fname TYPE string.
CLEAR lv_fname.
lv_fname = p_fname.
Uploading file from PC or presentation server to internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_fname
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = t_tab
EXCEPTIONS
file_open_error = 1.
IF sy-subrc <> 0.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
MOVE text-m01 TO w_message-msgtxt.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
ENDIF.
ENDFORM. " fr_upload_data
*& Form fr_validate_data
text
FORM fr_validate_data.
DATA : lv_lines1 TYPE i,
lv_lines2 TYPE i.
*Obtain Status depending on Check box selected.
IF p_test IS INITIAL.
gv_status = 'PRODUCTION'.
ELSE.
gv_status = 'TEST RUN'.
ENDIF.
*Batch Mode
CLEAR gv_mode.
IF rb_back EQ 'X'. "No Display
MOVE gc_back TO gv_mode.
ELSEIF rb_error EQ 'X'. "Error Only
MOVE gc_error TO gv_mode.
ELSEIF rb_all EQ 'X'. "All Screens
MOVE gc_all TO gv_mode.
ENDIF.
IF NOT t_tab[] IS INITIAL.
SORT t_tab BY cust.
REFRESH t_tab_temp.
t_tab_temp[] = t_tab[].
SORT t_tab_temp BY cust.
DELETE ADJACENT DUPLICATES FROM t_tab_temp COMPARING cust.
IF NOT t_tab_temp[] IS INITIAL.
SELECT werks vkorg FROM t001w
INTO TABLE t_check
FOR ALL ENTRIES IN t_tab_temp
WHERE werks = t_tab_temp-cust+0(4).
IF sy-subrc = 0.
SORT t_check BY werks.
ENDIF.
LOOP AT t_check.
IF t_check-vkorg <> ' '.
MOVE t_check-vkorg TO t_check-value.
MODIFY t_check TRANSPORTING value.
ENDIF.
ENDLOOP.
ENDIF.
FREE t_tab_temp.
ENDIF.
IF NOT t_check[] IS INITIAL.
REFRESH t_check_temp.
t_check_temp[] = t_check[].
SORT t_check_temp BY value.
DELETE ADJACENT DUPLICATES FROM t_check_temp COMPARING value.
IF NOT t_check_temp[] IS INITIAL.
SELECT * FROM zcs_param INTO TABLE t_zcs_param
FOR ALL ENTRIES IN t_check_temp
WHERE seq_no EQ gc_seq_no
AND object EQ gc_object
AND paraname EQ gc_paraname
AND value EQ t_check_temp-value.
IF sy-subrc = 0.
SORT t_zcs_param BY value.
ENDIF.
ENDIF.
FREE t_check_temp.
ENDIF.
IF NOT t_tab[] IS INITIAL.
LOOP AT t_tab.
READ TABLE t_check WITH KEY werks = t_tab-cust BINARY SEARCH.
IF sy-subrc <> 0.
MOVE 'X' TO t_tab-error.
MODIFY t_tab TRANSPORTING error.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
CONCATENATE t_tab-cust text-030
INTO w_message-msgtxt SEPARATED BY space.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
EXIT.
ELSE.
READ TABLE t_zcs_param WITH KEY value = t_check-vkorg
BINARY SEARCH.
IF sy-subrc <> 0.
MOVE 'X' TO t_tab-error.
MODIFY t_tab TRANSPORTING error.
DESCRIBE TABLE t_message LINES n.
w_message-msgnum = n + 1.
w_message-msgtyp = 'E'.
CONCATENATE text-003 t_tab-cust text-004 t_check-vkorg
INTO w_message-msgtxt SEPARATED BY space.
APPEND w_message TO t_message.
Subroutine for writing log.
PERFORM fr_write_log.
EXIT.
ELSE.
PERFORM fr_format_tab.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
DESCRIBE TABLE t_tab LINES lv_lines1.
IF lv_lines1 <> 0.
DELETE t_tab WHERE error EQ 'X'.
ENDIF.
DESCRIBE TABLE t_tab LINES lv_lines2.
IF lv_lines2 <> 0.
IF lv_lines2 <> lv_lines1.
EXIT.
ELSE.
IF p_test IS INITIAL.
LOOP AT t_tab.
*Subroutine to build BDC table
PERFORM fr_fill_bdctab.
*Subroutine to Post Data into SAP.
PERFORM fr_data_posting.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " fr_validate_data
*& Form fr_write_log
text
FORM fr_write_log.
CLEAR error.
error = 'X'.
WRITE:/1 'Msg No'(027), 10 'Type'(028), 20 'Text'(029).
ULINE:/1(120).
FORMAT RESET.
LOOP AT t_message.
IF t_message-msgtyp = 'E'.
FORMAT COLOR 6 INTENSIFIED .
ELSEIF t_message-msgtyp = 'W'.
FORMAT COLOR 3 INTENSIFIED .
ELSEIF t_message-msgtyp = 'I'.
FORMAT COLOR 5 INTENSIFIED .
ENDIF.
WRITE:/1 t_message-msgnum,
10 t_message-msgtyp,
20 t_message-msgtxt.
FORMAT RESET.
ENDLOOP.
ULINE:/1(120).
ENDFORM. " fr_write_log
*& Form fr_write_report
text
FORM fr_write_report.
CLEAR gv_exit.
LOOP AT t_message.
IF t_message-msgtyp = 'E'.
gv_exit = 'X'.
EXIT.
ENDIF.
ENDLOOP.
IF NOT gv_exit IS INITIAL.
EXIT.
ELSE.
PERFORM fr_display_report.
IF NOT t_text[] IS INITIAL.
Subroutine for Display Call Transaction messages.
PERFORM fr_write_msg.
ENDIF.
ENDIF.
ENDFORM. " fr_write_report
*& Form fr_display_report
text
FORM fr_display_report.
IF NOT t_tab1[] IS INITIAL.
CLEAR: gv_qty, gv_sale, gv_final.
LOOP AT t_tab1.
WRITE:/1(10) t_tab1-cust,
13(10) t_tab1-date,
25(05) t_tab1-currency,
32(14) t_tab1-extnbr,
48(09) t_tab1-pos-cont,
60(18) t_tab1-matnr,
80(16) t_tab1-qty RIGHT-JUSTIFIED ,
98(16) t_tab1-sale RIGHT-JUSTIFIED ,
116(07) t_tab1-paymeth,
125(16) t_tab1-final RIGHT-JUSTIFIED,
143(06) t_tab1-tarcur,
152(12) t_tab1-assign.
gv_qty = t_tab1-qty + gv_qty.
gv_sale = t_tab1-sale + gv_sale.
gv_final = t_tab1-final + gv_final.
ENDLOOP.
FORMAT COLOR 3.
ULINE: /(164).
WRITE:/ 'TOTALS',
80(16) gv_qty RIGHT-JUSTIFIED,
98(16) gv_sale RIGHT-JUSTIFIED,
125(16) gv_final RIGHT-JUSTIFIED,
182 ''.
ULINE: /(164).
FORMAT RESET.
ENDIF.
ENDFORM. " fr_display_report
*& Form FR_DISPLAY_HEADER
text
FORM fr_display_header.
IF error IS INITIAL.
FORMAT COLOR 1.
WRITE:/ 'Date upload :'(007), 25 sy-datum, 38 ''.
WRITE:/ 'Production or Test Run:'(008), 25 gv_status, 38 ''.
WRITE:/ 'Upload User Logon :'(009), 25 sy-uname, 38 ''.
ULINE: /(164).
WRITE:/1(04) 'Site'(010),
13(10) 'Date'(011),
25(05) 'Curr.'(012),
32(14) 'Receipt'(013),
48(09) 'Cashier'(014),
60(18) 'Article'(015),
92 'Qty'(016),
102 'Item Amount'(017),
116(7) 'M.o.P.'(018),
128 'Tender Amount'(019),
143(6) 'T.Curr'(020),
152(12) 'Assignment'(021).
ULINE:/(164).
FORMAT RESET.
ENDIF.
ENDFORM. " FR_DISPLAY_HEADER
*& Form fr_newdynpro
text
FORM fr_newdynpro USING program LIKE bdcdata-program
dynpro LIKE bdcdata-dynpro.
t_bdcdata-program = program .
t_bdcdata-dynpro = dynpro.
t_bdcdata-dynbegin = 'X'.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " fr_newdynpro
*& Form fr_loadfield
text
FORM fr_loadfield USING field LIKE bdcdata-fnam
value.
t_bdcdata-fnam = field.
t_bdcdata-fval = value.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " fr_loadfield
*& Form fr_fill_bdctab
text
FORM fr_fill_bdctab.
REFRESH t_bdcdata.
PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
PERFORM fr_loadfield USING 'G_DATUM' t_tab-date.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BON'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '500'.
PERFORM fr_loadfield USING 'WPSCB01-POSKREIS' t_tab-pos-cont.
PERFORM fr_loadfield USING 'WPSCB01-KASSID' t_tab-pos-id.
PERFORM fr_loadfield USING 'WPSCB01-BELEGWAERS' t_tab-currency.
PERFORM fr_loadfield USING 'WPSCB01-CSHNAME' t_tab-cashier.
PERFORM fr_loadfield USING 'WPSCB01-BONNUMMER' t_tab-extnbr.
PERFORM fr_loadfield USING 'E1WPB02-QUALARTNR(01)' t_tab-qualif.
PERFORM fr_loadfield USING 'E1WPB02-ARTNR(01)' t_tab-matnr.
PERFORM fr_loadfield USING 'E1WPB02-MENGE(01)' t_tab-qty.
PERFORM fr_loadfield USING 'WPSCB03-KONDVALUE(01)' t_tab-sale.
PERFORM fr_loadfield USING 'E1WPB02-VORGANGART(01)' t_tab-pos-tr.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'ZAHL'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
PERFORM fr_loadfield USING 'WPSCB06-ZAHLART' t_tab-paymeth.
PERFORM fr_loadfield USING 'WPSCB06-SUMME' t_tab-final.
PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
PERFORM fr_loadfield USING 'WPSCB06-ZUONR' t_tab-assign.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'SAVE'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
PERFORM fr_loadfield USING 'WPSCB06-ZAHLART' t_tab-paymeth.
PERFORM fr_loadfield USING 'WPSCB06-SUMME' t_tab-final.
PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
PERFORM fr_loadfield USING 'WPSCB06-ZUONR' t_tab-assign.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
PERFORM fr_newdynpro USING 'SAPLSPO1' '0200'.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'YES'.
PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
PERFORM fr_loadfield USING 'G_DATUM' t_tab-date.
PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
ENDFORM. " fr_fill_bdctab
*& Form fr_data_posting
text
FORM fr_data_posting.
IF NOT t_bdcdata[] IS INITIAL.
REFRESH messtab.
CALL TRANSACTION 'WPUK' USING t_bdcdata
MODE gv_mode
UPDATE 'S'
MESSAGES INTO messtab.
IF sy-subrc = 0 .
CLEAR w_text.
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = sy-langu
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = w_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
MOVE w_text TO t_text-msgtxt.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Posted Sucessfully'(032)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
ENDLOOP.
ELSE.
CLEAR w_text.
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = sy-langu
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = w_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
MOVE w_text TO t_text-msgtxt.
IF messtab-msgnr EQ '213'.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Posted Sucessfully'(032)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
EXIT. ELSE.
CONCATENATE 'Site:'(031) t_tab-cust
'Article:'(024) t_tab-matnr
'Not Posted'(033)
INTO t_text-desc SEPARATED BY space.
APPEND t_text.
CLEAR t_text.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " fr_data_posting
*& Form fr_authority_check
text
FORM fr_authority_check.
AUTHORITY-CHECK OBJECT 'Y_VATADJ'
ID 'VKORG' FIELD t001w-vkorg
ID 'TCD' FIELD 'YGFVAT'.
IF sy-subrc NE 0.
MESSAGE e999 WITH text-m02.
ENDIF.
ENDFORM. " fr_authority_check
*& Form fr_write_msg
text
FORM fr_write_msg.
SKIP.
ULINE:/(164).
WRITE:/
'Messages encountered while Calling Transaction WPUK'(025),
90 'Message Text'(026).
ULINE:/1(164).
LOOP AT t_text.
WRITE:/1 t_text-desc,
90 t_text-msgtxt,
164 ''.
ENDLOOP.
ULINE:/1(164).
ENDFORM. " fr_write_msg
*& Form FR_BUILD_REP
text
FORM fr_build_rep.
IF error IS INITIAL.
IF NOT t_tab[] IS INITIAL.
LOOP AT t_tab.
MOVE:
t_tab-cust TO t_tab1-cust, "site/customer number
t_tab-date TO t_tab1-date, "transaction date
t_tab-currency TO t_tab1-currency, "currency
t_tab-extnbr TO t_tab1-extnbr, "external reference number
t_tab-pos-cont TO t_tab1-pos-cont, "POS controler
t_tab-pos-id TO t_tab1-pos-id, "POS id
t_tab-cashier TO t_tab1-cashier, "cashier name
t_tab-qualif TO t_tab1-qualif, "qualifier of the article
t_tab-matnr TO t_tab1-matnr, "article number
t_tab-pos-tr TO t_tab1-pos-tr, "POS transfert type
t_tab-paymeth TO t_tab1-paymeth, "payment method
t_tab-tarcur TO t_tab1-tarcur, "target currency
t_tab-assign TO t_tab1-assign.
REPLACE ',' WITH '.' INTO t_tab-qty.
CONDENSE t_tab-qty NO-GAPS.
MOVE t_tab-qty TO t_tab1-qty.
REPLACE ',' WITH '.' INTO t_tab-sale.
CONDENSE t_tab-sale NO-GAPS.
MOVE t_tab-sale TO t_tab1-sale.
REPLACE ',' WITH '.' INTO t_tab-final.
CONDENSE t_tab-final NO-GAPS.
MOVE t_tab-final TO t_tab1-final.
APPEND t_tab1.
CLEAR t_tab1.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " FR_BUILD_REP
*& Form fr_format_tab
text
FORM fr_format_tab.
DATA : lv_qty TYPE string.
IF NOT t_tab-qty IS INITIAL.
IF t_tab-qty+0(1) EQ '-'.
CLEAR lv_qty.
MOVE t_tab-qty TO lv_qty.
CLEAR t_tab-qty.
SHIFT lv_qty LEFT CIRCULAR.
CONDENSE lv_qty NO-GAPS.
MOVE lv_qty TO t_tab-qty.
MODIFY t_tab TRANSPORTING qty.
ENDIF.
ENDIF.
ENDFORM. " fr_format_tab -
How to log the exception using Log action in Oracle Service Bus
Hi,
Whenever an exception is raised how to log the exception using Log action in oracle service bus.After logging where I have to find the logged message.It would be in the log file for the managed server which ran the request. If you are logging the message at a lower level than your app server, however, you won't see it. You should be logging the exception at Error level.
-
JNI - How to use the error reporting mechanism?
I've developed a C++ DLL which is loaded from a commercial Win32 application (not written by me) as a plug-in for external calculations. On its initialization the C++ DLL launches the Java VM via the JNI invocation interface. When the DLL functions are called by the application, they forward the calls to Java objects inside the Java VM, again via JNI invocation interface.
This works well, but I have encountered a weird error.
From Java I open a JFrame containing a JTextArea as small console for debug output messages. If I turn output to this debug console off (my printToConsole routine checks whether a boolean flag is set), the string concatenation operator may lead to a crash of the Java VM.
For example, if in one of the Java functions called from the
DLL via JNI invocation interface the following is the first statement,
it leads to a crash of the Java VM and the application that loaded the C++ proxy DLL.
String test=""+Math.random(); // String test not used later
Interestingly, if I comment this statement out, the Java code works fine WITHOUT any crash. I've already thought about potential races and synchronization issues in my code, but I don't see where this is the case. And the string concatenation error fails as well, if I insert sleep() statements in front of it and at other places in the code. However, if I turn on log messages printed to my JFrame debug console (containing a JTextArea), the String concatenation works without problems.
So maybe the JNI interface has a bug and affects the Java VM; I don't see where my JNI code is wrong.
One problem is that I do not get any stdout output, as the C++ proxy DLL is loaded by the Windows application, even if I start the Windows application from the DOS command line (under Windows).
Does anyone know how to use the error reporting mechanism?
http://java.sun.com/j2se/1.4.2/docs/guide/vm/error-handling.html
Is it possible that the JVM, when it crashes, writes debug information about the crash into a file instead of stdout/stderr?
My C++ proxy DLL was compiled in debug mode, but the commercial application (which loaded the DLL) is very likely not.
I do not know hot to find the reason why the String concatenation fails inside the Java function called from the C++ DLL via JNI.Yes, I've initially thought about errors in the C++ code too. But the C++ code is actually very simple and short. It doesn't allocate anything on the C++ side. It allocates a couple of ByteBuffers inside the Java VM however via JNI invocation interface calls of env->NewDirectByteBuffer(). The native memory regions accessed via the ByteBuffers are allocated not by my own C++ code, but by the program that calls my DLL (the program is Metastock).
The interesting thing is that everything works fine if output to my debug console is enabled, which means that in the Java print routine getConsoleLoggingState() returns true and text is appended to the jTextArea.
static synchronized void print(String str)
{ MetaStockMonitor mMon=getInstance();
if ( mMon.getFileLoggingState() && mMon.logFileWriter!=null) {
mMon.logFileWriter.print(str);
mMon.logFileWriter.flush();
if ( mMon.getConsoleLoggingState() ) {
mMon.jTextArea1.append(str);
Only if output to the JTextArea is turned off (ie. getConsoleLoggingState()==false), the crash happens when the FIRST statement in the Java routine called via JNI invocation interface is a (useless) String concatenation operation, as described above.
String test=""+Math.random(); // String test not used later
Moreover, the crash happens BEFORE the allocated ByteBuffer objects are accessed in the Java code. But again, if console output is turned on, it works stable. If console output is turned off, it works when the (useless) String concatenation operation is removed in the Java routine called from C++.
I've already thought about potential races (regarding multiple threads), but this can be ruled out in my case. It almost appears as if the JVM can have problems when called by the invocation interface (I tested it with Java 1.4.2 b28).
All the calls between C++ and Java go ALWAYS in the direction from C++ code to Java. Unfortunately, there is no special JRE version with extensive logging capabilities to facilitate debugging. And the problem is not easily reproducible either.
JNIEnv* JNI_GetEnv()
JNIEnv *env;
cached_jvm->AttachCurrentThread((void**)&env,NULL);
fprintf(logfile,"env=%i\n",env);
fflush(logfile);
return env;
// function called by Metastock's MSX plug-in interface
BOOL __stdcall createIndEngine (const MSXDataRec *a_psDataRec,
const MSXDataInfoRecArgsArray *a_psDataInfoArgs,
const MSXNumericArgsArray *a_psNumericArgs,
const MSXStringArgsArray *a_psStringArgs,
const MSXCustomArgsArray *a_psCustomArgs,
MSXResultRec *a_psResultRec)
a_psResultRec->psResultArray->iFirstValid=0;
a_psResultRec->psResultArray->iLastValid=-1;
jthrowable ex;
jmethodID mid;
JNIEnv* env=JNI_GetEnv();
jobject chart=getChart(env, a_psDataRec);
if ( chart==NULL) {
return MSX_ERROR;
jobject getChart (JNIEnv* env, const MSXDataRec *a_psDataRec)
jthrowable ex;
jmethodID mid;
int closeFirstValid, closeLastValid;
closeFirstValid=a_psDataRec->sClose.iFirstValid;
closeLastValid=a_psDataRec->sClose.iLastValid;
long firstDate, firstTime;
if (closeFirstValid>=1 && closeFirstValid<=closeLastValid) {
firstDate = a_psDataRec->psDate[closeFirstValid].lDate;
firstTime = a_psDataRec->psDate[closeFirstValid].lTime;
} else {
firstDate=0;
firstTime=0;
jclass chartFactoryClass = env->FindClass("wschwendt/metastock/msx/ChartFactory");
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot find class ChartFactory\n");
printSBufViaJava(sbuf);
return NULL;
mid = env->GetStaticMethodID(chartFactoryClass, "getInstance", "()Lwschwendt/metastock/msx/ChartFactory;");
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getInstance()\n");
printSBufViaJava(sbuf);
return NULL;
jobject chartFactory=env->CallStaticObjectMethod(chartFactoryClass, mid);
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Exception while calling ChartFactory.getInstance()");
printSBufViaJava(sbuf);
return NULL;
mid = env->GetMethodID(chartFactoryClass, "getChartID", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIIIII)F");
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getChartID()\n");
printSBufViaJava(sbuf);
return NULL;
jobject symbolBuf=env->NewDirectByteBuffer(a_psDataRec->pszSymbol, strlen(a_psDataRec->pszSymbol) );
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot allocate symbolBuf\n");
printSBufViaJava(sbuf);
return NULL;
jobject securityNameBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityName, strlen(a_psDataRec->pszSecurityName) );
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot allocate securityNameBuf\n");
printSBufViaJava(sbuf);
return NULL;
jobject securityPathBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityPath, strlen(a_psDataRec->pszSecurityPath) );
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot allocate securityPathBuf\n");
printSBufViaJava(sbuf);
return NULL;
jobject securityOnlineSourceBuf=env->NewDirectByteBuffer(a_psDataRec->pszOnlineSource, strlen(a_psDataRec->pszOnlineSource) );
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Cannot allocate onlineSourceBuf\n");
printSBufViaJava(sbuf);
return NULL;
// Java Function call leads to crash, if console output is turned off and
// the first statement in the Java routine is a (useless) string concatenation.
// Otherwise it works stable.
jfloat chartID=env->CallFloatMethod(chartFactory, mid, securityNameBuf, symbolBuf,
securityPathBuf, securityOnlineSourceBuf, (jint)(a_psDataRec->iPeriod),
(jint)(a_psDataRec->iInterval), (jint)(a_psDataRec->iStartTime),
(jint)(a_psDataRec->iEndTime), (jint)(a_psDataRec->iSymbolType),
(jint)firstDate, (jint)firstTime );
if (ex= env->ExceptionOccurred() ) {
env->ExceptionDescribe();
env->ExceptionClear();
sprintf(sbuf, "DLL: Exception while calling ChartFactory.getChartID()");
printSBufViaJava(sbuf);
return NULL; -
How to use the bind variable in custom.pll
Hi,
How to use the bind variable in custom.pll.Its through error.
any one gem me.
very urgent.
M.Soundrapandian.Hello,
Please, ask this kind of questions in the e-business forum.
Francois -
How to get the session variable value in JSF
Hi
This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
<managed-bean-name>login</managed-bean-name>
<managed-bean-class>LoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope> like that...
So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
Already i tried
session.getAtrribute("userId");
session.getValue("userId");
but it retrieve only "null" value.. could u please help me.. it's very urgent one..
By
SubbusWhere i use that..is it in jsp or backend bean...
simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
in LogoutBean inside
public String getUserID()
Object sessionAttribute = null;
FacesContext facescontext=FacesContext.getCurrentInstance();
ExternalContext externalcontext=facescontext.getExternalContext();
Map sessionMap=externalcontext.getSessionMap();
if(sessionMap != null)
sessionAttribute = sessionMap.get("userId");
System.out.println("Session value is...."+(String)sessionAttribute);
return (String)sessionAttribute;
return "fail";
JSP Page
<jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
System.out.println("SS value is ...."+logs.getUserID());
but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
By
Subbus -
How to log the user activity in JSF?
How to log the user activity in JSF?
e.g. the pages the user accessed
searching criteria the user inputted...user080701 wrote:
I need to write the info to database so that we can analyse which product most people seach for , etc.
Can I write a filter to capture the request info and write the info to database?Of course. Although I would still advocate using logs. You can always parse them and put the data in a database after the fact. -
How to rectify the error message " duplicate data records found"
Hi,
How to rectify the error "duplicate data records found" , PSA is not there.
and give me brief description about RSRV
Thanks in advance,
Ravi AlakunltaHi Ravi,
In the Info Package screen...Processing tab...check the option Do not allow Duplicate records.
RSRV is used for Repair and Analysis purpose.
If you found Duplicate records in the F fact table...Compress it then Duplicate records will be summarized in the Cube.
Hope this helps. -
Hello All,
I am using this API for creating a contact for an employee in R12.
But, some times i am not able to create the contact successfully, and Unable to figure out proper reason for record erroring out.
I dont find any out msg data variables for this API in order to check it for the Error.
So, can any body help me how to get the ERROR Message for such APIs.
Thanks inAdvance,
Amarnadh Jsuser12243334 wrote:
solved the issue on myselfIt would be nice if you could share the solution with us.
Thanks,
Hussein -
How to Run the NEW "System Info Command" in Tiger ?????
I am new to Applescript and was wondering if someone could help me on how to run the new "System Info Command"?
Thanks!!!The "system info" command that red_menace uses above is the new system info command that's mentioned on the web page you referenced. However, red's example only displays the "long user name" and the "AppleScript version" in the dialog.
The entire system info record actually contains all of these items, each of which you can access just like red_menace shows you in his example:
AppleScript version
AppleScript Studio version
system version
short user name
long user name
user ID
user locale
home directory
boot volume
computer name
host name
IPv4 address
primary Ethernet address
CPU type
CPU speed
physical memory
Steve
PS - if you switch Script Editor over so the bottom pane displays the "Event Log" you'll see the entire system info record displayed in the log when you run red_menace's script.
Maybe you are looking for
-
Deploy customize workflow takes a long time to show up in application
Hi, This is the first time (newbie) i am customizing and deploying work flow in ebiz(R12), the problem that I am facing is that after I deploy the customize workflow it takes a long for the ebiz to pickup/show the changes. What I did was to customize
-
Reports 2.01 Variance Error
I have a report that uses accounts in the page dimension (with UDAs). When I use the variance function in a column formula I receive a cell error. Why?I have product in the rows & ,years & months in the columns I'm try to compare current month to pri
-
I have a SOAP Web Service secured with a Basic Authentication. I've wrapped this SOAP service with an ESB service. Should I be able to pass the Basic Authentication credentials through the ESB service to the underlying SOAP service? I see "support fo
-
Implementing Web Services as Transport Protocol in B2B and Healthcare
Hi B2B Gurus, I am unable to implement web service transport in B2B and Healthcare, I am getting few issues. I fallowed below link. http://docs.oracle.com/cd/E28280_01/user.1111/e10229/bb_partner_webservice.htm#BABIIEJJ Can any one explain how exactl
-
Hi all, I have a problem with home buttom, someone have the same problem? I stack, i mean i try to push and push but doesn't work... Dissapointed