How to read zl cluster
i want to read how many hours are worked under each wage type so that i can calculate pay accordingly. i was told this information will be available in zl cluster of pcl2 table. how do i read this table.
Hi
Welcome to SDN forum
You have to use IMPORT..EXPORT commands to fetch the Payroll data from clusters like PCL2
see the sample code which is used to fetch some payroll data from PCL2 cluster into RT table and based on wage types we take the amounts
report zporgr0100
line-size 252
line-count 60(1)
no standard page heading
message-id zx.
Database Tables & Infotypes
tables: pcl1, " HR Cluster1
pcl2, " HR Cluster1
pa0003, " Master data - Payroll Status
cskt, " Cost Center Texts
t528t, " Positions Texts
t513s, " Job Titles
pernr, " Logical PNP
t001p, " Personnel Subarea
t500p, " Personnel Area
t501, " Employee Group
t503k, " Employee Subgroup
csks. " Cost Center
infotypes:0000,0001.
*include rpclst00.
include rpc2rx00.
include rpc2rxx0.
include rpc2cd00.
*include rpc2ps00.
*include rpc2pt00.
*include rpcfvp00.
*include rpcfdc10.
*include rpcfdc00.
include rpppxd00.
include rpppxd10.
Declaration of Internal Tables
Internal Table for Output Data
data: begin of rep_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
pernr like pa0001-pernr, " Personal Number
ename like pa0001-ename, " Employee Name
ctext like cskt-ltext, " Cost Center Text
ptext like t528t-plstx, " Position Text
ot1 type p decimals 2, " Jan OT Amount
ot2 type p decimals 2, " Feb OT Amount
ot3 type p decimals 2, " Mar OT Amount
ot4 type p decimals 2, " Apr OT Amount
ot5 type p decimals 2, " May OT Amount
ot6 type p decimals 2, " Jun OT Amount
ot7 type p decimals 2, " Jul OT Amount
ot8 type p decimals 2, " Aug OT Amount
ot9 type p decimals 2, " Sep OT Amount
ot10 type p decimals 2, " Oct OT Amount
ot11 type p decimals 2, " Nov OT Amount
ot12 type p decimals 2, " Dec OT Amount
ott type p decimals 2, " Total OT Amount
end of rep_tab.
Declaration of Variables
data: v_mon(2) type n, " Month
v_no type i, " Data Lines
v_year(4) type c, " Year
v_date like sy-datum, " Date
v_date1 like sy-datum, " Date
v_seqnr like pc261-seqnr. " Sequence No.
Declaration of Constants
data: c_type like hrp1001-otype value 'S', " Object Type
c_kokrs like cskt-kokrs value '1000', " Controlling Area
c_date1 like sy-datum value '18000101', " Date
c_date2 like sy-datum value '99991231', " Date
c_x type c value 'X', " Sign
c_mon(2) type c value '01', " Month
c_val1(2) type c value '31', " Date
c_val2(2) type c value '12', " Month Type
c_val like p0041-dar01 value '01', " Date Type
c_lgart1 like p0008-lga01 value '0722', " Wage Type
c_lgart2 like p0008-lga01 value '0723', " Wage Type
c_1(2) type n value '01', " Month1
c_2(2) type n value '02', " Month2
c_3(2) type n value '03', " Month3
c_4(2) type n value '04', " Month4
c_5(2) type n value '05', " Month5
c_6(2) type n value '06', " Month6
c_7(2) type n value '07', " Month7
c_8(2) type n value '08', " Month8
c_9(2) type n value '09', " Month9
c_10(2) type n value '10', " Month10
c_11(2) type n value '11', " Month11
c_12(2) type n value '12'. " Month12
Selection-screen
parameters:
p_year like pc2b0-pabrj obligatory. " Payroll Year
At selection-screen
at selection-screen.
Validate the Selection Screen fields
perform validate_screen.
Start-of-Selection
start-of-selection.
Selection of Period
perform get_period.
Get PERNR from LDB
get pernr.
Get the Master data from infotype 0001
perform get_master_data.
Top-of-page
top-of-page.
Write the Report and Column Headings
perform top_of_page.
End-of-Page
end-of-page.
write /1(252) sy-uline.
End-of-Selection
end-of-selection.
Display the Output Report.
perform display_report.
Form-Routines
*& Form validate_screen
Validation of selection Screen fields
form validate_screen.
Validation of Cost Center
clear csks.
if not pnpkostl[] is initial.
select single kostl
into csks-kostl
from csks
where kostl in pnpkostl.
if sy-subrc <> 0.
message e999 with 'Invalid Cost Center'(003).
endif.
endif.
Validation of Personnel Number
clear pa0003.
if not pnppernr[] is initial.
select pernr
from pa0003 up to 1 rows
into pa0003-pernr
where pernr in pnppernr.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personal Number Entered'(002).
endif.
endif.
Validation of Personnel Area
clear t500p.
if not pnpwerks[] is initial.
select persa
from t500p up to 1 rows
into t500p-persa
where persa in pnpwerks.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personnel Area Entered'(001).
endif.
endif.
Validation of Personnel Sub Area
clear t001p.
if not pnpbtrtl[] is initial.
select btrtl
from t001p up to 1 rows
into t001p-btrtl
where btrtl in pnpbtrtl.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Personnel Sub Area Entered'(037).
endif.
endif.
Validation of Employee Group
clear t501.
if not pnppersg[] is initial.
select persg
from t501 up to 1 rows
into t501-persg
where persg in pnppersg.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Employee Group Entered'(038).
endif.
endif.
Validation of Employee Sub Group
clear t503k.
if not pnppersk[] is initial.
select persk
from t503k up to 1 rows
into t503k-persk
where persk in pnppersk.
endselect.
if sy-subrc <> 0.
message e999 with 'Incorrect Employee Sub Group Entered'(039).
endif.
endif.
endform. "validate_screen
*& Form get_period
Get the Correct Period based on Selection screen selection
form get_period.
clear: v_year,v_mon, v_date, v_date1.
v_year = sy-datum+0(4).
v_mon = sy-datum+4(2).
if pnptimr1 = c_x. " Current Date
pnpbegda = sy-datum.
pnpendda = sy-datum.
elseif pnptimr2 = c_x. " Current Month
concatenate v_year v_mon c_val into v_date.
concatenate v_year v_mon c_val1 into v_date1.
pnpbegda = v_date.
pnpendda = v_date1.
elseif pnptimr3 = c_x. " Current Year
concatenate v_year c_val c_val into v_date.
concatenate v_year c_val2 c_val1 into v_date1.
pnpbegda = v_date.
pnpendda = v_date1.
elseif pnptimr4 = c_x. " Upto Today
pnpbegda = c_date1.
pnpendda = sy-datum.
elseif pnptimr5 = c_x. " From Today
pnpbegda = sy-datum.
pnpendda = c_date2.
else.
if ( pnpbegda is initial and pnpendda is initial ).
pnpbegda = c_date1.
pnpendda = c_date2.
elseif pnpbegda is initial and not pnpendda is initial.
pnpbegda = c_date1.
pnpendda = pnpendda.
elseif not ( pnpbegda is initial and pnpendda is initial ).
pnpbegda = pnpbegda.
pnpendda = pnpendda.
endif.
endif.
endform. "get_period
*& Form get_master_data
Get the Master Data from Database Tables PA0001,0002,0003
form get_master_data.
Get data from Respective Infotypes
rp_provide_from_last p0001 space pnpbegda pnpendda.
if p0001-kostl in pnpkostl.
rep_tab-kostl = p0001-kostl.
rep_tab-pernr = p0001-pernr.
rep_tab-ename = p0001-ename.
Get the Position Text
clear t528t-plstx.
select single plstx into t528t-plstx from t528t
where plans = p0001-plans and
otype = c_type and
sprsl = sy-langu.
if sy-subrc = 0.
rep_tab-ptext = t528t-plstx.
endif.
Get the Cost Center Text
clear cskt-ltext.
select single ltext into cskt-ltext from cskt
where spras = sy-langu and
kokrs = c_kokrs and
kostl = p0001-kostl.
if sy-subrc = 0.
rep_tab-ctext = cskt-ltext.
endif.
Get the Overtime Payment Data
perform get_ot_data.
rep_tab-ott = rep_tab-ot1 + rep_tab-ot2 + rep_tab-ot3 +
rep_tab-ot4 + rep_tab-ot5 + rep_tab-ot6 +
rep_tab-ot7 + rep_tab-ot8 + rep_tab-ot9 +
rep_tab-ot10 + rep_tab-ot11 + rep_tab-ot12.
append rep_tab.
clear rep_tab.
endif.
sort rep_tab by kostl pernr.
delete rep_tab where kostl = ' '.
delete rep_tab where ott = 0.
endform. "get_master_data
*& Form get_ot_data
Get the Overtime Payment Data
form get_ot_data.
cd-key = pernr-pernr.
rp-imp-c2-cd.
sort rgdir by seqnr.
To get sequence number for the payroll period
loop at rgdir where void is initial
and reversal is initial
and outofseq is initial
and srtza eq 'A'.
if rgdir-fpper+0(4) = p_year.
To consider offcycle run data
if not rgdir-ocrsn is initial.
v_seqnr = rgdir-seqnr.
exit.
endif.
v_seqnr = rgdir-seqnr.
endif.
if not v_seqnr is initial.
perform import_rx.
endif.
perform process_wagetypes.
endloop.
endform. "get_ot_data
include rpppxm00.
*& Form Import_rx
Import the RX data from Clusters
form import_rx.
rx-key-pernr = cd-key-pernr.
rx-key-seqno = v_seqnr.
rp-init-buffer.
rp-imp-c2-rx.
endform. " Import_rx
*& Form Process_wagetypes
Calculate the Overtime Amount based on Wage types
form process_wagetypes.
loop at rt.
if rt-lgart = c_lgart1 or rt-lgart = c_lgart2.
if rgdir-fpper+0(4) = p_year.
v_mon = rgdir-fpper+4(2).
case v_mon .
when c_1.
rep_tab-ot1 = rep_tab-ot1 + rt-betrg.
when c_2.
rep_tab-ot2 = rep_tab-ot2 + rt-betrg.
when c_3.
rep_tab-ot3 = rep_tab-ot3 + rt-betrg.
when c_4.
rep_tab-ot4 = rep_tab-ot4 + rt-betrg.
when c_5.
rep_tab-ot5 = rep_tab-ot5 + rt-betrg.
when c_6.
rep_tab-ot6 = rep_tab-ot6 + rt-betrg.
when c_7.
rep_tab-ot7 = rep_tab-ot7 + rt-betrg.
when c_8.
rep_tab-ot8 = rep_tab-ot8 + rt-betrg.
when c_9.
rep_tab-ot9 = rep_tab-ot9 + rt-betrg.
when c_10.
rep_tab-ot10 = rep_tab-ot10 + rt-betrg.
when c_11.
rep_tab-ot11 = rep_tab-ot11 + rt-betrg.
when c_12.
rep_tab-ot12 = rep_tab-ot12 + rt-betrg.
endcase.
endif.
endif.
endloop.
endform. "process_wagetypes
*& Form top_of_page
Write the Report and Column Headings
form top_of_page.
format color col_heading on.
write: /1(252) 'NATIONAL DRILLING COMPANY'(010) centered,
/1(252) 'Overtime Payments Details'(011) centered.
format color off.
if pnptimr1 = c_x. " Current Date
write: /2 'Period From :'(036), sy-datum, 'To:'(006), sy-datum.
elseif pnptimr2 = c_x. " Current Month
write: /2 'Period From :'(036), v_date, 'To:'(006), v_date1.
elseif pnptimr3 = c_x. " Current Year
write: /2 'Period From :'(036), v_date, 'To:'(006), v_date1.
elseif pnptimr4 = c_x. " Upto Today
write: /2 'Period From :'(036), c_date1, 'To:'(006), sy-datum.
elseif pnptimr5 = c_x. " From Today
write: /2 'Period From :'(036), sy-datum, 'To:'(006), c_date2.
else.
if ( pnpbegda is initial and pnpendda is initial ).
write: /2 'Period From :'(036), c_date1, 'To:'(006), c_date2.
elseif pnpbegda is initial and not pnpendda is initial.
write: /2 'Period From :'(036), c_date1, 'To:'(006), pnpendda.
elseif not ( pnpbegda is initial and pnpendda is initial ).
write: /2 'Period From :'(036), pnpbegda,
'To:'(006), pnpendda.
endif.
endif.
write: 219 'Report Run Date:'(018), sy-datum.
if not pnpkostl[] is initial.
if pnpkostl-high is initial.
write: /2 'Cost Center :'(004), pnpkostl-low,
219 'Time :'(020), sy-uzeit.
else.
write: /2 'Cost Center From:'(005), pnpkostl-low+7(3),
'To:'(006), pnpkostl-high,
219 'Time :'(020), sy-uzeit.
endif.
else.
write: /219 'Time :'(020), sy-uzeit.
endif.
if not pnppernr[] is initial.
if pnppernr-high is initial.
write: /2 'Personal Number :'(007), pnppernr-low,
219 'User :'(021), sy-uname.
else.
write: /2 'Personal No.From:'(008), pnppernr-low,
'To:'(006), pnppernr-high,
219 'User :'(021), sy-uname.
endif.
else.
write: /219 'User :'(021), sy-uname.
endif.
write: /219 'Page No :'(022), sy-pagno.
format color col_heading.
write /1(252) sy-uline.
write:/1 sy-vline, 10 sy-vline,
41 sy-vline,
67 sy-vline, 68(167) 'Overtime Payments(Dirhams)'(013) centered,
235 sy-vline,252 sy-vline.
format color col_heading.
write:/1 sy-vline, 2(8) 'Emp #'(019) centered,
10 sy-vline, 11(30) 'Employee Name'(012) centered,
41 sy-vline, 42(25) 'Position'(014) centered,
67 sy-vline, 68(167) sy-uline,
235 sy-vline,236(16) 'Total'(017) centered,
252 sy-vline.
write:/1 sy-vline, 10 sy-vline,
41 sy-vline,
67 sy-vline, 68(13) 'JANUARY'(024) centered,
81 sy-vline, 82(13) 'FEBRUARY'(025) centered,
95 sy-vline, 96(13) 'MARCH'(026) centered,
109 sy-vline,110(13) 'APRIL'(027) centered,
123 sy-vline,124(13) 'MAY'(028) centered,
137 sy-vline,138(13) 'JUNE'(029) centered,
151 sy-vline,152(13) 'JULY'(030) centered,
165 sy-vline,166(13) 'AUGUST'(031) centered,
179 sy-vline,180(13) 'SEPTEMBER'(032) centered,
193 sy-vline,194(13) 'OCTOBER'(033) centered,
207 sy-vline,208(13) 'NOVEMBER'(034) centered,
221 sy-vline,222(13) 'DECEMBER'(035) centered,
235 sy-vline,252 sy-vline.
format color off.
write /1(252) sy-uline.
endform. "top_of_page
*& Form Display_report
Write the Report Output
form display_report.
clear v_no.
describe table rep_tab lines v_no.
if v_no = 0.
message i999 with
'No Data found for the entered Selection'(015).
endif.
loop at rep_tab.
format color 3.
at new kostl.
read table rep_tab index sy-tabix.
write:/1 sy-vline, 2(12) 'Cost Center:'(009),
14(10) rep_tab-kostl,
25(30) rep_tab-ctext,
252 sy-vline.
format color off.
write /1(252) sy-uline.
endat.
format color col_normal.
write: /1 sy-vline, 2(8) rep_tab-pernr,
10 sy-vline, 11(30) rep_tab-ename,
41 sy-vline, 42(25) rep_tab-ptext,
67 sy-vline, 68(13) rep_tab-ot1 no-zero,
81 sy-vline, 82(13) rep_tab-ot2 no-zero,
95 sy-vline, 96(13) rep_tab-ot3 no-zero,
109 sy-vline,110(13) rep_tab-ot4 no-zero,
123 sy-vline,124(13) rep_tab-ot5 no-zero,
137 sy-vline,138(13) rep_tab-ot6 no-zero,
151 sy-vline,152(13) rep_tab-ot7 no-zero,
165 sy-vline,166(13) rep_tab-ot8 no-zero,
179 sy-vline,180(13) rep_tab-ot9 no-zero,
193 sy-vline,194(13) rep_tab-ot10 no-zero,
207 sy-vline,208(13) rep_tab-ot11 no-zero,
221 sy-vline,222(13) rep_tab-ot12 no-zero,
235 sy-vline,236(16) rep_tab-ott no-zero,
252 sy-vline.
at end of kostl.
write /1(252) sy-uline.
endat.
format color off.
at last.
sum.
format color 1.
write: /1 sy-vline,
10 sy-vline, 11(30) 'Total'(017) centered,
41 sy-vline,
67 sy-vline, 68(13) rep_tab-ot1 no-zero,
81 sy-vline, 82(13) rep_tab-ot2 no-zero,
95 sy-vline, 96(13) rep_tab-ot3 no-zero,
109 sy-vline,110(13) rep_tab-ot4 no-zero,
123 sy-vline,124(13) rep_tab-ot5 no-zero,
137 sy-vline,138(13) rep_tab-ot6 no-zero,
151 sy-vline,152(13) rep_tab-ot7 no-zero,
165 sy-vline,166(13) rep_tab-ot8 no-zero,
179 sy-vline,180(13) rep_tab-ot9 no-zero,
193 sy-vline,194(13) rep_tab-ot10 no-zero,
207 sy-vline,208(13) rep_tab-ot11 no-zero,
221 sy-vline,222(13) rep_tab-ot12 no-zero,
235 sy-vline,236(16) rep_tab-ott no-zero,
252 sy-vline.
write /1(252) sy-uline.
endat.
format color off.
endloop.
endform. "display_report
<b>Reward points for useful Answers</b>
Regards
Anji
Similar Messages
-
How to read flushed cluster array from input queue?
Hi! I'm new to LabView. Can someone please help me?
I want to use a subvi to read a queue which I created in another vi. The created queue holds an array of clusters that I want to unbundle in a for loop in the reading vi. But the output of the flush queue function is a string array (since the subvi has no info on what sort of queue is being input).
I can't connect the unbundle function to a string input; can I use the type cast function to force the flush output to be a cluster? Or is there a better way to do this?
And if so, what is the string constant I need to attach to the "type" input in the type cast function?
And also, I'm told that the cluster is kind of like a "struct"; so is there a way to n
ame it so that other vi's know what it is(i.e. type cast)?
jenI did look at the help examples, but I couldn't find one that was sending the queue from one vi to another(well, not any that I could understand), and that was really my problem.
I did get the thing to work when it was all in one vi.
You bring up an interesting point about "dequeue" and "flush". Perhaps I am mistaken, but my reasoning for using flush rather than dequeue was the following:
I am using the queue as a data buffer. I need the queue to hold a few minutes of data. This data is dumped to file upon fault event, i.e. it tells me what was going on right before the fault occurred. I need that queue to dump the data and then immediately turn around and start filling up again. I felt that holding on to the queue reference in the save-to-file routi
ne (which involves lots of potentially slow hard disk access) might cause the object to lock and hence not be able to save right away. I don't know how LabView does threading, but if I was writing the threading routine, I would lock any object which was being executed upon in a routine to prevent data collision.
Of course, this begs the question: does LabView lock all objects in a subroutine that is executing? Or just in the part which is unresolved? or does it lock objects at all? Perhaps I should flush the queue outside of the subroutine anyway, so that the subroutine can happily munch on the flushed array while my queue goes back to the business of collecting data?
Am I way off base in how the threading works?
Thanks!
jen -
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to manage windows cluster on windows server 2008 R2
Hi I want to know how to properly shutdown or stop windows cluster with out failover or failing it.
I have successfully created windows cluster on win 2008 R2 sp1 using vmware with starwind software for SAN storage.
Now when I shut down or stop cluster service on node1 it failsover and shows critical errors fine.ok... I tried to destroy and clean up cluster using cmd commands.Forcecleanup both nodes with cmd commands.it was successful.
Later I recreated san storage with target and initiator configuration using starwind without any issue.
I Reinstalled FC service on both the nodes restarted vmnodes.I cheked all the firewall were disable.and machines able to ping well..
Now when I tried to recreate new cluster it fails and gives different errors.AS Node1 was evicted from cluster,Another was Quoram was lost as no witness disk was found.
Also It did not show my cluster under FCM on Node2.I tried to add node Node2 but error saying Node2 is already in a cluster.
So I want to know how to manage windows cluster properly and manage it entries in active directory so that even after shutting/stopping the service/destroying cluster I do not need to do all over again.
I had to recreate all VMware from start and do AD setup and SAN storage again then only windows cluster got successfully created once again....................
I had to recreate all vmware nodes with FC sevice reinstalled and also recreate AD DS and DNS.
srm_2010Hi srm_2010,
You can refer the following KB:
Start or Stop the Cluster Service on a Cluster Node
http://technet.microsoft.com/en-us/library/cc771742.aspx
I’m glad to be of help to you!
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Read from cluster table ZL-PCL2
Hi all,
I need to read cluster table ZL that stores wage type for pernr. Now previously i was suggested
FM 'CU_READ_RGDIR'
FM 'CD_RED_LAST'.
FM 'PYXX_READ_PAYROLL_RESULT'. But i want to use the statement
Import from database.
i have included the file RPC2ZL00.
then the statement
Import ZL to ZZL from database PCL2(ZL) ID ZL-KEY.
Now does anyone have idea abt ZL-KEY??
means what value i need to feed in ZL-KEy and how do i feed it??
thanks in advance for all those who help me..
ReenaHi Reena,
Key is the combination of Pernr & sequence no., which u see it from report display payroll result(HINCLSTR) or RGDIR table.
Instead of Import statement You can also use macro as below .
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR = PERNR-PERNR
TABLES
IN_RGDIR = RGDIR
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
CHECK SY-SUBRC = 0.
PAY_BEGDA = SEL-BEGDA.
LOOP AT RGDIR WHERE SRTZA = 'A' AND VOID = SPACE
AND ( PAYDT >= SEL-BEGDA AND PAYDT <= SEL-ENDDA ).
IF RGDIR-RUNDT >= PAY_RUNDT.
MOVE RGDIR-RUNDT TO PAY_RUNDT.
PAY_BEGDA = RGDIR-FPBEG.
SEQNR = RGDIR-SEQNR.
ENDIF.
ENDLOOP.
RX-KEY-PERNR = PERNR-PERNR.
UNPACK SEQNR TO RX-KEY-SEQNO.
<b>RP-IMP-C2-RU.</b>
CHECK RP-IMP-RU-SUBRC = 0.
Read the cluster table
LOOP AT CRT.
ENDLOOP.
Hope this helps.
Thanks,
Sarika. -
How to read the RD Connect Broker DataBase!!!!
The msdn say there is a RD Connect Broker Data Base , it store the session information,but i dont know where is it and how to read it !
Thank you !!!!Hi,
You can use the vbs script below to dump the contents of the RD Connection Broker database.
With credits to the authors of the Windows Server 2008 R2 RDS Resource Kit for putting it in there!
' Copyright (c) 2004-2005 Microsoft Corporation
' WMI Script - SDDatabaseDump.vbs
' Author - GopiV
' This script dumps the contents (clusters and associated sessions)
' of the Session Directory database
' USAGE: Cscript.exe SDDatabaseDump.vbs <SBservername> <Administrator> <Password>
const TAB = " "
const LINESEPARATOR = "------------------------------------------------"
ON ERROR RESUME NEXT
'* Function blnConnect()
'* Purpose: Connects to machine strServer.
'* Input: strServer a machine name
'* strNameSpace a namespace
'* strUserName name of the current user
'* strPassword password of the current user
'* Output: objService is returned as a service object.
Function blnConnect(objService, strServer, strNameSpace, strUserName, strPassword)
ON ERROR RESUME NEXT
Dim objLocator
blnConnect = True 'There is no error.
' Create Locator object to connect to remote CIM object manager
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in creating a locator object."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
Exit Function
end if
' Connect to the namespace which is either local or remote
Set objService = objLocator.ConnectServer (strServer, strNameSpace, strUserName, strPassword)
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in connecting to server " _
& strServer & "."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
end if
objService.Security_.impersonationlevel = 3
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred in setting impersonation level " _
& strServer & "."
if Err.Description <> "" then
Wscript.Echo "Error description: " & Err.Description & "."
end if
Err.Clear
blnConnect = False 'An error occurred
end if
end Function
' Start of script
if Wscript.arguments.count<3 then
Wscript.echo "Script can't run without 3 arguments: ServerName Domain\UserName Password "
Wscript.quit
end if
Dim strServer, strUserName, strPassword
Dim objService, blnResult
' Extract the command line arguments
strServer=Wscript.arguments.Item(0)
strUserName=Wscript.arguments.Item(1)
strPassword=Wscript.arguments.Item(2)
' Connect to the WMI service on the SD Server machine
blnResult = blnConnect( objService, strServer, "root/cimv2", strUserName, strPassword )
if not blnResult then
Wscript.echo "Can not connect to the server " & strServer & " with the given credentials."
WScript.Quit
end if
Set clusterEnumerator = objService.InstancesOf ("Win32_SessionDirectoryCluster")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if clusterEnumerator.Count = 0 then
Wscript.Echo "No clusters found in Session Directory database on " & strServer & "."
Wscript.Echo
Wscript.Quit
end if
for each clusterObj in clusterEnumerator
WScript.Echo LINESEPARATOR
WScript.Echo "ClusterName = " & clusterObj.ClusterName
WScript.Echo "NumberOfServers = " & clusterObj.NumberOfServers
WScript.Echo "SingleSessionMode = " & clusterObj.SingleSessionMode
Wscript.Echo
set serverEnumerator = objService.ExecQuery("Select * from Win32_SessionDirectoryServer where ClusterName = '" & clusterObj.ClusterName & "'")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if serverEnumerator.Count = 0 then
Wscript.Echo "Error : No servers in cluster " & clusterObj.ClusterName
Wscript.Echo
else
' Enumerate the servers in this cluster
for each serverObj in serverEnumerator
WScript.Echo TAB & "SERVER :"
WScript.Echo TAB & "ServerName = " & serverObj.ServerName & " ServerSingleSessionMode = " & serverObj.SingleSessionMode & " LoadIndicator = " & serverObj.LoadIndicator
' WScript.Echo TAB & "ServerIP = " & serverObj.ServerIPAddress
' WScript.Echo TAB & "ServerWeight = " & serverObj.ServerWeight
set sessionEnumerator = objService.ExecQuery("Select * from Win32_SessionDirectorySession where ServerName = '" & serverObj.ServerName & "'")
if Err.Number then
Wscript.Echo "Error 0x" & CStr(Hex(Err.Number)) & " occurred"
end if
if sessionEnumerator.Count = 0 then
WScript.Echo
WScript.Echo TAB & "No sessions on server " & serverObj.ServerName
WScript.Echo
else
WScript.Echo TAB & "NumberOfSessions = " & sessionEnumerator.Count
Wscript.Echo
' Enumerate the sessions on this server
for each sessionObj in sessionEnumerator
WScript.Echo TAB & TAB & "SESSION :"
WScript.Echo TAB & TAB & "UserName= " & sessionObj.DomainName & "\" & sessionObj.UserName & TAB & "ApplicationType= " & sessionObj.ApplicationType
& TAB & "SessionState= " & sessionObj.SessionState
WScript.Echo TAB & TAB & "CreateTime= " & sessionObj.CreateTime & TAB & "DisconnectTime= " & sessionObj.DisconnectTime
' WScript.Echo TAB & TAB & "ServerName= " & sessionObj.ServerName
' WScript.Echo TAB & TAB & "SessionID= " & sessionObj.SessionID
' WScript.Echo TAB & TAB & "ServerIP= " & sessionObj.ServerIPAddress
' WScript.Echo TAB & TAB & "TSProtocol= " & sessionObj.TSProtocol
' WScript.Echo TAB & TAB & "ResolutionWidth= " & sessionObj.ResolutionWidth
' WScript.Echo TAB & TAB & "ResolutionHeight= " & sessionObj.ResolutionHeight
' WScript.Echo TAB & TAB & "ColorDepth= " & sessionObj.ColorDepth
' WScript.Echo
WScript.Echo
next
end if ' End of sessions on this server
next
end if ' End of servers on this cluster
next
Wscript.Echo
Wscript.Echo
Wscript.Echo "Dump of SD database on " & strServer & " complete."
Kind regards,
Freek Berson
http://www.microsoftplatform.blogspot.com
Wortell company website -
How to read data directly from clusters
hi all,
how to read data directly from clusters
Thanx in advance,
amruta.Using macro:
RP-IMP-C2-B2.
RP-IMP-C2-B1.
RP-IMP-C2-ZL.
....etc.
For TM cluster, U also can use BAPIs like HR_TIME_RESULTS_GET
More details see SAP HR course 350(HR Programming) -
How to create a cluster on existing table
how to create a cluster on existing table
user8949393 wrote:
how to create a cluster on existing tableAFAIK you can't. You have to create the cluster from scratch, something like
--cluster key can be just one column also
CREATE CLUSTER s_emp_dept_ic (deptno NUMBER(7), dname varchar2(30));
CREATE TABLE emp(
DEPTNO NUMBER(7),
DNAME VARCHAR2(30),
EMPNO NUMBER(4),
ENAME VARCHAR2(30)
--cluster clause puts table in cluster. Deptno, dname are table columns in
--cluster key
CLUSTER s_emp_dept_ic (deptno,dname);
--a cluster index must be created before any data is inserted
--the index columns used come from the cluster key from CREATE CLUSTER
CREATE INDEX s_emp_idx ON CLUSTER s_emp_dept_ic; -
How was created the cluster with keys in example: Sim Phone.vi
Hello all
I have LV 7.1.1
I have found the example: Sim Phone.vi
And I don't know how was created the cluster with keys?
Best regards
IskanderIt's just like any other cluster you create. Put a cluster container on the front panel and insert some Booleans. the actual Booleans are on the classic controls palette. The border of the cluster is also colored transparent with the paintbrush on the Tools palette.
-
How to read the content in one node of XML in Java? Pls help
My dear brothers,
I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
1. Create a GUI form which gives the ability for user to choose a XML file (ok)
2. Load XML and return the file (ok)
3. Read the file from node to node to create the node in Tree View (?!)
Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
Hoang Yen BinhI hope this one helps you.
<ABC Type="ProductBased" ProdName="One" Location="India">
<CEO>Raj</CEO>
<Finance>Vikram</Finance>
<HR>Karthik</HR>
<Technical>Satish</Technical>
</ABC>
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Attr;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.DOMException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
public class XmlReading {
Document doc;
Element element;
public static void main(String[] args) throws Exception{
XmlReading xr = new XmlReading();
xr.getXmlParser(args);
public void getXmlParser(String[] args) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if(args.length != 1) {
System.err.println("Argument Required");
try {
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(new File(args[0]));
}catch(ParserConfigurationException e1) {
}catch(SAXException e2) {
}catch(IOException e3) {
getAttributes();
public void getAttributes() {
// Retrive the entire Document from the Dom Tree
element = doc.getDocumentElement();
// System.out.println(element);
NamedNodeMap attrs = element.getAttributes();
// Get number of attributes in the element
int numAttrs = attrs.getLength();
// Process each attribute
for (int i=0; i<numAttrs; i++) {
Node node = attrs.item(i);
// Get attribute name and value
String attrName = node.getNodeName();
String attrValue = node.getNodeValue();
System.out.println(attrName + ": " + attrValue);
String s1 = element.getTagName();
System.out.println(s1);
// To get all the elements in a DOM Tree
NodeList nl1 = element.getElementsByTagName("*");
int i2 = nl1.getLength();
System.out.println(i2);
for(int i=0; i<i2; i++) {
System.out.println(nl1.item(i) + "\n");
} -
How can Reader v 9 be installed to a volume other than c:?
How can Reader v >9 be installed to a volume other than c:? such as g:?
and is there a distrubution executable available so Reader can be installed on a machine that is not connected to the Internet?download the .exe from the ftp service and use it to target the install directory:
ergo
ftp://ftp.adobe.com/pub/adobe/reader/
and pick OS and version and language thus:
ftp://ftp.adobe.com/pub/adobe/reader/win/9.x/9.5.0/en_US/AdbeRdr950_en_US.exe -
How to read BLOB column from a table in SQL or PL/SQL
I have table which is having one BLOB data type column . Ihave inserted few rows in that table . Now i want to see wheather BLOB column has been inserted properly or not . How to read that column through SQL or PL/SQL.
Can anyone help me to do this.You can only manipulate LOBs in PL/SQL because you have to use the DBMS_LOB package.
Check out the Oracle Developer's Guide -
How to read excel file in document library and store excel content in sql table
Hello,
Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
Please let me know the ways to acheive this. Feel free to give your suggestions.
Thanks,
Cool DeveloperHi!
this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
System.Data.OleDb.
OleDbConnection ExcelConnection = null;
FileMode fileMode;
string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb _web = _site.OpenWeb())
string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
fileMode =
FileMode.Create;
byte[] byteArray = _file.OpenBinary();
MemoryStream dataStream = new MemoryStream(byteArray);
Stream stream = dataStream;
using (FileStream fs = File.Open(filePath, fileMode))
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
fs.Write(buffer, 0, bytesRead);
fs.Close();
//Create the Connection String
try
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source ='"
+ filePath + "'; Extended Properties=Excel 5.0";
//Create the connection
ExcelConnection =
new System.Data.OleDb.OleDbConnection(ConnectionString);
//create a string for the query
string ExcelQuery;
//Sheet1 is the sheet name
//create the query:
//read columns from the Excel file
ExcelQuery =
"Select * from [Sheet1$]"; // from Sheet1";
//use "Select * ... " to select the entire sheet
//create the command
System.Data.OleDb.
OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
//Open the connection
ExcelConnection.Open();
//Create a reader
System.Data.OleDb.
OleDbDataReader ExcelReader;
ExcelReader = ExcelCommand.ExecuteReader();
//For each row after the first
while (ExcelReader.Read())
thanks,
kshitij -
How to read device report for HP Deskjet 1510
Hi HP,
I can see from the software provided with this printer there is this option to print the device reports.
Please assist on how to read this report because it consist of unknown coding and stuff.
I would appreciate if your side can help me on this coz I assume that we can track our usage through this report.
If this is not the purpose, perhaps you may suggest any other way to get an understandable usage reports?
Regards,
Nadiya
This question was solved.
View Solution.Hello Nadiya,
Welcome to the forums
I understand you are looking for a usage report. The printer will print a test page and you can see the page count on that page, along with the printer information, such as your serial number, etc. If there is anything else you may mean by "usage" please let me know and I will do my best to help.
Click this link: Fixing Ink Streaks, Faded Prints, and Other Common Print Quality Problems
In the guide, look under "Solution six: Print and evaluate a test page and troubleshoot defects" and print a test page.
Take care,
R a i n b o w 7000I work on behalf of HP
Click the “Kudos Thumbs Up" at the bottom of this post to say
“Thanks” for helping!
Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution! -
How to read Excel file in flex
Hi,
I am new to Adobe flex and i dont know how to read Excel in flex and i need coding for that. So anybody help me...
thanks in advance...Hi
You can read and parse XLS files (only works with xls-files) with urlloader and a ZIP-lib that can read zip-files.
public function loadXLS(url:String):void
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, onLoadComplete);
urlLoader.load(new URLRequest(url));
private function onLoadComplete(even:Event):void
urlLoader.removeEventListener(Event.COMPLETE, onLoadComplete);
model.sheetsDict = new Dictionary();
var zipFile:ZipFile = new ZipFile(urlLoader.data);
for(var i:int = 0; i < zipFile.entries.length; i++)
var entry:ZipEntry = zipFile.entries[i];
var data:ByteArray = zipFile.getInput(entry);
if(useFile(entry.name, "/sheet([^$]+)"))
model.sheetsDict[entry.name.split("xl/")[1]] = new XML(data.toString());
else if( useFile(entry.name, "/sharedStrings.xml") )
model.sharedStrings = new XML(data.toString());
else if( useFile(entry.name, "/workbook.xml$") )
model.workbook = new XML(data.toString());
else if( useFile(entry.name, "/workbook.xml.rels") )
model.rels = new XML(data.toString());
trace(model.sharedStrings)
to read the xml properly you have to use namespaces in the reader-class
namespace ns1 = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
use namespace ns1;
namespace ns2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
use namespace ns2;
namespace ns3 = "http://schemas.openxmlformats.org/markup-compatibility/2006";
use namespace ns3;
namespace ns4 = "urn:schemas-microsoft-com:mac:vml";
use namespace ns4;
namespace ns5 = "http://schemas.openxmlformats.org/package/2006/relationships";
use namespace ns5;
//Olof
Maybe you are looking for
-
MP3's do not play in finder (preview)
For some reason I cant the preview feature does not work for Mp3 files in Finder. Instead, the file shows up as a quicktime icon and clicking on it launches quicktime. I do not see the play bar anymore. Any idea what I need to do so that I can listen
-
Hello All, I have 2 questions: 1) I have loaded all my data from R/3 to ODS and now want to load from ODS to Cube. SO I have generated an export datasource by right clicking on the ODS and selecting "Generate Export..." and it gave a successful messa
-
TFS 2013 Upgrade 3 Admin Console hangs
Hi, I upgraded TFS 2013 to TFS 2013.3 and it worked ok for few days. Now when i try to access TFS Admin Console it hangs. When I try to access through TWA its d same problem. I did a)Recycle App pool b)Restart the TFS site c)Reboot the server yet I
-
How to know the delay in redo log apply on Active Dataguard 11g
Hello All, How to know the delay in redo log apply on Active Dataguard 11g... Do we need to wait till log switch occurs? Or is it recommended to schedule a log switch every 15 min, no matter data is updated/inserted or not in primary? Please suggest.
-
Changing FTP Port in 10.3
hi, i am searching everywhere on how to change the port of the ftp service built into OSX 10.3. but no luck on find anything. can someone please tell me how to change this port 20-21 to someting else such as 22-23. thanks.