FDM, How to replace the value of my source file inside BefFileImport

Hi all,
I want to edit some value that will need some validating inside the source file with some condition inside the source file.
I know the easy way is to build the validation inside import script, but the import script usually will run for each row, if I put the logic inside it will make the performance slow, I assume, because every one row, it will open the file.
So I try to do one time conversion, so I choose to put my logic inside BefFileImport VBScript, but after my script run, the value was not change, it still stick with old value.
Need your help for this.
the below example, I want to do
Sub BefFileImport(strLoc, strCat, strPer, strFile)
If InStr(strFile,"test123")>0 Then
Location="C:\Oracle\FDMApp\SampleApp\Inbox\Batches\OpenBatch\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile(Location & strFile, 1)
Set str= CreateObject("System.Collections.ArrayList")
Do Until f1.AtEndOfStream
  str.add f1.ReadLine
Loop
Set f1=Nothing
Set f2 = fso.OpenTextFile(Location & strFile, 2)
For Each dataLine In str
  tmp = Split(dataLine,";")
  value = valcheck(str,tmp(14),tmp(13), tmp(6), tmp(1))
  If  entityPartner = "" Then
  f2.WriteLine tmp(0) & ";" & tmp(1) & ";" & tmp(2) & ";" & tmp(3) & ";" & tmp(4) & ";" & tmp(14)
  Else
  f2.WriteLine tmp(0) & ";" & tmp(1) & ";" & tmp(2) & ";" & tmp(3) & ";" & tmp(4) & ";"& value
  End If
Next
Set f2=Nothing
Set str=Nothing
Set fso=Nothing
End If
End Sub
Thanks
Dedy

Hi
You can achieve this with virtual characteristics option. Code the logic in the customer exit program and it would work.
Thanks & Regards
8283

