Assigning a timestamp to an Import Parameter in eCATT

I am trying to assign a value to an Import parameter that will be unique every time the eCATT script runs.  I have inserted a piece of Inline ABAP code that looks like this:
ABAP.
   DATA: BEGIN of wa,
      time_stamp TYPE P,
   END OF wa.
   GET TIME STAMP FIELD wa-time_stamp.
   I_DATETIME = wa-time_stamp.
END ABAP.
This only assigns a time stamp to I_DATETIME is the parameter is type V.  Unfortunately, the script produces an error unless I_DATETIME is type I, however the Inline ABAP produces a syntax error when I_DATETIME is type I. 
For example, when I_DATETIME is type V I see in my
LOG I_DATETIME statement that the value 20050518200719 or something similar has been assigned to that parameter.  However, in the SAPGUI command interface where I deleted the original number value and replaced it with parameter I_DATETIME it reads: Value = I_DATETIME = '
Why can't I use parameters of type I and V interchangeably in the script and Inline ABAP?  Is there an easier way to go about getting a time stamp or unique value for an Import Parameter?
Message was edited by: Ben Weisberg

Ben,
there are two issues here:
<b>Parameter visibility in inline ABAP</b>
In inline ABAP, <b>only</b> local variables (visibilty V) can be used. The reason for this was to minimize the amount of data that has to be transferred to the target system of the script when the inline ABAP is generated.
<b>Avoiding inline ABAP where possible</b>
You said yourself that you suspect your approach is inefficient. I always tell people that inline ABAP can be fun, using the eCATT script language is better
You can generate yourself a timestamp in eCATT like this:
First, declare a parameter with type C. Since you are going to fill it in the script, there is no need for it to be an importing parameter - local variable (V) will do - let's call it V_TIMESTAMP.
Fill the field using <b>either</b>
V_TIMESTAMP = &DATE & &TIME
<b>or</b>
V_TIMESTAMP = sy-datum & sy-uzeit
<i>What's the difference?</i>
If you use the eCATT variables &DATE and &TIME, you will always get the date and time of the <b>current target system</b>. If you use the ABAP system fields sy-datum and sy-uzeit, you will always get the date and time of the <b>local eCATT system</b>. Obviously, if you are working locally in a system, these two sets of values will be the same. However, if you start working remotely - possibly against app servers in different time zones - you will have to decide which you want to use.

