Import and Export Vs. Tables in a Function module interface

Hi,
i need to import and export internal tables to/from a Function Module.
Passing internal tables using import and export is good enough or do i need to use 'Tables' option. Please let me know the reasons if possible.
thanks for your help.
GK.

you can use changing but you have declare a table type and use it in changing..
however TABLES is declared aas oblselete in ECC version 6.0
No Points Plz

Similar Messages

  • Exporting int table in a function module

    Hi,
    How to export the resultant table in function module ? I have  created a itab in my function module and it's getting filled up.I need to export this table ? how to do it?
    DATA : BEGIN of itab occurs 0,
              empno type p0001-pernr,
              ename type p0001-ename,
              END of itab.
    I don't want to create structure in se11.
    Rgds,
    jothi.P

    Hello Mr. Jothi,
    This is Venkat.O here.
    Just follow this ..
    <b>1. Function module source code.</b>
    FUNCTION zvenkat_testfun.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PERNR) TYPE  PERNR-PERNR
    *"  TABLES
    *"      II_TAB
    DATA:
      BEGIN OF li_output occurs 0,
          pernr TYPE pa0001-pernr,
          ename TYPE pa0001-ename,
      END OF li_output.
      SELECT pernr ename
        FROM  pa0001
        into table li_output
        WHERE  pernr  = pernr.
      IF sy-subrc = 0.
       ii_tab[] = li_output[].
      ENDIF.
    ENDFUNCTION.
    <b>2.Sample abap program  with Logical database PNP.</b>
    REPORT zvenkat_notebook.
    TABLES pernr.
    DATA: BEGIN OF i_tab OCCURS 0,
            pernr TYPE pa0001-pernr,
            ename TYPE pa0001-ename,
          END OF i_tab.
    START-OF-SELECTION.
    GET pernr.
      CALL FUNCTION 'ZVENKAT_TESTFUN'
        EXPORTING
          pernr = pernr-pernr
      TABLES
        ii_tab        = i_tab.
      loop at i_tab.
       write:/ i_tab-pernr,
               i_tab-ename.
      endloop.
    It is working fine.
    By the way How are you .
    Thanks,
    Venkat.O

  • Import and Export header in CAUFVD

    Hello all,
    Can anyone tell me How to use Import and Export header for CAUFVD in function exit EXIT_SAPLCOZV_001 as my requirement is to populate overhead key automatically at the time of po order release. Do i have to use any function module ?? If yes then what and how?? I am new for enhancements so dont have much idea.
    Thanks!!

    Hi bala,
    Thanks for your prompt reply. But can you please ellaborate where excatly i need to wirte this export parameter. My code looks like this:
    IF wa_caufvd-zschl EQ space.
      "Overhead Key
      SELECT matnr matkl FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara
      WHERE matnr = wa_caufvd-matnr.
      SELECT werks zschl
       FROM zppoverhead
       INTO CORRESPONDING FIELDS OF TABLE it_zppoverhead
       FOR ALL ENTRIES IN it_mara
       WHERE matkl = it_mara-matkl
       AND  werks = wa_caufvd-werks
       AND  auart = wa_caufvd-auart.
      IF sy-subrc EQ 0.
        wa_caufvd-zschl = wa_zppoverhead-zschl.
      ENDIF.
    ENDIF.
    "Process Order Release
    SELECT objid arbpl FROM crhd INTO CORRESPONDING FIELDS OF TABLE it_crhd
    WHERE objid = wa_caufvd-st_arbid.
    IF it_crhd IS NOT INITIAL.
      SELECT werks zsubplant FROM zplantmaster INTO CORRESPONDING FIELDS OF TABLE it_zplantmaster
      FOR ALL ENTRIES IN it_crhd
      WHERE p_resource = it_crhd-arbpl.
    ENDIF.
    IF sy-subrc EQ 0.
      wa_zpporders-zsubplant = wa_zplantmaster-zsubplant.
    ENDIF.
    As per my understanding i need to use export parameter for zschl, but how and where excatly.
    Please guide me.
    Thanks!!

  • Any example to import and export itab to function module

    hi all,
    as the table parameter in function module is obsolete, please advise an example on how to pass in an internal table
    and return back the result in an internal table as well.
    for example, i have itab1 and itab2. By using table parameters i got the following code. Please advise alternative way by using import and export.
    ""Local Interface:
    *"  TABLES
    *"      itab1 STRUCTURE  Zitab1
    *"      itab2 STRUCTURE  Zitab2
    loop at itab1 into wa_itab.
    **do some logic here to assign value to itab2 and return.
      wa_itab2-a = xxx .
      wa_itab2-b = xxx.
    append wa_itab2 to itab2.
    endloop.
    thank you.

    hi,
    suppose you have two structure name struc1 and struc2.
    create table type zitab1 & 2 for both.
    please do the following:
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(itab1) TYPE  Zitab1
    *"  EXPORTING
    *"     VALUE(itab2) TYPE  Zitab2
    you can avoid to use the obsolete table parameters as well as LIKE in function module creation.
    cheers

  • Internal table with Import and Export

    Hi All,
    Hi all
    Please let me know the use of <b>Internal table with Import and Export parameters and SET/GET parameters</b>, on what type of cases we can use these? Plese give me the syntax with some examples.
    Please give me detailed analysis on the above.
    Regards,
    Prabhu

    Hi Prabhakar,
    There are three types of memories.
    1. ABAP MEMORY
    2. SAP MEMORY
    3. EXTERNAL MEMORY.
    1.we will use EXPORT/ IMPORT TO/ FROM MEMORY-ID when we want to transfer between ABAP memory
    2. we will use GET PARAMETER ID/ SET PARAMETER ID to transfer between SAP MEMORY
    3. we will use EXPORT/IMPORT TO/FROM SHARED BUFFER to transfer between external memory.
    ABAP MEMORY : we can say that two reports in the same session will be in ABAP MEMORY
    SAP MEMORY: TWO DIFFERENT SESSIONS WILL BE IN SAP MEMORY.
    for ex: IF WE CALL TWO DIFFERENT TRANSACTIONS SE38, SE11
    then they both are in SAP MEMORY.
    EXTERNAL MEMORY: TWO different logons will be in EXTERNAL MEMORY.
    <b>Syntax</b>
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
    To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.
    The relevant fields must each be linked to an SPA/GPA parameter.
    On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
    On a screen, you link fields to parameters in the Screen Painter. When you define the field attributes of an input field, you can enter the name of an SPA/GPA parameter in the Parameter ID field in the screen attributes. The SET parameter and GET parameter checkboxes allow you to specify whether the field should be filled from the corresponding SPA/GPA parameter in the PBO event, and whether the SPA/GPA parameter should be filled with the value from the screen in the PAI event.
    When an input field is linked to an SPA/GPA parameter, it is initialized with the current value of the parameter each time the screen is displayed. This is the reason why fields on screens in the R/3 System often already contain values when you call them more than once.
    When you call programs, you can use SPA/GPA parameters with no additional programming overhead if, for example, you need to fill obligatory fields on the initial screen of the called program. The system simply transfers the values from the parameters into the input fields of the called program.
    However, you can control the contents of the parameters from your program by using the SET PARAMETER statement before the actual program call. This technique is particularly useful if you want to skip the initial screen of the called program and that screen contains obligatory fields.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    Saving Data Objects in Memory
    To read data objects from an ABAP program into ABAP memory, use the following statement:
    Syntax
    EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.
    This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM <f i >, the data object <f i > is saved under its own name. If you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    Check this link.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    Thanks,
    Susmitha.
    Reward points for helpful answers.

  • Difference between Import and Export parameters in Function Module

    Hi All,
    I am unclear about the import and export parameters, when i create a function module. Can anyone explain abt this. However when i call the function module in any program the import parameters in Function module are displayed as exporting in program amd the export parameters as importing.
    Any help on this would be appericiated.
    Shejal.

    HI,
    Import parameter in FM is the value u provide to FM for processing.
    export is the value u get from FM after processing.
    when u call a FM in a progam the import parameter will appear as Export bcos u r giving value to the FM.
    and u r getting value from FM in import parameter(bcos u r importing).
    rgds,
    latheesh
    Message was edited by: Latheesh Kaduthara

  • Import and export the database table

    I would like to know what is the syntax of using imp.exe and exp.exe to import and export the database table?
    Could anyone teach me what is the syntax and how could do the export and import in the Forms?
    Thanks a loT~

    try: imp help=yes
    Or read the documentation online on OTN.

  • JCA IConnection call to BAPI with table in table as import and export param

    Is it possible to call a BAPI with a table in table as import and export data?
    Please give small code example if this is possible.
    Thanks in advance.

    Inner tables can be handled with:
    IRecordSet innerTable = (IRecordSet)outerTable.getObject("INNER_TABLE");

  • Issue while importing table from oracle to sql server using import and export wizard

    Hi All,
    I am trying to populate oracle table to sql server using import export wizard  and i am getting the below error.the table is allready present in the database but still it throwing error like table doesn't exists.
    Could not connect source component.
    Error 0xc0202009: Source - JOB_ACTION_HISTORY [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    Error 0xc02020e8: Source - JOB_ACTION_HISTORY [1]: Opening a rowset for ""FLXUSER"."JOB_ACTION_HISTORY"" failed. Check that the object exists in the database.
     (SQL Server Import and Export Wizard)
    Kindly help me out
    Thanks in advance

    Hi Snehasis,
    Please check whether the table name in the Oracle database has lower case letters. The table name should be exactly correct. 
    In addition, the issue might be related to the Oracle driver. What provider/driver do you use? If you use Microsoft OLE DB Provider for Oracle, you can try the
    Oracle OLE DB Provider. If you use Enterprise or Developer edition of SSIS 2008 or higher, you can also try the
    Microsoft Connectors for Oracle by Attunity. The  Oracle OLE DB Provider and Microsoft Connectors for Oracle are proved to have better performance.
    Regards,
    Mike Yin
    TechNet Community Support

  • Import and Export Parameters READ_TEXT

    Hi ALL
    I have to read Standard Text through this Function Module and populate that Standard Text into an Internal Table. Kindly let me know about the Import and Export parameterto do this. Also pls let me know a way to accomplish this
    Thanks

    What text are u reading and from which transaction.
    The following are the main parameters,
    ID:
    this is text id(U can find it in ur transaction,generally it will start with z)
    LANGUAGE:
    This depends on the language in which the text is maintained.For example En(english)
    NAME:
    No for which the text id is maintained,it may be deliver no or transport no.Depends on ur case.
    OBJECT:
    This represents mostly wether it is header data or item data respectively.so u can check this in ur transaction.
    A short example as follows,
    FORM read_text1 TABLES   g_t_lines STRUCTURE tline
                    USING    p_var TYPE c
                             p_obj TYPE c.
      READ TABLE xvttp INDEX 1.
      g_f_tdname1 = xvttp-vbeln.
      g_f_obj1 = p_obj.
      g_f_langu1 = 'DE'.
      REFRESH g_t_lines.
      CLEAR g_t_lines.
      CALL FUNCTION 'READ_TEXT'
           EXPORTING
                id                      = p_var
                language                = g_f_langu1
                name                    = g_f_tdname1
                object                  = g_f_obj1
           TABLES
                lines                   = g_t_lines
           EXCEPTIONS
                id                      = 1
                language                = 2
                name                    = 3
                not_found               = 4
                object                  = 5
                reference_check         = 6
                wrong_access_to_archive = 7
                OTHERS                  = 8.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.
    Check this and let me know if u face any problenm.
    Regards

  • Import and Export to Memory

    hi guys, im currently making a program that imports and exports data into a memory so that when the user logs out that would still remain in the memory. The data would be use for the slection screen but i can't seem to make it work.  Could you please help me. Or if you have other ideas on how to store data that would also be ok. The thing is when Im running the program through se38 its working fine but if i run it through its transaction code the import does not work. Please help.
    here is my code:
    DATA: begin of i_memory,
                 memory_id(31),
               end of i_memory.
    initialization.
    IF p_prem IS INITIAL.
         CONCATENATE c_memory_id sy-uname into v_memory_id
                     SEPARATED BY c_underscore.
         IMPORT i_memory FROM MEMORY ID v_memory_id.
         IF sy-subrc = 0.
            p_prem = i_memory-memory_id.
         ELSE.
            p_prem = '0.04'.
         Endif.
      ENDIF.
    at selection-screen.
      i_memory-memory_id = v_memory_obj.
      CONCATENATE c_memory_id sy-uname into v_memory_id
                  SEPARATED BY c_underscore.
      EXPORT i_memory to MEMORY ID v_memory_id.
      IF sy-subrc = 0.
      Endif.
    Please help. Thanks in advance guys.

    Shekhar Kulkarni 
    I need help understanding your code.
    Im trying to do same thing as you described in the post.
    My main purpose is to IMPORT variant contents from cluster table VARI for all the selection screen variables dynamically.
    I can IMPORT individual screen variables :: For ex :
    st_key-report = 'ZNIDHS20'.
    st_key-variant = 'TEST_VAR'.
    IMPORT slsin_p TO TMP_VAR FROM DATABASE VARI(VA) ID ST_KEY.
    This will get me the contents of slsin_p parameter in variant TEST_VAR of program ZNIDHS20.
    But If I use same statement in a loop, im not able to get the data. : see below
    LOOP AT i_selection_table..
    IMPORT i_selection_table-name TO TMP_VAR FROM DATABASE VARI(VA) ID ST_KEY.
    ENDLOOP.
    I found your post interesting and started to test this way....As said, I have extracted selection screen variable table, and then tried to EXPORT the contents to Share Memory from database table VARI(VA), unfortunately program fails. Pls see code below....Pls see if you can help me out...
    DATA: BEGIN OF st_key,
            report LIKE rsvar-report,
            variant LIKE rsvar-variant,
          END OF st_key.
    data : i_selection_table like rsparams occurs 0 WITH HEADER LINE,
    v_rsvar like rsvar-report.
    st_key-report  = 'ZNIDHS20'.
    st_key-variant = 'VJ_TEST'.
    V_RSVAR = 'ZNIDHS20'.
    data : begin of itab occurs 0,
           COL1(40) type c,
           COL2(40) TYPE C,
           end of itab.
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
      EXPORTING
        CURR_REPORT           = V_RSVAR
      TABLES
        SELECTION_TABLE       = i_selection_table
    EXCEPTIONS
       NOT_FOUND             = 1
       NO_REPORT             = 2
       OTHERS                = 3.
    LOOP AT I_SELECTION_TABLE.
      MOVE I_SELECTION_TABLE-SELNAME TO ITAB-COL1.
      APPEND ITAB.
    ENDLOOP.
    EXPORT (ITAB) TO SHARED MEMORY VARI(VA) ID ST_KEY.
    IMPORT ITAB = JTAB FROM SHARED MEMORY VARI(VA) ID ST_KEY.
    Pls help.....

  • DRM/MDM Import and Export File types - Question

    Hi Guys,
    We have been implementing Hyperion DRM to our existing Oracle Environment for managing the company's sales data which comes from multiple data sources. In my experience and research, I feel DRM is an excellent tool but there are some questions I have in our mind. The following are the few questions that I\we have.
    a) How does the Import and Export of data functionality works in DRM? In this forum, I have found some one saying we can only import the data through flat files, in other words, "text file" with the delimiters [ ] seperated by comma. My question is, Is there any other possible way to import the data, Such as getting the data directly from the database tables? To get the data, Do we need to have any integration points or do we need to use SOAP APIs (& programming)?
    b) While we exporting the data, can we export it directly to the Oracle database tables? What are the integration points needed for this kind of export?
    c) Is there any sample guide or design document available for creating the hierarchy and nodes. I just want to know how the attributes that we have "is transformed" into the hierarchies and nodes in DRM? In the past, I used Essbase, which is integrated with DRM and that process was straight forward since we imported and exported data directly from DRM to Essbase.
    I would appreciate any suggestion offered to me regarding the questions posted above.
    Thanks in advance,
    Leo
    Edited by: user10201910 on Apr 1, 2009 4:58 PM
    Edited by: user10201910 on Apr 1, 2009 5:00 PM

    Hi,
    1.As per my knowledge the Import can be done using Flat files only,we can import the data from Oracle Tables once the structure is ready in DRM.
    2.We have an utility called Export to Table(in the last tab when you performing an Export along with Export to File), which requires the DB mapping to be done properly,
    Thanks!

  • What is the best way to import and export footage from the 5D Mark II?

    Hello,
    I've just finished shooting what I am considering to be my directorial masterpiece.  Shot it on the Canon 5D (1080p, 24fps), and the footage looks amazing.  Now I am ready to start editing and have been using premiere lately, but I have yet to figure out the proper pipeline.  I want to know the best way to retain resolution before I delve into this project.
    My questions:
    1)  What is the best way to start a new project and import the footage without having to render whilst editing, so as to retain all resolution and originality of the source footage?
    2)  What is the best way/ codec/ format to export this same footage once editing is complete so as to retain that crisp 1080p for which the 5D is so recognized?
    3)  What is the best way/ codec/ format to import and export/ render between premiere and after effects?  I am speaking mostly of vfx and color correction.  I also have some 30fps footage that I intend to slow down in AE and then import into premiere.
    I know this is pretty broad, but as a solo filmmaker I really need someone's guidance.  I rarely ever finish my films with the same, crisp look as the footage.  I need pipeline help, and really appreciate it!

    ascreenwriter wrote:
    Hello,
    I've just finished shooting what I am considering to be my directorial masterpiece.  Shot it on the Canon 5D (1080p, 24fps), and the footage looks amazing.  Now I am ready to start editing and have been using premiere lately, but I have yet to figure out the proper pipeline.  I want to know the best way to retain resolution before I delve into this project.
    My questions:
    1)  What is the best way to start a new project and import the footage without having to render whilst editing, so as to retain all resolution and originality of the source footage?
    2)  What is the best way/ codec/ format to export this same footage once editing is complete so as to retain that crisp 1080p for which the 5D is so recognized?
    3)  What is the best way/ codec/ format to import and export/ render between premiere and after effects?  I am speaking mostly of vfx and color correction.  I also have some 30fps footage that I intend to slow down in AE and then import into premiere.
    I know this is pretty broad, but as a solo filmmaker I really need someone's guidance.  I rarely ever finish my films with the same, crisp look as the footage.  I need pipeline help, and really appreciate it!
    1. Follow the advice above. Also use the Media Browser to import the footage in case you have spanned media files. Import files with the Media Browser.
    2. It largely depends on what you wish to ouput to: Blu-ray, web, etc. This FAQ gives the best answer: What are the best export settings?
    3. Use the Replace with Adobe After Effects Composition function.

  • Dynamic Export table of a function Module

    Hi Friends,
    I have a requirement where fields of  Export table of my function Module is dynamic. It is like the Fields to be expoerted by the Function Module would be stored in a seperate Z table
    The Z table would contain the records as follows .
    Table Name              FieldName
    =========     
    MARA                      MATNR
    MARC                      WERKS
    and So on..
    . How can I define my Export table in Function module dynamically so that the structure of my Export Function Module would be same as that of the Fieldnames in Z table..
    Thanks

    Just declare the associate type as "ANY TABLE" in the exporting parameter.
    FUNCTION ZTEST.
    *"*"Local Interface:
    *"  EXPORTING
    *"     REFERENCE(IT_TAB) TYPE  ANY TABLE

  • Import and Export in 4.6b

    Hi All,
    I have a syntax regarding Import and Export statements which are not working in 4.6b. Below is the statement.
    IMPORT ID = (Internal Table) FROM DATA BUFFER ( String Variable ).
    EXPORT ID = (Internal Table) TO DATA BUFFER ( String Variable ).
    What can we have alternate to above statements ?
    Actually I need to transfer or export some internal table content to String and Import the same data from string.
    I am looking perticularly about buffer only. If not that what can we have alternate to that ?
    Thanks,
    Ram

    Hi
    You can try to use Field symbols also, for example
    you need to code in the target program.
    field-symbols <fs_itab> type standard table.
    assign '(PROGRAMNAME)ITAB[]' TO <FS_ITAB>.
    example, i did this in user exit
    assign '(SAPMV50A)XLIPS[]' to <FS_ITAB>.
    if <FS_ITAB> is assigned.
    code will continue
    make sure program name is in capital letters.
    Regards
    Madhan

Maybe you are looking for