FDMEE import Jython Script - field Split function
Hi people,
I have to admit, this Jython gives me a heavy headache!
In fact, it's a simple mistake, but I'm fighting around with it for hours now. Maybe one of you guys can help.
I want to create a Script of Import in FDMEE 11.1.2.3.500.17. The source file (separator: tab) contains a column with the following entries:
What I want to achieve at first is to import the figure after the first point. For example, hours - 00275. 3. 4.1 I want to import 3.
I wrote a script to import, based on an example of written script in FDMEE admin guide (page 273):
I assigned this script to the respective column in the Import Format:
Seems easy. But for some reason, it does not. The problem is: even the log file is not help, because it seems to be growing constantly when I want to open it (after becoming 30 MB I cancelled). By the way: without this script works import.
Any ideas? Help is very appreciated!
See you soon
Carmonte
I wasn't talking about the script file extension, as you say is irrelevant, your file name of the script was eGRCcISPA (without the extension) and your function called eGRCsISPA (in the body of the script). They were different and should be the same. They are the same today? Also when you say that this does not work, what do you mean?
(1) import runs successfully, but represented for that field values are not what you expect the rest of the script is running?
(2) the mistakes of import process when using that import format?
Tags: Business Intelligence
Similar Questions
-
Import of Jython Script if Stmt
I have a Jython import the script I'm debugging. I proved that everything works properly until my if stmt. That's what I want to do... If the DR_str field is null, then returns the CR_str field; otherwise the return DR_str field.
This script in its current state will import all records where DR_str is not null. He will ignore the fields where the DR_Str is null
def AMOUNT_CSV_12 (strfield, strrec):
arrRecords = strrec.split(',')
DR_str = arrRecords [12]
CR_str = arrRecords [13]
If DR_str is None or DR_str == "or DR_str == 0:
End_str = float (CR_str)
Another thing:
End_str = float (DR_str)
return End_str
Hi 898555,
The return statement is indented in this clause else for now so it'll never return a value for End_str, when the else clause works. This cut from the version of your function to the return in four spaces returns 9999.0
def AMOUNT_CSV_12():
DR_str = 0
CR_str = 9999
If DR_str is None or DR_str == "or DR_str == 0:
End_str = float (CR_str)
Another thing:
End_str = float (DR_str)
return End_str
-
My load the import data were thrown a curve ball. I used to have a 1 or 2 digits in the card. If it's a digit, I simply added a zero at the beginning (i.e. FillL convert 1 01). But now I have a leader 4 digits and a hyphen. So instead of '1', I have 2500-1, instead of "12", I now 2500-12. I need to remove what is to the right of the dash and then add a zero not significant if it is not already 2 digits. Does anyone know the script that would achieve this?
Your help is very appreciated.
FA
Hello
You can create this jython script and assign import format:
def customFill (strField, strRecord):
return ('0' + strField.split("-") [1]) [-2:]
This function divides your strField using "-" as the delimiter, then him concatenate '0' with the second element ([1] in the table starts in position 0) and finally to take the last two characters [-2:]
If you have 1 number after the hyphen you will get 0 x. On the other hand, if you have already a 2-digit, you will get xx
Hope says.
-
Import Format script to update multiple fields
Following my previous post yesterday (Import Format script required for work in several areas , now I need my script import to Update several fields (two) at the same time, based on criteria across multiple fields. ) So far, I can use DW. Utilities.fParseString to assess values across several fields, but now I need to update not only the field in question, but also an additional field at the same time. For example:
Function TBService (strField, strRecord)
"How to upgrade a second field at the same time?
Dim strField2 As String
If left (strField, 1) = "S" Then
If DW. Utilities.fParseString (strRecord, 3, 8, ',') = 'B1110"Then
strField2 = "N101.
On the other
strField2 = 'network n/a '.
End If
TBService = strField
On the other
TBService = "Service s/o".
End If
End Function
Is it still possible? Should I look for to create an event script that would work subsequent to importation? Or is it possible here in the import script?The second field you are trying to manipulate should have its own import script.
-
Invert sign to import with script
Dear Lion,
11.1.2.3 FDMEE and the new Jython scripting language are beautiful.
Now please help me please with the following:
This script works very well:
def separation(strfield,strrec): if strfield == 0: return strrec.split(";")[8] else: x = strfield return x
This script, where I want to reverse x value, does not work very well! Why and how to manage this problem?
def separation(strfield,strrec): if strfield == 0: return strrec.split(";")[8] else: x = strfield * -1 return x
Thank you very much.
Hello
Let me try to show you some examples.
First of all, think that FDMEE password string for the import script parameters
In this example, you can see that there basically is convert to float your strfield and 9th field in the record.
In this way, you would be able to reverse the sign.
Note that x = x *-1 is also valid but the jythonic also would be x * = - 1
But what will happen if strfield or field 9 cannot be converted to a float?
As you can see, it would fail because of the ValueError exception.
In Jython where the type of conversion is necessary as float() using try / except is recommended.
In the following example, if one of the two fields is not the record number is ignored during import:
I hope this helps.
Concerning
-
When I try to batch photos to resize in Scripts > Image Processor function, an error message that says: "comand"Pen"is not available. What can I do to fix this?
Yes Adobe tile action fails with the error when he didn't is not the active selection. Note that the Cut Out, built-in frame and thumbnail (selection) after their name. These actions require an active selection to the selected mobile dotted lines before using the action. Action seeks to soften the selection that were provided to you. There was no selection, so there is nothing to be flag.
In addition, the step of the pen in the action of the tile is an interactive step on its dialog box is. An interactive action defeat as the design of the Image Processor script commands. Isn't interactivity in a batch.
-
I can't import my script (film) into Adobe Story. The error message says: I am unable to connect to the Adobe servers. Is this a problem with the Adobe?
Yes and no it seems that if the file is a .doc or .pdf, that it does not load properly. But if I bring him in a Final Draft format, it works perfectly.
Adam
Sent from my iPhone
-
Audition Audio 'Split function' does not?
Have no idea why, but on my old Adobe audition 3.0 version (which works perfectly), when I go to multitrack view and want to change a track - requiring the split function - it does not work. I pull up the menu and 'split' is one of the options (normal) - then I left click on the position where I want to change the audio track. (normal) THEN, when I use the right click and HOLD function on the mouse to "drag" the piece of splitting the audio down in another (normal) track, now it does not work - nothing happens. Our here does he know why it can happen? Very frustrated. Is there a secondary way, I can try to 'split' or separate and 'move' the play published audio... when done, I then MIX again...
For the record - I CAN cut section and paste it into another track, but I can't MOVE the tracj with my my right click on the mouse.
make people of sense? pls advise - Johnny W
You have the right hybrid tool, selected from among the four tool icons in the menu bar? You don't do a right-click and drag if you have the choice of time or scrub tool selected.
-
Application front end error after importing the script executed successfully in R12
Hello
I got an exception in the environment of R12.
I developed a simple page of the OPS and deployed in apps to import the script runs successfully.
but when I open this page at the Front end will give an exception.
It's
Details of the exception.
oracle.apps.fnd.framework.OAException: could not load application module 'tflsm.oracle.apps.po.per.server.TflsmAM '.
# # 0 in detail
Houston-30003: the application pool (cph-oadb - tst22.dk.flsmidth.netTST221543tflsm.oracle.apps.po.per.server.TflsmAM) failed at the checkout a module of application because of the following exception:
oracle.jbo.JboException: Houston-29000: Unexpected exception caught: oracle.jbo.JboException, msg = Houston-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg = Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
# # 0 in detail
oracle.jbo.JboException: Houston-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg = Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:545)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2094)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1961)
# # 0 in detail
oracle.jbo.NoDefException: Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:441)
Houston-30003: the application pool (cph-oadb - tst22.dk.flsmidth.netTST221543tflsm.oracle.apps.po.per.server.TflsmAM) failed at the checkout a module of application because of the following exception:
oracle.jbo.JboException: Houston-29000: Unexpected exception caught: oracle.jbo.JboException, msg = Houston-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg = Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
# # 0 in detail
oracle.jbo.JboException: Houston-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg = Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:545)
# # 0 in detail
oracle.jbo.NoDefException: Houston-25002: type tflsm.oracle.apps.po.per.server.TflsmAM ApplicationModule definition not found
at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:441)
I will check all the class files and the Application Module below top xml files, are all there in the top server (less)
/ U02/TST22/Apps/apps_st/COMN/java/classes/xxfls
but I got the exception.
is there a different structure in R12.
i.Ein the/u02/TST22/apps/apps_st/comn/java/classes/xxfls top of the page from the server (here my class all files in xml files and binary mode in ASCII mode)
Only the CLASS files are needed or the XML files are also needed. (I'm moving all CLASS and XML files)
could you please help me on this.
Thank you, regards,
MuthuHello
-In the same way it is you are oracle also... ?
/ U02/TST22/Apps/apps_st/COMN/java/classes/xxfls
Concerning
Meher Irk -
How to assign the value to the variable of project in the Jython script
Hello
I want to assign a value to the variable of project in the jython script.
I tried to assign the following, but it is throwing some errors.
< @.
int noOfRecords = 10;
#var1 = noOfRecords;
@ >
Can you please help me in this regard.
Concerning
ShyamPerfect! Good to know that!
Please, don't forget to close the thread and assign the status to 'correct' or 'comfortable' to each response that helped you!
Thank you
Cezar Santos
http://odiexeperts.com -
FDMEE mapping <; white >; does not / Jython Script
Hi all
Has anyone got the < white > mapping work? I put it in my SIMILAR mapping and it does nothing. Any help would be appreciated.
As a solution, I tried to add an import script to my base file import format. I want it all empty fields in PKI to convert in [no PIC]. Keep logs process details (see below) gives me an error. He doesn't seem to like dealing with NULL values. Here is my script to import of Jython:
def OracleEBS_ICPNone (strField, strrecord):
If strfield is not nothing and len (strfield) > 0:
return "[ICP None]"
Another thing:
return strfield
Error log:
2014-06-03 14:57:18, 892 [AIF] DEBUG: 105039:EPMERPI - error expression evaluation: OracleEBS_ICPNone (", 725, 100151_C, 000, 16434308.16')
result: null
2014-06-03 14:57:18, ERROR 894 [AIF]: 105039:EPMERPI - 105042:EPMERPI - error evaluating script.
null
THX,
Mike
How are your values of source?
does not refer to NULL. This will work only if the value of your source has a blank space.
So if you have a map as
--> [no PIC] and your source is an empty string... it won't
It won't work if it has a white space (' ')
For you the script:
def OracleEBS_ICPNone (strField, strrecord):
If strfield is not nothing and len (strfield) > 0:
return "[ICP None]"
Another thing:
return strfield
Jython is case-sensitive: strField <> strfield
If you want to capture values empty source in PKI:
def OracleEBS_ICPNone (strField, strRecord):
# You can cut your source, remove the whitespace on the left/right and then check if the length is zero
If len (strField.strip () == 0:
return "[ICP None]"
Another thing:
return strField
-
Import the script to remove the zeros in the field counts
FDM dear Experts,
The problem is our source system always extracts 10 characters, but we use 7 characters in HFM.
Example, in 0001201010 (10 characters) must be 1201010 (7 characters).
I want to write a Script to import to remove, if necessary, zeros on the left side of the value into account at the stage of import. We have no accounts starting with 0.
Thanks in advance for your help,
CarstenService account (strField, strRecord)
strField = FormatNumber(strField,0,0,0,0)
Account = strFieldEnd Function
-
How to use a SELECT QUERY using fdmAPI.executeDML in the Jython Script FDMEE?
Hello
Is just the way we use DELETE and INSERT statement using fdmAPI.executeDML, possible to run a SELECT statement and get the result in the variables?
I want to refrain from using import java.sql and enter the connection information in a script. I would rather use SELECT directly if possible. I want to read the TDATASEG. DATAKEY column and use it for some custom in a custom table process
Thank you!
Try RS.next instead of RS. Next
-
I use fdmContext ['PERIODKEY'] to pull in the PeriodKey and she returned to 2013-11-18 (AAAA-MM-JJ), and I would like to change the format of 201311 (YYYYMM). Something there suggestions on how this can be accomplished using Jython?
Thanks in advance.
Try
import of java
print java.text.SimpleDateFormat("yyyyMM").format (java.util.Date ())
-
Jython script analysis on commas
I use an import script to import a file with records similar to the one below.
Entity, CR_Amt, DR_Amt, Custom1, account
' 100 ',' 2000 ',' 300 ',' 17,000,000.00 ',.
'400', '5000', '600', '28,000.00.
My script is on the DR_Amt and CR_Amt fields is as follows:
def AMOUNT_CSV (strfield, strrec):
arrRecords = strrec.split(',')
strDr = arrRecords [4]
strCr = arrRecords [5]
dr_str = strDr.replace('"','')
Cr_str = strCr.replace('"','')
If dr_str is None or dr_str == "" or dr_str == 0:
End_str = floating fenΩtre (Cr_str) *-1
Another thing:
End_str = float (dr_str)
return End_str
The script seems to work fine except that it scans my fields amount on the comma separator. For example, the first record will return at 17.00 and the second field will return 28.00. Is there a way to get around this?
It seems that regular import module expression or csv import scripts does not work correctly...
Python/jython is very powerful, you might also have a solution using list function for a list of positions for the character "and then get the amount of CR based on the last two positions.
def parseDoubleQuotesDRCR (strfield, strrec):
If strfield is None or strfield.strip () == ' ' or strfield == 0:
# Sample line-> ""400","5000","600","28,000.00.
# Get a list of the positions of the characters in double quotation marks
# Ex: [0, 4, 6, 11, 13, 17, 20, 30]
listposquotes = [i i, in enumerate (strrec) so ltr ltr == "'"]
"# Get the position of the first character after the double quotes after the last '.
# CR is stored between 20 and 30-> strrec [21:30]
crstart = listposquotes [(len (listposquotes)-2)] # + 1 post 21
crend = listposquotes [(len (listposquotes)-1)] # 30 Position
Separator to replace thousands of # to avoid conversion problems
amount = float (str(strrec[crstart:crend]).replace (',', ")) *-1
Another thing:
quantity = float (strfield.replace(',',''))
return the amount
Maybe you are looking for
-
Could not open the file - "user lacks access privileges.
I use Windows 7 and I recently reformatted my computer because it became too slow, etc. Now it is as new but I can't access one of my Word Document files because I had encrypted the file on my system before reformat and I think I might have played ar
-
How to use "IR" and "SERIAL ON" connectors
I tried a LED connected to a mini plug to see if I could stand in front of my box hidden, but there is no signal coming out of each connector. How does it work?
-
Equium L40-10 X: Atheros AR5007EG adapter firmware update
Does anyone know if it is possible to update the firmware on the Atheros AR5007EG Wireless Network adapt to be able to use WPA WEP encryption is weak and easily broken?
-
Greetings. The charger for my 100 Ideapad s failed. I tried to find a replacement on the Lenovo Web site, but I can't seem to locate. Could someone direct me to a compatible charger? Thank you.
-
HP 6000 printer sends only blank copies trying to copy.
Original title: blank copies my hp 5600 printer stopped making copies of the copier function. He's going through the motions, but only blank papers come out, why?