Sqlldr WHEN clause with function call ?

I have a requirement to load data from a file with each row being checked for good data.
But that check is wrapped inside a function, as it is somewhat complex.
So I woul like to load the data with a WHEN clause like this
WHEN ( "CHECK_IF_GOOD(:field1, :field2,.. )" = '1' )
But sqlldr compains that column CHECK_IF_GOOD(:field1, :field2,.. ) is not present in tableA
Obviously sqlldr thought CHECK_IF_GOOD(:field1, :field2, ) to be a column name.
Is there any work around for this problem

The quotes and colons are not shown in the documentation for the when clause.
http://download.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_control_file.htm#i1005657
I do not know if you can invoke your own function in the Loader operation.

Similar Messages

  • Where-Clause with function(entered static parameter)

    Hello,
    I have no clue on the way to deal with this issue.
    Basically, for performance, I removed a join with a table, and replaced it by a call to a function within the where clause. This function only convert the entered date into an id, in order to compare with the id in the selected table.
    I knew (I think I'm right!!) that if I put a function into a where-clause, then the function is called at each row.
    As the parameter of this function is a Discoverer parameter, and therefore, it's a static value, I wanted to know whether with Discoverer, there would be a way to convert the entered Discoverer parameter value into a constant that I could use within my where-clause.
    To summarise, hete is the face of my query, at the moment:
    SELECT myColumns
    FROM myTables
    WHERE thisID < myConvertedDate(:RefDate);
    I would like to do this :
    The User enters the :RefDate, I convert it and save the result into a constant.
    Then, my query would look like :
    SELECT myColumns
    FROM myTables
    WHERE thisID < myConstantFromDate;
    I hope that my explanation is clear, and that one of you will be able to advise me.
    Thanks,
    Olivier

    Hello Nigel,
    I am not too sure that the function is called at each row. This is just my thought, from my "average" knowledge of SQL. We cannot run tkprof at the office, in order to get a better understanding.
    And also, the fact that goes towards this direction is that, when I add the call to my function in the where-clause, I have the impression that the query runs more slowly than without the call.
    I reckon that it would be great if the optimizer notices that the function is called with the same value, and returns always the same result.
    Thanks for your comments,
    Olivier

  • UnsatisfiedLinkError with function call

    Hi,
    I am using JNI to make native function calls from Java.
    I use
    System.loadLibrary("myLibName");
    to load my library, and that works without a problem.
    I can use this library without any problems from a simple test app I wrote. However, I get an UnsatisfiedLinkError when I try and integrate with the rest of my applicaton. I am 100% certain that function is defined correctly in both Java and C++.
    The only difference I can think of between my real application (which does not work) and my test application (which does work) is that in my real application, the object that makes use of the class that contains all my native methods is cloned before it makes any calls to my native code.
    What can cause an UnsatisfiedLinkError if my System.loadLibrary() is correct, and my function definitions are also correct?
    Thanks!
    Eliott
    Edited by: EliottH on Mar 1, 2010 12:17 PM

    In case my post needs any clarification, here is some sample code that demonstrates what I am doing:
    //An instance of this class gets cloned before any native function calls are made!
    public class SomeClass implements Cloneable {
        JniClass jniclass;
        SomeClass() {
               jniclass = new JniClass();
        //This returns an UnsatisfiedLinkError when called
        public void func() {
                jniclass.nativeFunc1();
        public void clone() {
              //Something....
    public class JniClass {
        public native void nativeFunc1();
        static {
             System.loadLibrary("myLibName");
    }Edited by: EliottH on Mar 1, 2010 1:00 PM

  • Overriding sub-report queries in CF8 with function calls

    There is not enough information in the documentation about
    overriding sub-report queries using functions. I can not figure out
    how the function call is to be passed.
    Here is the page and quote from the livedocs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_r-s_07.html
    "Note: You cannot specify a subreport query that depends on
    arguments from the master report. Instead, you can define a CFML
    function or CFC method that returns the subreport query given the
    arguments from the master report. ColdFusion calls this code when
    it executes the subreport."
    If I send over just the function call as a string it throws
    an error that it must be a query. If I evaluate it with # then it
    appears to make the call once before creating the report and uses
    the same query for the sub-report for every single master report
    record.
    My example report is simple. Retrieve a query of contacts
    records. The contact records have a state field which is the
    parameter for the sub-report. The sub-report performs a query and
    presents related information.
    I am trying to optimize this by pre-processing the queries
    for each state into memory, then pass a function that is to be used
    to get the correct sub-report query from memory.
    I have tried all variations that I can think of with no
    success. If I try to pass variables to the function that exist in
    the report, such as query and param, errors are thrown. I can only
    access variables already created earlier in my code which makes me
    think that the function is being evaluated once in the cfqueryparam
    tag. I can not find a way to delay evaluation so that it is
    evaluated for each call to the sub-report instead.

    I'm following the instructions laid out in the livedocs for
    advanced queries with CFML :
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=reportBuilder_17.html
    However the Report Builder won't save the CFML I enter.
    Everytime I go back to the Advanced query there are just blank
    query tags. Most of the time it doesn't even show that any changes
    were made to the report at all. The little asterisks does not
    appear next to the report name tab which indicates if there are
    unsaved changes. At some point I got it to save some code but it
    had a mistake and I couldn't get it to save the corrected code.
    This is very frustrating. I'm putting in a bug report for at
    least the saving of CFML in the advanced query section.

  • Personal recruitment How to do new measure with function call Update IT4000

    Hi out there and happy new year to forum,
    i want to update to implement a recruitment measure (Transaction PB40). I did it already with batch input, but i guess it's much more comfortable to do with funtion module, bapi or calsses.
    After choosing the measure, the infogroup will be processed. So i guess, i just have to use the corresponding function modules to update the infotypes in a given sequence. is this suggestion right?
    What are these function modules? How to update f.e. IT4000? Does anyone has a coding snippet?
    Is it HR_INFOTYPE_OPERATION? 
    In our Infogroup there are also customer specific infotypes f.e. 9***. Can I use the sap standard function modules for "own implemented" infotypes?
    I also appreciate an abap oo pattern or any similar....
    Best regards,
    T

    Andy Goris wrote:
    But I don't think that it's possible to hire an application completly with function modules (there is no PERNR in the beginning so I would keep the BIM).
    The applicants already exists in system, i just want to implement a measure with exact one click!
    Otherwise there is a BAPI for applicant_create.
    I'm not very expierienced focussing the implementation in pa-recruiting. I'm really looking for a good documentation or anything like that f.e. sap press.
    Andy Goris wrote:
    ... but why would you use the old recruiting database? This is hardly used anymore.
    What are the alternatives to it. (I'm not looking forward to upgrade releases or using wd4a or webgui). we are on ecc 6.0 There is already a lot of z-coding in recruitment. We are also using an self implemented e-recruiting approach
    Edited by: Timo Ehl on Jan 3, 2012 2:30 PM

  • When Clause with FIELDS TERMINATED BY and TRAILING NULLCOLS option?

    Dear all
    If i have the following datafields:
    E;15;
    D;14;16;
    E;18;
    to load into table tab1 (Type_ligne VARCHAR2(1),
                                     Nombre1 NUMBER(2),
                                     Nombre2 NUMBER(2))
    Is it possible to have the following control file :
    LOAD DATA
    TRUNCATE
    INTO TABLE Tab1
    when (1) ='E'
    FIELDS TERMINATED BY ';' TRAILING NULLCOLS
    (Type_Ligne CHAR,
    Nombre1 INTEGER EXTERNAL)
    INTO TABLE Tab1
    when (1) ='D'
    FIELDS TERMINATED BY ';' TRAILING NULLCOLS
    (Type_Ligne  CHAR,
    Nombre1 INTEGER EXTERNAL,
    Nombre2 INTEGER EXTERNAL)
    If no! please show me the correct syntax.

    Yes, you can, but for each WHEN clause after the first one, you have to specify the starting position for the first field, as shown in bold below.
    LOAD DATA
    TRUNCATE
    INTO TABLE Tab1
    when (1) ='E'
    FIELDS TERMINATED BY ';' TRAILING NULLCOLS
    (Type_Ligne CHAR,
    Nombre1 INTEGER EXTERNAL)
    INTO TABLE Tab1
    when (1) ='D'
    FIELDS TERMINATED BY ';' TRAILING NULLCOLS
    (Type_Ligne  POSITION(1) CHAR,
    Nombre1 INTEGER EXTERNAL,
    Nombre2 INTEGER EXTERNAL)

  • Problem with function call from sql when using distinct

    I have the following problem.
    SELECT DISTINCT colA from tabA where my_function(colB) = 'TRUE'
    This statement will return a handfull of results from a table with 70k + records. The function takes about 0.5 secs to execute.
    How do i force the optimizer to do the select distinct first then execute the function on the results rather than execute the function for every single line first?
    Thanks in advance
    Keith

    Let's compare some of those methods:
    michaels>  CREATE OR REPLACE FUNCTION my_function (tr VARCHAR2)
       RETURN VARCHAR2
    AS
    BEGIN
       DBMS_APPLICATION_INFO.set_client_info (SYS_CONTEXT ('userenv','client_info') + 1);
       IF LOWER (tr) LIKE '%name%'
       THEN
          RETURN 'TRUE';
       ELSE
          RETURN 'FALSE';
       END IF;
    END my_function;
    Function created.
    michaels>  CREATE TABLE taba AS SELECT object_id cola ,object_name colb FROM all_arguments
    Table created.
    michaels>  SELECT COUNT(*) FROM taba
      COUNT(*)
         78786
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  SELECT DISTINCT colA from tabA where my_function(colB) = 'TRUE'
    167 rows selected.
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    78786
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  SELECT DISTINCT cola FROM (SELECT ROWNUM r, t.* FROM (SELECT DISTINCT cola, colb FROM taba) t)
              WHERE my_function (colb) = 'TRUE'
    167 rows selected.
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    14225
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  SELECT DISTINCT cola FROM taba WHERE (SELECT my_function (colb) FROM DUAL) = 'TRUE'
    167 rows selected.
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    14281
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  SELECT DISTINCT cola FROM taba WHERE EXISTS (SELECT ROWNUM FROM dual WHERE my_function (colb) = 'TRUE')
    167 rows selected.
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    13913
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  WITH temp AS
      (SELECT DISTINCT colA, colB FROM tabA)
    SELECT DISTINCT colA FROM temp WHERE  my_function(colB) = 'TRUE'
    167 rows selected.
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    78786
    michaels>  EXEC dbms_application_info.set_client_info(0)
    michaels>  WITH temp AS
      (SELECT colB, my_function(colB) func FROM (SELECT DISTINCT colB FROM   tabA))
    SELECT DISTINCT colA FROM tabA a, temp t WHERE  a.colB = t.colB AND t.func = 'TRUE'
    michaels>  SELECT SYS_CONTEXT ('userenv','client_info') ci FROM dual
    CI   
    78786 The combination with exists, rownum and dual gives the least calls to the function.

  • Decode null with function call

    Hi
    Is it possible to use decode in select for the below scenario, if so what is the correct syntax
    IF function one returns null I want to call display the value from function 2 in decode statement.
    Regards
    anna

    Hi, Anna,
    I would use COALESCE for that:
    COALESCE (a1, a2, a3, ...)returns the first of its arguments (there can be as few as 2, and probably at least 100) that is not NULL.
    If you need help, post some sample data (CREATE TABLE and INSERT statements), function code, and the results that you want from that data.

  • Java.util.regex and replacing patterns with function calls

    Hi everyone,
    I'm in terrible need for help.
    Any advice is much appreciated.
    I have the following sentence in a file. The sequence of numbers is actually a
    date in seconds since 1970. I need to identify the 9 or 10 sequence of numbers
    send that to a method that will transate the numbers into a date in a string format.
    Then replace it in the file.
    Here is an example:
    "My name is Peter. Please 1020421277 help me figure this out 108062327. "
    using the following block I can convert it to this
    "My name is Peter. Please | help me figure this out |. "
    [block]
    Pattern p = Pattern.compile("[0-9]{9,10}+");
    Matcher m = p.matcher("");
    String aLine = null;
    while((aLine = in.readLine()) != null) {
    m.reset(aLine);
    String result = m.replaceAll("|");
    out.write(result);
    out.newLine();
    [end block]
    So I need to change the above block so that my sentence looks like this.
    "My name is Peter. Please 05/03/2002 10:21:17 help me figure this out 06/04/1973 17:18:47. "
    The method that converts the numbers into a date is not of a concern because I already have
    the code to do that.
    If anyone has suggestion, please let me know.
    Thanks in advance.
    Peter
    [email protected]

    Never mind, I was able to figure it out....
    Common2 cm = new Common2();
    Pattern p = Pattern.compile("[0-9]{9,10}+");
    Matcher m = p.matcher("");
    m = p.matcher(s1);
    while ((found = m.find())) {
    String replaceStr = m.group();
    System.out.print("\tReplaceString is: " + replaceStr);
    replaceStr = cm.get_date(replaceStr);
    System.out.println("\t\tConverted to: " + replaceStr);
    m.appendReplacement(buf,replaceStr);
    m.appendTail(buf);
    ----------------- The get_date method in Common2 looked like this ------------------------------
    public String get_date(String myString)
    String s;
    long lsecs = Long.parseLong(myString);
    lsecs = lsecs * 1000; // its now milliseconds.
    // Determine default calendar and then the offset to GMT.
    Calendar localCalendar = Calendar.getInstance();
    int offset = localCalendar.get(Calendar.DST_OFFSET) + localCalendar.get
    (Calendar.ZONE_OFFSET);
    // Take the number of milliseconds subtract the gmtoffset
    Date GMTdate = new Date(lsecs - offset);
    // Format date
    Format myformat;
    myformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss a z ");
    s = myformat.format(GMTdate);
    return s;
    Peter

  • Problem using function call in WHERE part of a Report's SQL query

    I tried doing some searches on this, but couldn't find anything. I'm trying to run something similar to the following query in my report, but keep getting a "Query cannot be parsed within the Builder" error:
    SELECT function1(TABLE2.ID) A
    FROM TABLE1, TABLE2
    WHERE TABLE1.ID = TABLE2.ID AND
               TABLE1.NAME = 'BLAH' AND
               TABLE2.DATE > SYSTIMESTAMP AND
               (function2(TABLE2.ID) = 'YES' OR
                function3(:USER_ID) = 'YES')
    ORDER BY TABLE1.NAMEWhy won't this work? I can take out the 2 lines with function calls from the WHERE clause, and it works, so I'm assuming that APEX doesn't like something about my function calls. I know the functions are valid and work properly, because I tested them independently. Can anyone see what the problem is? Thanks!

    Here's the actual query:
    SELECT BUILD_EXT_RES_LIST(EXT_FILE.ID) A
    FROM EXT_FILE_RES, EXT_FILE
    WHERE EXT_FILE_RES.ON_OWNER_PROFILE = 'Y' AND
          EXT_FILE.OWNER_ID = :PROFILE AND
          EXT_FILE.ID = EXT_FILE_RES.EXT_ID AND
         (RES_SUBSCRIBER_YN(EXT_FILE.ID,:CURR_ID) = 'YES' OR
          ADMINYESNO(:CURR_ID,:PROFILE) = 'YES')
    ORDER BY EXT_FILE.FILE_NAMEAnd here's the actual error message:
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00904: "SER_IS_ADMINYESNO": invalid identifier

  • When clause in SQL Loader

    hi,
    i am facing a problem during when clause in sql loader
    here is my control file
    options(direct=true)
    load data
    infile 'data_file.txt'
    truncate
    into table "TABLE_NAME"
    when col1 = '1'
    trailing nullcols
    col1 integer external TERMINATED BY ',',
    col2 integer external )
    into table "TABLE_NAME"
    when col1 = '2'
    trailing nullcols
    col1 integer external TERMINATED BY ',' ,
    col2 integer external )
    =======================================
    this file loads only data when col1=1 and does not load data when col1=2
    can any body help me
    thanks in advance

    Hi,
    I currently have the same problem. Seems that SQLLDR WHEN clause only apply for columns that based on datafile. Also, data that to be compared in WHEN clause is get from datafile and you can not make any modification on that data.
    How did you do to work around with that?

  • How to specify when clause in a database trigger

    I would like to create a database trigger that only fires on database create statements. In particular, it only needs to fire when tables with a specific prefix fire.
    I'd like to be able to specify something in the when clause along the lines of :
    CREATE OR REPLACE
    TRIGGER CAPTURE_STATS
         after CREATE ON rtrei.schema
         WHEN ( NEW.table_name like 'RT_FOO%' )
    begin
    add_stats_capture( :new.min_range, :new.max_range);
    end;
    It looks like I should be able to use a when as part of a database trigger, but I have no idea what new would be defined to be so that I could use it... perhaps it is an object and the clause would look something like
    when (new.objecttype = 'TABLE' and new.name like 'RT_FOO%')?
    Any ideas? I've searched through the docs, but have not been able to find anything relevant.
    thanks very much,
    Robin

    You can use the WHEN clause with DDL triggers. You can move Todd's IF-THEN clause up into the WHEN clause.
    See http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10795/adfns_ev.htm for all of the System-Defined Event Attributes.
    CREATE OR REPLACE TRIGGER capture_stats
    AFTER CREATE ON SCHEMA
    WHEN (ora_dict_obj_type = 'TABLE' AND ora_dict_obj_name LIKE 'RT_FOO%')
    BEGIN
            --Do whatever here.
    END capture_stats;

  • ITunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working

    iTunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working and then it shuts iTunes down.  Anyone else every have this issue.  Any ideas on a fix?
    Thanks,

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    Well, since you've had the same problem, with three different phones, that all use different size sim cards, it seems pretty obvious the problem is with your carrier/coverage & nothing to do with your phone or sim card.

  • Function module not working when used with 'In Background Task'

    hi,
    this is my code
    call function 'Z_IBD_FILL_ZINETACT'
                  in background task
                  destination  'SAPD220125'
                  tables
                      it_net1 = it_net1
                      it_net2 = it_net2
                      it_net3 = it_net3  .
    when this code is executed i am not getting any data in my internal tables i.e it_net1, it_net2, and it_net3
    but i changed this code see the below code
          call function 'Z_IBD_FILL_ZINETACT'
                 in background task (THIS IS COMMENTED)
                  destination  'SAPD220125'
                  tables
                      it_net1 = it_net1
                      it_net2 = it_net2
                      it_net3 = it_net3  .
    now i am getting data into my internal tables
    can any one tell me what can be the problem and how to solve it in my case
    its very urgent

    Hi,
    Pls. go through the  docu..
    CALL FUNCTION
    Variant 5
    CALL FUNCTION func IN BACKGROUND TASK.
    Additions:
    1. ... AS SEPARATE UNIT
    2. ... DESTINATION dest
    3. ... EXPORTING  p1 = f1    ... pn = fn
    4. ... TABLES     p1 = itab1 ... pn = itabn
    Effect
    Flags the function module func to be run asynchronously. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and the next COMMIT WORK executes it in another work process.
    Note
    This variant applies only as of Release 3.0, so both the client system and the server system must be Release 3.0 or higher.
    Note
    qRFC with Outbound Queue
    This is an extension of tRFC. The tRFC is serialized using queues, ensuring that the sequence of LUWs required by the application is observed when the calls are sent.
    For further information about qRFC, refer to the Serialized RFC: qRFC With Outbound Queue section of the SAP Library.
    Addition 1
    ... AS SEPARATE UNIT
    Effect
    Executes the function module in a separate LUW under a new transaction ID.
    Addition 2
    ... DESTINATION dest
    Effect
    Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed either in another R/3 System or as a C-implemented function module. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    Note
    Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you may not use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
    Addition 3
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    EXPORTING passes values of fields and field strings from the calling program to the function module. In the function module, formal parameters are defined as import parameters. Default values must be assigned to all import parameters of the function module in the interface definition.
    Addition 4
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    TABLES passes references to internal tables. All table parameters of the function module must contain values.
    Notes
    If several function module calls with the same destination are specified before COMMIT WORK, these normally form an LUW in the target system. Calls with the addition 1 are an exception to this rule - they each have their own LUW.
    You cannot specify type 2 destinations (R/3 - R/2 connections).
    (See Technical details and Administration transaction.)
    Example
    REPORT  RS41503F.
    /* This program performs a transactional RFC.
    TABLES: SCUSTOM.
    SELECT-OPTIONS: CUSTID FOR SCUSTOM-ID DEFAULT 1 TO 2.
    PARAMETERS: DEST LIKE RFCDES-RFCDEST DEFAULT 'NONE',
                MODE DEFAULT 'N',
                TIME LIKE SY-UZEIT DEFAULT SY-UZEIT.
    DATA: CUSTITAB TYPE TABLE OF CUST415,
          TAMESS   TYPE TABLE OF T100,
          WA_CUSTITAB TYPE CUST415.
    SELECT ID NAME TELEPHONE INTO CORRESPONDING FIELDS OF TABLE CUSTITAB
                   FROM SCUSTOM WHERE ID IN CUSTID ORDER BY ID.
    PERFORM READ_CUSTITAB.
    EDITOR-CALL FOR CUSTITAB TITLE 'Editor for table CUSTITAB'.
    PERFORM READ_CUSTITAB.
    CALL FUNCTION 'TRAIN415_RFC_CALLTRANSACTION'
         IN BACKGROUND TASK
         DESTINATION DEST
         EXPORTING
              TAMODE    = MODE
         TABLES
              CUSTTAB   = CUSTITAB.
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
         EXPORTING
              STARTDATE = SY-DATUM
              STARTTIME = TIME
         EXCEPTIONS
              OTHERS    = 1.
    IF SY-SUBRC = 1.
      EXIT.
    ENDIF.
    COMMIT WORK.
    CALL TRANSACTION 'SM58'.
          FORM READ_CUSTITAB                                   *
    FORM READ_CUSTITAB.
      WRITE: / 'System ID:', SY-SYSID.
      SKIP.
      LOOP AT CUSTITAB into WA_CUSTITAB
        WRITE: / WA_CUSTITAB-ID, WA_CUSTITAB-NAME,
                 WA_CUSTITAB-TELEPHONE.
      ENDLOOP.
      ULINE.
    ENDFORM.
    Pls. reward if useful....

Maybe you are looking for