Similar Messages

  • Import Parameter as Select Option for a FM in ECC 6.0

    Hi All,
    Can someone help me get the import parameter of a function module to be of the type select-options( the way it is used in reports) in ECC 6.0.
    Thanks for all your help in advance.
    Divya

    What I do is as following....
    I create two parameters...One for <b>START</b> and the other for <b>END</b>....Then, inside my FM I create a RANGE...
      DATA: BEGIN OF r_datum OCCURS 1,
            sign(1),
            option(2),
            low  TYPE vekp-vhilm,
            high TYPE vekp-vhilm,
            END OF r_datum.
    Passing the START to low and END to high....
    P.S: Don't forget to assign points to useful answers.
    Greetings,
    Blag.
    Message was edited by:
            Alvaro Tejada Galindo

  • Field symbol as import parameter in class method ???

    Hi everyone,
    is it possible to pass a field symbol as an import parameter to a method in a class? If yes, how do I define the data type of the import parameter? I'm trying to work with field symbols as the program doesn't know what kind of structure the program parameter p_srcdso has. Coding example would be something like this:
    PARAMETERS: p_srcdso TYPE rsdodsobject DEFAULT '/BIC/AKVI0001'.
    DATA: lr_srcpkg TYPE REF TO data.
    FIELD-SYMBOLS: <fs_table> TYPE ANY TABLE.
    CREATE DATA lr_srcpkg TYPE TABLE OF (p_srcdso).
    ASSIGN lr_srcpkg->* TO <fs_table>.
    SELECT *
    FROM (p_srcdso)
    INTO TABLE <fs_table>.
    CALL METHOD cl_ref->create_somethign
    EXPORTING
        i_source_package = <fs_table>.
    Thanks,
    Alex

    Halo Alexander,
    You can use TYPE REF TO DATA( say the parameter name is i_data) as the importing parameter of the method create_somethign and inside the method you need to dereference it using data reference variable again.
    data: dref type ref to data.
    field-symbols: <fs_table> type table.
    create data dref like i_data.
    assign dref->* to <fs_table>.
    Regards
    Arshad

  • Passing a table to an import parameter for a FM

    Hello experts,
    The goal is to update the date of  a record from the database table ZSHIPM_PLAN05.
    In   ABAP dictionnany I define a structure ZST_SHIPM_PLAN05 based on a database table in ZSHIPM_PLAN05
    Further I define a variable import in function Module(FM): IV_SHIPMENT type ZST_SHIPM_PLAN05.
    But I get the following error when compiling the FM: "IV_SHIPMENT" is neither specified under "TABLES"  nor defined as a internal table.
    Thank you for your Help.
    In the top_include I have :
    TYPES: BEGIN OF tt_ZST_SHIPM_PLAN05.
            INCLUDE STRUCTURE ZST_SHIPM_PLAN05.
    END OF tt_ZST_SHIPM_PLAN05.
    DATA: gt_outtab TYPE TABLE OF tt_ZSHIPM_PLAN05,
                 wa_ZSHIPM_PLAN05 LIKE LINE OF gt_outtab.
        CALL FUNCTION 'Z_SHIPM_PLAN_SAVE05'
          EXPORTING
            iv_shipment = gt_outtab
          IMPORTING
            es_return   = gty_bapiret2.
    FUNCTION Z_SHIPM_PLAN_SAVE05.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IV_SHIPMENT) TYPE  ZST_SHIPM_PLAN05
    *"  EXPORTING
    *"     REFERENCE(ES_RETURN) TYPE  BAPIRET2
    LOOP AT IV_SHIPMENT INTO wa_ZST_SHIPM_PLAN05.
    settings the color
      IF wa_ZST_SHIPM_PLAN05-art = 'AA02' and wa_ZST_SHIPM_PLAN05-descr = 'ci0017'.
        wa_ZSHIPM_PLAN05-crea_date = sy-date.
      ENDIF.
      MODIFY gt_outtab FROM wa_ZST_SHIPM_PLAN05 TRANSPORTING crea_date.
    ENDLOOP.
          "MESSAGE 'Do you want save' type 'I'.
           SET SCREEN 0.
    ENDFUNCTION.

    Hi,
    Assign IV_SHIPMENT under changing or tables Parameter because import and Export statement holds a field not structure or table.
    Thanks
    Arbind

  • Using Field-Symbols in a user exit to change the importing parameter

    Please don't ask why but I need to use a user exit, changing the importing parameter.  I decided that I could do this using field-symbols.
    Please excuse my ignorance but I have never used field symbols for something such as this.
    Here is my goal:  Loop through an internal table (im_document-item).  When I find what I need I want to make a change to this line (not so hard if I am looping into a field symbol) and also append a line to the end of the table im_document-item.
    I have the following so far:
      DATA: wa_item TYPE accit,
            wa_item_out type ACCIT_SUB.
    FIELD-SYMBOLS: <document> type acc_document,
                   <accit> TYPE ACCIT.
    LOOP AT im_document-item ASSIGNING <accit> where saknr = '0000211000'.
    * Modify the curent line
    wa_item = <accit>
    * Append a new line into table im_document-item.
    ENDLOOP.
    How can I use field-symbols to append a line to this table?  Please note that the table in question (im_document-item) is an importing only parameter.
    Regards,
    Davis

    that will allow me to append an initial line with <accit> pointing to the line. Therefore I just have to modify <accit> and the new line will then have my changes?
    Yep, that is exactly it.    So after the APPEND statement, simply fill the fields of the <accit>.
    append initial line to im_document-item ASSIGNING <accit>.
    <accit>-field1 = 'Blah'.
    <accit>-field2 = 'Blah'.
    Regards,
    Rich Heilman

  • The import parameter of a RFC FM is not long enough

    Hii
    I have a standard FM and one of the import parameter field is not long enough for. 
    Instead of copying the RFC FM please advise how can i change the FIELD TYPE?
    What is the most appropriate solution

    If it is a standard FM, it will have it's import parameters type with reference to Data Dictionary. So, if this parameter is not long enough for YOU (or better said, for the value you want to assign to it), there is nothing you can do about it.
    For example when creating a business partner, with a Last name of more than 40 characters, you will not be able to store this name in SAP anyway, since in SAP the last name is typed as CHAR40.

  • How to access generic imported parameter

    Hi friends,
    If i pass internal table in importing parameter with <b>type</b> index table in method, how can i access that internal table in my method or how can i loop through it's each row.
    because that is generically defined internal table, it has unknown structure.
    hopping earliest reply.
    Regards,
    virat

    Hi,
    Try this:
    it_data importing type standard table.
    field-symbols:
    <fs_any> type any,
    <fv_any> type any.
    loop at it_data assigning <fs_any>.
      assign component ... of structure <fs_any> to <fv_any>.
    endloop.

  • Modify import parameter of FM

    I have a FM called during an SAP event. here, under a certain condition, i need to replace the old value of an import parameter.
    Can any one suggest some means to change the import parameter values of the FM.

    Hi Arindam,
    If you are using classes method in function module, yes u can do this. But you must use the field symbols.
    this is a sample..
    it_condition is import param.
    method set_new_values.
       data : ls_diffcond  type ztrm_s_vtbfinko_type,
              ls_condition type vtbefinko.
       data : lv_text type string.
       field-symbols : <fs_text> type any,
                       <fs_text2> type any,
                       <fs_condition> type vtbefinko.
       loop at gt_diffcond into ls_diffcond.
         if ls_diffcond-cond_type eq '+'.
           move-corresponding ls_diffcond to ls_condition.
           append ls_condition to it_condition.
         elseif ls_diffcond-cond_type eq '-'.
           move-corresponding ls_diffcond to ls_condition.
           delete it_condition from ls_condition.
         elseif ls_diffcond-cond_type eq 'C'.
           move-corresponding ls_diffcond to ls_condition.
           loop at it_condition assigning <fs_condition>
             where rkond    eq ls_condition-rkond and
                   dguel_kp eq ls_condition-dguel_kp..
             concatenate '<fs_condition>-' ls_diffcond-field_name into lv_text.
             assign (lv_text) to <fs_text>.
             concatenate 'ls_condition-' ls_diffcond-field_name into lv_text.
             assign (lv_text) to <fs_text2>.
             if <fs_text> is assigned.
               <fs_text> = <fs_text2>.
             endif.
             exit.
           endloop.
         endif.
       endloop.
    endmethod.

  • BAPI BAPI_GOODSMVT_CREATE import parameter problem

    Hi All,
    I am using BAPI BAPI_GOODSMVT_CREATE in function module ZQM06_FM_TASK_GOODS_MOVEMENT which is z copy of FM QM06_FM_TASK_GOODS_MOVEMENT. The FM get used in transaction IW52 i.e. Change Notification
    Now my query is the BAPI contain import parameter as GOODSMVT_CODE (Assign Code to Transaction for Goods Movement) and i don't know which value to pass to it.
    Could you please help me out?
    Thanks & Regards,
    Parag

    Hi,
    check the data element GM_CODE documentation for your requirement.
    Regards,
    Boobalan S

  • Problem with import parameter

    Our GetDetail function has an import parameter that we need to use to filter the returned dataset.  The parameter, MTRANTY, shows up correctly in the "Import" section of our GetDetail in the Mapping Screen of merep_sbuilder.  What I am not seeing is any reference to MTRANTY in the generated meRepMeta.xml file.  In the "Import" section of the mapping screen is does show "Link to Key Field of TOP: MTRANTY" in the Mapping Description.
    When I bring up the filtering criteria of our syncbo it shows another field, CUSTOMER, as "Filter Field 1", but I can't seem to be able to change it to MTRANTY as I think it should be.
    So, my question is, do the filter field and the import parameter have any connection?  Is there something else I need to do to make MTRANTY available in the meRepMeta.xml definition?  Or do I just set the key field of TOP (SYNC_KEY from the xml file) to my desired value and perform the synchronization?
    On a related note, in the xml file on the "SyncBO id" line, the parameter "reqDirectSync" is set to false.  Will this prevent me from initiating a synchronization using SyncManager.synchronizeWithBackend()?
    Thanks,
    Adam

    Hi Adam,
    The main thing here are ,
    <u>1)Metadata definition (XML file: Client view of SyncBO)</u>
    (meRepMeta.xml )
    The data structure used for the data exchange between  the mobile clients and the MI Server Component can be specified by defining the metadata for the SyncBO.
    This XML document will be used by the MI JAVA APIs to access and manipulate the local SyncBO data downloaded from Smart Synchronization.
    <b>A client application developer typically looks into the generated XML document for implementing the data access layer of a client application.</b>
    <u>2)Default value setting</u>
    It might not be necessary to expose some fields to the clients; how ever, the fields can be mandatory fields when the BAPI wrappers are called (mainly in create and change functions). In such cases, the field can be set as “default“ and its default value can be assigned. <b>The default values also need to be assigned for the selection criteria parameter(s) of the GetList BAPI
    wrapper function, which is used to pre-filter data being stored in the replica database.</b>
    <u>3)Filter setting</u>
    <b>To reduce the number of records on client devices, for example, to avoid downloading unnecessary data, the data filtering function can be used to filter the <b>data downloaded from the replica database</b></b>.
    Filtering is possible on these levels:
    a)At SyncBO level
    b)At Mobile ID level
    c) Mobile group Level.
        During synchronization,
    associated with each sync bo ...
    Getlist populate the Header Instances.
    --  for each Header instance getdetail is executed.
      so in the importing mapping part ,
    the mapped fields are only necessary for the  server at runtime.(here u can create value ids corresponding to each importing parameter and set values .)
    if u want to filter the header instances by means of user who is syncing .. then u ca directly give the default value of Value ID as ME-SYNC_USER against ur importing parameter.
    [In the client  we need only the header details and item details only].
       The relation bw  filtering of ITEM (Getdetail) is maintained  through the key fields in the ImportParam of Getdetail.(which are internally linked through the Header populated in Getlist ..)
    (Key fields of Getlist  is a subset of fields in the Header Structure).
    <<So, my question is, do the filter field and the import parameter have any connection? >>
    As i mentioned above  ,  Getlist is executed using the import params , and the replica BD is populated with the output from  getList. <b>Filters filter data from Replica DB to the Client  Device...</b>
                                   Regards
                                   Kishor Gopinathan

  • Cannot assign an empty string to a parameter with JDBC type VARCHAR

    Hi,
    I am seeing the aforementioned error in the logs. I am guessing its happening whenever I am starting an agent instance in PCo. Can somebody explain whats going on?
    Regards,
    Chanti.
    Heres the complete detail from logs -
    Log Record Details   
    Message: Unable to retreive path for , com.sap.sql.log.OpenSQLException: Failed to set the parameter 1 of the statement >>SELECT ID, PARENTID, FULLPATH, CREATED, CREATEDBY, MODIFIED, MODIFIEDBY, REMOTEPATH, CHECKEDOUTBY FROM XMII_PATHS WHERE FULLPATH =  ?  <<: Cannot assign an empty string to a parameter with JDBC type >>VARCHAR<<.
    Date: 2010-03-12
    Time: 11:32:37:435
    Category: com.sap.xmii.system.FileManager
    Location: com.sap.xmii.system.FileManager
    Application: sap.com/xappsxmiiear

    Sounds like a UI browsing bug (when no path is selected from a catalog tree folder browser) - I would suggest logging a support ticket so that it can be addressed.

  • How to use import parameter to be instead of SQL where sub-sentence ?

    I wrote a RFC to read data from SAP table. To fetch data flexibility, I want to use import parameter xx instead of where sub-sentence in SQL sentence.
       For example, "SELECT * FROM T WHERE XXX",  and "XXX" is a importing parameter.
       How can I use it.
       Thanks a lot.
       Frank.

    FUNCTION ZRFC_04.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(TARGETTABLE) LIKE  MAKT-MAKTX
    *"     VALUE(TWHERE) LIKE  MAKT-MAKTX
    *"  EXPORTING
    *"     VALUE(ZRETURN) LIKE  MAKT-MAKTX
    *"  TABLES
    *"      TMP_TEST1 STRUCTURE  ZTEST1
      DATA:
      TRANSACTION_ID LIKE ARFCTID,
      V_VAILD(1) TYPE C,
      scond(80) TYPE c.
      V_VAILD = 'X'.
    GET PARAMETER twhere fields scond.
    The error " 'LATE FIELDS' expected, not 'TWHERE FIELDS' " generated.

  • Can we assign two values to the same parameter? If yes how? For details ple

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • Can we assign two values to the same parameter? If yes how?

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • How to put data into a RFC import parameter structure from portal

    Hi, All,
    I have a RFC in which an import parameter is a structure (not a table). I want to put data into that structure. I know how to put data into a table or a string. I tried to use
    IRecordSet MyTABStr = (IRecordSet)structureFactory.getStructure(function.getParameter("MYTABSTR").getStructure());
    MyTABStr.setString("FIELD1", value1);
    MyTABStr.setString("FIELD2", value2);
    importParams.put("MYTABSTR",MyTABStr);
    But it works for table not structure.  Is there anybody know how to do that?
    Thanks in advance!
    Meiying

    Hi,
    You can try the following code -
    IRecord structure = (IRecord)structureFactory.getStructure(function.getParameter("MYTABSTR").getStructure());
    structure.setString("FIELD1", value1);
    structure.setString("FIELD2", value2);
    importParams.put("MYTABSTR",structure);
    Regards,
    Sudip

Maybe you are looking for