Convert CustomAttribute from Text to Date - setup 2 date range filters

Background: We have setup an Active Directory OU called Quarantine to temporarily store user accounts that have just been terminated before terminating their office 365 mailboxes licenses, legal holds and archives.  My director wants me to search that
OU for all users with data in a CustomAttribute field (text format) that we are populating with a termination date (looks like a date but the default format of the field is text).  Once I get all users who have info in that field, I have to convert it
to date format and then for those users who are terminated 90 days ago or more I have to process a script to disable legal hold.  For those users who are 89 days or less I do NOT disable the legal hold.
This has proven more difficult than I thought.  I'm not sure I'm converting the text field properly and I'm also not sure how to differentiate between the two filters. I have one example of a script below that tries to convert the date (unsuccessfully) but
it does not try two different filters because I'm not sure how to set those up (I know how to get 90days plus...I think...but I can't figure out how to get results for those that are 89 days or less):
Script 1
$RelayMailServer = "relay.domain.com"
$FromAddress = "[email protected]"
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList [email protected],$password
$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
$importresults = Import-PSSession $s
$adusers = get-aduser -filter * -searchbase 'ou=quarantine,dc=domain,dc=com' | select userprincipalname
$results = @()
$ErrorActionPreference = "continue"
foreach ($user in $adusers) {
$results += get-mailbox $user.userprincipalname -resultsize unlimited | ?{$_.customattribute7 -ne ""} |`
select UserPrincipalName,CustomAttribute7
If ($results) {
function Convert-DateString ([CustomAttribute7]$Date, [CustomAttribute7[]]$Format)
$dateresult = New-Object DateTime
$convertible = [DateTime]::TryParseExact(
$Date,
$Format,
[System.Globalization.CultureInfo]::InvariantCulture,
[System.Globalization.DateTimeStyles]::None,
[ref]$dateresult)
if ($convertible) { $dateresult }
If (!$results) { Write-Host "variable is null" }
If ($results){$file = "c:\Office365\TermedUsersCA7.csv"}
If ($results){$results | Export-csv $file -NoTypeInformation}
If ($results) {import-csv c:\Office365\TermedUsersCA7.csv}
Foreach ($result in $results) {
$qdate += $result.customattribute7 -gt (get-date).AddDays(-90)
#$qdate1 = get-date customattribute7.adddays(+90)
#$qdate2= echo date{'yyyy-mm-dd', $qdate1. ' + 90 days'}
Get-Mailbox -identity $_.userprincipalname -filter {CustomAttribute7 -gt $qdate}| `
select userprincipalname, customattribute7 | export-csv "C:\office365\q90users.csv"
Remove-PSSession $s

Yeah I figured that out right after I ran it and fixed it...thank you
It's working now but I adjusted the script a bit by having it omit those with no value in that attribute:
Get-ADUser-Filter*-PropertiesextensionAttribute7-SearchBase'ou=employees
quarantine,dc=31gifts,dc=corp'|?{$_.extensionAttribute7
-ne$null}
|`
ForEach{....

Similar Messages

  • Using servlets to read from text file and insert data

    Hi,
    Can I use a servlet to read from a space delimited text file on the client computer and use that data to insert into a table in my database? I want to make it easy for my users to upload their data without having to have them use SQL*Loader. If so can someone give me a hint as how to get started? I appreciate it.
    Thanks,
    Colby

    Create a page for the user to upload the file to your webserver and send a message (containing the file location) to a server app that will open the file, parse it, and insert it into your database. Make sure you secure the page.
    or
    Have the user paste the file into a simple web form that submits to a servlet that parses the data and inserts it into your db.

  • Convert timestamp from text file (hh:mm:ss) into seconds

    How can I import a column of time stamps from a text file of the form hh:mm:ss and convert it into seconds using LabView? For example, 13:30:30 into 48630.
    Also, using the "Read from Spreadsheet File VI" I can't seem to get the entire time stamp imported correctly. Only the value before the colon is read. For example, if the timestamp reads 13:30:30, only 13 is inputed into the array in LabView.
    FYI I'm using LabView 7. Thanks!

    Here's a LV 7 example. Just a Scan From String, a couple of Multiply functions and add the results. As far as your Read From Spreadsheet issue, by default, the function creates an array of SGLs. 13:30:30 is text and the functions needs to be modified to return an array of strings. There are instructions on the diagram on how to do this. When you've made the changes, save it as a new name and in a new location.
    Attachments:
    time_to_seconds.vi ‏17 KB

  • Bug when converting from text to date

    Hello Guys,
    I have a table with about 700 rows and the first column is for date.
    Most rows correctly have the cell content as date, but some rows show it as text, and even when I try to change it to date, nothing happens. It sticks as text.
    Main problem is I can't sort correctly of even do calculations.
    For me it really seems to be a bug.
    The only solution I see is to create a new column to convert the values with formula, but this is a shame to need to do this to workaround such simple bug.
    Best regards,
    Bruno

    Hi Wayne,
    LOL.
    Here's the cell that came from text file exactly like the next one. After setting as date in the format panel, it stays as expected:
    The row below came from another paste from the same text file, but it insists on not becoming date:
    After setting date, and leaving the cell selection, it goes back to "Automatic".
    In the bar at the bottom, it is shown as "Text".
    I have already tried to select the entire column and set as Date, and also to do it individually, but only some are converted. Other stays as Texts.
    Best regards,
    Bruno

  • Can I convert Facebook time Text to Project Siena's Date value ?

    Can I convert Facebook time Text to Project Siena's Date value ?
    I want to show create_time on screen by my Localtime formatted text.
    Facebook time Text = 2014-07-14T11:22+0000
    I want to show = 2014/07/14 18:22
    My Time Zone is +09:00, Osaka/Japan.
    Currently I try it by Text/Replace/Replace/Replace/Left/DateValue/+ , etc.
    And I ask more simple way.
    Regards,
    Yoshihiro Kawabata

    Thank you Andy , and Robin, I can.
    Text(TimeValue(Substitute(ThisItem!created_time,"+0000",".000Z")),"yyyy/mm/dd hh:mm")
    At Facebook Albums's Gallary, I can convert from Facebook created_time to Localtime Text DateTime.
    and I hope more easy way like Excel Power Query's one.
    Regards,
    Yoshihiro Kawabata

  • Comparing Converted Text To Date With Date Column

    I have a query where I need to break out a text column into a date format and then compare that column against another column in the same table which is already date format. I tried using a sub query to avoid doing it in two steps, but get an:
    'ORA 01858' a non numeric character was found where numeric was expected
    error message which obviously has something to do with the formating of the date in the subquery: the types don't match.
    Note: clock_num is a text column and contains numbers that are supposed to be dates like 070111 - hence the need for conversion into a date type to match the stat_date which is date column type. I do not have contol over the data in this column. It is not my table, it is the company's table and I must use it!
    So my quesion is what syntax/function do I use to get the clock_nbr expression type to match the eff_date type.
    Or is there a different way to go about doing the same thing without using the subquery?
    Any assistance is appreciated..
    SELECT
    me.ssn,
    FROM
    member_enroll me
    WHERE me.ssn = '999999999'
    AND me.stat_date <
    (SELECT to_date(substr(me.clock_num,1,2)||'/' || substr(me.clock_num,3,2)|| '/' ||substr(me.clock_num,5,2),'mm-dd-yy') as clock_nbr
    FROM member_enroll me
    WHERE me.ssn = '999999999')

    user12296489 wrote:
    I wasn't assuming that all the dates were correct. But that is where I made the error. But the reason I didn't see the error was that I didn't know if the way I had the substr function set up with the subquery was correct. I thought that was the problem and so wanted to make sure that was correct before I moved on. As I pointed out, there is a much simpler way to convert the string to a date using a format mask that matches the string data rather than parsing the data using SUBSTR and converting it to a different format before calling TO_DATE.
    It turns out that the reason you posted your function was actually what was holding it up. I had forgotten to include enough criteria in the subquery to return only the 1 record that had a valid clock_num. Once I did that, the query worked - without your function.Just be aware that though it works today, it may not work tomorrow when the query plan changes.
    So, now, onto the issue that you brought up, I don't know how to integrate that function you posted into my query. I have no knowledge of creating functions in pl/sql. I tried placing it before the query and it ran but returned no records You need to create the function once whereas you would run the query many times. I'm not sure what application you're using to interact with the database. If you run just the CREATE FUNCTION DDL statement, does that work? If you're using SQL*Plus, you'd see something like this with the "Function created." feedback.
    SQL> CREATE OR REPLACE FUNCTION my_to_date( p_str IN VARCHAR2 )
      2    RETURN DATE
      3  IS
      4    l_date DATE;
      5  BEGIN
      6    BEGIN
      7      l_date := to_date( p_str, 'MMDDYY' );
      8    EXCEPTION
      9      WHEN OTHERS THEN
    10        l_date := null;
    11    END;
    12
    13    RETURN l_date;
    14  END;
    15  /
    Function created.>
    Here is what I did. It doesn't error out. It says 'done in 0.156 seconds', but no records are returned. when I replace the function you gave (and rem out your function) with the to_date function, it returns 1 record. If I don't rem out your function and use the to_date function, it runs, but again, no records are returned.
    select me.subs_ssn,
    me.clock_num,
    my_to_date(mbr02.mbr02_clock_num) as clock_num
    from odw.mbr02_member_enroll_info mbr02
    where mbr02.mbr02_subs_ssn = '999999999'
    and mbr02.mbr02_grp_id = '00000'If you only have the function call in the SELECT list, the presence or absence of the function cannot possibly change the number of rows that are returned. So if your description is of the behavior of this particular query, something is very wrong. It is possible that the CLOCK_NUM column could be NULL if the MBR02_CLOCK_NUM column is in an invalid format. But the other two columns would have to be populated here if they are populated when you simply remove the call to the function.
    Justin

  • Changes in BDC program to upload data from text/excel file

    Hi friends i have obtained the BDc program after recording :
    start-of-selection.
    perform open_group.
    perform bdc_dynpro      using 'SAPLCOIH' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'AUFPAR-PM_AUFART'
                                  'PM01'.
    perform bdc_field       using 'CAUFVD-IWERK'
                                  '460a'.
    perform bdc_field       using 'CAUFVD-GSBER'
                                  '2460'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_dynpro      using 'SAPLCOIH' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'CAUFVD-KTEXT'
                                  'abc'.
    perform bdc_field       using 'CAUFVD-INGPR'
                                  'GM'.
    perform bdc_field       using 'CAUFVD-VAPLZ'
                                  'RTN_VELR'.
    perform bdc_field       using 'CAUFVD-VAWRK'
                                  '460A'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-GLTRP'.
    perform bdc_field       using 'CAUFVD-GSTRP'
                                  '1.8.2010'.
    perform bdc_field       using 'CAUFVD-GLTRP'
                                  '1.8.2010'.
    perform bdc_field       using 'CAUFVD-TPLNR'
                                  'RTNP-HIG'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_field       using 'AFVGD-INDET'
                                  '1'.
    perform bdc_field       using 'AFVGD-WERKS'
                                  '460A'.
    perform bdc_field       using 'AFVGD-STEUS'
                                  'PMIN'.
    perform bdc_field       using 'AFVGD-ARBEH'
                                  'H'.
    perform bdc_field       using 'AFVGD-DAUNE'
                                  'H'.
    perform bdc_dynpro      using 'SAPLCOIH' '3000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'CAUFVD-KTEXT'.
    perform bdc_field       using 'CAUFVD-KTEXT'
                                  'abc'.
    perform bdc_field       using 'CAUFVD-INGPR'
                                  'GM'.
    perform bdc_field       using 'CAUFVD-VAPLZ'
                                  'RTN_VELR'.
    perform bdc_field       using 'CAUFVD-VAWRK'
                                  '460A'.
    perform bdc_field       using 'CAUFVD-GSTRP'
                                  '01.08.2010'.
    perform bdc_field       using 'CAUFVD-GLTRP'
                                  '01.08.2010'.
    perform bdc_field       using 'CAUFVD-TPLNR'
                                  'RTNP-HIG'.
    perform bdc_field       using 'CAUFVD-EQUNR'
                                  '10000009'.
    perform bdc_field       using 'AFVGD-LTXA1'
                                  'abc'.
    perform bdc_field       using 'AFVGD-INDET'
                                  '1'.
    perform bdc_field       using 'AFVGD-ARBPL'
                                  'RTN_VELR'.
    perform bdc_field       using 'AFVGD-WERKS'
                                  '460A'.
    perform bdc_field       using 'AFVGD-STEUS'
                                  'PMIN'.
    perform bdc_field       using 'AFVGD-ARBEH'
                                  'H'.
    perform bdc_field       using 'AFVGD-DAUNE'
                                  'H'.
    perform bdc_transaction using 'IW31'.
    perform close_group.
    after executing it has two options.one is for call transactioin and other is for with session.Now i want to do the uploading from text file.Please guide me how to achieve that and what should be the order of fields in the text file.I am just a beginner.I know how to do that with LSMW bt trying BDc first time for creating PM orders

    You can use class "cl_gui_frontend_services". First you must select file with "file_open_dialog" method and the you can upload file with "gui_upload" method into internal table. Here is a sample: (I didn't try the code but I'm sure you can get it working, there are lots of sample codes about that. You can also search FM "GUI_UPLOAD").
    REPORT  zreport.
    DATA:
    gv_subrc TYPE sysubrc,
    gv_result TYPE abap_bool,
    gt_data_tab type table of zstruc.
    PARAMETERS: p_fname LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
        PERFORM file_open_dialog USING space space space space
                            CHANGING p_fname gv_action gv_subrc.
    START-OF-SELECTION.
    PERFORM gui_upload TABLES gt_data_tab
                     USING p_fname  CHANGING gv_subrc.
    *** FORMS ***
    FORM file_open_dialog USING pv_window_title
                                pv_default_extension
                                pv_default_filename
                                pv_initial_directory
                       CHANGING pv_filename
                                pv_user_action
                                pv_subrc.
      DATA:
      lt_file_table TYPE filetable,
      lv_rc         TYPE i,
      lv_initial_directory TYPE string.
      IF pv_initial_directory IS INITIAL.
        PERFORM get_desktop_directory CHANGING lv_initial_directory.
      ELSE.
        lv_initial_directory = pv_initial_directory.
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = pv_window_title
          default_extension       = pv_default_extension
          default_filename        = pv_default_filename
    *     file_filter             =
    *     with_encoding           =
          initial_directory       = lv_initial_directory
    *     multiselection          =
        CHANGING
          file_table              = lt_file_table
          rc                      = lv_rc
          user_action             = pv_user_action
    *     file_encoding           =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5
      pv_subrc = sy-subrc.
      IF pv_subrc EQ 0.
        READ TABLE lt_file_table INTO pv_filename INDEX 1.
      ENDIF.
    ENDFORM.
    FORM gui_upload TABLES pt_data_tab
                     USING pv_filename
                  CHANGING pv_subrc    TYPE sysubrc.
      DATA:
      lt_data_tab TYPE TABLE OF string,
      lv_filename TYPE string.
      lv_filename = pv_filename.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename                = lv_filename
          filetype                = 'ASC'
         has_field_separator     = 'X'
    *     header_length           = 0
    *     read_by_line            = 'X'
    *     dat_mode                = SPACE
    *     codepage                = SPACE
    *     ignore_cerr             = ABAP_TRUE
    *     replacement             = '#'
    *     virus_scan_profile      =
    *     show_transfer_status    = 'X'
    *   IMPORTING
    *     filelength              =
    *     header                  =
        CHANGING
          data_tab                = lt_data_tab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          not_supported_by_gui    = 17
          error_no_gui            = 18
          OTHERS                  = 19
      pv_subrc = sy-subrc.
      IF pv_subrc EQ 0.
        pt_data_tab[] = lt_data_tab[].
      ENDIF.
    ENDFORM.

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How to store data into database by reading sql statements from text file

    how to write java program for storing data into database by reading sql statements from text file

    Step 1: Create a property file to add various queries.
    Step 2: Read the properties file using ResourceBundle
    Step 3: Use the jdbc to execute the query read from the property file.
    So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file.

  • Cant get data from text file to print into Jtable

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest

    Here's a thread that loads a text file into a JTable:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=315172
    And my reply in this thread shows how you can use a text file as a simple database:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=342380

  • Can I convert Twitter time Text to Project Siena's Date Value ?

    Can I convert Twitter time Text to Project Siena's Date Value ?
    I want to show localtime of Twitter created_at.
    Twitter time text = ThisItem!created_at , ex: Tue Jul 15 17:19:00 +0000 2014
    I want to show 2014/07/16 02:19 by Japan localtime.
    Regards,
    Yoshihiro Kawabata

    Siena uses JavaScript to parse date/times, via the TimeValue function. A good specification regarding what is acceptable can be found here:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
    The example above is truly bizarre: I thought I had seen it all. You will need to turn that form into one of those listed on the above site, using string functions to chop it up and reassemble it into a saner form.

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext
    SECTION - 1
    This a test description.This a test description.
    This a test description.This a test description.
    This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
    while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
    When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
    SECTION - 2
    This a test description.This a test description.\r\n\r\nThis a test description.This a
    test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
    BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?
    Thanks,
    Deepak

    DeepakJ wrote:
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
    update foo
    set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10).

  • How to save data from text file in databse for a transaction...

    Hi Guys,
    I have a text file which has some data related relevant to transaction VA01 separated by tabs.
    Now instead of going in the transaction in VA01 and thne feeding the data manually, I would like this data
    to get read automatically from the text file and get processed field by field for transaction VA01 and thne get saved.
    How do I achieve this ? Do I have to use SHDB or some other method ?a

    hi tushar,
    REPORT  ZCALL_TRANS_TAB1                      .
    TABLES: LFA1,LFBK,lfb1.
    *& internal table declaration
    data: BEGIN OF it_vendor occurs 0,
           LIFNR LIKE LFA1-LIFNR,
           bukrs like lfb1-bukrs,
           END OF it_vendor.
    DATA: BEGIN OF IT_BANK occurs 0,
          LIFNR LIKE LFA1-LIFNR,
          BANKS LIKE LFBK-BANKS,
          BANKL LIKE LFBK-BANKL,
          BANKN LIKE LFBK-BANKN,
          koinh like lfbk-koinh,
          END OF IT_BANK.
    data: it_bdcdata like bdcdata occurs 0 with header line.
    data: it_messages like bdcmsgcoll occurs 0 with header line.
    *selection screen.
    selection-screen: begin of block b1 with frame.
    parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
    obligatory.
    parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
    obligatory.
    selection-screen: end of block b1.
    *at selection screen.
    at selection-screen on value-request for p_file.
    perform f4_help using p_file.
    at selection-screen on value-request for p_file1.
    perform f4_help1 using p_file1.
    *start of selection
    start-of-selection.
    *******uploading file
    perform upload_file using p_file P_FILE1.
    ******open session.
    perform populate_data.
    *&      Form  f4_help
          text
         -->P_P_FILE  text
    form f4_help  using    p_p_file.
    data: l_file type ibipparms-path.
    call function 'F4_FILENAME'
    importing
       file_name           = l_file.
       p_file = l_file.
    endform.                    " f4_help
    *&      Form  POPULATE_DATA
          text
    -->  p1        text
    <--  p2        text
    form populate_data .
    DATA: L_STRING TYPE STRing.
    DATA: L_COUNTER(2) TYPE n.
    loop at it_vendor.
    perform bdc_dynpro      using 'SAPMF02K' '0106'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-D0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                   it_vendor-lifnr.
    perform bdc_field       using 'RF02K-BUKRS'
                                  it_vendor-bukrs.
    perform bdc_field       using 'RF02K-D0130'
                                  'X'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-bankn(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    ******CALL TRANSACTION.
    call transaction 'FK02' using it_bdcdata mode 'A'
                            messages into it_messages.
    write:/ sy-subrc.
    perform format_messages.
    clear it_bdcdata.
    refresh it_bdcdata.
    endloop.
    endform.                    " POPULATE_DATA
    *&      Form  FORMAT_MESSAGES
          text
    -->  p1        text
    <--  p2        text
    form format_messages .
    data: l_msg(100).
    loop at it_messages.
    call function 'FORMAT_MESSAGE'
    exporting
       id              = it_messages-msgid
       lang            = sy-langu
       no              = it_messages-msgnr
       v1              = it_messages-msgv1
       v2              = it_messages-msgv2
       v3              = it_messages-msgv3
       v4              = it_messages-msgv4
    importing
       msg             = l_msg
    exceptions
       not_found       = 1
       others          = 2
    write:/ l_msg.
      endloop.
    endform.                    " FORMAT_MESSAGES
    *&      Form  bdc_dynpro
          text
         -->P_0173   text
         -->P_0174   text
    form bdc_dynpro  using    value(p_program)
                              value(p_screen).
    it_bdcdata-program = p_program.
    it_bdcdata-dynpro = p_screen.
    it_bdcdata-dynbegin = 'X'.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0178   text
         -->P_0179   text
    form bdc_field  using    value(p_fnam)
                             value(p_fval).
    it_bdcdata-fnam = p_fnam.
    it_bdcdata-fval = p_fval.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_field
    *&      Form  upload_file
          text
         -->P_P_FILE  text
         -->P_P_FILE1  text
    form upload_file  using    p_p_file
                               p_p_file1.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_VENDOR
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      FILE_OPEN_ERROR               = 2
      FILE_READ_ERROR               = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      NO_AUTHORITY                  = 10
      OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    *******UPLOADING BANK DETAILS
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE1
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_BANK
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    endform.                    " upload_file
    *&      Form  f4_help1
    form f4_help1  using    p_p_file1.
    data:l_file1 type ibipparms-path.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
       FILE_NAME           = l_file1.
       p_file1 = l_file1.
    endform.                    " f4_help1

  • FM or Way to validate Date format. The date is from TEXT File

    Dear All,
    I need to validate a date field whether it is in proper format.
    The field is coming from TEXT file to Internal table by using FM GUI_UPLOAD.
    Can any one give me the FM name or guide me how to do that?
    Definitely points will be given for correct solution.
    Thanks & Regards,
    Neeraj

    try the function module 'DATE_CHECK_PLAUSIBILITY'
      call function 'DATE_CHECK_PLAUSIBILITY'
           exporting
                date                      = '23.09.2007'
           exceptions
                plausibility_check_failed = 1
                others                    = 2.
      if sy-subrc <> 0.
        write:/ 'Please verify the date'.
        exit.
      endif.

  • Can't shown chinese text when copy & paste data from server to Outlook, Word & notepad, etc.( Office 2013)

    Can't shown chinese text when copy & paste data from server to Outlook, Word & notepad, etc.( Office 2013)

    Hi
    As per the information and details provided by you, when you copy & paste a data from server to Outlook, word, notepad, then you do not receive the Chinese text.
    For Outlook, please follow these steps: -
    Close and reopen Outlook in your western locale (or switch the windows system to your Western locale if you changed that),
    Manually change the message from Western to Chinese encoding, which you can do in all versions up to Outlook 2007.
    If you want to stay in your Chinese locale in Outlook 2007, then:
    After you hit reply, go to the Option tab > More Options.
    In the Encoding drop-down menu, select the Chinese encoding you are working in (Not the encoding used by the person who will receive the message)
    Note:
    To set the Chinese locale in all versions up to 2007 the controls are under.
    Tools > Options. In Outlook 2010 File tab > Options > Advanced > International options.
    Unicode (UTF-8)
    is a good setting for multilingual users.
    Check the
    Auto select 2007)/ Automatically select (2010) encoding box.
    I hope this information will be helpful for you.
    Thanks and regards
    Shweta@G 

Maybe you are looking for

  • Hiding fields in standard SAP Transactions

    Hi All, We have a requirement to hide some fields in ME51n, ME21n, ME31k,ME11,MIGO,ML81n,MIRO I know we have screen layout at doc level through which we can make the fields as optional, display and mandatory. Please let me know the standard way to hi

  • Regarding error message from a transaction

    Hello all,       I have a scenario where i need to collect all the error message from a trasaction and display it in a pop up.       i am calling a function module and inturn calling transaction 'FB08' using bdc. i may get one or more error message.

  • SUN Java WebServer on Linux install error

    Hi All I am trying to install SUN JavaWebServer 6.1 SP2 on linux. My environment is Red Hat Enterprise Linux ES release 3 (Taroon Update 6) Kernel 2.4.21-37.ELsmp on an i686 I am logged in as root. I got the software sun-webserver61-rh72[1].tar.gz fr

  • Problem while restoring backup from the pc to the ...

    hi all today i make two backups of my phone  ( nokia XpressMusic 5730 Symbiyan 60 3rd)  and then i restore all original phone settings  using *#7370# after that  i tried to recover the back up from the pc  but after it finished restoring the backup a

  • How to view the Hierarchy called 'ORGEH'  created in CRM

    Hi How we can view the full hierarchy called 'ORGEH' created in CRM. Thanks in Advance. Sarah.