Similar Messages

  • How to replace the values in variable selection Screen urgent plz

    Hi all,
    I am having a requirement. where the user need pass the value in the variable, Here v r having option like '1' and '2' which represent 'month' and 'ytd'.
    While selecting user view as 1,2 .Now my requirement is to replace the value 1=monthly and 2=ytd while the user passing the value to avoid the confusion.
    Is it possible if so plz let me know
    Regards

    Dear Venkat.
    You please try the following steps:
    1. Say the InfoObject is 0EMPLOYEE against which you have created the variable, which user is trying to select value against, when they execute the report.
    2. Goto RSA1-> InfoObject tab-> Select InfoObject 0EMPLOYEE.
    3. Selcet the following options:
       Query Execution Filter Val. Selectn  -  'Only Posted Value for Navigation'
       Filter Value Repr. At Query Exec. -      'Selector Box Without Values'
    Please let me know if there is any more issue. Feel free to raise further concern
    Thnx,
    Sukdev K

  • How to get the line number of source file?

    Hi,
    What is the equivalent in Java of the __LINE__ and __FILE__ macros in C? I want to print out the line number and the file name where the instruction is being executed.
    Thanks,

    If you are doing this because you're implementing your own debug logging, have a look at Log4J.
    You can configure it to log classnames, method names and line numbers of the code you're executing.

  • Replace the value 733.534 in reporting.

    Hi Experts,
    I am facing one problem in reporting. I am in BI 7.0 environment.
    Reports are export to EP everthing is good,
    Issue:
    one column displaying value like -733.534
    my requirement is don't display this value istead of this should display same flag or colour ....
    Root cause:
    this fields is calculated in the reporting level, so this is not coming from any data target.
    calculation: Days from two different Dates.
    eg; offer given date - offer excepted date = Days( resulet)
    I calculated by farmula with replacement path.
    this -733.534 value is displaying only when any one of the two dates are missed then this value will displaying.
    if both dates are in reporting calculated value is displyaing right. (currect result).
    can any help me how to replace the value -733.534 by any flag or colour.
    Regards
    Vijay

    Hi,
    You can achieve this by using exceptions in Query desigenr.you can put some colours for those values.
    Let me know if you have any issues.
    Reg
    Pra

  • How to replace the char values into numeric in my string?

    Hi Friends,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    I mean How to replace the char values into numeric in my string?
    Thanks,
    Sridhar

    Hi Sridhar,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
    DATA: l_str TYPE string.
    l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
    REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
    IF sy-subrc EQ 0.
      WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
    ENDIF.
    Regards,
    Chen
    Edited by: Chen K V on Jun 13, 2011 12:36 PM

  • How to get the values from IDXML during a Pre processing

    Hi,
    I have a requirement to validate the attributes in the IDXML request while deactivating a user. I have configured a workflow with the steps "Initiate" "Externalaction" "Disable" "Commit".
    The following is my IDXML request. I want to get the values that is coming in the IDXML in the pre action (written a c++ plugin) and perform certain validations.
    <?xml version="1.0"?>
    <SOAP-ENV:Envelope
                             xmlns:SOAP-ENV="http://schemas-xmlsoap.org/soap/envelope/"
                             xmlns:oblix="http://www.oblix.com">
    <SOAP-ENV:Body>
         <oblix:authentication xmlns:oblix="http://www.oblix.com" type="basic">
              <oblix:login>adminuser</oblix:login>
              <oblix:password>password1</oblix:password>
         </oblix:authentication>
         <oblix:request application="userservcenter" function="workflowDeactivateUserSave">
         <oblix:params>     
              <oblix:param name="ObWorkflowName">obworkflowid=9bbb88b273b1012d000086E812d695ad,obcontainerId=workflowDefinitions,o=Oblix,dc=dnb,dc=com</oblix:param>          
              <oblix:param name="uid">[email protected],ou=dnbCustomers,ou=People,dc=dnb,dc=com</oblix:param>
              <oblix:param name="attrName_1">UserID</oblix:param>
              <oblix:param name="attrValue_1">[email protected]</oblix:param>
              <oblix:param name="attrValue_1_old">[email protected]</oblix:param>
              <oblix:param name="attrOperation_1">REPLACE</oblix:param>
              <oblix:param name="attrName_2">ApplicationID</oblix:param>
              <oblix:param name="attrValue_2">12345611</oblix:param>
              <oblix:param name="attrValue_2_old">123456</oblix:param>
              <oblix:param name="attrOperation_2">REPLACE</oblix:param>
              <oblix:param name="attrName_3">SubscriberNum</oblix:param>
              <oblix:param name="attrValue_3">09787655</oblix:param>
              <oblix:param name="attrValue_3_old">09787655</oblix:param>
              <oblix:param name="attrOperation_3">REPLACE</oblix:param>
              <oblix:param name="noOfFields">3</oblix:param>
         </oblix:params>
         </oblix:request>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    How to get the values "ApplicationID","SubscriberNum" inside the preaction hook (c++). Please provide suggestions.
    Thanks,
    Lakshmi

    Read the doc, write the code, test it and debug it . http://download.oracle.com/docs/cd/E15217_01/doc.1014/e12491/idapi.htm#CDEIDDAF

  • How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working 10g

    Hi,
    How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
    We have tried below methods
    1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    2) in that formula columns we have put it below case condition also ,
    Measure Column: Nom_amt --> edit formulas
    CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
    3) we have uncheked IS NULL check box in the admin tool also
    I tried above formats still it's not working for me..kindly help me on this..
    thanks to do the needfull
    Best Regards,
    R.Devarasu

    Hi,
    Null value in database displaying as 0 in report, I need to keep value as in database, and I have one calculated row which is based on null values should also null in report.
    but it showing 0 for null values also so, my calculated row showing wrong result.
    my report is like
    col1 col2
    ABC 0
    BCD 12
    DEF -12 --this is calculated row.
    I require result like:
    col1 col2
    ABC null
    BCD 12
    DEF null --this is calculated row.
    Please let me know how I can achieve this.
    Thanks,
    Rahul

  • How to Replace Null Value as 0 in an OBIEE11g Pivot Table?

    Hi,
    How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
    We have tried below methods
    1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    2) in that formula columns we have put it below case condition also ,
    Measure Column: Nom_amt --> edit formulas
    CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
    3) we have uncheked IS NULL check box in the admin tool also
    I tried above formats still it's not working for me..kindly help me on this..
    thanks in advance...
    Best Regards,
    R.Devarasu

    Hi Amith,
    I have update your suggested one,but it's working few of the rows only..remainings rows some of cells still NULL only
    Measure colmns is : Nom_SGD
    IFNULL(Nom_SGD,0.00)
    Movment : dynamic date calc by using $2-$1 oracle formula's
    Actually i am doing below things only,
    31/12/2011 31/03/2011 Movment
    Country
    India 100 -50 -150
    Singapore 200 200
    UK 1200 -1200
    USA 0.00 0.00 0.00 (here changed null as 0)
    Helpmeon this...

  • Replacing the value in a list

    All,
    A quick question. How do we replace the value of role attribute with some other value?  When I try to set it, the new role is just getting appended.  I wanted to remove the olde role and set the new role.  I know I can remove the roles by setting .  is there any thing similar to replace as well?
    Thanks,
    BIju.

    Actually Biju, is exactly what you need - it is replace, not remove.
    = Add and is the default behavior, as you've seen
    = Delete and will clear all values for the attribute
    = Replace - it will delete all existing values and add whatever values follow the like:
    <newrolename>
    Edited by: Geoff Curtis on Jul 10, 2009 1:04 PM

  • How to replace key value with character

    Hi Experts
    Can any one tell me, how to replace key value with character, whether it is possible are not. My present report is displaying below format.
    country--city-area-flatnocountry--City-Flatno
    Customer--USACOst1111---UK--HD20--
    C100--11---11--
    C200--11---1--
    For the above example format i am able to display. But now i want to replace 1 with character value for example. For C100
    country is USA at presnt 1 but it should replace with USA.
    You find required format below.
    country--city-area-flatnocountry--City-Flatno
    Customer--USACOst1111---UK--HD20--
    C100--USACOst1111--
    C200--UK--HD20--
    thanks .
    Regards,
    Vishal.

    Hi Markus,
    Thanks for reply,
    Actually i dont have attribute for the customer, the data is maintained in ods, in the form, customer name one info-object and customer value one more info-object this value got text. This value stored in the ods as below
    costomer number  customer value
    C100--USA
    -C100CO
    C100--11-
    C200----
    UK
    C200----
    20
    Please let me know any clarification you need.
    Thanks and Regards,
    Vishal.

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the value from databank

    Hi,
    How to get the value from databank? and how to set the same value to visual script object?
    thanks,
    ra

    Hi,
    You can use GetDatabankValue(HeaderName, Value) to get the value from databank and SetDataBankValue(HeaderName, Value) to set the value to databank.
    You can refer to the API Reference to see list of associated functions and techniques we can use with related to Data Bank.
    This is the for OFT but if you are using Open Script then you have direct access for getting the databank value but when it comes to setting a value you have to use File operation and write you own methods to do the set operation.
    Thanks
    Edited by: Openscript User 100 on Nov 13, 2009 7:01 AM

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

Maybe you are looking for

  • Restoring from Time Machine after erase & install

    Hi, I have an iMac I rebuilt and when I plug in my Time Machine disk, all the UIDs are mixed up. this is not surprising as I created users on my rebuilt iMac in a different order. This issue is how can I correct the ownership of each of my user direc

  • XI 3.0 Publisher Function: "Pachage as Zip File" causes random file name

    I found in XI 3.0 Publisher Function: "Pachage as Zip File" will lose control to each report's file name. That is: The zip file I name it to: Report-2008-08-08-22-45-20.zip In the zip: ~bcap_8d8553f0ca6b347942_1.xls; ~bcap_f94553f0ca6c247941_2.xls I

  • Nat Type

    Hello. A have a problem with NAT TYPE on my ps3. I've got a moderate. How to fix this problem? How open nat type? Help please !!

  • Which retailer sells Leopard at the lowest price in the UK?

    Which retailer sells Leopard at the lowest price in the UK? Thanks Rich

  • No auto-complete, correct, or spell check

    Just gettin started with my TouchPad, but I can't seem to get any typing functions to work.  There is no spell checking, no auto-complete, and no auto-correct (e.g. "you" for "u").  I have enabled everything I can find.  What am I missing?  My softwa