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

Similar Messages

  • Passing different tables as a input parameter

    HI,
    I've 5 tables TAB1, TAB2, TAB3, TAB4, TAB5
    and I created 5 store procedures to generate 5 file.txt with utl_file utility.
    Now I'd like to know if possible create just one stored procedure (or package) with just one cursor
    that passing different tables as a input parameter.
    Have you any idea?
    Thanks in advance!

    Here you go...
    SQL> create table tab1 as select 1 as x, 'A' as y from dual union
      2                       select 2, 'B' from dual union
      3                       select 3, 'C' from dual;
    Table created.
    SQL>
    SQL> create table tab2 as select 4 as x, 'D' as y from dual union
      2                       select 5, 'E' from dual union
      3                       select 6, 'F' from dual;
    Table created.
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE output_tbl (p_table_name IN VARCHAR2) IS
      2    v_cur     SYS_REFCURSOR;
      3    x         NUMBER;
      4    y         VARCHAR2(10);
      5  BEGIN
      6    OPEN v_cur FOR 'SELECT x, y FROM '||p_table_name||' ORDER BY x';
      7    LOOP
      8      FETCH v_cur INTO x, y;
      9      EXIT WHEN v_cur%NOTFOUND;
    10      -- Here you would output to your file, but for ease of
    11      -- demonstration I'll just dbms_output the data
    12      DBMS_OUTPUT.PUT_LINE(x||' : '||y);
    13    END LOOP;
    14  END;
    15  /
    Procedure created.
    SQL> exec output_tbl('TAB1');
    1 : A
    2 : B
    3 : C
    PL/SQL procedure successfully completed.
    SQL> exec output_tbl('TAB2');
    4 : D
    5 : E
    6 : F
    PL/SQL procedure successfully completed.
    SQL>

  • How to pass a value to the export parameter for a method (public instance)?

    Hello,
      I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
    Thanks in advance,
    Ranjini

    Hi,
    "class definition
    class lcl... definition.
      public section.
        method m1 imporitng par type ref to data.  "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
    endclass.
    "in program
    data: r_lcl type ref to lcl...
    create object r_lcl.
    call method r_lcl
      exporting
         par    =  "pass any reference variable here
    Regards
    Marcin

  • Table type in import parameter in rfc function module

    Hi we don't have the table type in our system which exist in the other system which is the import parameter of the rfc function module.so how can we pass the parameter. shell we create the same table type in our system also.it is a table type for a deep structure.

    Hello,
    I donot have access to CRM box I cannot view the FM. You can verify with the CRM counterpart what exactly is the TYPE for param DATA.
    Else you can define a generic internal table (TYPE TABLE) & try calling the FM.
    BR,
    Suhas

  • What are the import parameter for FM SWE_EVENT_CREATE

    Hello all,
    I want to use the function module SWE_EVENT_CREATE in order to create an event in order to execute a process chain which is triggered by this event.
    Beside the EVENT I have also OBJTYPE and OBJKEY as import parameter, but I do not know what should I enter there.
    In the TA sm64 where I have created the event, I could not find any other information than the event name.
    Any ideas would be great.
    Best regards,
    Stefan from Munich/Germany

    Hello Stefan,
    for OBJTYPE and EVENT see table SWETYPECOU
    OBJKEY usually is an idoc-number (edidc-docnum)
    hope it will help
    Regards Thomas

  • Changing Import Parameter for GetList

    Hi All,
    i have a getlist bapi which has a import parameter. I have mapped a constant in the BEA (Backend adapter).
    if i want to change the import parameter in the BEA i have to activate the BEAagain.
    is there a way to change the import parameter without activating the BEA again?
    we are using Mobile 7.1 SP08 Server.
    Thanks and Regards,
    Joseph Beevin.

    Hi,
    the default value is called default value because you define it once and then it stays forever. So based on that default value MI7.1 generates some entries in tables, code,... If you change this entry in the SDOE_WB, even it is the Default value and not the mapping - it is obvious that you need to regenerate this Backend adapter - cause you press the save button to save the backend adapter and so it is changed and this change needs to be reflected in the code.
    By the way: cause you only change the backend adapter there is no need to reimport the datamodel into your NDWI.
    And keep in mind: Changing the Default value can happen at development time but should not happen at runtime, cause then you have a design issue and in Production you should not be allowed to change any bit of the Data Model other then by transport!
    So the first question is: why do you really want to change the default value - it seems to be a big issue - and perhaops we need to find another solution for you.
    Regards,
    Oliver

  • Passing table as an import parameter

    Dear experts,
    While developing an RFC,i felt a problem and though i managed it.Still some doubt resides in mind.
    We have sections Import,Export,Tables,Sourcecode in SE37.
    Example i wish to pass tabular structure as input to RFC.I found that in import and export parameters
    i cannot take table type,i can only take table type in Tables section.
    So i defined input table as well as Output table in tables section only.I gave description as Input table and Output table
    for my understanding.I gave the source code and fetch data in my output tabe.
    It works !.But is that the only way ?.Or i was required to declare tables in some other section in order to conclude them as
    input/output table.

    Hi aditya,
    You can refer to any table as below try it -
    Parameter Name     Type Spec          Associated type
    ITAB                      LIKE     MAKT
    This simply means you have to use LIKE to refer to any table.
    Hope this helps.

  • Passing a table as a procedure parameter

    I'm trying to pass a table_name as a parameter but it is not working. Any idea ???
    CREATE OR REPLACE PROCEDURE SIMM.populate_field
    ( field_name IN all_tab_columns.column_name%TYPE)
    IS
    v_a part_index_temp.no_dossier%TYPE;
    CURSOR c_temp IS
    SELECT no_dossier FROM part_index_temp FOR UPDATE;
    BEGIN
    OPEN c_temp;
    LOOP
    FETCH c_temp INTO v_a;
    EXIT WHEN c_temp%NOTFOUND;
    UPDATE part_index_temp a
    SET
    a.nouv_nom = (
    SELECT field_name
    FROM part_index_temp
    WHERE rnum= (SELECT (1+ABS(MOD(dbms_random.random,10)))
    FROM dual)
    WHERE CURRENT OF c_temp;
    END LOOP;
    CLOSE c_temp;
    END;

    What are you trying to accomplish?
    Describe the business requirement and we can help you.
    The way you are trying to pass in a Column name (not the table name) requires dynamic sql...

  • Pass values to Guid collection/array parameter for anonymous pl/sql block

    The following code pops the System.ArgumentException: Invalid parameter binding
    Parameter name: p_userguids
    at Oracle.DataAccess.Client.OracleParameter.GetBindingSize_Raw(Int32 idx)
    at Oracle.DataAccess.Client.OracleParameter.PreBind_Raw()
    at Oracle.DataAccess.Client.OracleParameter.PreBind(OracleConnection conn, IntPtr errCtx, Int32 arraySize)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    Any help or advice ?
    anonymous pl/sql block text:
    DECLARE
    TYPE t_guidtable IS TABLE OF RAW(16);
    p_userguids t_guidtable;
    BEGIN
    DELETE testTable where groupname=:groupname;
    INSERT INTO testTable (userguid, groupname)
    SELECT column_value, :groupname FROM TABLE(p_userguids);
    END;
    c# code:
    public static void SetGroupUsers(string group, List<Guid> users)
    OracleConnection conn = Database.ConnectionEssentus;
    try
    conn.Open();
    OracleCommand sqlCmd = new OracleCommand();
    sqlCmd.CommandText = sqls["SetGroupUsers"]; // above anonymous block
    sqlCmd.Connection = conn;
    sqlCmd.BindByName = true;
    OracleParameter p_guidCollection = sqlCmd.Parameters.Add("p_userguids", OracleDbType.Raw);
    p_guidCollection.Size = users.Count;
    p_guidCollection.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    p_guidCollection.UdtTypeName = "t_guidtable";
    p_guidCollection.Value = users.ToArray();
    sqlCmd.Parameters.Add("groupname", OracleDbType.Varchar2, 30).Value = group;
    sqlCmd.ExecuteNonQuery();
    catch(Exception ex)
    System.Diagnostics.Debug.WriteLine(ex.ToString());
    finally
    conn.Close();
    }

    New question,
    How can I select records using "in" condition clause likes the following sentence?
    SELECT userguid, firstname, lastname FROM UserTable WHERE userguid in (SELECT column_value FROM TABLE(p_userguids))
    I tried using PIPE ROW like this, but ORACLE said "PLS-00629: PIPE statement cannot be used in non-pipelined functions"
    FOR i in p_userguids.first .. p_userguids.last
    LOOP
    SELECT userguid, firstname, lastname INTO l_userrecord FROM UserTable WHERE userguid=p_userguids(i);
    PIPE ROW(l_userrecord);
    END LOOP;

  • Can I pass an array as an input parameter for a stored procedure on SQL Server 2000

    I am trying to pass an array to a stored procedure residing on my SQL Server 2000 database server. Is this even possible? If it is possible, what is the syntax for this?
    Any help would be greatly appreciated.
    Thanks

    I have passed arrays to and from a database using SQL and ActiveX, including to and from stored procedures, but I cannot recall the precise method used to do so. If memory serves, everything is in the form of a string. You need to do a lot of parsing and 'unparsing' to get this data into your stored procedure.
    You are left with a couple of options to get your data to the stored procedure. I recommend using SQL in LabVIEW wherever possible as it saves the amount of external code calls (and believe me, calling ActiveX procedures developed by someone else in Visual Basic is NOT much fun at all...). You can either send the array and other data to the stored procedure (you will find the syntax in the SQL references in LabVIEW help under SQL), or you can send
    the array to the database, and have the database then act upon the array.
    I strongly recommend making routines (subVIs) to handle these operations.
    Sorry I don't have the syntax, I don't have SQL installed on this machine. If you can't find the syntax in the help, please post here again.
    -Mike Du'Lyea

  • Passing a table as a parameter

    Hi,
    I want to pass a table name as a parameter to a procedure . A cursor in the procedure will be using the passed parameter , to fetch the values.
    For eg.
    Procedure A(X varchar2)
    cursor c1 is
    select *
    from X;
    right now i'm getting an error , X must be defined...is there any other way to do the same..?
    Thanx in advance.
    Preetha

    You'll need to use dynamic SQL for this. Look up either the dbms_sql package or the 'execute immediate' call.
    With execute immediate, you'd do something like
    Procedure A(X varchar2)
    IS
    sqlStatement varchar2(4000);
    BEGIN
    sqlStatement := 'select * from " || x;
    execute immediate sqlStatement;
    END
    Justin

  • Smartform import parameter

    Hello all, I've created a new smartform with a new import parameter called TOTAL_DATA, which contains several fields. TOTAL_DATA is defined in the smartform global settings>form interface tab as an import parameter. I thought this would make this parameter data available within all smartform nodes. TOTAL_DATA is not a table but a structure.
    I've inserted some TOTAL_DATA field references, e.g. &TOTAL_DATA-1_6&, into text nodes within a template node. The smartform compiles correctly but when I test the smartform I get error 'Reference field TOTAL_DATA-1_1 unknown in form'. I inserted the field using the smartform field list window click and drag.
    Is there something I need to do to make the import paramter data available in the text node.
    Any help much appreciated.
    Thanks, Inde

    Thanks Subramanian, that's solved my problem. My import parameter was referencing a DD structure with currency fields. The DD reference currency field was not passed to the smartform...hence the error.
    I've defined the DD reference currency field as a global parameter for the smartform which fixed my problem. I could pass this in as another import parameter which would also fix my problem.
    Many thanks for your help, Inde

  • Passing internal table to a method of a Global Class

    Hi All,
    I have to pass a Select option (SO_RANGE) as a IMPORT parameter to a method of a global Class (while calling that method from a executable program).
    what Reference type should I give, while defining the IMPORT parameter for that method of class. 
    SO_RANGE have structure of type (SIGN, OPTION, LOW and HIGH)
    Regards,
    Pankaj.

    You first need to define a type for range.
    for that goto->public section of your class and put following under TYPES
    TYPES : tr_matnr type range of mara-matnr .
    now you can use this tr_matnr in global class to define input parameter and in your program to define a variable .
    In your program define variable as
    DATA data_mat TYPE Classname=>tr_matnr
    To define workarea type use following.
    TYPES : t_matnr TYPE LINE OF tr_matnr .

  • Problem in Passing internal table Function module

    Hi experts,
    I am new to creating function module and needed certain suggestions.
    I have created a type inside the FM
    types: begin of T1
    field A
    field  B
    end of T1.
    Now, i have populated the internal table of this type but how to send it through the tables tab of my FM.
    IN the parameter, i can write my internal table name but what should be associated type ...
    Please give some suggestions

    Hi,
      Not required.
    Table parameter will behave like type table of Z_sturcture. So just define the structure and use it in the TABLE parameter.It will convert that into internal table..
    Example :
    Parameter name         Typing                Associated type
    T_RETURN                  LIKE                   your Z_structure
    If you want to give table in the import parameter, then you need to create the table type for the structure.....

  • Suggestion regarding table as a import table in bapi

    Hello;
        Is it possible as TABLE as the import parameter in the BAPIs import parameter tab.
    Thnaks and Regards,
         sapdev10.
    Moderator Message: Duplicate post.
    Edited by: kishan P on Oct 13, 2010 1:38 PM

    Hello;
        Is it possible as TABLE as the import parameter in the BAPIs import parameter tab.
    Thnaks and Regards,
         sapdev10.
    Moderator Message: Duplicate post.
    Edited by: kishan P on Oct 13, 2010 1:38 PM

Maybe you are looking for

  • Problem with radio in Nokia5800 52.0.007 .

    Hello, I have installed firmware 52.0.007.  when I am switching radio stations radio application freezes  and I am unable to turn radio off with taskmanager. I must turn off and turn on my phone. What should I do with this?

  • Table for system status for an order

    Hi Gurus, we are displaying a report in which list of orders we are displaying in that system status also we need to dispaly for that the logic we have used is take OBJNR from AUFK by passing AUFNR and get all the active status for that AUFNR by pass

  • Manually autosacle doesn't work after setting scale Propety node

    Hello,       In the program, I  am using the graph property node for setting the X-scale range.      Now, The zoom tools in the graph palette works, nut the autoscale tools doesn't work. Thanks. Wei Tong. 

  • Strange error protecting BPEL service with WSM server agent

    I'm trying to protect a BPEL service with OWSM (SOA Suite 10.1.3.3 MLR#19). Everything looks fine as far as I can see, but when the service is called with WSM active it always fails with internal server error. There are no errors in the logs (BPEL lo

  • Problems viewing site in earlier versions of IE

    Hi everyone, I'm wondering if you can help me. I've just built a site and it appears fine in FF & IE8 but in earlier versions of IE the pages break up and I lose the scroll boxes. Can anyone offer me some advice? The site can be viewed at www.vulture