FUNCTION EXIT_SAPMM07M_001. para la transaccion MB1A
Gracias amigos por su ayuda, si fuera posible, los invitaria a todos a un asado...
necesito buscar un user exit para la transaccion MB1A, ya que al grabar, necesito validar un campo, la funcion que uso es
FUNCTION EXIT_SAPMM07M_001.
INCLUDE ZXMBCU02.
y al grabar funciona, pero cuando ingreso un nuevo material, y hago en enter en cantidad, se me activa igualmente este exit user, y luego al grabar, ya no pasa por haí..
ud saven por ke puede suceder esto..?? o sino, otro user exit para validar al grabar..??
gracias amigos
Hola,
No se por qué te sucede lo que dices, no lo he podido probar.
Puedes intentarlo con la siguiente exit, creo que te funcionará.
MB_CF001 (component: Function module EXIT_SAPLMBMB_001 with Include ZXMBCU01)
En caso contrario, puedes ver más exits en la documentación del siguiente punto de parametrización:
Gestión de materiales / Gestión de stocks e inventario / Actualizar exits de cliente para la gestión de stocks.
Espero te sea útil.
Chao!
Similar Messages
-
User exit EXIT_SAPLL03T_002 and jobs
Hi everybody,
I have a problem with user exit EXIT_SAPLL03T_002 and trx LT12, i put code (the code is in the end) in the user exit in order to update the field QNAME from the standar table LTAP, the sentences for the update are in a job.
The problem is when a run the LT12, put the order and press enter the trx finish normally, but when i see the jobs resumen (SM37) there isnt any job.
Thank you for your help, see you.
INCLUDE ZXLTOU02 *
DATA:
WJ_JTANUM LIKE LTAP-TANUM,
WJ_LGNUM LIKE LTAP-LGNUM,
WJ_WERKS LIKE LTAP-WERKS,
WJ_USER LIKE SY-UNAME,
Parametros para el Job
l_numero LIKE tbtcjob-jobcount, "ID de un job de fondo
l_fecha LIKE tbtcjob-laststrtdt, "Fecha de ejecución más tardía
l_hora LIKE tbtcjob-laststrttm, "Ultima hora de ejecución para
l_jobname LIKE tbtco-jobname VALUE 'JOB_RF',
W_USER LIKE SY-UNAME,
W_HORA LIKE SY-UZEIT,
W_DIA LIKE SY-DATUM.
GET PARAMETER ID 'mb_usuario' FIELD W_USER.
Solo lo realiza para la transaccion LM05 y LM07
y si es por logueo No SAP
***ANTIGUO
*IF ( SY-TCODE EQ 'LM05' OR
SY-TCODE EQ 'LM07' OR SY-TCODE EQ 'LM03' OR
SY-TCODE EQ 'LM04') AND ( W_USER NE '' ).
**********ACTUALIZADO 07/02*********
IF ( SY-TCODE EQ 'LM05' OR
SY-TCODE EQ 'LM07' OR SY-TCODE EQ 'LM03' OR
SY-TCODE EQ 'LM04' OR SY-TCODE EQ 'LT12' ) AND ( W_USER NE '' ).
ojo
UPDATE ZTMB_USERCOLA
SET STATU = ' ' DOCNUM = ' '
WHERE
BNAME = W_USER.
GET PARAMETER ID 'mb_hora' FIELD W_HORA.
GET PARAMETER ID 'mb_dia' FIELD W_DIA.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_jobname
IMPORTING
jobcount = l_numero
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
SUBMIT ZUPDATE_LTAP
AND RETURN
VIA JOB l_jobname NUMBER l_numero
WITH WJ_TANUM = T_LTAP_VB-TANUM
WITH WJ_LGNUM = T_LTAP_VB-LGNUM
WITH WJ_WERKS = T_LTAP_VB-WERKS
WITH WJ_USER = W_USER.
Llama a la funcion para cerrar el Job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_numero
jobname = l_jobname
strtimmed = 'X' "Inicio inmediato
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
REPORT ZUPDATE_LTAP .
PARAMETERS:
WJ_TANUM LIKE LTAP-TANUM, " Numero de OT
WJ_LGNUM LIKE LTAP-LGNUM, " Almacen
WJ_WERKS LIKE LTAP-WERKS, " Centro
WJ_USER LIKE SY-UNAME, " Usuario SAP
W_QNAME LIKE LTAP-QNAME.
data: w_actual, w_timeout type i.
Actualiza el campos de usuario
w_actual = '0'.
w_timeout = 0.
while w_actual = '0' and w_timeout < 300.
w_timeout = w_timeout + 1.
WAIT UP TO 7 SECONDS.
UPDATE LTAP
SET QNAME = WJ_USER ZZRF_BNAME = WJ_USER
WHERE
TANUM = WJ_TANUM
AND
LGNUM = WJ_LGNUM
AND
WERKS = WJ_WERKS.
AGREGANDO 4 ENERO
UPDATE ZTMB_USERCOLA
SET TPICKEO = SY-UZEIT FPICKEO = SY-DATUM
WHERE
LGNUM = WJ_LGNUM
AND
BNAME = WJ_USER.
AGREGANDO 4 ENERO
if sy-subrc = 0.
w_actual = '1'.
UPDATE LTAK SET ZZRF_BNAME = WJ_USER
WHERE TANUM = WJ_TANUM AND
LGNUM = WJ_LGNUM.
endif.
commit work.
endwhile.Hi,
Check the print parameters. Probably after execution you may be deleting the job.
You can change the print parameters during runtime.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
user = sy-uname
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = params
valid = ws_valid.
IF ws_valid <> space.
params-pdest = 'LOCL'. "Destination
params-primm = ''. "Print Immediately
params-prnew = 'X'. "New Spool Request.
params-armod = '1'. "Print: Archiving Mode - Print Only
params-linct = 65. "Rows
params-linsz = 255. "Cols
params-paart = 'X_65_255'.
params-prrec = sy-uname. "User name
params-prsap = ''. "Print: SAP Cover Page
params-prunx = ''. "PRINT: Host spool cover page
params-prcop = '001'. "number of copies
SUBMIT zmib_fiber_link_background
WITH file = i_file_list-name
WITH rb1 = space
WITH rb2 = c_x
WITH p_launch = c_x
VIA JOB ws_c_session NUMBER ws_c_jobnum
EXPORTING LIST TO MEMORY
TO SAP-SPOOL
WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS params
AND RETURN.
endif.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = ws_c_jobnum
jobname = ws_c_session
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
Also check the sy-subrc after JOB_OPEN.
Regards
Subramanian -
Using user-defined data types in Forms 6i
When I use the following code in Oracle Forms 6i
PROCEDURE test IS
prcl prcl_ty;
BEGIN
prcl := prcl.setParcel('xxx-xx-xxxx');
END;
I get 'Error 801'. However the above does work in SQL editor. The online help says PL/SQL8 client-side program units cannot support Oracle 8 object-related functionality and I suspect this is the reason I get the error from Forms. Is there a work-around for this.
The TYPE is defined as:
CREATE OR REPLACE
TYPE PRCL_TY AS OBJECT
(parcel VARCHAR2(11),
MEMBER FUNCTION getBook RETURN VARCHAR2,
MEMBER FUNCTION getMap RETURN VARCHAR2,
MEMBER FUNCTION getItem RETURN VARCHAR2,
MEMBER FUNCTION getItem_NS RETURN VARCHAR2,
MEMBER FUNCTION getSplit RETURN VARCHAR2,
MEMBER FUNCTION find RETURN VARCHAR2,
MEMBER FUNCTION find (yr in VARCHAR2) RETURN VARCHAR2,
MEMBER FUNCTION isValid RETURN BOOLEAN,
MEMBER FUNCTION toString RETURN VARCHAR2,
MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2,
STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty) -- to be used as a constructor
NOT FINAL
CREATE OR REPLACE
TYPE BODY PRCL_TY AS
MEMBER FUNCTION getBook RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,1,3);
END;
MEMBER FUNCTION getMap RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,4,2);
END;
MEMBER FUNCTION getItem RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,6);
END;
MEMBER FUNCTION getItem_NS RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,6,3);
END;
MEMBER FUNCTION getSplit RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,9,1);
END;
MEMBER FUNCTION find RETURN VARCHAR2 IS
found varchar2(1);
BEGIN
begin
select 'x'
into found
from casrp
where cp_book_num = self.getBook
and cp_map_num = self.getMap
and cp_item_num = self.getItem
and rownum = 1;
return 'CASRP';
exception
when NO_DATA_FOUND then
begin
select 'x'
into found
from pro_prop
where pp_book_num = self.getBook
and pp_map_num = self.getMap
and pp_item_num = self.getItem
and rownum = 1
and NOT EXISTS (select 'x'
from cncl_prcl
where cr_book_num = self.getBook
and cr_book_num = self.getMap
and cr_book_num = self.getItem
and rownum = 1);
return 'PRO_PROP';
exception
when NO_DATA_FOUND then
return '';
end;
end;
END;
MEMBER FUNCTION find (yr IN VARCHAR2) RETURN VARCHAR2 IS
found varchar2(1);
BEGIN
begin
select 'x'
into found
from casrp
where cp_book_num = self.getBook
and cp_map_num = self.getMap
and cp_item_num = self.getItem
and cp_tax_yr = yr
and rownum = 1;
return 'CASRP';
exception
when NO_DATA_FOUND then
begin
select 'x'
into found
from pro_prop
where pp_book_num = self.getBook
and pp_map_num = self.getMap
and pp_item_num = self.getItem
and pp_tax_yr = yr
and rownum = 1
and NOT EXISTS (select 'x'
from cncl_prcl
where cr_book_num = self.getBook
and cr_book_num = self.getMap
and cr_book_num = self.getItem
and cr_tax_yr = yr
and rownum = 1);
return 'PRO_PROP';
exception
when NO_DATA_FOUND then
return '';
end;
end;
END;
MEMBER FUNCTION isValid RETURN BOOLEAN IS
i number;
BEGIN
for i in 1..8 loop
if substr(parcel,i,1) not between '0' and '9' then
return FALSE;
end if;
end loop;
if nvl(substr(parcel,9,1),'#') not between 'A' and 'Z' and
nvl(substr(parcel,9,1),'#') != '#' then
return FALSE;
end if;
return TRUE;
END;
MEMBER FUNCTION toString RETURN VARCHAR2 IS
BEGIN
return self.toString('-');
END;
MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
return self.getBook||par|| self.getMap||par|| self.getItem;
END;
STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty IS
len number;
pos number;
lastch varchar2(1);
temp varchar2(30);
invalid_format exception;
pragma exception_init(invalid_format,-9001);
BEGIN
temp := upper(istr);
-- Find 1st occurance of '-'. If not in correct postion, pad book num with zeros.
pos := instr(temp,'-',1,1);
if pos > 0 then
if pos != 4 then
temp := lpad(substr(temp,1,pos-1),3,'0')||substr(temp,pos);
end if;
-- Find 2nd occurance of '-'. If not in correct postion, pad map num with zeros.
pos := instr(temp,'-',1,2);
if pos != 7 then
temp := substr(temp,1,4)||lpad(substr(temp,5,1),2,'0')||substr(temp,pos);
end if;
-- Pad item num
len := length(temp);
lastch := substr(temp,len);
temp := substr(temp,1,7)||lpad(substr(temp,8,len-1),3,'0');
if lastch between 'A' and 'Z' then
temp := temp||lastch;
end if;
end if;
temp := replace(temp,'-','');
if prcl_ty(temp).isValid then
return (prcl_ty(temp));
else
raise invalid_format;
end if;
END;
END;
Rich Hall
[email protected]You are correct in your assumptions. Client side PLSQL does not support user defined types like the one you are trying to use.
There are no workarounds I am afraid. -
T1 (Table and columns & data ) used in my example
create table T1 (col1 number,col2 number);
col1 col2
1 5
2 5
3 5
4 5
11 6
12 6
13 6
14 6
CREATE OR REPLACE FUNCTION TEST (par NUMBER) RETURN VARCHAR2 IS
l_concat VARCHAR2(32767) ;
BEGIN
select wm_concat(col1) into l_concat from t1 where col2=par;
RETURN l_concat;
END;
select TEST(5) from dual;
The above example always returns a NULL as opposed to (1,2,3,4);
CREATE OR REPLACE FUNCTION TEST (par NUMBER) RETURN VARCHAR2 IS
l_concat VARCHAR2(32767) ;
l_str varchar2(32767);
BEGIN
l_str:='select wm_concat(col1) from t1 where col2=:b';
execute immediate l_str into l_concat using par;
RETURN l_concat;
END;
select TEST(5) from dual;
This returns the correct answer .i.e. (1,2,3,4);
My question is why my first code returning NULL? Is there any restriction using aggregate functions inside
plsql code ?BluShadow wrote:
The in paramter has the same name as one of the column . Thus the select query was not taking the filtering predicate as the in parameter col1 ,rather it was
using the column's value for filtering each row and hence the wm_concat was not getting any row to concatenate .That's why you should use a good coding standard and perhaps prefix parameters with "p" or "p_" and local variables with "v" or "v_" etc.Smacks too much of archaic Hungarian notation. :-)
Explicit scope definition is supported by PL/SQL. So why invent a new manual standard for scope, when there exists one already?
SQL> create or replace procedure FooProc( empNo emp.empno%Type ) is
2 empRow emp%RowType;
3 begin
4 select
5 e.* into empRow
6 from emp e
7 where e.empno = FooProc.empNo;
8
9 dbms_output.put_line(
10 'Employee '||empNo||' is '||empRow.ename||
11 ', and employed as '||empRow.job
12 );
13 end;
14 /
Procedure created.
SQL>
SQL>
SQL> exec FooProc(7369)
Employee 7369 is SMITH, and employed as CLERK
PL/SQL procedure successfully completed.
SQL> Personally, I find the v_ and p_ prefix approach quite silly - attempting to address an issue that is already solved by explicit PL/SQL scope.
Never mind that the approach of using different prefixes, attempts to identify scope - and goes down the exact same slippery scope that Hungarian notation did. Which resulted in the death of this misguided standard, many years ago.
Frustrates me to no end to see the exact SAME mistakes made in PL/SQL that were made a decade or more ago - where lessons learned since then are conveniently ignored when it comes to PL/SQL programming.
It is still seems to be the Dark Ages when it comes to PL/SQL development.... :-( -
Hi,
There is an requirement where i need to generate report on aging..
ie.. amount unpaid by the customer to be identified on different aging
0-15 days 16-30 days 31-45 days 56-90 days
so the output of the report show be like above on different again
this logic need to be implemented using decode function in a single select statement
pls help me in this regardHi
create function as par ur aging requirement like
create FUNCTION AGING_30 (mcode varchar2,mdate date) RETURN number IS
a number(10,2);
aging_date date ;
BEGIN
aging_date := mdate - 30 ;
Select sum(Cr) into a from jmst,jdtl
where jmst.trnno = jdtl.trnno and jmst.vtype = jdtl.vtype
and chcode = mcode and trndate > aging_date and trndate<=aging_Date+30;
return(a);
Exception when no_data_found then
return(0);
END;
for aging 31 to 45 day
aging_date := mdate - 45
and trndate > aging_date and trndate<=aging_Date+15;
for 46 to 60 day
aging_date := mdate - 60 ;
and trndate > aging_date and trndate<=aging_Date+30;
abd so on
Rizwan
http://www.rizwanshafiq.blogspot.com -
How to approve creation of new identities
Hi,
I have created an approval process for the creation of new identities based on the how-to-guide for role approvals.
My idea is to determine all approvers in a script which gets the entry reference as parameter from ToIdentityStore pass.
However, for some reason, the entry reference is empty.
Any ideas what am I doing wrong?
Here is the script:
function nsn_getNSNApproversFromCompanyAddress(Par){
var entryReference = Par;
uErrMsg(1, "entry reference: " + entryReference);
var idStore = uGetIDStore();
var companyAddress = uIS_GetValue(entryReference, idStore, "MXREF_MX_COMPANY_ADDRESS");
uErrMsg(1, "company address: " + companyAddress);
var nsnApprovers = uIS_nGetValues(companyAddress, "MX_APPROVERS");
if (nsnApprovers.indexOf("!ERROR")>= 0)
uErrMsg(1, "ERROR: " + nsnApprovers);
return nsnApprovers;
uErrMsg(1, "entry reference: " + entryReference) does not print out any value for entry reference
And here is the destination tab content of the ToIdentityStorePass:
MSKEYVALUE %MSKEYVALUE%
MX_APPROVERS $FUNCTION.nsn_getNSNApproversFromCompanyAddress(%MX_ENTRY_REFERENCE%)$$
Thanks in advance for your help,
ElmarHm, from what the error output message tells me it looks like MX_ENTRY_REFERENCE does not contain ANY value.
uErrMsg(1, "entry reference: " + entryReference); generates this output: 'entry reference: '
May this be due to the fact that this is a creation process and the identity to be created is not yet stored anywhere? If so, what would be the correct way to implement an approval process for identity creation?
In the destination tab, MX_PENDING_VALUE is defined, as in the how-to-guide manager approval example.
Thanks & Br,
Elmar -
Is it possible to know the file name of images loaded?
Hi:
I have a folder containing some images named 01_image_name.jpg, 02_image_name.jpg, 03_image_name.jpg, ... wich names I read with a PHP script. Then I loop loading each image and waiting until all are loaded to display them
1. The PHP script reads file names and returns a string with names separated by a "|" char, then I use the split method to store them in imagesNames array and sort it
2. I loop trough imagesNames array loading images
3. Anytime a new image arrives I push it in imagesContainer array and check if all images are loaded to show them
The problem is there's no guarantee they arrive in the same order they were requested. So, how I sort the imagesContainer array by file name, i.e. in the same order they are in imagesNames array?
Thanks in advanceif you know when a new image arrives and you can retrieve that new image file name ...
Well, that's precisely my doubt, how can I know the file name? Is there a property/method for it?
function loadImages() {
for (var i:int=0; i<imagesNames.length; i++) {
var imgLoader:Loader=new Loader;
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
imgLoader.load(new URLRequest(imgPath + imagesNames[i]));
function imgLoaded(par:Event):void {
trace(par.target,par.target.content,par.target.content.name);
Output window:
[object LoaderInfo] [object Bitmap] instance160
[object LoaderInfo] [object Bitmap] instance159
[object LoaderInfo] [object Bitmap] instance161 -
Manager attribute from AD and to AD
Hello Experts,
I am working with AD-IDM implementation.
I am facing two problems here:
1. Issue in getting Manager attribute of the users from HR system onto IDM via initial load and
2. Issue in assigning the Manager attribute to a user from IDM while creating a new user on AD
In case 1, I am simply trying to pass the manager in HR system to attribute MX_MANAGER as
in pass 'to identity store' -> MX_MANAGER = %manager%
For this, the IDM throws an error as "Entry reference value is not numeric when storing attribute MX_MANAGER=xyz"
In case 2, while creating a new identity assigning the AD privilege, I am trying to assign the manager to that new AD user. But it fails to create a user on AD as the manager attribute value comes with an error "CONSTRAINT_ATT_TYPE"
I know that the manager value on AD resides in DN format, but not sure how to resolve that to use the same for purposes.
Could you please suggest on the above issues.
FYKI - Version: IDM 7.2
Many thanks in advance!
NaveenHi Naveen,
In order to start writing scripts, you should know what are the tables/views to query for getting the required information.
I strongly recommend you to go through the the blog IDM SQL Basics #1: Queries against the Identity Store by Per Krabsetsve
Anyways I am writing down the sample scripts for your reference, which you can make use of.
Let me know for any further queries.
1. For getting the MSKEY of the user from MSKEYVALUE
// Main function: z_sap_getMskeyForMskeyvalue
function z_sap_getMskeyForMskeyvalue(Par)
var msKey = "";
msKey = "select distinct mcMSKEY from idmv_entry_simple where mcMSKEYVALUE='"+Par+"'";
msKey = uSelect(msKey);
return msKey;
2. For gettting the DN of the Manager with MSKey as the input to the script.
// Main function: z_sap_getManagerADDN
function z_sap_getManagerADDN(Par)
var msKey = Par;
var managerADDN = "";
managerADDN = "select avalue from idmv_value_basic where MSKEY="+Par+" and AttrName='ACCOUNTIDECAD'";
// in the above select query ACCOUNTIDECAD is my AD account attribute. In your case it is ACCOUNT<AD Rep Name>
managerADDN = uSelect(managerADDN);
return managerADDN;
All the best !!
~ Krishna. -
Hello Experts,
I am receiving an error whenever i am executing a java script file. I am calling the script in the below fashion.
MSKEYVALUE - $FUNCTION.DP_getMskeyValueForUser(%ABCD01%)$$
function DP_getMskeyValueForUser(Par){
---- Here we have written logic---
var result = uSelect(query);
result = DP_generateId("CREATE");// calling another script
return result;
function DP_generateId(Par){
--------------Here Code Logic ----------------------
--------At ending setting the output value and storing it in the context variable
uSetContextVar("new_mskeyvalue", newMskeyValue);
return newMskeyValue;
While executing i am getting an error message at the above highlighted part stating that got RuntimeException - org.mozilla.javascript.EvaluatorException: uSetContextVar: Only valid for Provisioning jobs at the line
Can you kindly please help me with this error.
Regards,
DPHi DP,
Hope this helps.
context var is used if you want to pass values between tasks. If you are using in a job and you want to use values between passes, then you could use a job variable. Or if you want to calculate and use the values in same pass in the job, you can use a Hashmap.
Kind regards,
Jai -
Error while provisioning roles (SetABAPRole&ProfileForUser)
Hi Experts
While provisioning roles in IDM 7.2, I see this error in the Job logs:
Failed running function in string "$FUNCTION.sap_abap_getNameOfAssignedPendingPrivileges(mskey!!repname!!role!!true)$$". Marking entry as failed. Exception was: undefined: "sap_abap_convertToABAPValidFromDate" is not defined.
I am getting this error only if I provision the existing SAP users. Assigning any role to a new user works fine. Went through both the above mentioned scripts, but don't see any Problem there.
What am I missing here?
Best regards
AnnapurnaHi Annapurna,
I was just going through the setup in our landscape and noticed that we have only one script for Assign User Membership to ABAP which is "sap_abap_getNameOfAssignedPendingPrivileges"
As mentioned by Jai earlier, we have the same script as Jai.
Can you try by using the below script for "sap_abap_getNameOfAssignedPendingPrivileges" and delete the other two and try to execute?
Not sure, if this could work, but maybe can give a try.
Script below:
===============================================
// Main function: sap_abap_getNameOfAssignedPendingPrivileges
* Returns a list of all privileges with properties {validfrom, validto} of the
* passed user for the passed repository and the passed privilege type.
* It contains all already assigned privileges plus/minus the delta of the
* current pending added and/or removed privileges.
* Note: Needed by connectors that always send the complete list of privileges
* to the backend, e.g. ABAP, BusinessSuite, JAVA
* @param {Par} Format:
* MSKEY of user!!repository name!!privilege type<!!includeValidityProperty>
* e.g. 172645!!BQQ001!!PROFILE!!TRUE
* @return {String} List of Privilege (backend) names in format:
* if includeValidityProperty is defined as true, then
* {VALIDFROM=<date>!!VALIDTO=<date>}<priv>|{VALIDFROM=<date>!!VALIDTO=<date>}<priv>|{VALIDFROM=<date>!!VALIDTO=<date>}<priv>
* else
* <priv>|<priv>|<priv>
function sap_abap_getNameOfAssignedPendingPrivileges(Par) {
importClass(java.lang.StringBuffer);
// enable this flag (tracingEnabled) only for debugging purposes as this will impact the performance
var tracingEnabled = false;
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: is called with " + Par);
var parameters = Par.split("!!");
var mskey = parameters[0];
var repositoryName = parameters[1];
var privilegeType = parameters[2];
var addValidityProperty = false;
if (parameters.length > 3 && parameters[3] != null && parameters[3].toLowerCase() == "true") {
addValidityProperty = true;
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: mskey: " + mskey);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: repositoryName: " + repositoryName);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: privilegeType: " + privilegeType);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: addValidityProperty: " + addValidityProperty);
var nolock = "";
if("%$ddm.databasetype%" == 1) { //MS-SQL
nolock = "WITH (NOLOCK)";
if (tracingEnabled) {
sap_debug_logUserAssignments(mskey);
* - get only assignments (mcLinkType = 2)
* - get all assignments of current entry X (mcLinkState = 0, mcExecState = 1 & mcDisabled = 0)
* - and with assignments in state "pending add" (mcLinkState = 1 & mcExecState = 512 or 513,
mcDisabled can be 1 e.g. if the user gets reactivated)
* - assignments with mcExecState 2 (Rejected) and 4 (Failed) are not included. If a failed
* assignment gets retried, the state changes immediately to pending.
* - for specfified repository Y
* - and privilege type Z
* - add member task must have been running for the privilege (mcAddAudit IS NOT NULL)
-> no future assignments
-> no assignments for which an approval will be done but approval task is not yet running
* - no privileges for which an approval is needed/running
* mcValidateAddAudit < mcAddAudit <- approval is already done
* or mcValidateAddAudit IS NULL <- if no approval is necessary
* - no duplicate privilege names (-> SELECT DISTINCT) in case of contexts
var sql = "SELECT DISTINCT privilegename.mcMSKEYVALUE, assignment.mcValidFrom, assignment.mcValidTo \
FROM idmv_value_basic_all repositorynames " + nolock + " \
INNER JOIN idmv_value_basic_all privilegetype " + nolock + " ON privilegetype.mskey = repositorynames.mskey \
INNER JOIN idmv_entry_simple privilegename " + nolock + " ON privilegename.mcMSKEY = repositorynames.mskey \
INNER JOIN mxi_link assignment " + nolock + " ON assignment.mcOtherMskey = repositorynames.mskey \
WHERE assignment.mcThisMskey = " + mskey + " \
AND assignment.mcLinkType = 2 \
AND (\
(assignment.mcLinkState = 0 AND assignment.mcExecState = 1 AND assignment.mcDisabled = 0) \
OR (\
assignment.mcLinkState = 1 AND assignment.mcExecState IN (512,513) \
AND ( \
(assignment.mcAddAudit > assignment.mcValidateAddAudit) \
OR \
(assignment.mcAddAudit IS NOT NULL AND assignment.mcValidateAddAudit IS NULL) \
AND repositorynames.attrname = 'MX_REPOSITORYNAME' AND repositorynames.SearchValue = '" + repositoryName + "' \
AND privilegetype.attrname = 'MX_PRIVILEGE_TYPE' AND privilegetype.SearchValue = '" + privilegeType + "'";
//result looks like privMskeyValue!!privMskeyValue!!privMskeyValue
var result = uSelect(sql);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: SQL Query:\n" + sql);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: Result: " + result);
var allPrivsStringBuf = new StringBuffer();
var firstElement = true;
if (result != null && result != "") {
var resultArray = result.split("!!");
for (var i = 0; i < resultArray.length; i++) {
var columns = resultArray[i];
var columnArray = columns.split("|");
//privMskeyValue is like PRIV:<type>:<repository>:<privilegeName>
var privMskeyValue = columnArray[0];
var repTemp = privMskeyValue.split(":");
var repstring = repTemp[0] + ":" + repTemp[1] + ":" + repTemp[2] + ":";
var privName = uReplaceString(privMskeyValue, repstring, "");
if (!firstElement) {
allPrivsStringBuf.append("|");
if (addValidityProperty) {
var validfrom = columnArray[1];
var validto = columnArray[2];
allPrivsStringBuf.append("{VALIDFROM=");
allPrivsStringBuf.append(validfrom);
allPrivsStringBuf.append("!!VALIDTO=");
allPrivsStringBuf.append(validto);
allPrivsStringBuf.append("}");
allPrivsStringBuf.append(privName);
firstElement = false;
var allPrivs = String(allPrivsStringBuf); // must be casted explicitly to String
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: Calculated privileges for " + Par + " are: " + allPrivs);
return allPrivs;
* Prints out all assignments the user has (also all assignments in pending remove state etc.)
function sap_debug_logUserAssignments(mskey) {
var columns = "mcUniqueId, mcThisMSKEY, mcOtherMSKEY, mcAttrName, mcThisOcName, mcOtherOcName, mcThisMSKEYVALUE, mcOtherMSKEYVALUE, mcLinkState, mcAssignedDirect, mcAssignedInheritCount, mcExecState, mcExecStateHierarchy, mcChangeNumber, mcGroupGuid, mcLastAudit, mcAddedTime, mcModifyTime, mcValidateAddAudit, mcAddAudit, mcContextMSKEY, mcContextCategory, mcContextStr1, mcContextStr2, mcOrphan, mcSoDViolation, mcNotAllowedFor, mcUnsupportedContextType, mcMissingConditionalContext, mcDisabled, mcRequestID";
var debugSql = "SELECT " + columns + " FROM idmv_link_ext WHERE mcThisMskey = " + mskey + " ORDER BY mcUniqueId";
var debugResult = uSelect(debugSql);
//format output
debugResult = uReplaceString(debugResult, "!!", "\n");
debugResult = uReplaceString(debugResult, "\|", "\t");
columns = uReplaceString(columns, ", ", "\t");
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: Debug SQL Query:\n" + debugSql);
uInfo("sap_abap_getNameOfAssignedPendingPrivileges:: Debug Result:\n" + columns + "\n" + debugResult);
Thanks & Regards,
V! -
Javascript Moving Focus - Vikas Example
I am trying a variation on an example posted by vikas (keep up the good work by the way excellent examples, cheers !)
see http://htmldb.oracle.com/pls/otn/f?p=24317:255:778434680004999
i have used some of the code in the example but it just doesn't like the line
var nextinput=TD.nextSibling.getElementsByTagName('input')[0];
I have put an alert in after the line which returns nothing
if i put an alert in for the variable TD i get [HTMLTableCellElement]
basically when a user clicks onto the field it gives them an error message then moves the focus to the next field ....or should do !!
full function below
<script type="text/javascript">
function Check(pArea)
if(pArea.value.length>3) {
alert("Cannot Update Key Fields");
var TD=pArea.parentNode;
var nextinput=TD.nextSibling.getElementsByTagName('input')[0];
alert(nextinput);
var lEl = html_GetElement(PArea);
lEl.focus();
</script>
Any help greatly appreciated
cheers
Christhe DOM has the 'onfocus' event listener
-
In mini bridge, is it possible to view the file name and the rating at the same time?
Hello,
In mini bridge, is it possible to view the file name and the rating at the same time?
Thank you.if you know when a new image arrives and you can retrieve that new image file name ...
Well, that's precisely my doubt, how can I know the file name? Is there a property/method for it?
function loadImages() {
for (var i:int=0; i<imagesNames.length; i++) {
var imgLoader:Loader=new Loader;
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
imgLoader.load(new URLRequest(imgPath + imagesNames[i]));
function imgLoaded(par:Event):void {
trace(par.target,par.target.content,par.target.content.name);
Output window:
[object LoaderInfo] [object Bitmap] instance160
[object LoaderInfo] [object Bitmap] instance159
[object LoaderInfo] [object Bitmap] instance161 -
UDESEncrypt Errors when using the JAVA engine (NW IDM 7.0)
Folks,
I'm seeing an error when I use the uDESEncrypt function with the Java Engine in NW IDM SP2 Patch 3.
The error I am getting is:
runFunctionsInString($FUNCTION.encrPWD()$$) got exception
org.mozilla.javascript.EvaluatorException: uDESEncrypt: Key should be exactly 24 bytes long.
The code calling it is:
// Main function: encrPWD
function encrPWD(Par){
//Example calling DSE internal function
//UserFunc.uStop("Terminated by user");
key = "C:\Program Files\SAP\IdM\Workflow\configs\KEY\keys.ini";
OutString = UserFunc.uDESEncrypt(key, Par);
return OutString;
I have also seen this error when using Patch 4.
Interestingly enough, the error does not occur when using the Windows Engine. Anyone else seeing this?
Thanks,
MattHi Matthew,
Try to replace the '\' with '
key = "C:
Program Files
SAP
IdM
Workflow
configs
KEY
keys.ini";
Alternative approaches,
1) setting key empty and it will look into %DSE_HOME%\KEY\key.ini
which should be C:\Program Files\SAP\IdM\Identity Center\Key\key.ini on default installation path.
2) or setting the key to something like = 6D5A2AF59B1CDD7F9592484F178331C891537A3F9B91D362
a 24 byte key...
Also when using DES you should ensure that in Identity Center underneath Options/General
you have encryption algorithm set to 3DES.
Normally if you intend to use this for password provisioning in IC you would also
on the identity store (for instance 'Enterprise people') underneath 'password policy' check
of for 'enable password provisioning.'
By doing so the MX_ENCRYPTED_PASSWORD with be set when operating through
workflow (3DES encryption version of the MX_PASSWORD) which allows you to obtain password
when provisioning to other target systems... -
Hi,
I am working on SAP NW IDM 7.1.
I had a small requirement, which says whenever we create a user, independent of the source from where the data is coming from,
the attribute MSKEYVALUE should be populated with User ID which is unique. I have written a script for generating unique User ID, using user's first name , middle name and last name.
Now I don't know how to assign it to MSKEYVALUE.
I refered many documents, and did according to whatever was specified, but it seems that the system is automatically populating MSKEYVALUE in the format
MX_%MSKEY% and not what I had assigned .
This is the link that I had referred
/people/matthew.pollicove/blog/2009/03/19/renaming-the-nw-idm-mskeyvalue-attribute
It would be really helpful, if anybody could help me with it.I had used JScript for generating User Id, which is working fine, as it is populating unique value for User Id, everytime, even if the name is same for two different users.
But when i am using the script in To Generic Pass : Next Entry as specified in the above mentioned link, I am getting 2 errors saying :
org.mozilla.javascript.EvaluatorException: Invalid JavaScript value of type com.sap.idm.ic.DSEEntry
putNextEntry failed storing2151
And a warning saying :
Executing RenameEntry(2228 - {MSKEY=2228, UID=sharmaan}) got RuntimeException - org.mozilla.javascript.EvaluatorException: Invalid JavaScript value of type com.sap.idm.ic.DSEEntry HINT: Check line 2 in the script RenameEntry
Following is the script that I had included within To Generic Pass:
function RenameEntry(Par){
var mskey = uIS_nGetValues(Par,"MSKEY");
var uid = uIS_nGetValues(Par,"UID");
OutString = uIS_SetValue(mskey, 1 , 'MSKEYVALUE' ,uid);
OutString.ErrInfo = uGetErrorInfo();
Edited by: Rashma M on Oct 27, 2009 10:45 AM -
Problem with getting word count in TLF text
Hi,
I want to get the word count from my TLF text, but the problem is that I am not being able to handle th case for space.
I am using the findNextWordBoundary property of ParagraphElement as shown below:
private function countWords( para : ParagraphElement ) : void
var wordBoundary:int = 0;
var prevBoundary:int = 0;
while ( wordBoundary != para.findNextWordBoundary( wordBoundary ) )
// If the value is greater than 1, then it's a word, otherwise it's a space.
if ( para.findNextWordBoundary( wordBoundary ) - wordBoundary > 1)
wordCount += 1;
prevBoundary = wordBoundary;
wordBoundary = para.findNextWordBoundary( wordBoundary );
// If the value is greater than 1, then it's a word, otherwise it's a space.
if ( wordBoundary - prevBoundary > 1 )
var s:String = para.getText().substring( prevBoundary, wordBoundary );
lenTotal += s.length;
Now I have 2 issues here:
If my string is for eg: Hi, I am writing in "TLF". And I want to get its word count then
1) Suppose I take the case of the string Hi, . Then para.getText().substring( prevBoundary, wordBoundary ) gives the text as Hi i.e without the comma. Same case for the string "TLF forums" , It treats each " as a single word and not the whole "TLF" as a single word. Why doesn't it compute till spaces, that should be the ideal case. So until we don't give a space it should count the whole thing as a word.
2) So now the problem is I have applied a condition if ( wordBoundary - prevBoundary > 1 ) to check if it is a space i.e. if the diff is <= 1 it is a Space. But if I use this I miss out on single words. Like for eg if I have "Hi, This is a string" ,then 'a' is ignored too.
Now I could have added a check here along with the space check that the string between prevBoundary and wordBoundary is " "(i.e a space), Then also it is a problem as then the single words like a,&,I will be ignored.
So, now I am stuck with this issue and need some help from you guys.
ThanksfindNextWordBoundary is not going to serve your purpose. I'd propose doing something like this:
// didn't test this but something like this - whitespace matches any set of 1 or more white space characters
static const whiteSpaceRegExp:RegExp = /[u0020|u000A|u000D]*/
public static function countWords( para : ParagraphElement ) : void
return para.getText().split(whiteSpaceRegExp).length;
A good list of everything considered whitespace extracted from the unicode space can be found here:
http://sourceforge.net/adobe/tlf/svn/449/tree/trunk/textLayout/src/flashx/textLayout/utils /CharacterUtil.as
In function createWhiteSpaceObject
Hope that helps,
Richard
Maybe you are looking for
-
We failthfully followed the procedure given in technet.oracle.com/products/jdev (JDeveloper 3.0 Technical Information - Developing and Deploying EJBs using JDeveloper 3.0 and running the deployed EJB from a client application) to create an EJB. We go
-
How to read a file which content hindi characters.....
I m reading a text file which content hindi characters.... but m nt getting the right result. It shows garbage instead of hindi characters. plz somebody help me....:(
-
Dear SAP Gurus, I have posted debit note (DR) with journal entries: DR Customer (Trading Partner defalted from Customer Master) CR Sales When I saved the document, Trading Partner in the Customer Line Item is defaulted from Customer Maste
-
Critical SMS_Executive SQL Login failed for user 'NT AUTHORITY\SYSTEM'.
I am getting sql login errors on my sms executive log that i believe is stopping me from pxe booting. I have tried finding where to enter the credentials but i cannot find it. SMS_EXECUTIVE 4/10/2014 3:13:12 PM 2412 (0x096C) Starting SMS_EXECUTIVE...
-
ALV: ADD leading ZEROs in a CHAR field
Hello Everybody! I have a problem and I hope you can help me What I have: 1. ALV (hier) 2. Char field 'DEBIT' type SAKNR. 3. Field catalog TYPE slis_t_fieldcat_alv, created by FUNCTION MODULE 'REUSE_ALV_FIELDCATALOG_MERGE'. The problem is: i need