Upgradation -hard Coding issue
Hi,
I'm working in an Upgradation Project(from 4.6c to ECC 6.0) where I need to remove Hard Coding in general.
I met with a situation where I have to use hard coding, but it's not good to use interms of performance.
Could anyone post the solution for this.
Up front, I would agree with Sravan, however, you haven't posted any example of one of the subroutines in which you have used some hard-coding. But normally, when you are for example using screen field names for calling these subroutines, I wouldn't mind doing some hard coding since these screen will 'never' change anyway. It would be a hell of a job correcting all the BDC programs and replacing these with constants.
Similar Messages
-
Many times my computer takes too long to connect to new website. I have wireless internet (time capsule) and I am running a pretty powerful real time financial work program at same time, what is the best solution? Upgrading speed from cable network? is it a hard drive issue? do I only need to "clean out" the computer? Or all of the above...not to computer saavy. It is a Macbook Pro osx 10.6.8 (late 2010).
Almost certainly none of the above! Try each of the following in this order:
Select 'Reset Safari' from the Safari menu.
Close down Safari; move <home>/Library/Caches/com.apple.Safari/Cache.db to the trash; restart Safari.
Change the DNS servers in your network settings to use the OpenDNS servers: 208.67.222.222 and 208.67.220.220
Turn off DNS pre-fetching by entering the following command in Terminal and restarting Safari:
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false -
Output type for the managed codes cut letter is hard coded
Hello,
Very Good afternoon!
I have a requirement to create new Output Types for a Smart Form.
The already existing Output types are hard coded as shown Below :
CONSTANTS : c_kschl_order LIKE nast-kschl
VALUE 'ZUS0',
c_kschl_order1 LIKE nast-kschl
VALUE 'ZUS1',
Now they do not want to use ZUS1. Insted they wnat to use New Output Types.
u2022 Remove ZUS1 as we no longer use this one.
u2022 Add ZAU0
u2022 Add ZNZ0
u2022 Add ZJP0
u2022 Add ZCN0
u2022 Add ZKR0
How to add these Output types without Hardcoding as shown ABove.
Any Suggestions will be appreciated.....
For reference..I will paste the code of the Program here.
Here is the code :
PROGRAM DECLARATION
PROGRAM ID Z_RVADOR01_SALES_CUT_LETTER
TABLES: vbak, "Sales Document: Header Data
vbap, "Sales Document: Item Data
vbpa, "Sales Document: Partner
vbep, "Sales Document: Schedule Line Data
kna1, "General Data in Customer Master
MARA, "Material Master
KOMK, "Communicationarea for conditions
KOMP, "Communicationarea for conditions
KOMVD, "Communicationarea for conditions
VBCO3, "Communicationarea for view
VBDKA, "Headerview
VBDPA, "Itemview
VBDPAU, "Subitemnumbers
CONF_OUT, "Configuration data
SADR, "Addresses
TVAG, "Reason for rejection
VEDKA, "Servicecontract head data
VEDPA, "Servicecontract position data
VEDKN, "Servicecontract head notice data
VEDPN, "Servicecontract pos. notice data
RISERLS, "Serialnumbers
KOMSER, "Serialnumbers for print
TVBUR, "Sales office
TVKO, "Sales organisation
ADRS, "Communicationarea for Address
FPLTDR, "billing schedules
WTAD_ADDIS_IN_SO_PRINT, "additional
WTAD_BUYING_PRINT_EXTRA_TEXT, "texts belonging to additional
adrc,
adr6,
t247.
INCLUDE RVADTABL.
INCLUDE RVDIREKT.
INCLUDE VEDADATA.
data for access to central address maintenance
INCLUDE SDZAVDAT.
TYPE-POOLS: ADDI.
DATA PRICE_PRINT_MODE(1) TYPE C. "Print-mode
DATA: RETCODE LIKE SY-SUBRC. "Returncode
DATA: REPEAT(1) TYPE C.
DATA: XSCREEN(1) TYPE C. "Output on printer or screen
DATA: BEGIN OF STEU, "Controldata for output
VDKEX(1) TYPE C,
VDPEX(1) TYPE C,
KBKEX(1) TYPE C,
KBPEX(1) TYPE C,
END OF STEU.
DATA: BEGIN OF TVBDPA OCCURS 0. "Internal table for items
INCLUDE STRUCTURE VBDPA.
DATA: END OF TVBDPA.
DATA: BEGIN OF TKOMV OCCURS 50.
INCLUDE STRUCTURE KOMV.
DATA: END OF TKOMV.
DATA: BEGIN OF TKOMVD OCCURS 50.
INCLUDE STRUCTURE KOMVD.
DATA: END OF TKOMVD.
DATA: BEGIN OF TVBDPAU OCCURS 5.
INCLUDE STRUCTURE VBDPAU.
DATA: END OF TVBDPAU.
DATA: BEGIN OF TKOMCON OCCURS 50.
INCLUDE STRUCTURE CONF_OUT.
DATA: END OF TKOMCON.
DATA: BEGIN OF TKOMSERVH OCCURS 1.
INCLUDE STRUCTURE VEDKA.
DATA: END OF TKOMSERVH.
DATA: BEGIN OF TKOMSERVP OCCURS 5.
INCLUDE STRUCTURE VEDPA.
DATA: END OF TKOMSERVP.
DATA: BEGIN OF TKOMSERVHN OCCURS 5.
INCLUDE STRUCTURE VEDKN.
DATA: END OF TKOMSERVHN.
DATA: BEGIN OF TKOMSERVPN OCCURS 5.
INCLUDE STRUCTURE VEDPN.
DATA: END OF TKOMSERVPN.
DATA: BEGIN OF TKOMSER OCCURS 5.
INCLUDE STRUCTURE RISERLS.
DATA: END OF TKOMSER.
DATA: BEGIN OF TKOMSER_PRINT OCCURS 5.
INCLUDE STRUCTURE KOMSER.
DATA: END OF TKOMSER_PRINT.
DATA: BEGIN OF TFPLTDR OCCURS 5.
INCLUDE STRUCTURE FPLTDR.
DATA: END OF TFPLTDR.
DATA: TADDI_PRINT TYPE ADDI_SO_PRINT_ITAB WITH HEADER LINE.
TYPES:BEGIN OF ty_orders ,
xblnr LIKE mkpf-xblnr, "delivery number
erfmg LIKE mseg-erfmg, "goods issue quantity
custname LIKE kna1-name1, "customer name
bstnk LIKE vbak-bstnk, "purchase order number
ean11 LIKE vbap-ean11, "upc
kdmat LIKE vbap-kdmat, "customer material code
arktx LIKE vbap-arktx, "description
csrno LIKE kna1-kunnr, "customer service rep number
spras LIKE kna1-spras, "customer language key
csrname LIKE kna1-name1, "customer service rep name
csremail LIKE adr6-smtp_addr, "csr email
csrphone LIKE kna1-telf1, "csr telephone
csrext LIKE adrc-tel_extens, "csr extension
csrfax LIKE kna1-telfx, "csr fax
total LIKE lips-lfimg, "cut quantity
ldate(18) TYPE c,
END OF ty_orders.
CONSTANTS: c_kschl_order LIKE nast-kschl
VALUE 'ZUS0',
c_kschl_order1 LIKE nast-kschl
VALUE 'ZUS1', c_parvw_shipto LIKE vbpa-parvw
VALUE 'WE',
c_parvw_csr LIKE vbpa-parvw
VALUE 'ZS',
c_eng(1) TYPE c VALUE 'E',
c_sep(1) TYPE c VALUE '/',
c_sale(25) type c VALUE 'Sales Order'.
DATA: WA_VBAK TYPE VBAK,
tbl_ord TYPE ty_orders OCCURS 0 WITH HEADER LINE,
w_csrname(30) TYPE c,
w_csrno(30) TYPE c,
w_email LIKE adr6-smtp_addr,
f_shipto_found TYPE c,
w_custname(30) TYPE c,
w_month(2),
w_ldate(18),
w_total LIKE lips-lfimg,
w_lines TYPE i VALUE 0,
f_mail(1) TYPE c,
cnt_1 TYPE i VALUE 0,
cnt_2 TYPE i VALUE 0,
tbl_otf LIKE itcoo OCCURS 0 WITH HEADER LINE,
w_type(25) TYPE c,
st_doc_data LIKE sodocchgi1,
tbl_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
tbl_line LIKE tline OCCURS 0 WITH HEADER LINE,
tbl_attach LIKE solisti1 OCCURS 10 WITH HEADER LINE,
tbl_objhead LIKE solisti1 OCCURS 10 WITH HEADER LINE,
tbl_proc_para LIKE soparai1 OCCURS 10 WITH HEADER LINE,
tbl_maillist LIKE somlreci1 OCCURS 10 WITH HEADER LINE,
tbl_pack_list LIKE sopcklsti1 OCCURS 10 WITH HEADER LINE,
tbl_cpo LIKE itcpo OCCURS 0 WITH HEADER LINE,"SAPscript output
" interface
tbl_cpp LIKE itcpp OCCURS 0 WITH HEADER LINE,"SAPscript output
" parameters
tbl_smtp TYPE szadr_adsmtp_line OCCURS 0 WITH HEADER LINE,
tbl_cdhdpos LIKE cdshw OCCURS 0 WITH HEADER LINE,
tbl_cdpos LIKE cdshw OCCURS 0 WITH HEADER LINE,
wrk_lines LIKE sy-tabix,
hltlines TYPE i,
off1 TYPE p,
fle1(2) TYPE p,
fle2(2) TYPE p,
htabix LIKE sy-tabix,
hfeld(500) TYPE c.
FORM ENTRY USING RETURN_CODE US_SCREEN.
if sy-tcode = 'VA01'.
IF nast-kschl = c_kschl_order.
SELECT SINGLE * FROM VBAK INTO WA_VBAK WHERE vbeln = nast-objky.
IF SY-SUBRC = 0.
CLEAR RETCODE.
XSCREEN = US_SCREEN.
PERFORM PROCESSING USING us_screen.
IF RETCODE NE 0.
RETURN_CODE = 1.
ELSE.
RETURN_CODE = 0.
ENDIF.
ELSE.
retcode = sy-subrc.
syst-msgid = 'ZVERROR'.
syst-msgno = '000'.
syst-msgty = 'E'.
syst-msgv1 = NAST-KSCHL.
syst-msgv1 = 'Sales Order cut letter
for this order already issued'.
syst-msgv2 = ' '.
PERFORM protocol_update.
ENDIF.
ELSE.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
IF retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDIF.
endif.
ENDFORM.
FORM PROCESSING *
FORM PROCESSING USING proc_screen.
CASE nast-kschl.
WHEN c_kschl_order.
PERFORM get_orders.
CHECK retcode = 0.
PERFORM openform USING proc_screen vbak-landtx.
CHECK retcode = 0.
PERFORM layout.
CHECK retcode = 0.
CHECK proc_screen NE 'X'.
w_type = c_sale.
PERFORM send_email USING proc_screen.
WHEN c_kschl_order1.
PERFORM get_orders.
CHECK retcode = 0.
CHECK proc_screen NE 'X'.
w_type = c_sale.
PERFORM send_email USING proc_screen.
WHEN OTHERS.
retcode = 1.
syst-msgid = 'E0'.
syst-msgno = '430'.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDCASE.
IF retcode EQ 0.
syst-msgid = '69'.
syst-msgno = '254'.
syst-msgty = 'S'.
syst-msgv1 = nast-kschl.
PERFORM protocol_update.
ELSE.
syst-msgid = 'CKCC'.
syst-msgno = '036'.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
ENDFORM.
FORM PROTOCOL_UPDATE *
The messages are collected for the processing protocol. *
FORM PROTOCOL_UPDATE.
IF xscreen EQ space.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
MSG_ARBGB = SYST-MSGID
MSG_NR = SYST-MSGNO
MSG_TY = SYST-MSGTY
MSG_V1 = SYST-MSGV1
MSG_V2 = SYST-MSGV2
MSG_V3 = SYST-MSGV3
MSG_V4 = SYST-MSGV4
EXCEPTIONS
OTHERS = 1.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
*& Form get_orders
text
--> p1 text
<-- p2 text
FORM get_orders.
DATA : f_csr_found TYPE c.
SELECT SINGLE vbeln vkorg vdatu bstnk kunnr
FROM vbak
INTO (vbak-vbeln,vbak-vkorg,vbak-vdatu,vbak-bstnk,vbak-kunnr)
WHERE vbeln EQ nast-objky.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'VN'.
syst-msgno = '203'.
syst-msgty = 'E'.
syst-msgv1 = 'VBAK'.
syst-msgv2 = sy-subrc.
PERFORM protocol_update.
ENDIF.
SELECT vbeln posnr matnr pmatn arktx abgru kdmat werks
FROM vbap
INTO (vbap-vbeln,vbap-posnr,vbap-matnr,vbap-pmatn,
vbap-arktx,vbap-abgru,vbap-kdmat,vbap-werks)
WHERE vbeln = vbak-vbeln
AND abgru NE space "select items havng Rejection Reason
and PSTYV NE 'ZHDR'.
to check whether the reason for rejection was picked from the
managed codes tables
data: war_abgru type abgru,
w_exist type c.
clear : war_abgru, w_exist.
select single abgru from ZMAT_REJ002
into war_abgru
where vkorg = vbak-vkorg
and kunnr <> vbak-kunnr
and MATNR = vbap-matnr
and datef <= vbak-vdatu
and datet >= vbak-vdatu.
if sy-subrc <> 0.
select single abgru from ZMAT_REJ003
into war_abgru
where vkorg = vbak-vkorg
and kunnr <> vbak-kunnr
and MATNR = vbap-matnr
and datef <= vbak-vdatu
and datet >= vbak-vdatu.
if sy-subrc <> 0.
select single abgru from ZMAT_REJ001
into war_abgru
where vkorg = vbak-vkorg
and werks <> vbap-werks
and matnr = vbap-matnr
and datef <= vbak-vdatu
and datet >= vbak-vdatu.
if sy-subrc <> 0.
select single abgru from ZMAT_REJ004
into war_abgru
where vkorg = vbak-vkorg
and matnr = vbap-matnr
and datef >= vbak-vdatu
and datet <= vbak-vdatu.
if sy-subrc <> 0.
else.
w_exist = 'X'.
endif.
else.
w_exist = 'X'.
endif.
else.
w_exist = 'X'.
endif.
else.
w_exist = 'X'.
endif.
if w_exist = 'X'.
end for check from managed codes table
*to find the quantity fields
SELECT SINGLE wmeng bmeng
FROM vbep
INTO (vbep-wmeng,vbep-bmeng)
WHERE vbeln EQ vbap-vbeln
AND posnr EQ vbap-posnr.
*to get info about the customer
SELECT SINGLE kunnr
FROM vbpa
INTO vbpa-kunnr
WHERE vbeln EQ vbak-vbeln
AND parvw EQ c_parvw_shipto.
IF sy-subrc EQ 0.
f_shipto_found = 'X'.
SELECT SINGLE name1 spras
FROM kna1
INTO (kna1-name1,kna1-spras)
WHERE kunnr EQ vbpa-kunnr.
IF sy-subrc EQ 0.
w_custname = kna1-name1.
CLEAR kna1-name1.
ENDIF.
ENDIF.
SELECT SINGLE kunnr
FROM vbpa
INTO vbpa-kunnr
WHERE vbeln EQ vbak-vbeln
AND parvw EQ c_parvw_csr.
IF SY-SUBRC EQ 0.
f_csr_found = 'X'.
SELECT SINGLE kunnr name1 name2 adrnr
FROM kna1
INTO (kna1-kunnr,kna1-name1,kna1-name2,
kna1-adrnr)
WHERE kunnr EQ vbpa-kunnr.
IF sy-subrc EQ 0.
w_csrno = kna1-kunnr.
w_csrname = kna1-name1.
CLEAR kna1-name1.
SELECT SINGLE tel_number tel_extens fax_number
FROM adrc
INTO (adrc-tel_number,adrc-tel_extens,
adrc-fax_number)
WHERE addrnumber EQ kna1-adrnr.
CLEAR: adr6, w_email.
SELECT SINGLE * FROM adr6 WHERE addrnumber = kna1-adrnr.
IF sy-subrc = 0.
w_email = adr6-smtp_addr.
ENDIF.
ENDIF.
ENDIF.
*to get the date format in french
IF kna1-spras NE c_eng.
w_month = sy-datum+4(2).
SELECT SINGLE ltx
FROM t247
INTO t247-ltx
WHERE spras EQ kna1-spras
AND mnr EQ w_month.
CONCATENATE sy-datum+6(2)
t247-ltx
sy-datum+0(4)
INTO w_ldate
SEPARATED BY space.
ELSE.
CONCATENATE sy-datum+4(2)
sy-datum+6(2)
sy-datum+0(4)
INTO w_ldate
SEPARATED BY c_sep.
ENDIF.
w_total = vbep-wmeng - vbep-bmeng.
IF w_total GT 0.
PERFORM fill_orders.
ELSE.
IF vbap-abgru NE space.
w_total = vbep-wmeng.
PERFORM fill_orders.
ENDIF.
ENDIF.
CLEAR vbap.
endif. " check for w_exist for Managed Codes entry
ENDSELECT.
IF tbl_ord[] IS INITIAL.
retcode = 1.
syst-msgid = 'FZ'.
syst-msgno = '027'.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
IF f_csr_found IS INITIAL.
syst-msgid = '8B'.
syst-msgno = '127'.
syst-msgty = 'W'.
syst-msgv1 = c_parvw_csr.
PERFORM protocol_update.
ENDIF.
IF f_shipto_found IS INITIAL.
syst-msgid = '8B'.
syst-msgno = '127'.
syst-msgty = 'W'.
syst-msgv1 = c_parvw_shipto.
PERFORM protocol_update.
ENDIF.
ENDFORM. " get_orders
*& Form layout
text
--> p1 text
<-- p2 text
FORM layout.
SORT tbl_ord BY bstnk kdmat.
LOOP AT tbl_ord.
AT FIRST.
PERFORM writeform_text.
ENDAT.
PERFORM writeform.
AT LAST.
PERFORM writeform_footer.
ENDAT.
ENDLOOP.
CLEAR : cnt_1,cnt_2.
PERFORM closeform.
ENDFORM. " layout
*& Form openform
text
FORM openform USING us_screen us_country.
DESCRIBE TABLE tbl_ord LINES w_lines.
IF w_lines EQ 0.
retcode = '1'.
syst-msgid = 'FE'.
syst-msgno = '078'.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
CHECK retcode EQ 0.
INCLUDE zrvadopfo.
ENDFORM. " openform
*& Form send_email
text
-->P_PROC_SCREEN text
FORM send_email USING PROC_SCREEN.
f_mail = 'X'.
PERFORM openform USING proc_screen vbak-landtx.
LOOP AT tbl_ord.
AT FIRST.
PERFORM writeform_text.
ENDAT.
PERFORM writeform.
AT LAST.
PERFORM writeform_footer.
ENDAT.
ENDLOOP.
CLEAR cnt_2.
PERFORM closeform.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF' "'ASCII'
IMPORTING
bin_filesize = st_doc_data-doc_size
TABLES
otf = tbl_otf
lines = tbl_line
EXCEPTIONS "DEVK912166
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'OA'. "DEVK912166
syst-msgno = '186'. "DEVK912166
syst-msgty = 'E'. "DEVK912166
PERFORM protocol_update.
ENDIF.
REFRESH tbl_objtxt.
CLEAR tbl_objtxt.
CLEAR tbl_proc_para.
REFRESH tbl_proc_para.
CLEAR tbl_maillist.
REFRESH tbl_maillist.
CLEAR tbl_pack_list.
REFRESH tbl_pack_list.
st_doc_data-obj_name = 'Sales Order Cut Letter'.
st_doc_data-obj_langu = 'E'. "DEVK905849
st_doc_data-sensitivty = 'F'. "DEVK905849
st_doc_data-obj_prio = 1. "DEVK905849
CONCATENATE w_type 'Cut Letter' INTO "#EC NOTEXT
st_doc_data-obj_descr SEPARATED BY space.
DATA w_line(3) TYPE c.
PERFORM format_pdf. "DEVK905849
concatenate VBAK-VBELN '.PDF' into tbl_objhead.
tbl_objhead = 'Sales Order Cut Letter.PDF'.
APPEND tbl_objhead.
"DEVK905849
CLEAR wrk_lines.
DESCRIBE TABLE tbl_attach LINES wrk_lines.
fields needed for email
tbl_maillist-com_type = 'INT'.
tbl_maillist-receiver = w_email.
tbl_maillist-rec_type = 'U'.
APPEND tbl_maillist.
send email
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
STARTING NEW TASK 'MAIL'
EXPORTING
document_data = st_doc_data
document_type = 'PDF'
COMMIT_WORK = 'X' " added after ECC6.0 upgrade
TABLES
object_header = tbl_objhead
object_content = tbl_objtxt
receivers = tbl_maillist
EXCEPTIONS "DEVK912166
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'ZA_G'. "DEVK912166
syst-msgno = '922'. "DEVK912166
syst-msgty = 'E'. "DEVK912166
syst-msgv1 = sy-subrc. "DEVK912166
syst-msgv2 = tbl_smtp-adsmtp-smtp_addr. "DEVK912166
PERFORM protocol_update.
syst-msgid = 'VW'.
syst-msgno = '001'.
syst-msgty = 'E'.
syst-msgv1 = 'Print successful:email Recepient Invalid'."#EC NOTEXT
PERFORM protocol_update.
ENDIF.
ENDFORM. " send_email
*& Form fill_orders
text
--> p1 text
<-- p2 text
FORM fill_orders.
tbl_ord-bstnk = vbak-bstnk.
tbl_ord-kdmat = vbap-kdmat.
tbl_ord-xblnr = vbak-vbeln.
tbl_ord-ean11 = vbap-pmatn.
tbl_ord-arktx = vbap-arktx.
tbl_ord-csrno = w_csrno .
tbl_ord-csremail = w_email.
tbl_ord-spras = kna1-spras .
tbl_ord-csrphone = adrc-tel_number.
tbl_ord-csrfax = adrc-fax_number.
tbl_ord-csrext = adrc-tel_extens.
tbl_ord-total = w_total.
tbl_ord-custname = w_custname.
tbl_ord-csrname = w_csrname .
tbl_ord-ldate = w_ldate.
APPEND tbl_ord.
CLEAR tbl_ord.
CLEAR w_total.
CLEAR w_ldate.
ENDFORM. " fill_orders
*& Form writeform_text
text
--> p1 text
<-- p2 text
FORM writeform_text.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'WTEXT'
window = 'WINDOW2'
EXCEPTIONS
element = 1
window = 2.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'EBR'.
syst-msgno = '056'.
syst-msgty = 'E'.
syst-msgv1 = 'WTEXT'.
syst-msgv2 = 'WINDOW2'.
PERFORM protocol_update.
ENDIF.
ENDFORM. " writeform_text
*& Form writeform
text
--> p1 text
<-- p2 text
FORM writeform.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'EMAIN'
window = 'MAIN'
EXCEPTIONS
element = 1
window = 2.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'EBR'.
syst-msgno = '056'.
syst-msgty = 'E'.
syst-msgv1 = 'WTEXT'.
syst-msgv2 = 'WINDOW2'.
PERFORM protocol_update.
ENDIF.
ENDFORM. " writeform
*& Form writeform_footer
text
--> p1 text
<-- p2 text
FORM writeform_footer.
IF nast-spras = 'N'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'FOOTER'
window = 'MAIN'
EXCEPTIONS
element = 1
window = 2.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'WFOOTER'
window = 'WINDOW12'
EXCEPTIONS
element = 1
window = 2.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'EBR'.
syst-msgno = '056'.
syst-msgty = 'E'.
syst-msgv1 = 'WFOOTER'.
syst-msgv2 = 'WINDOW12'.
PERFORM protocol_update.
ENDIF.
ENDFORM. " writeform_footer
*& Form closeform
text
--> p1 text
<-- p2 text
FORM closeform.
CALL FUNCTION 'CLOSE_FORM'
TABLES
otfdata = tbl_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
OTHERS = 3.
IF sy-subrc NE 0.
retcode = sy-subrc.
syst-msgid = 'PS'.
syst-msgno = '005'.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
ENDFORM. " closeform
*& Form format_pdf
text
--> p1 text
<-- p2 text
FORM format_pdf.
FIELD-SYMBOLS <fs>.
DESCRIBE TABLE tbl_line LINES hltlines.
DESCRIBE FIELD tbl_line LENGTH fle1 IN BYTE MODE . Defect#1579-
DESCRIBE FIELD tbl_objtxt LENGTH fle2 IN BYTE MODE . Defect#1579-
Start of Defect#1579+
DESCRIBE FIELD tbl_line LENGTH fle1 IN CHARACTER MODE.
DESCRIBE FIELD tbl_objtxt LENGTH fle2 IN CHARACTER MODE.
End of Defect#1579+
CLEAR tbl_objtxt.
REFRESH tbl_objtxt.
LOOP AT tbl_line.
htabix = sy-tabix.
MOVE tbl_line TO hfeld+off1.
IF htabix = hltlines.
fle1 = strlen( tbl_line ).
ENDIF.
off1 = off1 + fle1.
IF off1 GE fle2.
CLEAR tbl_objtxt.
tbl_objtxt = hfeld(fle2).
APPEND tbl_objtxt.
SHIFT hfeld BY fle2 PLACES.
off1 = off1 - fle2.
ENDIF.
IF htabix = hltlines.
IF off1 GT 0.
CLEAR tbl_objtxt.
tbl_objtxt = hfeld(off1).
APPEND tbl_objtxt.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " format_pdf
ANy Suggestion or help will be appreciated!
Regards,
Kittu
Edited by: Kittu on Jun 30, 2008 12:32 PMHello Julie Waller,
Very Good evening!
Thank you very much for your response!
Sometimes...I miss the basic things and start concentarcting on typical ways to fix the issue. ....which will only make my issue critical.
Hello Sathya,
Thank you for your response!
POints are rewarded..
Have a great day ahead!
Regards,
Kittu -
Hard coded links in R12.1.1 SOLARIS 10 64 bit Rapid Install stack
Hi,
Just a heads up for anyone using the Solaris 10 64 bit Rapid Install.
I am doing a 11.5.10.2 > 12.1.1 upgrade on Solaris 10 64-bit.
On my Rapid Install delivered R12.1.1 tech stack there are some hard coded links to Oracle test server files in the 10.1.2 and 10.1.3 lib32 directories. Which is not a good thing - it stops little things like adpatch working!
e.g.
$ cd $ORACLE_HOME/lib32
$ ls -l ldflags
$ lrwxrwxrwx 1 appdugc dba 56 Feb 4 16:21 ldflags -> */d4/R12/ab/apps/R1211XB9/*apps/tech_st/10.1.2/lib/ldflags
This leads to libclntsh.so not being generated and errors like this when running adpatch:
ld.so.1: adpatch: fatal: /*/*/*/apps/tech_st/10.1.2/lib/libclntsh.so.10.1: wrong ELF class: ELFCLASS64
Killed
The fix is to recreate the soft links to point to the correct local mount points/paths
How on earth did that slip through?
I raised an SR on this issue and got no where at all. I only got to the bottom of it when I noticed the /d4/R12 path and googled that. I then found Vikram's article at http://oracleappstechnology.blogspot.com/2009/09/r1211-apache-wont-start.html and realised that it was the cause of my problems too.
Edited by: user6675174 on 16-Feb-2010 00:45Hello All,
I faced the same situation. This is what I did to fix the issue on all the Tiers that has the Applications Tech Stack.
cd "applications install base"
find ./inst ./apps -type l -exec ls -l {} \; | grep d4
Set your applications environment appropriately using APPS<instance>_<host>.env under the APPL_TOP
cd $ORACLE_HOME
/bin/rm ./bin/lbuilder
/bin/rm ./bin/webcachectl
/bin/rm ./lib32/ldflags
/bin/rm ./lib32/libocci.so
/bin/rm ./lib/libnavhoa.a
/bin/rm ./lib/hsdb_inf.so
/bin/rm ./lib/hsdb_odbc.so
/bin/rm ./lib/hsdb_oing.so
/bin/rm ./lib/hsdb_ora.so
/bin/rm ./lib/hsdb_syb.so
/bin/rm ./webcache/lib32
/bin/rm ./webcache/examples/readme.examples.html
/bin/rm ./sysman/webapps/emd/WEB-INF/lib/log4j-core.jar
ln -s $ORACLE_HOME/nls/lbuilder/lbuilder $ORACLE_HOME/bin/lbuilder
ln -s $ORACLE_HOME/webcache/bin/webcachectl $ORACLE_HOME/bin/webcachectl
ln -s $ORACLE_HOME/lib/ldflags $ORACLE_HOME/lib32/ldflags
ln -s $ORACLE_HOME/lib32/libocci.so.10.1 $ORACLE_HOME/lib32/libocci.so
ln -s $ORACLE_HOME/lib32/libnavhoa.a $ORACLE_HOME/lib/libnavhoa.a
ln -s $ORACLE_HOME/lib32/hsdb_inf.so $ORACLE_HOME/lib/hsdb_inf.so
ln -s $ORACLE_HOME/lib32/hsdb_odbc.so $ORACLE_HOME/lib/hsdb_odbc.so
ln -s $ORACLE_HOME/lib32/hsdb_oing.so $ORACLE_HOME/lib/hsdb_oing.so
ln -s $ORACLE_HOME/lib32/hsdb_ora.so $ORACLE_HOME/lib/hsdb_ora.so
ln -s $ORACLE_HOME/lib32/hsdb_syb.so $ORACLE_HOME/lib/hsdb_syb.so
ln -s $ORACLE_HOME/webcache/lib $ORACLE_HOME/webcache/lib32
ln -s $ORACLE_HOME/webcache/docs/readme.examples.html $ORACLE_HOME/webcache/examples/readme.examples.html
ln -s $ORACLE_HOME/sysman/jlib/log4j-core.jar $ORACLE_HOME/sysman/webapps/emd/WEB-INF/lib/log4j-core.jar
cd $ORACLE_HOME/bin
./genclntsh -32
Thanks,
Sushil Motwani -
Permissions Issue, Colour Wheel, Hard Drive Issue??
Hi!
I have had issues with my mid 2009 MBP recently and I'm wondering what the best way to fix them would be.
First off, I have some major permissions issues with my accounts. I am using 3 different users regualrly on the same machine and needed to access files from the home folder so I changed them a long time ago, and am not sure how to fix that. I have repaired the permissions countless times in the disk utility and it seems like there's always loads more to do each time. When I varify the disk, it says its all okay.
Secondly, I have had the machine freeze on me several times while doing very little on it. This happened awhile ago, and thought that it was just the permisions thing and so I did that again, and it started working better, for awhile. It would go a few days or weeks before doing the same thing, sometimes not even getting past the apple logo on startup before freezing. This makes me think it may be a hard drive issue???????
This morning, I tried dozens of times to boot, with no success at all..... until about the 25th time when it miraculasly booted. I have run permissions repair a few more times and it seems to be working okay at the moment, but the problem seems to be happening more often over time.
To complicate matters, I am traveling at the moment and will not be home for several months. I purchased an external harddrive last night and was able to successfully back up my data.
Question 1: Is it the permissions that are causing these problems, or is it related to something else. The computer seems to work fine when its working, and then once in awhile, decides its not going to do anything.
Question 2: Would upgrading to Lion (currently running 10.6.8) fix the permissions issues or just carry them forward? I would like to consolidate the 3 users into one, if that would solve it. Does the migration utility preserve permissions or does it give you a brand new start?
Question 3: If neither solving the permissions or the OS upgrade would fix the problem and it does need a new harddrive, is it possible to buy one and install it myself? I do not have apple care left on this machine and am on a very tight budget. I am used to taking things apart and all that as part of my job and it seems simple enough. Where can you buy a replacement??
Hopefully someone out there will be able to help me out on this one.
Cheers!!!!
Brianbgroot422 wrote:
First off, I have some major permissions issues with my accounts. I am using 3 different users regularly on the same machine and needed to access files from the home folder so I changed them a long time ago, and am not sure how to fix that. I have repaired the permissions countless times in the disk utility and it seems like there's always loads more to do each time. When I verify the disk, it says its all okay.
Disk Utility permissions are separate from User account permissions.
This link is how to fix them
https://discussions.apple.com/thread/2181549?start=0&tstart=0
Disk Utility will always show something to be needing repair, but that's ok
Apple supoort doc.
https://support.apple.com/kb/TS1448?locale=da_DK
Verify Disk is good, that's a good thing.
To complicate matters, I am traveling at the moment and will not be home for several months. I purchased an external hard drive last night and was able to successfully back up my data.
Your data is backed up, hopefully not with TimeMachine alone, but if you did, then get another drive and backup data manually to that as well. If the TM drive gets messed up, it's a pain to get your data off of it.
Question 1: Is it the permissions that are causing these problems, or is it related to something else. The computer seems to work fine when its working, and then once in awhile, decides its not going to do anything.
Well you could call Apple for replacement 10.6.x disks, and just reinstall 10.6 and bundled programs, but this can kick out kext files out of the /System/Library/Extensions folder installed by some third party software.
This method fixes OS X, but doesn't touch your files or most programs.
Nor will this method fix your Users accounts if the issue is in there.
A creation of a new user, then deletion of the others, return files from backup (set permissions) will fix User folder issues if the above user permissions fix doesn't work.
(Of course you could wipe the drive from the 10.6 disk, but you have to install all software again)
Would upgrading to Lion (currently running 10.6.8) fix the permissions issues or just carry them forward?
No, you don't want to install Lion, it won't fix those issues in User folders, not only that Lion has it's own issues and doesn't work with a lot of older software etc. No use clusterfscking a already bad situtation when it's seems it's only localized to the User accounts.
I would like to consolidate the 3 users into one, if that would solve it.
Yes that could very nicely and tidy up things in the process.
What you do is transfer all files to one regular powered storage hard drive.
(Don't use/disconnect the TimeMachine drive for this as it preserves the users seperated and you don't want all those users back restoring with Migration Assistant)
Create the New User on the machine as Admin, log into it and delete all the other Users, transfer all your files back from the regular storage drive, changing all the permissions to yourself before placing them into their respective folders as they will have three different permissions.
Notes:
If you have a extensive iTunes playlists on one User (say #1), then create the new user with that same name (will require some work, create User 4, delete Users 1-3, reboot, create User 1, delete User 4) then transfer your iTunes folder to Music of that User 1 (same name as before). This will preserve the pathnames of your song locations and your playlists will be preserved.
(before you ask, no you can't combine playlists)
Also if you have photo's in iPhoto Library, you have to right click on it and "show package contents" inside is a folder called Originals, copy them out and import into the iPhoto of the User #1.
Does the migration utility preserve permissions or does it give you a brand new start?
Yes it preserves user permissions, no it doesn't give you a brand new start. Only a fresh install, creation of new users and then just transferring of files does that.
Nothing about TimeMachine or Migration Assistant gives one a "fresh start", it's if hosed, so is your restore.
If you want that sort of pristine protection, you need to clone your ideal boot partition/drive using Carbon Copy Cloner (free/donationware) occasionally as a hold the option key bootable drive, then you can erase and reverse clone the pristine saved clone.
One can also update the clone on occasion, this way keeping the clone pristine.
I maintain 3 clones time dated, even have my boot drive partitioned 50/50 and auto-cloned, this way I have two boot partitions on the road and two externals at home.
I never use TimeMachine, it's not bootable (well it is on 10.7.2 only to restore though) -
i want to insert hard coded values through ADF form..
kindly help me in this
Thanks in Advance
VL NaiduThanks john and Grant..
i have another issue now..
i have created the Edit form and a table
giving partial trigger for form to table..
so wen i select the row the corresponding row values will be displayed in the Edit form.
but i want to show a Empty form on page load and after data insertion.
i tried in refresh condition .but nothing worked.
can u help me in this issue.
Thanks in Advance
VL Naidu -
IBM QMF 9.1 - How to handle hard coded .ini and .xml files
Hi All,
I've been trying to sequence ibm QMF for workstation. The app has 2 gotchas in that there seems to be 2 config files that it uses to execute an eclipse environment.
C:\Program Files (x86)\IBM\DB2 Query Management Facility\QMF for Workstation\configuration\config.ini
has a path statement which cannot be resolved
[email protected]/Application Data/IBM/QMF for Workstation/settings
C:\Users\%USERID%\AppData\Roaming\IBM\QMF for Workstation\repositories.xml
has several path statements looking back at the program files directory (note I sequenced on an x86 machine, it doesn't work on x86 either)
<location id="1517929232917419009" url="C:\Program Files\IBM\DB2 Query Management Facility">
<property name="base-dir" value="C:\Program Files\IBM\DB2 Query Management Facility"/>
I can make the app work by copying in the directories to the PC and then editing the config files and changing the paths to something inside the app-v package.
What methods do folks use to get around this???With hard-coded paths like that, you need to sequence on the same 'bitness' as the client.
If the app is trying to read or write to that location under program files, then it should be redirected to the virtualised paths.
VFS issues can happen if:
The exe queries Windows to ask where it is running from, gets the virtual location, and finds an unexptected mismatch to the location expected in the config file.
The application uses WMI (or some other external service) to query if the folder exists, which then cannot find the folder.
You sequenced to the PVAD, as a result the folder is hidden in the virtual file system, and the app cannot see the install folder.
If you sequenced to the PVAD, I would try again setting a dummy PVAD location - or just sequence it with SP3.
If that does not help, does just creating those empty directories in the real file system do the trick?
If none of the above help, then creating a symbolic link under program files pointing to the virtual location may work.
Dan Gough - UK App-V MVP
Blog: packageology.com
Twitter: @packageologist
LinkedIn -
Is is possible to avoid hard-coding the Item in a shared Select List Query?
I created a "Select List" in the Shared Components area as follows:
My goal is to create a shared select list that can be used on any form for a particular Field.
IF :P10_FK_RSTA_CODE is NULL THEN
RETURN
'select col_description, col_code_pk
from CODE_TABLE
where col_active_ind = ''Y''';
ELSE
RETURN
'select col_description, col_code_pk
from CODE_TABLE
where col_code_pk = :P10_FK_RSTA_CODE';
END IF
Which works great, but how can I make the select list work for the same column on a different form?
Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
(I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?
Also, I am very new at this, so if there is a better way to do this, I would greatly appreciate any input.
Thanks in advance.
MF>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "956902".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I created a "Select List" in the Shared Components area as follows:
My goal is to create a shared select list that can be used on any form for a particular Field.
IF :P10_FK_RSTA_CODE is NULL THEN
RETURN
'select col_description, col_code_pk
from CODE_TABLE
where col_active_ind = ''Y''';
ELSE
RETURN
'select col_description, col_code_pk
from CODE_TABLE
where col_code_pk = :P10_FK_RSTA_CODE';
END IF
Which works great, but how can I make the select list work for the same column on a different form?
Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
(I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?Reference the value of an application item rather than a page item in the LOV query, setting the value using a process or computation on each form page. -
Not viewing links/coding issue
I used iweb08 to design a website. It always displayed fine in any web browser (ie safari or explorer etc) and a Mac or a PC could view it. When I upgraded to iweb09 only PCs seem to be able to view the links on top of the home page and Macs cannot view the links on the homepage and therefore can't move around the site.
I contacted the domain company (Hostess) and they gave me the following advice:
"The problem you are having is a coding issue. You'll have to either consult the makers of the program (Apple iLife'09) or a web developer to find the best way to resolve this issue. Different browsers (Internet Explorer, Firefox, Safari) use different methods of displaying content and depending how the content is coded, you can run into problems like this where it shows up in one browser but not another."
This would make sense to me if the PC couldn't see the links, but I don't understand why a Mac cannot view a page made on iweb and browsing in safari!
If anyone has any advice I would be more than grateful.After talking to www.hostess.com.au again the problem was suddenly fixed, although they still claimed it was a "coding issue".
-
I'm about to upgrade my hard drive to a larger one and will need to reinstall my CS6 Web/Design Suite... I've seen many people having issues with activation and licensing after they reformat their computers or buy a new one and try to install the programs on the new "system". How should I go about preparing my Adobe software on the current hard drive so I won't have any issues resintalling on the new hard drive? I will be installing CS6 Student/Teacher version on Windows 7 Pro 64-bit...
Thanks for the help!Thanks!
I wondered if that was all I needed, but when I built my new system and installed PS CS4 I kept getting errors. So, I went back to the old system and deactivated it and still got errors. Uninstalled it deactivated and still got errors on the new system. When I talked to Adobe they just kept telling me the key was invalid (even though I had been running that same program and key for the last 4 years without problems lol) and it was not a burnt copy or pirated. I had the orginal box with the original DVD case and serial number on the case... A friend of mine had upgraded their rig and went to a Suite so he gave me his CS4. But, needless to say (as it is said all over these forums apparently) Adobe was of no help at all so I had to buy a new version. I'm not looking to go through all of that BS again, haha.
So as long as I deactivate the Suite (or do I need to deactivate each program separately?) I should be able to reformat (or upgrade hard drives) and reinstall CS6 as many times as I want? (I usually do a reformat like once a year to keep my computers clean and free of junk that may have been downloaded by other household members...) -
Preventing the hard-coding of an annotation
Hello,
I have an JPA entity which is as follows:
@Table(name = "mySchema.Customer" )I would like for "mySchema" to be located somewhere else and avoid the hard-coded variable. Can it be a constant located somewhere else? Can it be retrieved from a web context param? How do I move it somewhere else bearing in mind it is not located "within" the class and let alone within a method?
Do you see my problem? Any solution?
Julien.Thank You I will try using the software install cd's that came with the emac to see if I can then follow the steps you outlined for me to erase the harddrive. I do not have anything that is titled just as an install CD.
I appreciate your help. I wanted to donate it or give this emac to my grandson to see his nursery rhymes on you tube like he does on my Imac but to no avail. Safari just quits and I keep getting message to upgrade the browser and I find out now there is no way to upgrade anything on this machine. The emac is only six years old but I am 69 years old and very behind the times with technology.Thank You again....Donna -
Note 1572302 - Hard-coded credentials in ABAP DDIC
Hello,
Have you read [Note 1572302 - Hard-coded credentials in ABAP DDIC|https://service.sap.com/sap/support/notes/1572302] ?
I had a good laugh when I read it. Before implementing the note or the corresponding SP, you'd better check the usernames in your production system !
I know 14 SAP employees that must have get some good congratulations !
I am also a little afraid by the lack of source code reviewing before distribution to customers....
Regards,
OlivierJulius Bussche wrote:
From my experiences SAP are also very responsive to reporting such issues, though 1st level support on SMP might initially tell you that the solution is not to use it...
Well, if you have found a security issue and face difficulties to address it properly, kindly do not hesitate to [report it via mail (PGP encrypted) to SAP|/docs/DOC-8218#section36 [original link is broken]]. -
SAP HR to E-Recruiting ALE for Qualifications - Dates Hard-Coded
The issue encountered occurs while using ALE to distribute Internal Candidate Qualifications from our SAP HR system to E-Recruiting (separate system/instance). The Qualifications which are stored in SAP HR (infotype HRP1001 or PA0024) looks nothing like what is being stored in E-Recruiting (infotype HRP5105) after distributation due to the fact that start and end dates are being hard-coded as 19000101 and 99991231. Given an internal candidate's proficiency in a qualification is changed, we don't know when it has changed. The time sequence is not being identified due to the fact that method CL_HRRCF_CANDIDATE_INFOTYPE_BL->MAINTAIN_CAND_QUALIFICATION is hard-coding 19000101 and 99991231 for the low and high dates. The standard class/method used for ALE inbound is
CL_HRRCF_EMPLOYEE_INBOUND->HRRCF_CAND_FROM_EE_ALE. As can be seen on line 558 we are always inserting qualications, no matter what time constraint the infotype is configured for. From our perspective this is unacceptable from a client perspective, since we cannot search for internal candidates effectively as a result since we do not know which proficiency they currently hold. We would like to generate interest in this since we need a "majority rule" to have SAP change the code.
Let me know if you need more detail to understand the issue.
Thanks in advance,
MattThanks Roman
I followed your suggestion, i run a hiring action directly on the e-recruiting server and the system created the CP object. Is the first time I synchronize data between ECC and e-recruiting.
These are the steps that I did:
1.- I use the t.code PFAL and distributed the object type O with the evaluation path O-O-S.
2.- Then i do the same with the object type P but without evaluation path.
The Message Type by default is HRMD_ABA as our distribution model use it with the following setting:
Filter group:
Infotype--> 0000,0001,0002,0003,0006,0105,1000,1001,1007,1008,1013,1025,1028 and 1033
Type of related object--> C, CP, O, Q, QK, S
Object Type--> C, O, P, S
In the e-recruiting system when distributed the object type P, the following warning message appears: "Relationship starting from 01P 10000039 impossible - 01CP50008123 does not exist/is not active". However in the ECC system the object P 10000039 is related with CP 50008123.
I would understand, how both system should be in the number range for personnel planning in the subgroup "01CP"
There are some basic configuration that I must do?
Thanks a lot for your help -
Adobe Bridge CS6, Output to HTML Gallery coding issue.
Adobe Bridge CS6, Output to HTML Gallery coding issue.
I have created the html, JavaScript, css file using the output function in Bridge CS6, which nicely generates the coding, pages, folders and files. I can edit the html files such as gallery title, name, etc., in Dreamweaver CS6 just fine and preview them in a selected browser (both chrome and IE) and everything works fine.
When I ftp upload the files and directories into my hosting account (Go Daddy), the images do not show up. The file table appears but the thumbs images does not appear and when selected to preview the larger image, it does not appear either. I have not altered the file structure at all. Go Daddy says it is a coding issue, but I cannot fine any errors.
Have you seen this issue before? All Adobe help research have failed. Any suggestions??Have you asked on Go Daddy site for help in uploading Adobe Bridge script? Just to say it is coding is not helpful.
-
How to get the table name in the trigger definition without hard coding.
CREATE TRIGGER db.mytablename
AFTER UPDATE,INSERT
AS
INSERT INTO table1(col1)
SELECT InsRec.col1
FROM
INSERTED Ins
--Below i am calling one sp for which i have to pass the table name
EXEC myspname 'tablename'
In the above trigger,presently i am hard coding the tablename
but is it possible to get the table name dynamically on which the trigger is defined in order to avoid hard coding the table nameI really liked your audit table concept. You inspired me to modify it so that, the entire recordset gets captured and added a couple of other fields. Wanted to share my end result.
USE [YourDB]
GO
/****** Object: Trigger [dbo].[iudt_AutoAuditChanges] Script Date: 10/18/2013 12:49:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[iudt_AutoAuditChanges]
ON [dbo].[YourTable]
AFTER INSERT,DELETE,UPDATE
AS
BEGIN
SET NOCOUNT ON;
Declare @v_AuditID bigint
IF OBJECT_ID('dbo.AutoAudit','U') IS NULL BEGIN
CREATE TABLE [dbo].[AutoAudit]
( [AuditID] bigint identity,
[AuditDate] DateTime,
[AuditUserName] varchar(128),
[TableName] varchar(128) NULL,
[OldContent] XML NULL,
[NewContent] XML NULL
ALTER TABLE dbo.AutoAudit ADD CONSTRAINT
PK_AutoAudit PRIMARY KEY CLUSTERED
[AuditID]
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
CREATE NONCLUSTERED INDEX [idx_AutoAudit_TableName_AuditDate] ON [dbo].[AutoAudit]
( [TableName] ASC,
[AuditDate] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
END
Select * Into #AuditDeleted from deleted
Select * Into #AuditInserted from inserted
While (Select COUNT(*) from #AuditDeleted) > 0 OR (Select COUNT(*) from #AuditInserted) > 0
Begin
INSERT INTO [dbo].[AutoAudit]
( [AuditDate], [AuditUserName], [TableName], [OldContent], [NewContent])
SELECT
GETDATE(),
SUSER_NAME(),
[TableName]=object_name([parent_obj]),
[OldContent]=CAST((SELECT TOP 1 * FROM #AuditDeleted D FOR XML RAW) AS XML),
[NewContent]=CAST((SELECT TOP 1 * FROM #AuditInserted I FOR XML RAW) AS XML)
FROM sysobjects
WHERE
[xtype] = 'tr'
and [name] = OBJECT_NAME(@@PROCID)
Set @v_AuditID = SCOPE_IDENTITY()
Delete from AutoAudit
Where AuditID = @v_AuditID
AND Convert(varchar(max),oldContent) = Convert(varchar(max),NewContent)
Delete top(1) from #AuditDeleted
Delete top(1) from #AuditInserted
End
END
Maybe you are looking for
-
How do I sign multiple fields in a pdf without saving untill the end?
I have Acrobat 9 and I am trying to put in 20-50 signature fields all to be signed by the same person in one to however many sittings. For every signature it prompts to "Save As". I work in the medical field so all our training is tied up in medica
-
Can't re download pages to macbook with lion
I recently had to replace the harddrive I installed a fresh copy of Lion and then went to the App Store to re install Pages and Numbers and got a message that they were unavailable as separate items and that they were avaioable in Mavericks; however
-
Start updates after hours then shut down
Is their a way to have updates start at a certain time and when finished shut down the computer. Reason: I teach at a college and we would like the Lab computers to due updates after the Lab is closed and then shut down on their own.
-
Hi all ! I have a question ... I have a timed loop (which run on RT target ) . I parameter this loop with 1Khz clock and 1 ms period. The aim of my program is to transmitt/send CAN frames. When i parameter my programm to send a frame every 10s, I r
-
I would like to know how to bring xml data into flash. Specifically images that someone can click on the thumbnail and view the larger image. please can anyone point me to some tutorials or sites that i can start to learn how to do this. thanks.