Help to modify MultiCurrencyTrans.LGL script
We are working on this budgeting scenario:
For the input schedules, SKUs are budgeted per Entities. Budgeted sales price per SKU could be in any currency (currencies are chosen by the end user based on agreement with the sales department). Sample data are the following:
ENTITY 1
SKU 1
USD (or any currency chosen by the end user)
ENTITY 1
SKU 2
JPY (or any currency chosen by the end user)
ENTITY 2
SKU 1
EURO (or any currency chosen by the end user)
ENTITY 2
SKU 2
SGD (or any currency chosen by the end user)
Report output should have the budgeted original currencies per SKU per Entity as well as translated currencies into EURO.
In the SAP BPC MultiCurrencyTrans.LGL script, the currency translation works for a single LC to multiple currencies. However, in the scenario above, it works the other way around, i.e. data are in multiple LCs (i.e. sales price) to be translated to a single currency (i.e. EURO).
Can you help me in modifying the LGL script to meet the requirement described above?
One other thought that's a blend of the two above and would probably do what you're looking for is:
1. I would do this as a separate application from any financial reporting applications you my have and push the LC over if needed for reporting.
2. Keep the currency translation dimension on the entity dimension with the correct currency property to identify what it's LC currency is.
3. Create the application with a standalone currency dimension (not used in other apps) that has all the members from the InputCurrency dimension in your rate application + add in LC.
4. Have users select the specifc currency that they're entering to (never LC). So they'd pick Entity1, SKU1, JPY as an input point.
5. Write a custom FXTrans process that converts from the input currency to LC based on the entity. I'd run this as part of default logic.
6. Use the standard FXTrans process then to convert from LC into your reporting currency of EURO. If this is the only reporting currency then the single currency FXTrans would work. You'd want to make sure the code ONLY goes from LC to EURO.
So, users would enter JPY which would translate back to the LC of the entity and write the value to LC. Then you'd translate from LC to EURO for reporting. In cases where the data entry is done in EURO, you'd go from EURO > LC > EURO but that shouldn't matter as long as you don't make any changes to the translation rates between the two processes. HOWEVER, you need to be certain that if you change translation rates after data entry has occured that the process to go from input currency to LC is run so the LC values are correctly calculated or you would get different results when going to your reporting currency.
Similar Messages
-
I need help to modify my AS script
I have the following script and I would like to modify it:
1.On this file I need to type the name of some video Albums in order to be displayed in the SWF file.
2. What I wanr is that this file read the specific folder and read the directories which they will be the names of the Albums
How can I do this?
One more thing is that this file was created to work with Flas CS3 and I am trying to test it with CS5.
I really appreciate the whole help I can get.
I don't know anything about AS2 nor AS3, I only know hoe to modify the files by following comments and other samples from all around the web.
Thanks and I hope someone can help me, I've been trying few thing but I just stuck. So I really need help.
// Set the path to the External Parameters file relative to the *.swf file.
// If this file cannot be found or if it contains errors, the
// Internal Parameters(the parameters below) will be used.
//var ParametersFile = "MyControls.xml";
var ParametersFile = "XML_Files/MyControls.xml";
// Set the path to the Theme file relative to the *.swf file.
// If this file cannot be found or if it contains errors, the
// Default Grey skin will be used instead.
// To learn how to edit Themes, please refer to the 'Help' folder.
// next line commented by SAMY
//var ThemeFile = "Theme.xml";
// NEXT LINE ADDED BY SAMY
var ThemeFile = "FLASH_DIR/3D_GALLERY/BlueTheme.xml";
// To learn more about how to add albums, please refer to the
// 'Help' folder. This line says that replace and modify the name of the title album and the xml file which is as shown here
var AlbumLabel_1 = "Pastor Alejandro Bullon";//<-- This is the typical line that I want to be input from the external folder name *
//var AlbumDataFile_1 = "Videos/Alejandro_B/Alejandro_Bullon.xml";
// next line for website configuration typical
//var AlbumDataFile_1 = "Media/Media.xml";
//next line works fine locally
//var AlbumDataFile_1 = "Videos/Videos_website.xml";
var AlbumDataFile_1 = "FLASH_DIR/3D_GALLERY/Videos/Alejandro_B/Alejandro_B.xml";
var AlbumLabel_2 = "Pastor Stephen Bohr";// <-- *
// next line commented by samy
var AlbumDataFile_2 = "FLASH_DIR/3D_GALLERY/Videos/Stephen_B/Stephen_Bohr.xml";
// next line added by samy for website configuration typical for all albums
//var AlbumDataFile_2 = "Videos/Videos.xml";
var AlbumLabel_3 = "Pastor Caleb Jara";
var AlbumDataFile_3 = "FLASH_DIR/3D_GALLERY/Videos/Caleb_Jara/Caleb_Jara.xml";
//var AlbumDataFile_3 = "City/City.xml";
var AlbumLabel_4 = "Pastor Doug_Batchellor";
var AlbumDataFile_4 = "FLASH_DIR/3D_GALLERY/Videos/Doug_B/Doug_Batchellor.xml";
//var AlbumDataFile_4 = "FLASH_DIR/3D_GALLERY/City/City.xml";
var AlbumLabel_5 = "Musica";
var AlbumDataFile_5 = "FLASH_DIR/3D_GALLERY/Musica/Musica.xml";
//var AlbumDataFile_5 = "Landscape/Landscape.xml";
var AlbumLabel_6 = "Powerpoint";
var AlbumDataFile_6 = "FLASH_DIR/3D_GALLERY/Powerpoint/Powerpoint.xml";
var AlbumLabel_7 = "Escuela Sabatica '10";
var AlbumDataFile_7 = "FLASH_DIR/3D_GALLERY/Escuela_Sab/Esc_Sab_2010.xml";
var AlbumLabel_8 = "Escuela Sabatica '11";
var AlbumDataFile_8 = "FLASH_DIR/3D_GALLERY/Escuela_Sab/Esc_Sab_2011.xml";
var AlbumLabel_9 = "Test Nature";
var AlbumDataFile_9 = "Nature/Nature.xml";
// Select wether to enable or disable error messages created
// due to 'file not found' , 'format not supported' or 'corrupted
// XML files' type of errors.
// Note: There error messages are automatically disabled when you
// export your *.swf file.
var EnableErrorMessages = "yes";//[Yes , No]
// Set parameters for items.
var ItemWidth = 170;
var ItemHeight= 130;
var ShowItemNumber = "yes";
//var ShowItemNumber = "no";
// Select fitting technique , stretch the thumb picture to fit the item
// or crop it from the top left.
var ThumbFittingMethod = "stretch";
// Select what to do when the file preview is clicked, either to enlarge
// the preview or navigate to the URL provided for the current item in
// the XML data file of the current album
var WhenPreviewIsClicked = "Enlarge";//[Enlarge , GetUrl]
// Select the window target, '_blank' to open a new window or '_self' to
// navigate to the URL in the same window
var WindowTarget = "_blank";
// Select wether to show the information of the item or not
var ShowItemInfo = "yes";
// Select wether to show the albums menu or not
var ShowAlbumsMenu = "yes";
// Select wether to show the video controller or not
var ShowVideoController = "yes";
// Select wether to show the autoplay option or not
//var ShowAutoplayButton="no";
var ShowAutoplayButton="yes";
// Set the delay time for autoplay, this will be used for pictures only
var AutoplayDelayTime = 5;
// Set the spinning speed of a single wheel
//var WheelSpinningSpeed = 5;
var WheelSpinningSpeed = 2;
// Select direction of scrolling of pages
var DefaultDirection = "LeftToRight";
// Select wether you want to disable one of the wheels
var DisableWheel = "none";
// Set the maximum number of items to be loaded on a single wheel
var MaximumLoadOnEachWheel = 10;
// Select how you want the wheel to interact with the mouse
// Refer to the 'Help' folder for more information.
var ScrollingStyle = "2";
// Select wether to enable tool tips or not.
var EnableToolTips = "yes";
// Set the delay time for the tool tips to appear
var ToolTipsDelayTime = 1;
// This is like a shortcut, set this parameter to 'Name' to display
// the name of the item as a tool tip.......
var ToolTipsContent = "tooltips";//[ToolTips , Name , FileType]
// Select wether to enable or disable visual effects.
var EnableDepthOfField = "yes";
var EnableMotionBlur = "yes";
Message was edited by: samy4moviesThis is a web-based app. And the application is for a carrousel video gallery.
I already figure out the auto XML generator with php, but I think I want to get all in one process. Meaning that I only want to upload my videos and run php codes by themselves and not to worry in adding or modifying the *.fla file everytime that I insert a new folder ("Album").
This is the link for the project I am working
http://anaheimspanish.net/index.php?option=com_content&view=article&id=98&Itemid=124
It's called 3D Video Gallery, I bought the component through a website for flash components, but their support is not very good, that's why I want to fix as much as I need.
Thanks in advance for your help
If you need a full zip project to test it, let me know. -
How to modify the standard script in scripts?
how to modify the standard script in scripts?
Nagaraju,
Standard scripts cant be modified.
Only thing is you need to copy it to z-form and have to do modifications as per ur requirements.
Here is the procedure to copy standard form to z-form.
goto SE71 t-code, then select the menu path : <b>Utilities -> Copy from Client</b>
then it will take to another screen, give the form name as Standard form name, if u r copying a stadard invoice means, type RVINVOICE01 and target form, ZRVINVOICE01. Now press execute button, it will copy the form into 25 languages. Now come back to se71, enter Z-form name and do the required changes.
Hope this hint may help you, Pls close the thread if u met with correct answer.
Regards,
Sujatha. -
Need help in writinf a stop script for a production server
can somebody help me with a stop script which stops a jrun
production server.
jrun -stop production
this command should work but how do i use this in a script .
ThanksHi,
I highly recommend that you skip VBScript and learn PowerShell instead. This is pretty trivial in PowerShell:
If ($env:COMPUTERNAME.Length -le 15) {
# Do stuff
# HINT: Look into Start-Service
Write-Host "Under limit: $env:COMPUTERNAME"
} Else {
# Do optional stuff
Write-Host "Over limit: $env:COMPUTERNAME"
(OT: jrv - happy? =])
If you must stick with VBScript for some odd reason, here's an example to get you started:
Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName
If Len(strComputerName) <= 15 Then
'Do stuff here when the name is short enough
WScript.Echo "Under limit: " & strComputerName
Else
'Do stuff here when the name is too long (only if you want to)
WScript.Echo "Over limit: " & strComputerName
End If
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/services/
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
Need help to modify a report written using Field-Groups Concept. - Part1
Hello ABAP Experts,
I need your help to modify the following report with following requirement as I have least knowledge
about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our
production requirement. I really appreciate your help, If its sent modifying the code required.
Modification required in the report.
To allow the sales representatives to see billed shipments and open orders for the current month.
1) Selection Screen Changes:
u2022 Add selection by Sales group and Customer group
u2022 Add sort by: 3. Ship-to / Material
u2022 Add another selection box
[ ] Open Orders and Shipments with the current month
2) For the new selection box, subtotal sales quantity and delivery quantity.
If delivered, make the sales quantity zero in the subtotal
Current report displays, in Selection Screen
Sales org:
Person Name:
Material:
Plant:
Sales Office:
Ship to Name:
Ship to Number:
Sorts Report by : 1. Person Name 2. Material
Check Boxes : 1. Open Orders 2. Delayed Orders.
report zorder LINE-SIZE 170
LINE-COUNT 58
MESSAGE-ID zv
NO STANDARD PAGE HEADING.
TABLES:
cdhdr, "Change Doc Header
cdpos, "Change Doc Item
kna1, "Customer master
likp, "Delivery Header
lips, "Delivery Item
*lips, "Delivery Item
zvbpa_lfa1, "Vendor Master
makt, "Material Desc
t001w, "Plant
tvkbt, "Sales Office
tvko, "Sales Organizations
vbak, "Sales Header
vbap, "Sales Item
zvvbak, "Sales Hdr - Time calc
vbup, "Item status
vbep, "Sales Schedule Line
vbfa, "Flow documents
vbpa, "Partners
vbrk, "Billing Header
vbrp. "Billing Item
SELECT-OPTIONS:
s_vkorg FOR vbak-vkorg OBLIGATORY,
s_ernam FOR vbak-ernam,
s_matnr FOR vbap-matnr,
s_werks FOR vbap-werks,
s_vkbur FOR vbak-vkbur,
s_name1 FOR kna1-name1,
s_kunnr FOR kna1-kunnr.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(49) text-c20.
PARAMETERS: p_sort TYPE n DEFAULT '1'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 19(40) text-022.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 19(40) text-023.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 19(40) text-024.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN COMMENT 19(40) text-070.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:p_open AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(48) text-072.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:p_delay AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(48) text-073.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b20.
DATA:
vbeln(11), "Document number
cancel_dt TYPE d, "Cancellation Date
BEGIN OF tabkey, "Tabkey
mandant LIKE sy-mandt,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
END OF tabkey,
name1_sp1 LIKE lfa1-name1, "Sales Carrier Name
name1_sp2 LIKE lfa1-name1, "Delivery Carrier Name
datum-1 TYPE d, "Current Dt Less 1
datum-14 TYPE d, "Current Dt Less 14
datum-90 TYPE d, "Current Dt Less 90
rpt_hdr1(170), "Report Header 1
rpt_hdr2(170), "Report Header 2
rpt_hdr3(170), "Report Header 3
cb_hdr1(170), "Control Break Header 1
line_pos1 TYPE i, "Line Print Position HDR1
line_pos2 TYPE i, "Line Print Position HDR2
line_pos3 TYPE i, "Line Print Position DET2
status, "Order Status
open, "Open Order
delayed VALUE 'D', "Delayed Order
v_comp(30). "Company Text Field
DATA: v_flagh2. " Flag for header 2 & 3
DATA: ls_comwa LIKE vbco6. "Structure for flow information
DATA: t_vbfa_tab TYPE STANDARD TABLE OF vbfa WITH HEADER LINE."Itab
for flow information
data: g_trans_id type vttk-tdlnr. "get transport id from flow
information
data v_sales_org_cpimex type vkorg value '3300'.
FIELD-GROUPS:
header,
order.
INSERT
status "Status
vbak-vkbur "Sales Office
vbak-ernam "Created By
kna1-kunnr "Customer
kna1-name1 "Customer Name
vbap-matnr "Material
vbap-werks "Plant
vbep-lddat "Load Dt
vbap-vbeln "Sales Document
INTO header.
INSERT
kna1-ort01 "City
kna1-regio "Region
likp-traid "Transport ID
lips-vbeln "Delivery Document
lips-ntgew "Net Wt
lips-gewei "Unit of Weight
vbap-kwmeng "Order Qty
vbap-vrkme "Sales Unit
vbak-bstnk "Customer PO
vbak-erdat "Sales Create Dt
vbak-ihrez "PO Release
vbak-vdatu "Req Delivery Dt
vbak-vzeit "Req Delivery Time
vbfa-vbeln "Goods issue doc
vbrk-vbeln "Billing Document
name1_sp1 "Sales Carrier
name1_sp2 "Delivery Carrier
INTO order.
INITIALIZATION.
AT SELECTION-SCREEN.
IF NOT p_sort BETWEEN 1 AND 2.
MESSAGE e022 WITH p_sort.
ENDIF.
* Report 1 or more of cancelled, delayed or open
IF p_open IS INITIAL AND
p_delay IS INITIAL.
MESSAGE e023.
ENDIF.
START-OF-SELECTION.
* Load Company Name
WRITE 'XYZ INC'(000) TO v_comp.
* Calculate Date Range
datum-1 = sy-datum - 1.
datum-14 = sy-datum - 14.
datum-90 = sy-datum - 90.
* Compose Parameter Header
PERFORM parm_hdr.
** Compose Report Header
v_flagh2 = 1.
PERFORM data_selection.
END-OF-SELECTION.
* Determine Sort
CASE p_sort.
WHEN 1.
SORT BY status vbak-ernam kna1-name1 kna1-kunnr
vbep-lddat vbap-vbeln.
WHEN 2.
SORT BY status vbap-matnr vbap-werks vbep-lddat
vbap-vbeln.
ENDCASE.
LOOP.
AT NEW status.
CASE status.
WHEN delayed.
WRITE 'Delayed Orders'(061) TO rpt_hdr1.
WHEN OTHERS.
WRITE 'Open Orders'(062) TO rpt_hdr1.
ENDCASE.
NEW-PAGE.
ENDAT.
AT NEW vbak-ernam.
IF p_sort = 1.
CLEAR cb_hdr1.
WRITE 'CAA:'(064) TO cb_hdr1.
WRITE vbak-ernam TO cb_hdr1+5.
NEW-PAGE.
ENDIF.
ENDAT.
AT NEW vbap-matnr.
IF p_sort = 2.
CLEAR makt.
SELECT SINGLE * FROM makt
WHERE spras = sy-langu AND
matnr = vbap-matnr.
CLEAR cb_hdr1.
WRITE 'Material:'(042) TO cb_hdr1.
WRITE vbap-matnr TO cb_hdr1+10.
WRITE makt-maktx TO cb_hdr1+21.
NEW-PAGE.
ENDIF.
ENDAT.
AT NEW vbap-werks.
AT order.
RESERVE 3 LINES.
SKIP 1.
NEW-LINE.
* Indicate new open item
WRITE vbap-vbeln TO vbeln.
* Find Transport ID
* Fill the structure LS_COMWA
ls_comwa-mandt = sy-mandt.
ls_comwa-vbeln = vbap-vbeln.
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
comwa = ls_comwa
TABLES
vbfa_tab = t_vbfa_tab.
IF sy-subrc EQ 0.
READ TABLE t_vbfa_tab WITH KEY vbtyp_n = '8'.
IF sy-subrc EQ 0.
SELECT SINGLE tdlnr INTO g_trans_id
FROM vttk WHERE tknum = t_vbfa_tab-vbeln.
CONDENSE g_trans_id.
ENDIF.
ENDIF.
IF vbak-erdat >= datum-1.
vbeln+10 = 'N'.
ENDIF.
CASE p_sort.
WHEN 1.
WRITE 1 vbak-vkbur.
WRITE 8 kna1-name1.
WRITE 44 vbeln.
WRITE 56 vbap-matnr.
WRITE:
75 vbap-kwmeng LEFT-JUSTIFIED,
vbap-vrkme,
100 vbak-bstnk,
vbak-ihrez,
134 vbak-vdatu,
vbak-vzeit,
154 vbep-lddat.
WRITE 166 vbap-werks.
NEW-LINE.
WRITE:
5 kna1-ort01,
41 kna1-regio.
IF name1_sp2 IS INITIAL.
WRITE:
45 name1_sp1,
ELSE.
WRITE 45 name1_sp2.
IF name1_sp1 = name1_sp2.
WRITE ' '.
ELSE.
WRITE '*'.
ENDIF.
ENDIF.
IF vbak-vkorg = v_sales_org_cpimex .
WRITE 81 g_trans_id.
ELSE.
WRITE 81 likp-traid.
ENDIF.
WRITE:
102 lips-vbeln,
115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
lips-gewei,
140 vbfa-vbeln,
152 vbrk-vbeln.
WHEN 2.
WRITE 1 vbak-ernam.
WRITE 14 vbak-vkbur.
WRITE 21 kna1-name1.
WRITE 57 vbeln.
WRITE:
69 vbap-kwmeng LEFT-JUSTIFIED,
vbap-vrkme,
92 vbak-bstnk,
vbak-ihrez,
126 vbak-vdatu,
vbak-vzeit,
146 vbep-lddat.
WRITE 162 vbap-werks.
NEW-LINE.
WRITE:
5 kna1-ort01,
41 kna1-regio.
IF name1_sp2 IS INITIAL.
WRITE:
45 name1_sp1,
ELSE.
WRITE 45 name1_sp2.
IF name1_sp1 = name1_sp2.
WRITE ' '.
ELSE.
WRITE '*'.
ENDIF.
ENDIF.
IF vbak-vkorg = v_sales_org_cpimex .
WRITE 81 g_trans_id.
ELSE.
WRITE 81 likp-traid.
ENDIF.
WRITE:
102 lips-vbeln,
115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
lips-gewei,
140 vbfa-vbeln,
152 vbrk-vbeln.
ENDCASE.
ENDAT.
ENDLOOP.
* FORM PARM_HDR *
FORM parm_hdr.
WRITE 'Program selections'(101) TO rpt_hdr1.
WRITE 'Sign'(102) TO rpt_hdr1+29.
WRITE 'Option'(103) TO rpt_hdr1+34.
WRITE 'From'(104) TO rpt_hdr1+41.
WRITE 'To'(105) TO rpt_hdr1+77.
ENDFORM. "PARM_HDR
* FORM RPT_HDR *
FORM rpt_hdr.
CASE p_sort.
WHEN 1. "When sort by CAA
WRITE 1'SOff'(066).
WRITE 8'Customer'(009).
WRITE 44'Sales Doc'(010).
WRITE 56'Material'(031).
WRITE 75'Sales Qty'(011).
WRITE 100'Customer PO'(012).
WRITE 134'Req.Del.Dt & Tm'(014).
WRITE 154'Load Dt'(015).
WRITE 166'Plnt'(016).
NEW-LINE.
WRITE 5'City'(017).
WRITE 41'Reg'(069).
WRITE 45'Carrier'(018).
WRITE 81'Transport ID'(019).
WRITE 102'Dlvry Doc'(021).
WRITE 115'Dlvry Qty'(025).
WRITE 140'PGI Doc'(026).
WRITE 152'Billng Doc'(027).
WHEN 2. "When sort by Material
WRITE 1'Created By'(008).
WRITE 14'SOff'(066).
WRITE 21'Customer'(009).
WRITE 57'Sales Doc'(010).
WRITE 69'Sales Qty'(011).
WRITE 92'Customer PO'(012).
WRITE 126'Req.Del.Dt & Tm'(014).
WRITE 146'Load Dt'(015).
WRITE 162'Plnt'(016).
NEW-LINE.
WRITE 5'City'(017).
WRITE 41'Reg'(069).
WRITE 45'Carrier'(018).
WRITE 81'Transport ID'(019).
WRITE 102'Dlvry Doc'(021).
WRITE 115'Dlvry Qty'(025).
WRITE 140'PGI Doc'(026).
WRITE 152'Billng Doc'(027).
ENDCASE.
ENDFORM. "RPT_HDR
INCLUDE zrpthdri.
WRITE:
/ rpt_hdr1.
ULINE.
IF v_flagh2 <> 0.
PERFORM rpt_hdr. "Write secondary header
ULINE.
* Control Break Header
WRITE / cb_hdr1.
ENDIF.
Continued in Part-2
Thanks a ton in advance.
Mythili Sharma
Edited by: Mythili sharma on Mar 30, 2009 3:32 AM
Edited by: Rob Burbank on Mar 30, 2009 10:46 AMHello ABAP Experts,
I need your help to modify the following report with following requirement as I have least knowledge about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our production requirement. I really appreciate your help, If its sent modifying the code required.
Modification required in the report.
To allow the sales representatives to see billed shipments and open orders for the current month.
1) Selection Screen Changes:
u2022 Add selection by Sales group and Customer group
u2022 Add sort by: 5. Ship-to / Material
u2022 Add another selection box
[ ] Open Orders and Shipments with the current month
2) For the new selection box, subtotal sales quantity and delivery quantity.
If delivered, make the sales quantity zero in the subtotal
Current report displays, in Selection Screen
Sales org:
Person Name:
Material:
Plant:
Sales Office:
Ship to Name:
Ship to Number:
Sorts Report by :
1. Person Name
2. Material
3. Plant
4. Sales Office
Check Boxes :
1. Open Orders
2. Delayed Orders
3.Cancelled Orders
PLEASE DOWNLOAD THE COMPLETE REPORT FROM THE FOLLOWING LINK
<< Link removed >>
It would be a great help, If the program is modified according to the requirement and snd it back through send space and send link, even if u send the necessary changes to be done in the report is also appreciable.
Thanks a ton in adanvce
Mythili
I wanted to close this thread as I could not put my question in a proper format. So please reply in the new thread which is posted.
Edited by: Mythili sharma on Mar 30, 2009 2:16 PM
Edited by: Rob Burbank on Mar 30, 2009 4:24 PM -
Need Help in creating Unix Shell Script for database
Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
Here is the condition which i want to implement.
1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
2. Increase size of redolog file.
3. Load sample schema.
4. dump the schema.
5. Create empty db (Script should check if db already exists and drop it in this case).
6. Create backup using rman.
7. restore backup which you have backed up.This isn't much of a "code-sharing" site but a "knowledge-sharing" site. Code posted me may be from a questioner who has a problem / issue / error with his code. But we don't generally see people writing entire scripts as responses to such questions as yours. There may be other sites where you can get coding done "for free".
What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
But the expectation here is for you to write your own code.
Hemant K Chitale -
Need help in modifying mapping parameters of out the box mapping
Hi There,
I am a new bee to dac.
Need help in modifying mapping parameters of out the box mapping, which is invoked by DAC task.
We got a requirement to edit mapping parameter. When I go and see parameter under mappings tab in a mapping, I could not see any values in it.
But when I set any value, and validate it. It is successful.
Is it right way to do it?
What my concern is, When I initially go and see parameter values under maapings tab in a mapping, they are blank.
Where is it storing these values?
Thanks,
RagIf you modify mapping then u have to create new task in dac and dac itself craete parameter file at run time. if you want to add more parameters then do it in dac system parameters tab.
Thanks
Jay. -
Can anyone help me create a relink script to simply open up the relink dialogue box?
Can anyone help me create a relink script to simply open up the relink dialogue box?
the "Relink" command uses the same dialog as the "Place" command, with the exception of having the "Replace" option checked...so, use Ctrl+Shift+P to bring up the Place dialog, select your new image then check the "Replace" check box.
if checking "Replace" with the mouse slows you down, after selecting your image, press "tab" key 3 times to switch focus to it, then press space bar to check it, then ok to place. -
Help in modifying my LV program
Hi,
I need help in modifying my LV 6i, PCI-MIO-16E-1 program. I did send an email to oleg, however no reply. So I hope the expert out there can help me and advise me. I have attached my lv for reference. My program allow me to turn on both LEDs with flashing. (real LEDs). Can anyone teach me how to program my LEDs to R turn on while IR is off, IR is on while R is off and both off. I really deperately need guidance, as I'm really bad in programming.
Thanks for all the help
Attachments:
flashing leds.vi 46 KBI think you need to explain in more details what the problem is, your description is confusing to me.
What is the purpose of the cluster?
Do you want the real LEDs to be controlled by the cluster on the FP?
Are you just looking for a radio button implementation such that clicking one boolean in the cluster turns off the other one?
Do you want the LEDs automatically blink as follows ((1) R: ON, IR: OFF, (2) R: OFF, IR: ON, (3) both off, repeat)?
something else?
Please provide additional information.
Message Edited by altenbach on 02-25-2006 10:14 AM
LabVIEW Champion . Do more with less code and in less time . -
Can you help me to create a script to send photos to other programs?
Hi
i have bridge cs6 64bit
i'm looking for a script that can send photos to ptgui and SNS-HDR Pro
i know there is drag and drop but i would love to have a script
thanksHi
is there someone that can help me giving me a script to run an external program?
i know nik hdr exf pro have a script even autopano giga
pleasee -
HELP !!! - sql script to find free space in Oracle7,8,9 DB
Hi All
I got a PL/SQL script to find out free space in Oracle7,8,9 db. But because in Oracle 7 there is no maxbytes column in dba_data_files, so this script is not working. I am trying to use cursor and putting sql in a variable so that when program executes, it does not see maxbytes. But it still does not work.
Please help. !!!
Script
set feedback off;
set serveroutput on;
set termout off;
set verify off;
spool /u01/app/oracle/admin/common/bck/log/ts.log
declare
v_tablespace_name varchar2(50);
v_total_space number(12) := 0;
v_free_space number(12);
v_space number(12);
v_space_used number(12);
v_pct_free number(6,3);
v_pct_threshold number(3) := 2;
v_table_exist number(2) := 0;
v_sql varchar2(300) := 'select sum(maxbytes) from dba_data_files where TABLESPACE_NAME = tablespace_rec.tablespace_name';
TYPE t_tableref IS REF CURSOR;
t_tablecur t_tableref;
begin
for tablespace_rec in (select tablespace_name from dba_tablespaces)
loop
-- Get the total space for the current tablespace
-- if this FILEXT$ view exists then some of the datafiles have autoextend on;
select count(*) into v_table_exist from dba_tables where table_name = 'FILEXT$';
dbms_output.put_line('table count: ' || v_table_exist);
if v_table_exist = 0 then
OPEN t_tablecur for v_sql;
fetch t_tablecur into v_total_space;
CLOSE t_tablecur;
-- select sum(maxbytes) into v_total_space from dba_data_files
-- where TABLESPACE_NAME = tablespace_rec.tablespace_name;
-- v_total_space := getMaxBytes(tablespace_rec.tablespace_name);
end if;
select sum(bytes) into v_space from dba_data_files
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
if (v_total_space = 0 or v_total_space < v_space) then
select sum(bytes) into v_total_space from dba_data_files
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
select sum(bytes) into v_free_space from dba_free_space
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
else
select sum(bytes) into v_free_space from dba_free_space
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
v_space_used := v_space - v_free_space;
v_free_space := v_total_space - v_space_used;
end if;
-- calculate the percent free for the current tablespace
v_pct_free := (v_free_space / v_total_space) * 100;
if (v_pct_free < v_pct_threshold) then
dbms_output.put_line(tablespace_rec.tablespace_name|| ' - Percent Free: ' || v_pct_free
||'%');
end if;
end loop;
end;
spool off;Hi All
I got a PL/SQL script to find out free space in Oracle7,8,9 db. But because in Oracle 7 there is no maxbytes column in dba_data_files, so this script is not working. I am trying to use cursor and putting sql in a variable so that when program executes, it does not see maxbytes. But it still does not work.
Please help. !!!
Script
set feedback off;
set serveroutput on;
set termout off;
set verify off;
spool /u01/app/oracle/admin/common/bck/log/ts.log
declare
v_tablespace_name varchar2(50);
v_total_space number(12) := 0;
v_free_space number(12);
v_space number(12);
v_space_used number(12);
v_pct_free number(6,3);
v_pct_threshold number(3) := 2;
v_table_exist number(2) := 0;
v_sql varchar2(300) := 'select sum(maxbytes) from dba_data_files where TABLESPACE_NAME = tablespace_rec.tablespace_name';
TYPE t_tableref IS REF CURSOR;
t_tablecur t_tableref;
begin
for tablespace_rec in (select tablespace_name from dba_tablespaces)
loop
-- Get the total space for the current tablespace
-- if this FILEXT$ view exists then some of the datafiles have autoextend on;
select count(*) into v_table_exist from dba_tables where table_name = 'FILEXT$';
dbms_output.put_line('table count: ' || v_table_exist);
if v_table_exist = 0 then
OPEN t_tablecur for v_sql;
fetch t_tablecur into v_total_space;
CLOSE t_tablecur;
-- select sum(maxbytes) into v_total_space from dba_data_files
-- where TABLESPACE_NAME = tablespace_rec.tablespace_name;
-- v_total_space := getMaxBytes(tablespace_rec.tablespace_name);
end if;
select sum(bytes) into v_space from dba_data_files
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
if (v_total_space = 0 or v_total_space < v_space) then
select sum(bytes) into v_total_space from dba_data_files
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
select sum(bytes) into v_free_space from dba_free_space
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
else
select sum(bytes) into v_free_space from dba_free_space
where TABLESPACE_NAME = tablespace_rec.tablespace_name;
v_space_used := v_space - v_free_space;
v_free_space := v_total_space - v_space_used;
end if;
-- calculate the percent free for the current tablespace
v_pct_free := (v_free_space / v_total_space) * 100;
if (v_pct_free < v_pct_threshold) then
dbms_output.put_line(tablespace_rec.tablespace_name|| ' - Percent Free: ' || v_pct_free
||'%');
end if;
end loop;
end;
spool off; -
Please help me to correct the script
I try to write a script by my slef, but not work
app.findGrepPreferencest = firstLineIndent:8, leftIndent:8;
app.changeGrepPreferences = firstLineIndent:8, leftIndent:16;
app.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
Can someone please help me to correct the script, please.both two script are working
but waht if I change the script into this format?
function(){
app.findGrepPreferences.firstLineIndent = "8 mm";
app.findGrepPreferences.leftIndent = "8 mm";
app.changeGrepPreferences.firstLineIndent = "8 mm";
app.changeGrepPreferences.leftIndent = "16 mm";
app.selection[0].changeGrep();
app.findGrepPreferences.firstLineIndent = "8 mm";
app.findGrepPreferences.leftIndent = "16 mm";
app.changeGrepPreferences.firstLineIndent = "8 mm";
app.changeGrepPreferences.leftIndent = "24 mm";
app.selection[0].changeGrep();
and then so on,
Can it works? -
Can someone help me modify a script file?
Hi Everyone!
I am working on a couple videos in AE that need subtitles.
I found this script that would work for me really well:
// Subtitle generator by !Rocky
// modified by Colin Harman ( http://colinharman.com/ ) to work on a Mac
// Save this code as
// "subtitles.jsx"
// Create a text file with your subtitles.
// Each line of text is one on-screen line.
// To have several lines on-screen at the same time,
// simply separate them with a pipe ( | ) character.
// eg "Character 1 talks|Character 2 interrupts"
// Create a new text layer in your comp, adjust its position,
// make sure the text's centered, so it looks nice
// Add markers (Numpad *) where each subtitle line must be shown/hidden.
// With the text layer selected, run the script, and select the subtitles file.
// Enjoy!
function makeSubs() {
var layer = app.project.activeItem.selectedLayers[0];
if (layer.property("sourceText") != null) {
var textFile = File.openDialog("Select a text file to open.", "");
if (textFile != null) {
var textLines = new Array();
textFile.open("r", "TEXT", "????");
while (!textFile.eof)
textLines[textLines.length] = textFile.readln();
textFile.close();
var sourceText = layer.property("sourceText");
var markers = layer.property("marker");
for (var i = sourceText.numKeys; i >= 1; i--)
sourceText.removeKey(i);
var line = 0;
var subTime, subText;
for (var i = 1; i <= markers.numKeys; i++) {
subTime = markers.keyTime(i);
sourceText.setValueAtTime(0, " ");
if ((i % 2) == 0) {
subText = " ";
else {
subText = textLines[line].replace("|", "\x0d\x0a");
line++;
sourceText.setValueAtTime(subTime, new TextDocument(subText));
makeSubs();
Except there is one problem. With this script, the first marker makes the first line show, the second marker makes the first line disappear and the third marker makes the second line show. (etc..)
Can this be modified in a way that the first marker would make the first line show, the second marker would make the second line show (etc..) As I don't need "empty" subtitles in this case.
Thanks,
DanielHi,
I get an error at line 50 but it seems to be working fine. I will test it on one of the videos later today.
Thanks for the help! -
Help modifying a powershell script
Hello,
I have recently been given a task to write/find a script that is capable of performing Full and Incremental backups. I found a script that does exactly what I need, however, it requires user input. I need this to be a scheduled task and therefore I need
the input to be a static path. Here is the script I am talking about:
#region Params
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$HashPath,
[Parameter(Position=3, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateSet("Full","Incremental","Differential")]
[System.String]
$BackupType="Full",
[Parameter(Position=4, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$LogFile=".\Backup-Files.log",
[Parameter(Position=5, Mandatory=$false,ValueFromPipeline=$false)]
[System.Management.Automation.SwitchParameter]
$SwitchToFull
#endregion
begin{
function Write-Log
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$Message,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$LogFile
#endregion
try{
Write-Host $Message
Out-File -InputObject $Message -Append $LogFile
catch {throw $_}
function Get-Hash
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$HashTarget,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateSet("File","String")]
[System.String]
$HashType
#endregion
begin{
try{ $objGetHashMD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider }
catch {throw $_ }
process{
try {
#Checking hash target is file or just string
switch($HashType){
"String" {
$objGetHashUtf8 = New-Object -TypeName System.Text.UTF8Encoding
$arrayGetHashHash = $objGetHashMD5.ComputeHash($objGetHashUtf8.GetBytes($HashTarget.ToUpper()))
break
"File" {
$arrayGetHashHash = $objGetHashMD5.ComputeHash([System.IO.File]::ReadAllBytes($HashTarget))
break
#Return hash
Write-Output $([System.Convert]::ToBase64String($arrayGetHashHash))
catch { throw $_ }
function Copy-File
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Any'})]
[System.String]
$SourceFile,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestFile
#endregion
try{
#The script fails when folder being copied to file. So the item will be removed to avoid the error.
if(Test-Path -LiteralPath $DestFile -PathType Any){
Remove-Item -LiteralPath $DestFile -Force -Recurse
#Creating destination if doesn't exist. It's required because Copy-Item doesn't create destination folder
if(Test-Path -LiteralPath $SourceFile -PathType Leaf){
New-Item -ItemType "File" -Path $DestFile -Force
#Copying file to destination directory
Copy-Item -LiteralPath $SourceFile -Destination $DestFile -Force
catch{ throw $_ }
function Backup-Files
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNull()]
[System.Collections.Hashtable]
$HashTable
#endregion
try{
$xmlBackupFilesHashFile = $HashTable
Write-Host "Backup started"
Get-ChildItem -Recurse -Path $SourceDir|ForEach-Object{
$currentBackupFilesItem = $_
#Full path to source and destination item
$strBackupFilesSourceFullPath = $currentBackupFilesItem.FullName
$strBackupFilesDestFullPath = $currentBackupFilesItem.FullName.Replace($SourceDir,$DestDir)
#Checking that the current item is file and not directory. True - the item is file.
$bBackupFilesFile = $($($currentBackupFilesItem.Attributes -band [System.IO.FileAttributes]::Directory) -ne [System.IO.FileAttributes]::Directory)
Write-Host -NoNewline ">>>Processing item $strBackupFilesSourceFullPath..."
#Generating path hash
$hashBackupFilesPath = $(Get-Hash -HashTarget $strBackupFilesSourceFullPath -HashType "String")
$hashBackupFilesFile = "d"
#If the item is file then generate hash for file content
if($bBackupFilesFile){
$hashBackupFilesFile = $(Get-Hash -HashTarget $strBackupFilesSourceFullPath -HashType "File")
#Checking that the file has been copied
if($xmlBackupFilesHashFile[$hashBackupFilesPath] -ne $hashBackupFilesFile){
Write-Host -NoNewline $("hash changed=>$hashBackupFilesFile...")
Copy-File -SourceFile $strBackupFilesSourceFullPath $strBackupFilesDestFullPath|Out-Null
#Returning result
Write-Output @{$hashBackupFilesPath=$hashBackupFilesFile}
else{
Write-Host -NoNewline "not changed..."
Write-Host "done"
Write-Host "Backup completed"
catch { throw $_ }
function Backup-Full
[CmdletBinding()]
[OutputType([System.String])]
#region Params
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$HashFile,
[Parameter(Position=3, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$ChainKey
#endregion
try{
#Creating an empty hash table
$xmlBackupFullHashFile = @{}
#Starting directory lookup
$uintBackupFullCount = 0
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$ChainKey\Full_" + $(Get-Date -Format "ddMMyyyy")) -HashTable $xmlBackupFullHashFile|`
ForEach-Object{
$xmlBackupFullHashFile.Add([string]$_.Keys,[string]$_.Values)
$uintBackupFullCount++
#Saving chain key.
$xmlBackupFullHashFile.Add("ChainKey",$ChainKey)
Write-Host -NoNewline "Saving XML file to $HashFile..."
Export-Clixml -Path $HashFile -InputObject $xmlBackupFullHashFile -Force
Write-Host "done"
Write-Output $uintBackupFullCount
catch { throw $_ }
function Backup-Diff
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'leaf'})]
[System.String]
$HashFile
#endregion
try{
#Loading hash table
$xmlBackupDiffHashFile = Import-Clixml $HashFile
$chainKeyBackupDiffDifferential = $xmlBackupDiffHashFile["ChainKey"]
$uintBackupDiffCount = 0
#Starting directory lookup
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$chainKeyBackupDiffDifferential\Differential_" + $(Get-Date -Format "ddMMyyyy.HHmm")) -HashTable $xmlBackupDiffHashFile|`
ForEach-Object{ $uintBackupDiffCount++ }
Write-Output $uintBackupDiffCount
catch { throw $_ }
function Backup-Inc
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'leaf'})]
[System.String]
$HashFile
#endregion
try{
#Loading hash table
$xmlBackupIncHashFile = Import-Clixml $HashFile
$chainKeyBackupIncIncremental = $xmlBackupIncHashFile["ChainKey"]
$uintBackupIncCount = 0
#Starting directory lookup
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$chainKeyBackupIncIncremental\Incremental_" + $(Get-Date -Format "ddMMyyyy.HHmm")) -HashTable $xmlBackupIncHashFile|`
ForEach-Object{
$xmlBackupIncHashFile[[string]$_.Keys]=[string]$_.Values
$uintBackupIncCount++
Write-Host -NoNewline "Saving XML file to $HashFile..."
Export-Clixml -Path $HashFile -InputObject $xmlBackupIncHashFile -Force
Write-Host "Done"
Write-Output $uintBackupIncCount
catch { throw $_ }
#0 - is OK. 1 - some error
$exitValue=0
process{
try{
$filesCopied=0
$strSourceFolderName = $(Get-Item $SourceDir).Name
$strHasFile = $("$HashPath\Hash_$strSourceFolderName.xml")
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir started")
#Automatically switch to full backup
$bSwitch = $(!$(Test-Path -LiteralPath $strHasFile -PathType "Leaf") -and $SwitchToFull)
Write-Log -Message $strMessage -LogFile $LogFile
switch($true){
$($BackupType -eq "Full" -or $bSwitch) {
$filesCopied = Backup-Full -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile -ChainKey $("Backup_$strSourceFolderName" + "_" + $(Get-Date -Format "ddMMyyyy"))
break
$($BackupType -eq "Incremental") {
$filesCopied = Backup-Inc -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile
break
$($BackupType -eq "Differential") {
$filesCopied = Backup-Diff -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile
break
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir completed successfully. $filesCopied items were copied.")
Write-Log -Message $strMessage -LogFile $LogFile
Write-Output $filesCopied
catch {
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir failed:" + $_)
Write-Log -Message $strMessage -LogFile $LogFile
$exitValue = 1
end{exit $exitValue}
I have some experience writing Powershell scripts,but I am lost at how this script prompts for Source and Destination paths. I tried modifying the Param section, but this didnt work and up until now I thought the only way you could get a prompt was with
"read-host". Any and all education on this matter would be greatly appreciated. (Side note: I have posted this question on the forum in which I found it and have not got an answer yet).
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$HashPath,
[Parameter(Position=3, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateSet("Full","Incremental","Differential")]
[System.String]
$BackupType="Full",
[Parameter(Position=4, Mandatory=$false,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$LogFile=".\Backup-Files.log",
[Parameter(Position=5, Mandatory=$false,ValueFromPipeline=$false)]
[System.Management.Automation.SwitchParameter]
$SwitchToFull
#endregion
begin{
function Write-Log
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$Message,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$LogFile
#endregion
try{
Write-Host $Message
Out-File -InputObject $Message -Append $LogFile
catch {throw $_}
function Get-Hash
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[System.String]
$HashTarget,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateSet("File","String")]
[System.String]
$HashType
#endregion
begin{
try{ $objGetHashMD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider }
catch {throw $_ }
process{
try {
#Checking hash target is file or just string
switch($HashType){
"String" {
$objGetHashUtf8 = New-Object -TypeName System.Text.UTF8Encoding
$arrayGetHashHash = $objGetHashMD5.ComputeHash($objGetHashUtf8.GetBytes($HashTarget.ToUpper()))
break
"File" {
$arrayGetHashHash = $objGetHashMD5.ComputeHash([System.IO.File]::ReadAllBytes($HashTarget))
break
#Return hash
Write-Output $([System.Convert]::ToBase64String($arrayGetHashHash))
catch { throw $_ }
function Copy-File
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Any'})]
[System.String]
$SourceFile,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestFile
#endregion
try{
#The script fails when folder being copied to file. So the item will be removed to avoid the error.
if(Test-Path -LiteralPath $DestFile -PathType Any){
Remove-Item -LiteralPath $DestFile -Force -Recurse
#Creating destination if doesn't exist. It's required because Copy-Item doesn't create destination folder
if(Test-Path -LiteralPath $SourceFile -PathType Leaf){
New-Item -ItemType "File" -Path $DestFile -Force
#Copying file to destination directory
Copy-Item -LiteralPath $SourceFile -Destination $DestFile -Force
catch{ throw $_ }
function Backup-Files
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNull()]
[System.Collections.Hashtable]
$HashTable
#endregion
try{
$xmlBackupFilesHashFile = $HashTable
Write-Host "Backup started"
Get-ChildItem -Recurse -Path $SourceDir|ForEach-Object{
$currentBackupFilesItem = $_
#Full path to source and destination item
$strBackupFilesSourceFullPath = $currentBackupFilesItem.FullName
$strBackupFilesDestFullPath = $currentBackupFilesItem.FullName.Replace($SourceDir,$DestDir)
#Checking that the current item is file and not directory. True - the item is file.
$bBackupFilesFile = $($($currentBackupFilesItem.Attributes -band [System.IO.FileAttributes]::Directory) -ne [System.IO.FileAttributes]::Directory)
Write-Host -NoNewline ">>>Processing item $strBackupFilesSourceFullPath..."
#Generating path hash
$hashBackupFilesPath = $(Get-Hash -HashTarget $strBackupFilesSourceFullPath -HashType "String")
$hashBackupFilesFile = "d"
#If the item is file then generate hash for file content
if($bBackupFilesFile){
$hashBackupFilesFile = $(Get-Hash -HashTarget $strBackupFilesSourceFullPath -HashType "File")
#Checking that the file has been copied
if($xmlBackupFilesHashFile[$hashBackupFilesPath] -ne $hashBackupFilesFile){
Write-Host -NoNewline $("hash changed=>$hashBackupFilesFile...")
Copy-File -SourceFile $strBackupFilesSourceFullPath $strBackupFilesDestFullPath|Out-Null
#Returning result
Write-Output @{$hashBackupFilesPath=$hashBackupFilesFile}
else{
Write-Host -NoNewline "not changed..."
Write-Host "done"
Write-Host "Backup completed"
catch { throw $_ }
function Backup-Full
[CmdletBinding()]
[OutputType([System.String])]
#region Params
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$HashFile,
[Parameter(Position=3, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$ChainKey
#endregion
try{
#Creating an empty hash table
$xmlBackupFullHashFile = @{}
#Starting directory lookup
$uintBackupFullCount = 0
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$ChainKey\Full_" + $(Get-Date -Format "ddMMyyyy")) -HashTable $xmlBackupFullHashFile|`
ForEach-Object{
$xmlBackupFullHashFile.Add([string]$_.Keys,[string]$_.Values)
$uintBackupFullCount++
#Saving chain key.
$xmlBackupFullHashFile.Add("ChainKey",$ChainKey)
Write-Host -NoNewline "Saving XML file to $HashFile..."
Export-Clixml -Path $HashFile -InputObject $xmlBackupFullHashFile -Force
Write-Host "done"
Write-Output $uintBackupFullCount
catch { throw $_ }
function Backup-Diff
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'leaf'})]
[System.String]
$HashFile
#endregion
try{
#Loading hash table
$xmlBackupDiffHashFile = Import-Clixml $HashFile
$chainKeyBackupDiffDifferential = $xmlBackupDiffHashFile["ChainKey"]
$uintBackupDiffCount = 0
#Starting directory lookup
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$chainKeyBackupDiffDifferential\Differential_" + $(Get-Date -Format "ddMMyyyy.HHmm")) -HashTable $xmlBackupDiffHashFile|`
ForEach-Object{ $uintBackupDiffCount++ }
Write-Output $uintBackupDiffCount
catch { throw $_ }
function Backup-Inc
#region Params
[CmdletBinding()]
[OutputType([System.String])]
param(
[Parameter(Position=0, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'Container'})]
[System.String]
$SourceDir,
[Parameter(Position=1, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateNotNullOrEmpty()]
[System.String]
$DestDir,
[Parameter(Position=2, Mandatory=$true,ValueFromPipeline=$false)]
[ValidateScript({Test-Path -LiteralPath $_ -PathType 'leaf'})]
[System.String]
$HashFile
#endregion
try{
#Loading hash table
$xmlBackupIncHashFile = Import-Clixml $HashFile
$chainKeyBackupIncIncremental = $xmlBackupIncHashFile["ChainKey"]
$uintBackupIncCount = 0
#Starting directory lookup
Backup-Files -SourceDir $SourceDir -DestDir $("$DestDir\$chainKeyBackupIncIncremental\Incremental_" + $(Get-Date -Format "ddMMyyyy.HHmm")) -HashTable $xmlBackupIncHashFile|`
ForEach-Object{
$xmlBackupIncHashFile[[string]$_.Keys]=[string]$_.Values
$uintBackupIncCount++
Write-Host -NoNewline "Saving XML file to $HashFile..."
Export-Clixml -Path $HashFile -InputObject $xmlBackupIncHashFile -Force
Write-Host "Done"
Write-Output $uintBackupIncCount
catch { throw $_ }
#0 - is OK. 1 - some error
$exitValue=0
process{
try{
$filesCopied=0
$strSourceFolderName = $(Get-Item $SourceDir).Name
$strHasFile = $("$HashPath\Hash_$strSourceFolderName.xml")
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir started")
#Automatically switch to full backup
$bSwitch = $(!$(Test-Path -LiteralPath $strHasFile -PathType "Leaf") -and $SwitchToFull)
Write-Log -Message $strMessage -LogFile $LogFile
switch($true){
$($BackupType -eq "Full" -or $bSwitch) {
$filesCopied = Backup-Full -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile -ChainKey $("Backup_$strSourceFolderName" + "_" + $(Get-Date -Format "ddMMyyyy"))
break
$($BackupType -eq "Incremental") {
$filesCopied = Backup-Inc -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile
break
$($BackupType -eq "Differential") {
$filesCopied = Backup-Diff -SourceDir $SourceDir -DestDir $DestDir -HashFile $strHasFile
break
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir completed successfully. $filesCopied items were copied.")
Write-Log -Message $strMessage -LogFile $LogFile
Write-Output $filesCopied
catch {
$strMessage = $($(Get-Date -Format "HH:mm_dd.MM.yyyy;") + "$BackupType backup of $SourceDir failed:" + $_)
Write-Log -Message $strMessage -LogFile $LogFile
$exitValue = 1
end{exit $exitValue}Hi Ryan Blaeholder,
Thanks for your posting.
To schedule a powershell script with input value, instead of modifying the script above, you can also try to add the input during creating a scheduled task like this:(save the script above as D:\backup.ps1)
-command "& 'D:\backup.ps1' 'input1' 'input2'"
For more detailed information, please refer to this article to complete:
Schedule PowerShell Scripts that Require Input Values:
http://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
I hope this helps.
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Need help to modify vb script used in XP for Windows 7
Can somebody help me in modifying scripts that were used for Windows XP, to run on Windows 7.
My friend advised me to change it to .ps1, but still some flaws..
Cscript \\nologo ???? is used for what purpose ?Almost all VBScripts written to work in Windows XP will also work for Windows 7, so there's not much to modify (unless you have specific examples of scripts not working).
Having said that, PowerShell is the future! It takes a bit more than to just change the file extension to .ps1 though (this may be why your scripts aren't working!).
The VBScript-to-Windows PowerShell Conversion Guide
http://technet.microsoft.com/en-us/library/ee221101.aspx
C:\>cscript /?
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Usage: CScript scriptname.extension [option...] [arguments...]
Options:
//B Batch mode: Suppresses script errors and prompts from displaying
//D Enable Active Debugging
//E:engine Use engine for executing script
//H:CScript Changes the default script host to CScript.exe
//H:WScript Changes the default script host to WScript.exe (default)
//I Interactive mode (default, opposite of //B)
//Job:xxxx Execute a WSF job
//Logo Display logo (default)
//Nologo Prevent logo display: No banner will be shown at execution time
//S Save current command line options for this user
//T:nn Time out in seconds: Maximum time a script is permitted to run
//X Execute script in debugger
//U Use Unicode for redirected I/O from the console
C:\>
Andreas Hultgren
MCTS, MCITP
http://ahultgren.blogspot.com/
Maybe you are looking for
-
Oracle and php 5.4 doesn't work
Description: I was using php 5.3 with oracle client 11g and everything works fine. I have a wep app already in production with php5.3. I tried upgrade to php5.4, so I install in another folder XAMPP 1.8 who uses php 5.4. I tried everything to make or
-
How to auto boot after shutting down bootcamp Windows?
I have an instructional lab of 30 20" imacs that are running dual-boot, 10.5 & XP SP3. They have bootpicker installed to simplify the selection of which OS to boot to and auto-select Windows at 60 sec. (This is for new computer users and English as a
-
N96 MMS problem (opening and deleting)
Hello people.. I came here through the Dutch Nokia website, so i hope my english is good enough to understand.... This is my problem: this morning I recieved an MMS, and later on i send an MMS back. At that time, there was no problem opening the mess
-
Floating-point numbers: min value
Hi, the number wrapper classes each define a MAX_VALUE and a MIN_VALUE constant. While the MIN_VALUE of non-floating point numbers are negative numbers, the MIN_VALUE of the floating point numbers are the smallest postive numbers. From the Javadoc: F
-
Ldd does not show dependency on libC/ libCrun or libCstd
When I do an ldd on my executables (built using WS6U2), it does not show that it depends on libC/ libCrun or libCstd. But the executables use the iostream. More over, one of them fails with the below message; ld.so.1: Rules: fatal: relocation error: