Capturing UserId's
Hi All,
I am creating a webdynpro report for displaying KM documents and hitscount. In that i want to capture the UserId's from portal and display it. How can i capture it? Is there any code samples for that?
Regards,
Divya
Hi Divya,
Use this method,
public java.lang.String getUserName( )
//@@begin getUserName()
//Getting the user name
String userName = "";
IWDClientUser wdUser = null;
try
wdUser = WDClientUser.getCurrentUser();
catch (WDUMException e)
wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
IUser usernam = wdUser.getSAPUser();
userName = usernam.getUniqueName();
return userName;
//@@end
and add the jar <b>com.sap.security.api</b>. Get back if there are any issues.
regards,
Siva
Similar Messages
-
Does anyone know how to capture the userid and use it as a parameter in a portal report?
Nevermind. I got it working. For some reason, when I pasted my select statement into the default value field, it didn't work. But when my boss typed it in, it worked. I used the same statement to get the department, but apparently we're not storing the e-mail address in Oracle yet.
RR
portal30.wwctx_api.get_user will return logged in user's id. How do I display the user's first name and last name rather than user id? I have a select statement used elsewhere
select first_name, last_name
from portal30.wwsec_person$
where user_name = portal30.wwctx_api.get_user
but can't figure out how/if to use it.
I want to use it in a form based on a procedure that e-mails the information the user enters into the form. I want the form to automatically display the user's name, department, and e-mail address so the user doesn't have to enter it. I put portal30.wwctx_api.get_user into the default value for the name field and it works great, except I want to display first and last names, not userid. Also, how do I get and display the department and e-mail address? I'm new to PL/SQL, so I'd appreciate detailed instructions and/or code.
Thank you in advance!
Rebecca -
How to capture userid,date in a custom table while updating a form
Hi,
I have a requirement to insert the userid, the form name and the date on which the record is saved in a custom table while updating a custom form.
We are using Form Builder 6.0.
I am new to Forms and can anyone help me with these?
I would also want to know under which trigger i should be writing the code in.
Thanks in advance.you can use:
usrid := get_application_property(username);
formname := get_application_property(current_form);
dt := to_char(sysdate,'dd/mm/yyyy hh:mi:ss');
you insert these values in on-update trigger at form level -
Help needed in Performance Tuning
Version : 2008 R2
Hi,
I am trying to build a salable proc which does the computation logic and currently i have 50k user. I am thinking in future perspective and targeting this logic for 500k users.
Sample table schema and test data
create table Comp_Detail(IDcompDetail int identity(1,1) primary key,IDcompAFR int,CompID int default 1050,UserId bigint,
TransferAmount money, processStatus bit default 0,AmtTransferDate datetime);
--===== Create and populate the balance table on-the-fly
;WITH
cteRowSource1 AS
SELECT TOP 500000
N = ROW_NUMBER() OVER (ORDER BY (SELECT NULL))
FROM master.sys.all_columns ac1
CROSS JOIN master.sys.all_columns ac2
INSERT into Comp_Detail(IDcompAFR,CompID,UserId,TransferAmount)
SELECT 1000, 1050,
UserId = ISNULL(N,0)
,TransferAmount = N*10
FROM cteRowSource1
-- select * from Comp_Detail
--===== Create and populate the balance table on-the-fly
Create table User_bank(IDUserBank int identity(1,1) primary key, UserId bigint,Amount_Pend money,Amount_Available money,
LastModDt datetime);
;WITH
cteRowSource AS
SELECT TOP 500000
N = ROW_NUMBER() OVER (ORDER BY (SELECT NULL))
FROM master.sys.all_columns ac1
CROSS JOIN master.sys.all_columns ac2
Insert into User_bank(UserId,Amount_Pend,Amount_Available)
SELECT UserId = ISNULL(N,0)
,PendingAmount = N*10
,AvailableAmount = N*2
FROM cteRowSource
;-- select * from member_balance;
update Comp_Detail set IDcompAFR = 1001 where IDcompDetail > 10000 and IDcompDetail < 20000 ;
update Comp_Detail set IDcompAFR = 1002 where IDcompDetail > 20000 and IDcompDetail < 30000;
update Comp_Detail set IDcompAFR = 1003 where IDcompDetail > 30000 and IDcompDetail < 40000;
update Comp_Detail set IDcompAFR = 1004 where IDcompDetail > 40000 and IDcompDetail <50000;
update Comp_Detail set IDcompAFR = 1005 where IDcompDetail > 50000 and IDcompDetail < 60000;
My logic below,
Declare @CompID int = 1050;
BEGIN
-- Check if any data available to be processed
IF EXISTS (
SELECT TOP 1 IDcompAFR
FROM Comp_Detail
WHERE CompID = @CompID
AND coalesce(processStatus, 0) = 0
BEGIN
BEGIN TRY
-- Set it so if the first UPDATE fails, we won't even start the second update.This really says "If we're in a transaction
-- and something fails, stop processing the transaction and do a rollback if we can".
SET XACT_ABORT ON;
-- temp variable to hold the actual data. this will be used to get IDcompAFR once the balance updated
DECLARE @ActualData TABLE (
UserId BIGINT
,IDcompAFR BIGINT
,ProcessingAmount MONEY
-- table variable to capture the Affected UserId's
DECLARE @AffecedRecords TABLE (UserId BIGINT);
BEGIN TRANSACTION;
-- Get the whole data to be processed.
INSERT INTO @ActualData (
UserId
,IDcompAFR
,ProcessingAmount
SELECT UserId
,IDcompAFR
,ProcessingAmount = COALESCE(TransferAmount, 0)
FROM Comp_Detail
WHERE CompID = @CompID
AND coalesce(processStatus, 0) = 0
-- Aggregare the ProcessingAmount based on UserId
WITH AggregateData
AS (
SELECT UserId
,ProcessingAmount = SUM(COALESCE(ProcessingAmount, 0))
FROM @ActualData
GROUP BY UserId
--Do the Amount update and capture the UserId that are affected.
UPDATE UB
SET UB.Amount_Available = COALESCE(UB.Amount_Available, 0) + AD.ProcessingAmount
,UB.Amount_Pend = COALESCE(UB.Amount_Pend, 0) - AD.ProcessingAmount
,LastModDt = getdate()
OUTPUT deleted.UserId
INTO @AffecedRecords(UserId)
FROM User_bank UB
INNER JOIN AggregateData AD ON UB.UserId = AD.UserId;
--===== Using the captured UserId get the IDcompAFR from @ActualData temp variable
-- and then update the processStatus = 1
--- means OFR processed for the trip .
UPDATE Comp_Detail
SET processStatus = 1
,AmtTransferDate = getdate()
WHERE IDcompAFR IN (
SELECT DISTINCT AD.IDcompAFR
FROM @ActualData AD
INNER JOIN @AffecedRecords AR ON (AD.UserId = AR.UserId)
AND processStatus = 0;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
DECLARE @ErrorMessage NVARCHAR(4000);
DECLARE @ErrorSeverity INT;
DECLARE @ErrorState INT;
SELECT @ErrorMessage = ERROR_MESSAGE()
,@ErrorSeverity = ERROR_SEVERITY()
,@ErrorState = ERROR_STATE();
ROLLBACK TRANSACTION;
RAISERROR (
@ErrorMessage
,@ErrorSeverity
,@ErrorState
END CATCH;
END
END
GO
the query logic takes 20 + minutes and it keeps on running. not sure what mistake i did. any suggestion to improve the speed please
loving dotnetHi Erland,
I understand your concern. Isprocessed is a not null column. I tried to replace the temp variable with temp table and for 500k records it tool 31 seconds. Here is my latest try,
Declare @CompID int = 1050;
BEGIN
-- Check if any data available to be processed
IF EXISTS (
SELECT TOP 1 IDcompAFR
FROM Comp_Detail
WHERE CompID = @CompID
AND coalesce(processStatus, 0) = 0
BEGIN
BEGIN TRY
-- Set it so if the first UPDATE fails, we won't even start the second update.This really says "If we're in a transaction
-- and something fails, stop processing the transaction and do a rollback if we can".
SET XACT_ABORT ON;
--Create a table to remember the rows we updated.
IF OBJECT_ID('tempdb..#ActualData') IS NOT NULL
BEGIN
DROP TABLE #ActualData;
END
IF OBJECT_ID('tempdb..#AffecedRecords') IS NOT NULL
BEGIN
DROP TABLE #AffecedRecords;
END
CREATE TABLE #ActualData(UserId BIGINT
,IDcompAFR BIGINT
,ProcessingAmount MONEY);
Create table #AffecedRecords (UserId BIGINT);
-- temp variable to hold the actual data. this will be used to get IdcompanyOFR once the balance updated
--DECLARE @ActualData TABLE (
-- UserId BIGINT
-- ,IDcompAFR BIGINT
-- ,ProcessingAmount MONEY
-- table variable to capture the Affected UserId's
--DECLARE @AffecedRecords TABLE (UserId BIGINT);
BEGIN TRANSACTION;
-- Get the whole data to be processed.
INSERT INTO #ActualData (
UserId
,IDcompAFR
,ProcessingAmount
SELECT UserId
,IDcompAFR
,ProcessingAmount = COALESCE(TransferAmount, 0)
FROM Comp_Detail
WHERE CompID = @CompID
AND coalesce(processStatus, 0) = 0
-- Aggregare the ProcessingAmount based on UserId
WITH AggregateData
AS (
SELECT UserId
,ProcessingAmount = SUM(COALESCE(ProcessingAmount, 0))
FROM #ActualData
GROUP BY UserId
--Do the balance update and capture the UserId that are affected.
UPDATE UB
SET UB.Amount_Available = COALESCE(UB.Amount_Available, 0) + AD.ProcessingAmount
,UB.Amount_Pend = COALESCE(UB.Amount_Pend, 0) - AD.ProcessingAmount
,LastModDt = getdate()
OUTPUT deleted.UserId
INTO #AffecedRecords(UserId)
FROM User_bank UB
INNER JOIN AggregateData AD ON UB.UserId = AD.UserId;
--===== Using the captured UserId get the IDcompAFR from @ActualData temp variable
-- and then update the processStatus = 1
--- means OFR processed for the trip .
UPDATE Comp_Detail
SET processStatus = 1
,AmtTransferDate = getdate()
WHERE IDcompAFR IN (
SELECT DISTINCT AD.IDcompAFR
FROM #ActualData AD
INNER JOIN #AffecedRecords AR ON (AD.UserId = AR.UserId)
AND processStatus = 0;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
DECLARE @ErrorMessage NVARCHAR(4000);
DECLARE @ErrorSeverity INT;
DECLARE @ErrorState INT;
DROP TABLE #ActualData;
DROP TABLE #AffecedRecords;
SELECT @ErrorMessage = ERROR_MESSAGE()
,@ErrorSeverity = ERROR_SEVERITY()
,@ErrorState = ERROR_STATE();
ROLLBACK TRANSACTION;
RAISERROR (
@ErrorMessage
,@ErrorSeverity
,@ErrorState
END CATCH;
END
END
GO
--select * from Comp_Detail
--select * from User_bank
Can you please help me if we could still speed up the query? I would still request to post the modified code if you have any other way to tune this logic.
thanks
loving dotnet -
MDT 2012 Replace computer task sequence
Hello all,
I am using MDT 2012 Update 1 for upgrading over 200 machines from Windows XP to Windows 7.
Some of these machines are going to be REFRESH scenario. I have the task sequence for REFRESH scenario and it is working as expected.
However, I do not know how to create REPLACE scenario task sequence. From what I understand, I need to create two tasks sequences. I have created a task sequence that capture user's data and upload it to a share.
But how do I create a restore task sequence that restores that data to another computer after installing OS? What do I need to in the restore task sequence that either prompts me to select where to restore the data from or knows where the data is?
In SCCM there is computer association, but I have not been able to figure out how to do it purely using MDT.
Any expert help is greatly appreciated.
Thanks in advance,
SinghP80Right, you will need 2 task sequences in a replace scenario. The REPLACE task sequence captures the user state from the running OS. Then you use a NEW COMPUTER task sequence (I called mine RESTORE) that restores the user state back after installing
the OS, which will boot from media or PXE. RESTORE gets all of its values from the Default and Jackson sections. My apologies, my customsettings.ini is butchered and has comments and junk in it that I should remove to clean it up. And you will
have to edit the code as described in the settings per task sequence thread for my cs.ini to work. And, I set my OSDComputerName=%assettag%. I set my Dell asset tags in the BIOS with the Dell CCTK tool.
http://social.technet.microsoft.com/Forums/en-US/e17a1952-d1f7-41ef-8231-0d6fcc41882e/mdt-2012-settings-per-task-sequence?forum=mdt
[Settings]
Priority=ByLaptopType, ByDesktopType, ByIsVM, DefaultGateway, TaskSequenceID, Default
Properties=MyCustomProperty
[DefaultGateway]
192.168.122.1=Jackson
[Jackson]
DeployRoot=\\192.168.122.6\FDO_Offices
SkipComputerBackup=NO
BackupDir=Captures
BackupShare=\\192.168.122.2\f$
UDShare=\\192.168.122.2\f$\usmtstorage
OSDComputerName=%AssetTag%
UDDir=%OSDComputerName%
SLSShareDynamicLogging=%DeployRoot%\Logs\%OSDComputerName%
SLSHARE=\\192.168.122.2\F$\Logs
MachineObjectOU=OU=Computers,OU=Jackson,OU=Branches,DC=xxxxxxxx,DC=xxxxxxxx,DC=xxxxxxxxxx
UserDataLocation=\\192.168.122.2\f$\usmtstorage\%OSDComputerName%
ComputerBackupLocation=\\192.168.122.2\f$\captures
UserID=xxxxxxxxxx
UserDomain=xxxxxxxxxx
UserPassword=xxxxxxxxxxxx
[ByLaptopType]
Subsection=Laptop-%IsLaptop%
[ByDesktopType]
Subsection=Desktop-%IsDesktop%
[ByIsVM]
Subsection=IsVM-%IsVM%
[Laptop-True]
SkipBitLocker=NO
BDEInstall=TPM
BDEInstallSuppress=NO
BDEWaitForEncryption=FALSE
BDEDriveSize=512
BDEDriveLetter=S:
BDERecoveryKey=AD
;BDEKeyLocation=\\192.168.122.2\f$\bitlocker_keys
BDEAllowAlphaNumericPin=Yes
[Desktop-True]
SkipBitLocker=YES
[IsVM-True]
SkipBitLocker=YES
[Laptop-False]
[Desktop-False]
[IsVM-False]
[Default]
XResolution=1
YResolution=1
BitsPerPel=32
ApplyGPOPack=NO
HIDESHELL=NO
DISABLETASKMGR=YES
;BackupDrive=ALL
SkipProductKey=YES
SkipLocaleSelection=YES
UserLocale=en-US
UILanguage=en-US
SkipTimeZone=YES
TimeZoneName=Central Standard Time
KeyboardLocale=en-US
_SMSTSOrgName=Office of xxxxxxxxxxxx
SkipAdminPassword=YES
AdminPassword=xxxxxxxxxxxxx
SkipApplications=YES
SkipAppsOnUpgrade=YES
SkipDeploymentType=YES
SkipSummary=Yes
MandatoryApplications001={aa888a5e-849a-4522-a4e4-57b39dfa29c2} ;you'll want to remove this
[NEWCOMPUTER]
SkipUserData=YES
DeploymentType=NEWCOMPUTER
OSInstall=Y
;OSDComputerName=
SkipComputerName=NO
SkipFinalSummary=Yes
FinishAction=LOGOFF
SkipTaskSequence=NO
SkipDomainMembership=YES
JoinDomain=xxxxxxxx
DomainAdmin=xxxxxxxxxxxxxx
DomainAdminDomain=xxxxxxxxxxx
DomainAdminPassword=xxxxxxxxxxxxx
SkipCapture=YES
DoNotCreateExtraPartition=NO
[CAPTURE]
SkipUserData=YES
TaskSequenceID=CAPTURE
DeploymentType=CUSTOM
BackupFile=MASTERCAPTURE.wim
SkipAdminPassword=YES
AdminPassword=xxxxxxxxxx
SkipCapture=NO
DoCapture=YES
[REFRESH]
SkipUserData=NO
TaskSequenceID=REFRESH
DeploymentType=REFRESH
DoCapture=NO
USMTMigFiles001=MigApp.xml
USMTMigFiles002=MigUser.xml
USMTMigFiles003=MigDocs.xml
USMTMigFiles004=migexcludexternaldrives.xml ;you'll want to remove this
USMTMigFiles005=migmydocs.xml ;and this
;USMTMigFiles006=migwallpaper.xml
;USMTMigFiles006=MigNetPrinters.xml
; USMTMigFiles007=config.xml
;ScanStateArgs=/v:5 /o /c /vsc /all /localonly
ScanStateArgs /v:5 /o /c /ue:%computername%\*
LoadStateArgs=/v:5 /c
;BackupDrive=ALL
;OSDComputerName=%OSDComputerName%
SkipComputerName=NO
OSInstall=Y
SkipFinalSummary=Yes
FinishAction=LOGOFF
SkipTaskSequence=NO
SkipCapture=YES
DoNotCreateExtraPartition=NO
SkipDomainMembership=YES
JoinDomain=xxxxxxxxxxxx
DomainAdmin=xxxxxxxxxxxxx
DomainAdminDomain=xxxxxxxxxxx
DomainAdminPassword=xxxxxxxxxxxxxx
BackupFile=%OSDComputerName%.wim
[REPLACE]
TaskSequenceID=REPLACE
DeploymentType=REPLACE
SkipComputerName=NO
DoCapture=NO
USMTMigFiles001=MigApp.xml
USMTMigFiles002=MigUser.xml
USMTMigFiles003=MigDocs.xml
USMTMigFiles004=migexcludexternaldrives.xml ;remove this
USMTMigFiles005=migmydocs.xml ;and this
;USMTMigFiles006=migwallpaper.xml
;USMTMigFiles006=MigNetPrinters.xml
; USMTMigFiles007=config.xml
;ScanStateArgs=/v:5 /o /c /vsc /all /localonly
ScanStateArgs /v:5 /o /c /ue:%computername%\* /ue:xxxxxxxxxxxx\administrator
LoadStateArgs=/v:5 /c
;BackupDrive=ALL
SkipUserData=NO
SkipAdminPassword=YES
AdminPassword=xxxxxxxxxxx
SkipCapture=YES
DoCapture=NO
SkipComputerBackup=NO
BackupFile=%OSDComputerName%.wim
[RESTORE]
TaskSequenceID=RESTORE
DeploymentType=NEWCOMPUTER
DoCapture=NO
USMTMigFiles001=MigApp.xml
USMTMigFiles002=MigUser.xml
USMTMigFiles003=MigDocs.xml
USMTMigFiles004=migexcludexternaldrives.xml
USMTMigFiles005=migmydocs.xml
;USMTMigFiles006=migwallpaper.xml
ScanStateArgs /v:5 /o /c /ue:%computername%\*
LoadStateArgs=/v:5 /c /ue:%computername%\* /ue:xxxxxxxx\xxxxxxxx
SkipComputerName=NO
SkipUserData=NO
SkipDomainMembership=YES
JoinDomain=MSS
DomainAdmin=xxxxxxxxxxxx
DomainAdminDomain=xxxxxxxxxxx
DomainAdminPassword=xxxxxxxxxxxxx
DoNotCreateExtraPartition=NO
SkipFinalSummary=Yes
FinishAction=LOGOFF
SkipComputerBackup=NO
Bootstrap.ini:
[Settings]
Priority=Default
[Default]
DeployRoot=\\192.168.122.6\FDO_Offices
UserID=xxxxxxxxxx
UserDomain=xxxxxxx
UserPassword=xxxxxxxxxxxx
SkipBDDWelcome=YES -
Unable to capture return values in web services api
At the time of login to web services if my server is down ,
it returns following error :
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1438)
at java.lang.String.substring(String.java:1411)
I want to capture this error so that i can try another server to login. how do i capture this error
Another place where i want to capture the return Value is when i look for a report on the server
rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
"@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
oInfoObjects = rh.getInfoObjects();
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
Here if the report is not there on the server , it returns a null handler exception.
but if i try catching it by checking my responsehandler is null like rh == null it does not catch it.
Any help will be appreciated
thanks
Rakesh GuptaTed : i have two cases
1) server = server_st.nextToken();
providerURL = "http://"server"/dswsbobje/services";
sessConnURL = new URL(providerURL + "/session");
Connection boConnection = new Connection(sessConnURL);
Session boSession = new Session(boConnection);
EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential();
boEnterpriseCredential.setLogin(userid);
boEnterpriseCredential.setPassword(pwd);
boEnterpriseCredential.setAuthType(auth);
SessionInfo boSI = boSession.login(boEnterpriseCredential);
I have got a list of servers running web servcies stored in my tokens. when i pass the first server name say " test:8080" and that server is down , i want to catch somewhere in the code above that it did not get the connection so that i can loop back and try with the second server say test1:8080
This is for failover purposes.
at present when i was trying to capture return value of boSI it breaks giving the error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1438)
at java.lang.String.substring(String.java:1411)
2nd case :
I am geeting reports from the server and scheduling them:
i run the following code which works fine if reports is there
rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
"@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
oInfoObjects = rh.getInfoObjects();
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
Here if the report is not there on the server then i should be able to catch from the response handle rh that it has got a null value.
but rh does not return a null value
the code ultimately throws a null handle at the following line
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
i am not able to catch the null value there also.
hope you got my issue. -
How to get Win NT userid for setting VPD application context?
We are planning to implement row-level security using VPD. For that to happen, we need to capture the Windows NT userid since all the applications connect through a generic Oracle userid which will not help us.
Has anyone done this before? Your responses are appreciated.
Thanks.SELECT osuser
FROM v$session
WHERE audsid = (SELECT USERENV ('sessionid') FROM dual) -
F4 for Editable field in ALV, display Name but capture ID
Hi Friends,
I have a ALV for which i have defined a Structure, which is passed to Fieldcatlog.
I have defined a Search help - ZUSER_NAME which has following fields to display.
USERID - USR02-BNAME
FNAME
LNAME
FULLNAME
So my structure for fieldcatalog has User-id which is linked to this search help with Domain XUBNAME.
So in my report i made this User-Id as editable and F4 available, everything is working fine.
when user does a F4, its displaying Userid,Fname,Lname and complete name.upon selection and save i am capturing the id and storing in the ztable.
But now i have a requirement that when user selects a value from this search help on F4, i need to display Fullname but capture the User Id. How can i do that?
This is something similar to the one we have in BSP- key-value pair.
how to do this in ALV.
Appreciate if someone can guide me thru.
Thanks,
Simha
Edited by: Simha on Sep 6, 2008 2:24 PMhai , this is example code for editing the F4 display .. check out this
REPORT zalv_editf4display.
*Type pools for alv
TYPE-POOLS : slis.
*structure for t582a tbale
TYPES : BEGIN OF ty_table,
infty TYPE infty,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
infty TYPE infty,
itext TYPE intxt,
sprsl TYPE sprsl,
END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
infty TYPE infty,
itext TYPE intxt,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
wa_table TYPE ty_table,
wa_output TYPE ty_output,
wa_ittext TYPE ty_itext.
*Data declarations for dropdown lists for f4
DATA: it_dropdown TYPE lvc_t_drop,
ty_dropdown TYPE lvc_s_drop,
*data declaration for refreshing of alv
stable TYPE lvc_s_stbl.
*Global variable declaration
DATA: gstring TYPE c.
*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container object
c_alvgd TYPE REF TO cl_gui_alv_grid, "ALV grid object
it_fcat TYPE lvc_t_fcat, "Field catalogue
it_layout TYPE lvc_s_layo. "Layout
*ok code declaration
DATA:
ok_code TYPE ui_func.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*select the infotypes maintained
SELECT infty
pnnnn
zrmkz
zeitb
dname
davo
davoe
FROM t582a UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_table.
*Select the infotype texts
IF it_table[] IS NOT INITIAL.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
*Apppending the data to the internal table of ALV output
LOOP AT it_table INTO wa_table.
wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
wa_output-zrmkz = wa_table-zrmkz.
wa_output-zeitb = wa_table-zeitb.
wa_output-dname = wa_table-dname.
wa_output-davo = wa_table-davo.
wa_output-davoe = wa_table-davoe.
For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
Calling the ALV screen with custom container
CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen ,
Here we can give a title and customized menus
*create 2 buttons with function code 'SAVE' and 'EXIT'.
GIVE A SUITABLE TITLE
*& Module STATUS_0600 OUTPUT
text
MODULE status_0600 OUTPUT.
SET PF-STATUS 'DISP'.
SET TITLEBAR 'ALVF4'.
ENDMODULE. " STATUS_0600 OUTPUT
calling the PBO module ALV_GRID.
*& Module PBO OUTPUT
text
MODULE pbo OUTPUT.
*Creating objects of the container
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CCONT'.
create object for alv grid
create object c_alvgd
exporting
i_parent = c_ccont.
SET field for ALV
PERFORM alv_build_fieldcat.
Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
i_save = 'A'
CHANGING
it_outtab = it_output
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMODULE. " PBO OUTPUT
*& Form alv_build_fieldcat
text
<--P_IT_FCAT text
*subroutine to build fieldcat
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '5'.
lv_fldcat-fieldname = 'ZRMKZ'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 1.
lv_fldcat-scrtext_m = 'PERIOD'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '6'.
lv_fldcat-fieldname = 'ZEITB'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 5.
lv_fldcat-scrtext_m = 'Time constraint'.
lv_fldcat-edit = 'X'.
*To avail the existing F4 help these are to
*be given in the field catalogue
lv_fldcat-f4availabl = 'X'.
lv_fldcat-ref_table = 'T582A'.
lv_fldcat-ref_field = 'ZEITB'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '7'.
lv_fldcat-fieldname = 'DNAME'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Dialogmodule'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '8'.
lv_fldcat-fieldname = 'DAVO'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Start'.
lv_fldcat-edit = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '9'.
lv_fldcat-fieldname = 'DAVOE'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'End'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
*To create drop down for the field 'DAVO'
with our own f4 help
ty_dropdown-handle = '1'.
ty_dropdown-value = ' '.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '1'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '2'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '3'.
APPEND ty_dropdown TO it_dropdown.
CALL METHOD c_alvgd->set_drop_down_table
EXPORTING
it_drop_down = it_dropdown.
LOOP AT it_fcat INTO lv_fldcat.
CASE lv_fldcat-fieldname.
To assign dropdown in the fieldcataogue
WHEN 'DAVO'.
lv_fldcat-drdn_hndl = '1'.
lv_fldcat-outputlen = 15.
MODIFY it_fcat FROM lv_fldcat.
ENDCASE.
ENDLOOP.
ENDFORM. " alv_build_fieldcat
*& Form alv_report_layout
text
<--P_IT_LAYOUT text
*Subroutine for setting alv layout
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-col_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM. " alv_report_layout
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*& Module PAI INPUT
text
MODULE pai INPUT.
*To change the existing values and refresh the grid
*And only values in the dropdown or in the default
*F4 can be given , else no action takes place for the dropdown
*and error is thrown for the default F4 help and font changes to red
*and on still saving, value is not changed
c_alvgd->check_changed_data( ).
*Based on the user input
*When user clicks 'SAVE;
CASE ok_code.
WHEN 'SAVE'.
*A pop up is called to confirm the saving of changed data
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'SAVING DATA'
text_question = 'Continue?'
icon_button_1 = 'icon_booking_ok'
IMPORTING
answer = gstring
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*When the User clicks 'YES'
IF ( gstring = '1' ).
MESSAGE 'Saved' TYPE 'S'.
*Now the changed data is stored in the it_pbo internal table
it_pbo = it_output.
*Subroutine to display the ALV with changed data.
PERFORM redisplay.
ELSE.
*When user clicks NO or Cancel
MESSAGE 'Not Saved' TYPE 'S'.
ENDIF.
**When the user clicks the 'EXIT; he is out
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
CLEAR: ok_code.
ENDMODULE. " PAI INPUT
*& Form REDISPLAY
text
--> p1 text
<-- p2 text
FORM redisplay .
*Cells of the alv are made non editable after entering OK to save
CALL METHOD c_alvgd->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
*Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " REDISPLAY -
How to capture date and userdi in the alert mail
Hi,
In the alert mail I want to capture the userid, date and time. In the container I can define these variables but I was unable to caputre the values. Iam not using any BPM scenario. Can any body help me in this regard how to capture these values. Thanks in advance.
Thanks & Regards,
Mallikarjun.MHi,
Iam using the correct dict type as you mentioned in the above mail. But in my mail it shows that the container elements ZDATE of type SWFXST_DATE, ZTIME of type SWFXST_TIME as not found. I hope this will be solved.
Thanks,
Mallikarjun.M -
Capturing the Message on the Login Page (Invalid user/password expired etc.
Hi, I have a requirment for capturing the error message on the Login page if the User's Account is expired or Account is Disabled or Invalid credentials, Password Lockout etc.
I am using the attached login page. Can any one please help me out on this.
<html><head><title>AARPLogin Page</title>
<script type="text/javascript" language="JavaScript" xml:space="preserve">
// This function automatically gets called for broswer detection
var isNav4 = false;
var isIE4 = false;
var isNS6 = false;
function obDetectBrowser()
if ( navigator.appVersion.charAt( 0 ) == "4" )
if ( navigator.appName == "Netscape" )
isNav4 = true;
} else {
isIE4 = true;
else
if ( navigator.appVersion.charAt( 0 ) >= 5 )
if ( navigator.appName == "Netscape" )
isNS6 = true;
obDetectBrowser ();
var HOSTNAME =
var COOKIE_OBREQUESTEDURL = "OBREQUESTEDURL";
var COOKIE_OBFORMLOGINCOOKIE = "ObFormLoginCookie";
var NCID_LANDING_PAGE_URL = "/landing/";
var QS_REDIR = "ReDir";
var keyChooser;
function checkPasswordEnterKey( event )
var form = document.forms[0];
if (isNav4 || isNS6) {
keyChooser = event.which ;
} else if (isIE4) {
keyChooser = window.event.keyCode;
if (keyChooser == 13) {
if (
form.userid.value
&& form.userid.value != ""
&& form.password
&& form.password.value != ""
form.submit();
return true;
else
alert('Please enter a UserId and Password');
return false;
function showHidePanel( panelID, displayValue )
var panelElement = document.getElementById( panelID );
if ( displayValue == 'show' )
panelElement.style.display = 'block';
else
panelElement.style.display = 'none';
function getQueryVariable( variable )
var query = window.location.search.substring( 1 );
var vars = query.split( "&" );
for ( var i=0; i < vars.length; i++)
var pair = vars[ i ].split( "=" );
if ( pair[ 0 ] == variable )
return unescape( pair[ 1 ] );
return "";
function Get_Cookie( name )
var nameEQ = name + "=";
var ca = document.cookie.split( ';' );
for( var i=0; i < ca.length; i++ )
var c = ca[ i ];
while ( c.charAt( 0 )==' ' )
c = c.substring( 1, c.length );
if ( c.indexOf( nameEQ ) == 0 )
return c.substring( nameEQ.length, c.length );
return null;
function Set_Cookie( name, value, expires, path, domain, secure)
document.cookie = name + "=" + escape( value ) +
( ( expires ) ? ";expires=" + expires.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
function Delete_Cookie( name, path, domain )
if ( Get_Cookie( name ) )
document.cookie = name + "=" +
( (path) ? ";path=" + path : "" ) +
( (domain) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
function lostPassword()
var CurrentLogin = document.forms[0].userid.value;
if ( CurrentLogin == "" ) {
alert ( "Please enter your eMail Address." );
document.forms[0].userid.focus();
else {
Set_Cookie( COOKIE_OBFORMLOGINCOOKIE, "done", 0, "/" );
var LOST_PWD_PAGE = "/identity/oblix/apps/lost_pwd_mgmt/bin/lost_pwd_mgmt.cgi?program=passwordChallengeResponse&login="+CurrentLogin+"&backUrl=http://oradev2.na.aarp.int/login/login.html&target=top";
window.location = LOST_PWD_PAGE;
function emailPassword()
document.passform.submit();
function onLoad()
if (getQueryVariable( "MSG" ) == 'LOGIN_FAILED' )
alert ("Login Failed, Please try again");
else if (getQueryVariable( "MSG" ) == 'PWD_EXP' )
alert ("Your Password Is About to Expire. Please Change it at your earliest convenience.");
var pwdExpUID = getQueryVariable( "login" );
var hostTarget = getQueryVariable( "hostTarget" );
var resURL = getQueryVariable( "resURL" );
var PWD_EXP_PAGE = "/identity/oblix/apps/lost_pwd_mgmt/bin/lost_pwd_mgmt.cgi?program=redirectforchangepwd&login="+pwdExpUID+"&backURL="+hostTarget+resURL+"&target=top";
window.location = PWD_EXP_PAGE;
else if (getQueryVariable( "MSG" ) == 'CHGPWD' )
alert ("You are required to change your password.");
var chgPwdUID = getQueryVariable( "login" );
var hostTarget = getQueryVariable( "hostTarget" );
var resURL = getQueryVariable( "resURL" );
var CHG_PWD_PAGE = "http://"+HOSTNAME+"/identity/oblix/apps/lost_pwd_mgmt/bin/lost_pwd_mgmt.cgi?program=redirectforchangepwd&login="+chgPwdUID+"&backURL="+hostTarget+resURL+"&target=top";
window.location = CHG_PWD_PAGE;
</script></head><body onload="onLoad();document.login.userid.focus();" alink="blue" bgcolor="#ffffff" link="blue" vlink="blue">
<p align="center">
<img alt="AARP Header Logo" src="login_files/aarpLogo.gif" border="0" height="91" width="219">
<br>
</p><form name="login" method="post" action="/access/oblix/apps/webgate/bin/webgate.so">
<div class="boldText" align="center">
<h2>Login</h2>
<div class="boldText" align="left">
<div id="LoginFailed" style="display: none;">
<table align="center" bgcolor="#ff0000" border="0" cellpadding="2" cellspacing="0" width="500">
<tbody><tr>
<td>
<table bgcolor="#e5e5e5" border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody><tr bgcolor="#ffffff">
<td rowspan="3" height="40" nowrap="nowrap" valign="top">
<img src="login_files/error.gif" name="error" height="20" width="20">
</td>
<td rowspan="3" align="center">
<p>
<font color="#ff0000" size="-1">
<b>
<div id="TryAgain" style="display: none;">Login Failed! Invalid UserID and/or Password, Please try again.<br></div>
<div id="AccountLocked" style="display: none;">Your Account has been Locked!</div>
</b>
</font>
</p>
<p>
<font color="#ff0000">
<b>For
assistance call E-Services Help Line at (XXX) XXX-XXXX Monday through
Friday between the hours of 8:00 am and 5:00 pm eastern standard time.</b>
</font>
</p>
</td>
</tr>
<tr bgcolor="#ffffff">
</tr><tr bgcolor="#e5e5e5">
</tr></tbody></table>
</td>
</tr>
</tbody></table>
</div>
<br>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tbody><tr>
<td background="login_files/border_upper_left.gif" height="20" nowrap="nowrap" width="20"> </td>
<td background="login_files/border_top.gif" height="20" nowrap="nowrap"> </td>
<td background="login_files/border_upper_right.gif" height="20" nowrap="nowrap" width="20"> </td>
</tr>
<tr>
<td background="login_files/border_left.gif" nowrap="nowrap" width="20"> </td>
<td>
<table bgcolor="#ebebce" border="0" cellpadding="2" cellspacing="0" height="100%" width="100%">
<tbody><tr>
<td colspan="3" align="center">
<font color="darkred" face="Arial" size="3">
<b>
</b></font>
<b> </b></td>
</tr>
<tr valign="bottom">
<td colspan="3" width="100%">
<table bgcolor="#ebebce" border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody><tr bgcolor="#e5e5e5">
<td rowspan="2" bgcolor="#ebebce" height="20" nowrap="nowrap" valign="top" width="4%">
<font color="#000000">
<span class="text">
<img src="login_files/arrow.gif" align="top" height="20" width="20">
</span>
</font>
<font color="#000000"> </font>
</td>
<td rowspan="2" bgcolor="#ebebce" width="96%">
<font color="#000000" size="-1">
<span class="text">Please enter your Email and Password. If you are a new user to AARP, please select First Time AARP User.
</span>
</font>
</td>
</tr>
<tr bgcolor="#e5e5e5">
</tr></tbody></table>
</td>
</tr>
<tr valign="bottom">
<td colspan="3">
<table align="center" border="0" width="349">
<tbody><tr>
<td nowrap="nowrap" width="74">
<font color="#000000" size="-1">
<div align="left">eMail:</div>
</font>
</td>
<td width="265">
<input name="userid" value="" size="32" maxlength="32" tabindex="2" type="text">
</td>
</tr>
<tr>
<td>
<font color="#000000" size="-1">
<div align="left">Password:</div>
</font>
</td>
<td>
<p>
<font color="#000000" size="-1">
<input name="password" size="32" maxlength="32" length="30" tabindex="3" type="password">
</font>
</p>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td>
<font color="#000000" size="-1">
<p align="center"><b>Forgot Your Password?</b></p>
</font>
</td></tr>
<tr>
<td align="center"> <font color="#000000" size="-1"><!--
Reset Password
-->
Email New Password
</font>
</td></tr>
<tr>
<td colspan="4">
<div class="boldText" align="center">
<br>
<input src="login_files/button_login.gif" name="Submit" value="" alt="login" type="image">
<!--
<b class="boldText"><img src="../images/button_login.gif" width="68" height="25" name="img_login" border="0" alt="login"/></b>
--> <b class="boldText"><img src="login_files/button_clear.gif" name="img_clear" alt="clear" border="0" height="25" width="68"></b>
<b class="boldText"><img src="login_files/button_help.gif" name="img_help" alt="help" border="0" height="25" width="68"></b>
<b class="boldText"><img src="login_files/button_cancel.gif" name="img_cancel" alt="cancel" border="0" height="25" width="68"></b>
</div>
</td>
</tr>
</tbody></table>
</td>
<td background="login_files/border_right.gif" nowrap="nowrap" width="20"> </td>
</tr>
<tr>
<td background="login_files/border_lower_left.gif" height="20" nowrap="nowrap" width="20"> </td>
<td background="login_files/border_bottom.gif" height="20" nowrap="nowrap"> </td>
<td background="login_files/border_lower_right.gif" height="20" nowrap="nowrap" width="20"> </td>
</tr>
</tbody></table>
<p></p>
<span class="text"><br><br><b>NOTICE:
This system is the property of AARP and is for authorized use only.
Unauthorized access is a violation of federal and state law. All
software, data transactions, and electronic communications are subject
to monitoring.</b></span>
<div id="hr" style="position: absolute; width: 100%; height: 10px; z-index: 90; top: 657px; left: 10px;">
<hr>
</div>
<div id="footer" style="position: absolute; width: 700px; height: 55px; z-index: 115; top: 678px; left: 50px;">
<span class="subhead">
Privacy Policy
Disclaimer
Contact Us
</span>
<span class="bodytext">
</span></div>
<form name="passform" action="http://oradev2.na.aarp.int/wampassword/passwordReset.html" method="post">
<input name="login" value="" type="hidden">
<input name="backUrl" value="http://oradev2.na.aarp.int/login/login.html" type="hidden">
</form>
<script type="text/javascript" language="JavaScript" xml:space="preserve">
var undefined;
if (
document.login
&& document.login.password
function clearForm()
document.login.reset();
function navigate( linkName )
if ( 'login' == linkName )
if ( document.accountLogin.userID.value != '' && document.login.password.value != '' )
alert('Please click the Account Registration Setup link for now');
//document.location = 'userDataPersonal.htm';
else
alert('Please enter a UserId and Password');
function openHelp()
helpDoc = window.open( "http://www.aarp.org", "", "scrollbars=yes,resizable=yes,width=500,height=300" );
function cancel()
// open dialog
var initX = parseInt( window.screenX ) + parseInt( window.outerWidth ) / 2 - 100;
var initY = parseInt( window.screenY ) + parseInt( window.outerHeight ) / 2 - 50;
cancelDialog = window.open( "./cancelDialog.html", " cancelDialog", "resizable=yes,toolbar=no,menubar=no,width=200,height=150,screenX=" + initX +",screenY=" + initY );
</script>
</div></form></body>
<script type="text/javascript">
<!--
function __RP_Callback_Helper(str, strCallbackEvent, splitSize, func){var event = null;if (strCallbackEvent){event = document.createEvent('Events');event.initEvent(strCallbackEvent, true, true);}if (str && str.length > 0){var splitList = str.split('|');var strCompare = str;if (splitList.length == splitSize)strCompare = splitList[splitSize-1];var pluginList = document.plugins;for (var count = 0; count < pluginList.length; count++){var sSrc = '';if (pluginList[count] && pluginList[count].src)sSrc = pluginList[count].src;if (strCompare.length >= sSrc.length){if (strCompare.indexOf(sSrc) != -1){func(str, count, pluginList, splitList);break;}}}}if (strCallbackEvent)document.body.dispatchEvent(event);}function __RP_Coord_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Coord_Callback = str;pluginList[index].__RP_Coord_Callback_Left = splitList[0];pluginList[index].__RP_Coord_Callback_Top = splitList[1];pluginList[index].__RP_Coord_Callback_Right = splitList[2];pluginList[index].__RP_Coord_Callback_Bottom = splitList[3];};__RP_Callback_Helper(str, 'rp-js-coord-callback', 5, func);}function __RP_Url_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Url_Callback = str;pluginList[index].__RP_Url_Callback_Vid = splitList[0];pluginList[index].__RP_Url_Callback_Parent = splitList[1];};__RP_Callback_Helper(str, 'rp-js-url-callback', 3, func);}function __RP_TotalBytes_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_TotalBytes_Callback = str;pluginList[index].__RP_TotalBytes_Callback_Bytes = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}function __RP_Connection_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Connection_Callback = str;pluginList[index].__RP_Connection_Callback_Url = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}
//--></script></html>Is it not possible that someone fired the password expiration cmd ?
SQL> select limit
2 from dba_profiles
3 where profile='DEFAULT'
4 and resource_name='PASSWORD_LIFE_TIME';
LIMIT
UNLIMITED
SQL> select profile from dba_users where username='MYUSER';
PROFILE
DEFAULT
SQL> conn myuser/myuser
Connected.
SQL> conn / as sysdba
Connected.
SQL> alter user myuser password expire;
User altered.
SQL> conn myuser/myuser
ERROR:
ORA-28001: the password has expired
Changing password for myuser
New password:
Password unchanged
Warning: You are no longer connected to ORACLE.
SQL> conn / as sysdba
Connected.
SQL> select name, astatus, TO_CHAR(ctime,'DD-MM-YYYY HH:MI') CTIME, TO_CHAR(ptime,'DD-MM-YYYY HH:MI') PTIME, TO_CHAR(EXPTIME,'DD-MM-YYYY HH:MI') EXPIRE
2 from sys.user$ where name ='MYUSER';
NAME
ASTATUS CTIME
PTIME
EXPIRE
MYUSER
1 23-11-2011 11:15
23-11-2011 11:15
23-11-2011 11:17
SQL>Nicolas. -
WEBCENTER CAPTURE - ERROR DURING CHECK-IN
Hi,
I’ve configured my commit driver as a “WebCenter Content”.
When releasing a batch I can see from the log that CHECKIN_UNIVERSAL is invoked but fails later with an exception -
“[APP: capture] Unable to locate authentication handler for Content Server response: OK
[2013-10-14T11:25:53.636+02:00] [capture_server1] [ERROR] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Error sending check-in request.[[ “
Anybody encountered such a behavior?
Thanks, Yan
The log:
[2013-10-14T11:23:33.214+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.batchprocessor.BatchProcessorBean] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-0000000000000087,0] [APP: capture] [SCND_DOC26 (26)] No batch processor specified, batch will be unlocked and placed in a ready state.
[2013-10-14T11:25:40.417+02:00] [capture_server1] [NOTIFICATION] [] [oracle.oddc.servlet.FileExchange] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a4,0] [APP: capture] [DSID: 0000K6qH3ZnDwW05zzWByW1IMvRE000001] Starting upload
[2013-10-14T11:25:40.573+02:00] [capture_server1] [NOTIFICATION] [] [oracle.oddc.servlet.FileExchange] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a4,0] [APP: capture] [DSID: 0000K6qH3ZnDwW05zzWByW1IMvRE000001] Upload complete in 516
[2013-10-14T11:25:40.652+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Initializing RIDC.
[2013-10-14T11:25:40.652+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Loading Capture metadata definitions from workspace ID 1.
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Creating RIDC binder for check-in.
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("IdcService", "CHECKIN_UNIVERSAL")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("dDocTitle", "redinvoice")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("dDocType", "Binary")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("dSecurityGroup", "Public")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("dDocAccount", "")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Adding metadata to binder. Name: [xComments]. Value: [red].
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] binder.putLocal("dDocAuthor", "weblogic")
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] primaryFile: C:\Users\ADMINI~1\AppData\Local\Temp\27\redinvoiceYan.PDF
[2013-10-14T11:25:52.870+02:00] [capture_server1] [NOTIFICATION] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] [SCND_DOC27 (27)] Sending check-in request.
[2013-10-14T11:25:53.480+02:00] [capture_server1] [WARNING] [] [] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Unable to locate authentication handler for Content Server response: OK
[2013-10-14T11:25:53.636+02:00] [capture_server1] [ERROR] [] [oracle.odc.commitprocessor.CommitProcessor] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: aaa1e3e54fdb4a71:-645755b7:141b64215f9:-8000-00000000000000a6,0] [APP: capture] Error sending check-in request.[[
oracle.stellent.ridc.protocol.http.HttpProtocolException: Http status: Moved Temporarily
at oracle.stellent.ridc.protocol.http.IdcHttpProtocol.writeRequest(IdcHttpProtocol.java:271)
at oracle.stellent.ridc.IdcClient.sendRequest(IdcClient.java:181)
at oracle.odc.commit.cs.ContentCommitDriver.releaseDocument(ContentCommitDriver.java:479)
at oracle.odc.commitprocessor.CommitProcessor.processBatch(CommitProcessor.java:407)
at oracle.odc.batchprocessor.BatchProcessorBean.processMessage(BatchProcessorBean.java:135)
at oracle.odc.batchprocessor.CommitProcessorBean.onMessage(CommitProcessorBean.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103)
at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100)
at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154)
at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113)
at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy235.onMessage(Unknown Source)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:486)
at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:389)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3822)
at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)The only thing I can think of is to check the Capture side - see Monitoring Capture - 11g Release 1 (11.1.1) (and the following chapter). Try to find what's being logged. Focus namely on Commit Batches (4.4.4.)
I'm afraid that either way (user will be in Capture, but not in UCM, or user won't be in either Capture, or UCM) you will need to search if something like that was not reported. -
Need Help With Capturing EDirectory/IChain User Info
After 8 years, we were finally able to get our production ColdFusion MX7 server, working with the company's EDirectory server. EDirectory now authenticates users, based on their job title, job class, job group, etc. We provided our IS (Information Security) department with the job codes and report names, directories, etc., that each employee (job code) can access. Previously, we used "passwords" to limit access to more confidential reports to select management employees.
There are only a few CF servers in our company, so the IS (Information Security) department is not familiar with how to use ColdFusion to "capture" user information that they say is being passed "back" to the CF server, after each user's query/report request. IS says about a dozen variables are being passed in the header, back to the CF server, including EMPLOYEE NAME, LOCATION, etc.
I'm trying to figure out how to capture that info, and use it to greet the user "by name" when they connect to our CF report server. And to also maintain a log file of which locations and employees are accessing our web reports. Today, we use the SQL Server logs, which only contain the IP address and URL information "sent" (not returned), to know how often certain reports are being requested. But we don't know by who, or by which locations.
One person in IS recommended using CFHTTP, and I've tried it, but don't seem to be able to pull the variables off the header. I thought using CFLDAP might work, but doesn't. If anyone is in a similar situation, and knows how best to pull this info from the header info coming from EDirectory, I would apppreciate some advice. Just knowing if CFLDAP or CFHTTP will work, or if something else is required. Just trying to get on the right footing, at the moment. Thank you,
Gary1Thanks for the reply. I was actually hoping the I-Chain/EDirectory variables would be available as CGI variables. Here are some of the CGI variables I tried to retrieve from the header. As you can see, only two contained values. There must be some other way to obtain these. I'd played around with CFLDAP, CFHTTP, etc. No such luck. But as mentioned, the IS dept says the values I'm looking for (UserID, Name, Location, etc.) are all being sent in every header (every response from the server). Am just not sure which CF tags/tools to use to capture them. Maybe it requires some special script. I tried a few of those found in the CF7 on-line help, but no luck in getting the scripts to run. If any other thoughts or suggestions, they would be much appreciated. Thanks again, Gary1.
<CFSET ValidSource1 = CGI.QUERY_STRING>
<CFSET ValidSource2 = CGI.HTTP_REFERER>
<CFSET ValidSource3 = CGI.REMOTE_USER>
<CFSET ValidSource4 = CGI.REMOTE_ADDR>
<CFSET ValidSource5 = CGI.AUTH_USER>
<CFSET ValidSource6 = CGI.REMOTE_USER>
<CFSET ValidSource7 = CGI.SERVER_NAME>
ValidSource1 =
ValidSource2 =
ValidSource3 =
ValidSource4 = 57.14.131.12
ValidSource5 =
ValidSource6 =
ValidSource7 = aometrics.xxx.com -
How to capture name of user that logs into Portal?
Im trying to create a report that returns information from a
Profile table. The UserId is the key to the Profile table.
Since this report returns information dependent upon who runs
it, I would make use of the USER functionality in SQL to isolate
the row in the Profile table. However, this technique wont
work through Portal because the user logs into Portal not the
database.
What technique (keyword, API, etc.) should I use to capture the
username of the person who logged into Portal?
Thanx,
JETry this:
PORTAL30.wwctx_api.get_user
Adam -
Can I capture crystal report user input in my web application?
Folks, I have a report that has a input paramter named "AccountKey". Crystal report launches its own input parameter capture screen where user can type in the AccountKey value and hit OK button. Subsequently the crystal report gets renedred in crystal report viewer.
I have a requirement of rendering the report in PDF not in crystal report. How do I do that.
I am able to do that when there is no user input needed in the crystal report or, if I can somehow supply needed input from code-behind, but the moment I has a parameter that expects user-input I loose control.
Is there anyway I can capture what value user has entered in Crystal Report Input paramagter capture form? or, any alternate that can help me acheive the result?
Thanks.Hi,
To capture the values of Parameters the best thing you can do is to code for parameters and take values from it through text boxes, so that you can capture it.
here some sample code for it - try it
I would like you to know the following code that I have tried at my end using Viewer Object model:
// Object Declaration
ParameterFields boParameterFields = null;
ParameterField boParameterField = null;
ParameterValues boParameterValues = null;
ParameterDiscreteValue boParameterDiscreteValue = null;
ParameterRangeValue boParameterRangeValue = null;
// loading the report
CrystalReportViewer1.ReportSource = Server.MapPath("ReportWithSubReport.rpt");
CrystalReportViewer1.RefreshReport();
// passing database credentials...
foreach(CrystalDecisions.Shared.TableLogOnInfo boTableLogOnInfo in CrystalReportViewer1.LogOnInfo)
ConnectionInfo boConnectionInfo = boTableLogOnInfo.ConnectionInfo;
boConnectionInfo.UserID ="sa";
boConnectionInfo.Password="sa";
// Parameter Country
boParameterFields = CrystalReportViewer1.ParameterFieldInfo;
boParameterField = boParameterFields["Country"];
boParameterValues = boParameterField.CurrentValues;
boParameterDiscreteValue = new ParameterDiscreteValue();
boParameterDiscreteValue.Value = "Argentina";
boParameterValues.Add(boParameterDiscreteValue);
// Parameter Sales
boParameterField = boParameterFields["Sales"];
boParameterValues = boParameterField.CurrentValues;
boParameterRangeValue = new ParameterRangeValue();
boParameterRangeValue.StartValue = 25000;
boParameterRangeValue.EndValue = 100000;
boParameterValues.Add(boParameterRangeValue);
// Parameter @percentage in subreport named SubReport
boParameterField = boParameterFields["@percentage", "SubReport"];
boParameterValues = boParameterField.CurrentValues;
boParameterValues.Clear();
boParameterDiscreteValue = new ParameterDiscreteValue();
boParameterDiscreteValue.Value = 75;
boParameterValues.Add(boParameterDiscreteValue);
Please note that I have used Range and Discrete values as parameter in the above code.
Also if you want to use the ReportDocument Object model then you can use:
ReportDocument.SetParameterValues("Parameter name", value)
Note:- This code is valid for only discrete values of Parameters.
or
boParameterFieldDefinitions = boReportDocument.DataDefinition.ParameterFields;
boParameterFieldDefinition = boParameterFieldDefinitions["@percentage","SubReport"];
boParameterValues = boParameterFieldDefinition.CurrentValues;
For getting output in PDF you can export the report to PDF throug viewer or from code fro e.g.-
boReportDocument.ExportToDisk(ExportFormatType.portabledocumentformat,"c:\\temp\\myrpt.pdf");
To download sample code click [here|https://boc.sdn.sap.com/codesamples].
You can also take help from [Dev library|https://boc.sdn.sap.com/node/7770]
Hope this helps!!
Regards,
Amit -
Capture Image metadata with JAI
Hi,
Can we capture the metadata of a photograph taken by a digital camera (JPEG file) using the JAI?
Some of the features that I'm interested in capturing are: Data Picture Taken, Camera Model and so on.
Any sample snippet of code is highly appreciated.
Thanks,
BhaskarShould have searched the forum throughly....this is the code which was given by Mr. Maxideon [http://forums.sun.com/profile.jspa?userID=1078315] -- All credits to him -- although this post is very old, probably would be helpful for someone else :)
import javax.swing.*;
import javax.imageio.*;
import javax.imageio.metadata.*;
import javax.imageio.stream.ImageInputStream;
import javax.imageio.stream.MemoryCacheImageInputStream;
import org.w3c.dom.NodeList;
public class ExifSSCCE {
private static String JPEGMetaFormat = "javax_imageio_jpeg_image_1.0";
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try{
runSequence();
}catch(Exception e) {
e.printStackTrace();
System.exit(-1);
private static void showMessageAndExit(String message) {
JOptionPane.showMessageDialog(null,message,"Error",JOptionPane.ERROR_MESSAGE);
System.exit(0);
public static void runSequence() throws java.io.IOException{
if(!ImageIO.getImageReadersByFormatName("tif").hasNext()) {
showMessageAndExit("You will need a tiff ImageReader plugin to " +
"parse exif data. Please download \"JAI-ImageIO\".");
JOptionPane.showMessageDialog(null,"Please select a jpeg file with " +
"EXIF metadata");
JFileChooser chooser = new JFileChooser();
if(chooser.showOpenDialog(chooser) == JFileChooser.CANCEL_OPTION) {
System.exit(0);
java.io.File toOpen = chooser.getSelectedFile();
ImageInputStream in = ImageIO.createImageInputStream(toOpen);
java.util.Iterator<ImageReader> readers = ImageIO.getImageReaders(in);
if(!readers.hasNext()) {
showMessageAndExit("The selected file was not an image file, or " +
"not a type that ImageIO recognized.");
ImageReader reader = null;
while(readers.hasNext()) {
ImageReader tmp = readers.next();
if(JPEGMetaFormat.equals(tmp.getOriginatingProvider().getNativeImageMetadataFormatName())) {
reader = tmp;
break;
if(reader == null) {
showMessageAndExit("The selected file was not a jpeg file.");
reader.setInput(in, true, false);
byte[] exifRAW = getEXIF(reader.getImageMetadata(0));
if(exifRAW == null) {
showMessageAndExit("The selected jpeg file did not contain any " +
"exif data.");
reader.dispose();
in.close();
IIOMetadata exifMeta = getTiffMetaFromEXIF(exifRAW);
JFrame frame = new JFrame();
frame.setContentPane(new JScrollPane(parseExifMeta(exifMeta)));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
private static JTable parseExifMeta(IIOMetadata exifMeta) {
//Specification of "com_sun_media_imageio_plugins_tiff_image_1.0"
//http://download.java.net/media/jai-imageio/javadoc/1.1/com/sun/media/imageio/plugins/tiff/package-summary.html
javax.swing.table.DefaultTableModel tags =
new javax.swing.table.DefaultTableModel();
tags.addColumn("Tag #");
tags.addColumn("Name");
tags.addColumn("Value(s)");
IIOMetadataNode root = (IIOMetadataNode)
exifMeta.getAsTree("com_sun_media_imageio_plugins_tiff_image_1.0");
NodeList imageDirectories = root.getElementsByTagName("TIFFIFD");
for(int i = 0; i < imageDirectories.getLength(); i++) {
IIOMetadataNode directory = (IIOMetadataNode) imageDirectories.item(i);
NodeList tiffTags = directory.getElementsByTagName("TIFFField");
for(int j = 0; j < tiffTags.getLength(); j++) {
IIOMetadataNode tag = (IIOMetadataNode) tiffTags.item(j);
String tagNumber = tag.getAttribute("number");
String tagName = tag.getAttribute("name");
String tagValue;
StringBuilder tmp = new StringBuilder();
IIOMetadataNode values = (IIOMetadataNode) tag.getFirstChild();
if("TIFFUndefined".equals(values.getNodeName())) {
tmp.append(values.getAttribute("value"));
}else {
NodeList tiffNumbers = values.getChildNodes();
for(int k = 0; k < tiffNumbers.getLength(); k++) {
tmp.append(((IIOMetadataNode) tiffNumbers.item(k)).getAttribute("value"));
tmp.append(",");
tmp.deleteCharAt(tmp.length()-1);
tagValue = tmp.toString();
tags.addRow(new String[]{tagNumber,tagName,tagValue});
return new JTable(tags);
/**Returns the EXIF information from the given metadata if present. The
* metadata is assumed to be in <pre>javax_imageio_jpeg_image_1.0</pre> format.
* If EXIF information was not present then null is returned.*/
public static byte[] getEXIF(IIOMetadata meta) {
//http://java.sun.com/javase/6/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html
//javax_imageio_jpeg_image_1.0
//-->markerSequence
//---->unknown (attribute: "MarkerTag" val: 225 (for exif))
IIOMetadataNode root = (IIOMetadataNode) meta.getAsTree(JPEGMetaFormat);
IIOMetadataNode markerSeq = (IIOMetadataNode)
root.getElementsByTagName("markerSequence").item(0);
NodeList unkowns = markerSeq.getElementsByTagName("unknown");
for(int i = 0; i < unkowns.getLength(); i++) {
IIOMetadataNode marker = (IIOMetadataNode) unkowns.item(i);
if("225".equals(marker.getAttribute("MarkerTag"))) {
return (byte[]) marker.getUserObject();
return null;
/**Uses a TIFFImageReader plugin to parse the given exif data into tiff
* tags. The returned IIOMetadata is in whatever format the tiff ImageIO
* plugin uses. If there is no tiff plugin, then this method returns null.*/
public static IIOMetadata getTiffMetaFromEXIF(byte[] exif) {
java.util.Iterator<ImageReader> readers =
ImageIO.getImageReadersByFormatName("tif");
ImageReader reader;
if(!readers.hasNext()) {
return null;
}else {
reader = readers.next();
//skip the 6 byte exif header
ImageInputStream wrapper = new MemoryCacheImageInputStream(
new java.io.ByteArrayInputStream(exif,6,exif.length-6));
reader.setInput(wrapper,true,false);
IIOMetadata exifMeta;
try {
exifMeta = reader.getImageMetadata(0);
}catch(Exception e) {
//shouldn't happen
throw new Error(e);
reader.dispose();
return exifMeta;
}Edited by: amitahire on Mar 27, 2010 4:57 AM
Maybe you are looking for
-
Error installing BW 3.1 (WAS 6.20)
Hi all I'm currently working on a new installation of BW 3.1 (WAS 6.20) on MSSQL. I got the SQL Server installed, along with SP3 and I have setup the Central Instance with no errors as well. However, when I do the Database Instance install, I get an
-
How do I set the quality of a "save to pdf" or "mail pdf" ?
I have created a document (say, in Pages, MS Word, or Apple Works/Claris Works [yes, that is still an excellent programme..., even on an intel Mac] and then want to save it as pdf or " mail pdf". If the document page has many pictures, the pdf create
-
SQL Server Data Tools for SQL 2014 setup
Hello, I have been using SQL server 2008 with Visual Studio 2008 to perform the ETL processes. I have recently got SQL 2014 and realized that Business Intelligence Development Studio does not come with it so I have to download SQL Server Data Tools f
-
Hello, my mac book air won't update. Every time i try it goes onto the purple starry screen and stays that way for hours, so i just have to shut it down. I have deleted a lot on my laptop so there is enough space, please help?
-
I am currently using an Ethernet connection in my hotel room to connect to the internet. I am able to send and receive emails with no problems. However, when I attempted to open web pages, Safari will only open 10% of the websites I have tried. I get