Ranges as export parameter in function modules

hi guys
i have to design a function module in such a way that i have to pass a ranges table.
watt structure or type should i use?
thanks
sameer

Define your range in the datadictionary and then use this type for the changing or exporting parameters.
In SE11 define a structure of table type.  From the edit menu choose define as ranges table.  After this you may input the field for the high\low data element.  input the name and create the structure:
Example range table for VKBUR.
create ZRT_VKBUR as structure (table)
Input  VKBUR as data element for high/low and input zrl_vkbur in structure row type.  Save and then click on the create button for ZRL_VKBUR which will create a standard range table line definition.

Similar Messages

  • Fetch data from table(ET_) which is exporting parameter of function module

    Hi,
    I m new to ABAP programming.
    I have to develop a smartform that has to be filled in with fields from few tables.
    These tables have the naming convention ET_<XXX> (i.e. exporting parameter of function module).
    I m not able to directly view its contents in se11 or use select query for it.
    I have a report program which i can execute to view these parameter names.
    Now, how do i fetch data from these parameters/tables and pass it from my driver program to smartform??
    Someone pls guide me...
    Thank You.

    Hi,
    I have done that using Field-Symbols.
    Thanks,
    Preetha

  • 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

  • Passing parameter in function module

    hi friends,
    I have created one function module in which i need to pass PO/SO number from standard EKKO/VBAK tables through the select option parameter S_POSONO. Inside the function module I have a select query which fetches the records from a Z-table which has a field called 'REFERENCE' which is 16-char long. Hence the length mismatches with PO/SO no which is 10-char long. the first 10-char from 'REFERENCE' is PO/SO number, next 3-char is line-item num, and the last three char is schedule item num. It is required to match only first 10-char with the parameter passed i.e, S_POSONO and display only those datas.
    The function module is as follows.....
    Function :
    CALL FUNCTION 'YFIIN_RETRIEVE_SOURCE_DATA'
    EXPORTING
       LT_RANGE_BUKRS          = S_BUKRS[]
       LT_RANGE_DOCNO          = S_POSONO[]
       LT_RANGE_DOCDATE        = S_DATUM[]
       LT_RANGE_CURRENCY       = S_FCURR[]
      TABLES
        IT_TEMEXPOSU            = LT_TEMEXPOSU
    EXCEPTIONS
       INVALID_SELECTION       = 1
       OTHERS                  = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Source code inside function module:
      SELECT * FROM ZFIGL_TEMEXPOSU INTO  TABLE IT_TEMEXPOSU
                                     WHERE   COMPANY_CODE IN LT_RANGE_BUKRS
                                     AND  currency in LT_RANGE_CURRENCY
                                     and  REFERENCE in LT_RANGE_DOCNO
                                     and  doc_date in LT_RANGE_docdate.
    IF SY-SUBRC = 0.
    SELECT COMPANY_CODE ATTRIBUTE_01 REFERENCE CREATION_DATE FOREIGN_CURR                                                               
               FROM TEMT_RAWEXPOS APPENDING CORRESPONDING FIELDS OF
                   TABLE IT_TEMEXPOSU WHERE COMPANY_CODE IN  LT_RANGE_BUKRS
                                     AND REFERENCE in LT_RANGE_DOCNO
                                     AND CREATION_DATE IN  LT_RANGE_DOCDATE
                                     AND FOREIGN_CURR IN LT_RANGE_CURRENCY.
       ENDIF.
    Import Parameter of Function Modules :
    LT_RANGE_BUKRS   - type - BUKRS
    LT_RANGE_DOCNO  - type - EBELN
    LT_RANGE_DOCDATE - type - DOKDATS
    LT_RANGE_CURRENCY - type - WAERS
    please help me to solve this problem..

    Hi Ram Tej,
    Try this.
    First Read all the records without Checking REFERENCE field with LT_RANGE_DOCNO into an internal Tbale.
    Then looping at that internal table delete records from the same internal table where REFERENCE(10) <> LT_RANGE_DOCNO.
    Hope this may help ur requirement.
    Award points if useful.

  • Checkbox as import parameter in function module

    Hi all,
    how to create a checkbox as import parameter in function module,
    thnx in advance

    ?? Function modules don't have screens...they do have import, export parameters.
    If you look at how "checkboxes" are stored in db tables, you'll see that the previous replies are precisely correct.  A check box is a char1 field...it is on when 'X' (ABAP_TRUE) and off when blank (initial)....you would call your FM with an import field of type char1 set to 'X' or set to space, and handle accordingly in your FM code.
    If you have a checkbox on a selection screen, then the value of that parameter is either 'X' or space, depending upon whether or not the user checked the box.

  • Add parameter in Function Module

    hi all,
    I'm trying to add a parameter to function module HRGPBS_HER_GET_SURNAME_NINO.
    However, the system is telling me to carry out modification comparison first.
    Can someone guide me on using SPAU or SE95, as I don't understand what to enter in the selection area?
    thanks

    If you go to transaction code: SPAU, you can find the item (program, function module, screen, etc) in question, open the tree to the lower levels. On the lower item, you can choose to save your changes or revert back to original.
    The developers should be able to tell what has been changed. In most cases, we wanted to keep our changes with the exception of when a change was made and later a note was released to produce the same result or if new functionality is released related to the item in question.
    Hope this helps.

  • Passing Select-options as parameter to function module

    I need to pass a select-option as a parameter to a function module. Is this possible?
    There is an option of passing all the values of the select-option to an internal table, passing that internal table as parameter to the function module, and then adding it manually again to a select-option in the function module.
    But is there any direct way to do this?

    Hi,
    I have a similar problem: I have RFC function module to which I want to pass select options. Therefore I defined table parameters as follows:
    IT_RUNID     TYPE     EFG_TAB_RANGES
    IT_PERNR      TYPE     EFG_TAB_RANGES
    IT_REINR     TYPE     EFG_TAB_RANGES
    I can successfully pass my values to the module, but if I try to check these parameters
    using
    CHECK IT_TRIPS-RUNID IN IT_RUNID.
        CHECK IT_TRIPS-PERNR IN IT_PERNR.
        CHECK IT_TRIPS-REINR IN IT_REINR.
    the check always fails, I guess because there are leading zeros in the ranges. Is there a way to solve this problem?
    Thanks and regards,
    Martin

  • Import parameter in Function Module for user exit

    Hi Experts,
    I need to send IDOC when PO release, for that i found an Exit M06E0004. It is having
    FUNCTION EXIT_SAPLEBND_002.
    ""Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(I_CEKKO) LIKE  CEKKO STRUCTURE  CEKKO  " EKKO table
    *"     VALUE(IT_BEKPO) TYPE  MMPUR_BEKPO OPTIONAL  " EKPO table
    *"     VALUE(IT_BEKET) TYPE  MMPUR_BEKET OPTIONAL    " EKEt table
    *"     VALUE(IT_EKKNU) TYPE  MMPUR_EKKNU OPTIONAL  
    *"  EXPORTING
    *"     VALUE(E_CEKKO) LIKE  CEKKO STRUCTURE  CEKKO
      INCLUDE ZXM06U22.
    ENDFUNCTION.
    All of the fields i have to take in IDOC segment r from EKKO and EKPO table, but 1 field is from MDSB table (MDSB-MATNR), how can i take it in the code i have to write. can i take TABLE: MDSB in the include, or any other way. because its standard FM we cant take it in IMPORT.
    Regards,
    Nik

    Hello Nik
    You can use a similar approach as described in thread:
    Get Parameter from Standard Transaction to BADi
    You need to find out in which main program MDSB is defined. Then you can try to access this field dynamically from within your exit.
    Alternatively, you have to search for a function module which can retrieve this (runtime) information (MDSB-MATNR).
    Regards
      Uwe

  • 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

  • Passing selection table as parameter to function modules

    i tried to pass a selection table as a parameter to a function module but there is a problem stating the eror the table length is different.
    *& Report  ZSFSELECT_OPTIONS_PGM
    REPORT  zsfselect_options_pgm.
    TABLES zselect_options.
    SELECT-OPTIONS sop FOR zselect_options-id.
    DATA  : fname(15) TYPE c.
    *CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
       formname                 = fname
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
      FM_NAME                  =
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    DATA lth(2) TYPE c.
    DATA ty TYPE i.
    DATA o TYPE i.
    DATA l TYPE i.
    DATA k TYPE c.
    DESCRIBE FIELD sop-sign TYPE lth LENGTH ty IN CHARACTER MODE.
    CALL FUNCTION fname
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        sf_sop                     =sop
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    in the smart form i have tried to pass the sp as the table.
    i have created a program line node
    :SELECT * FROM zselect_options INTO TABLE it_tab WHERE id IN sf_sop.

    Hi,
    If i understand ur problem correctly u r trying to pass a select-option to Tables for a smartform function module. It gives an error & it correct.
    If u understand the structure of a select option, it will have 4 fields in it & the structure will be
    SIGN                   CHAR1
    OPTION               CHAR2
    LOW                   Type Zfield
    HIGH                   Type Zfield
    But ur receiving Table paramter of the smnartform FM will be having only 1 field - Type Zfield
    So this mismatch gives u an error.
    Solution:
    Case1:
    Write code outsied th FM in ur program to get all the values & build an internal table & pass that to the FM.
    Case2:
    Define the Structure of table in the smartforms as tols earlier & then try passsig the Select option.
    Thanks & Regards,
    Bhargava

  • Pass internal tables in Export  Parameters of  Function Module

    Hi
    How to pass internal tables through export parametes of the calling function module. i
    think i can pass it by reference ....
    if so can anyone suggest how to do it?

    Hi,
    You can Export values of an Internal table in two ways, by :
    1) specifying in Tables tab
    (Not recommended since it's an obsolete in ECC 6.0)
    If used, will reduce the performance of the FM
    Tables are always passed by reference
    2) specifying in Exports tab.
    The parameter should be a Table type (created in se11)
    having a Line type that refers to the structure of the data.
    Pass by Value is not used for Normal Function modules.
    Used usually for RFC enabled FMs.
    Cheers,
    Remi

  • Populating the output parameter in function module.

    Hi Experts,
       I have written a function module,with material number,BEZEI as input and mvgr2 as output from table tvm2t.I am facing a problem in populating the material number as well in outputtable.The material number in input is nothing to do with output.
    please help me at the earliest.
    Regards,
    Sridevi.

    Hmmm, you wrote that the output is 'table parameter' but you mention 2 single fields. If you expect a good reply here, it helps to mention how you defined the table and how you select the data for the output. For example: input is matnr and you select the material group of this matnr. Output is all other matnr of this material group. Then we would know what you want to do here.
    So please describe what you need and give us the table description.
    Regards
    Nicola

  • (internal) Tables obsolete as parameter in function modules,

    Hi
    As you probably can see by the question, my ABAP Knowledge isn't exactly overwhelming !
    <i>anyway:</i>
    I'm trying to create a function module in NW2004s, This functionmodule should take an internal table, based on a structure as (import) parameter.
    In the earlier version, I've done this by defining it under the TAB 'Tables' in the function builder - But know its telling me that "<i>Tables Parameters are obsolete</i>", and that I should define it under "Changing" instead.
    I have tried that, but I'm only allowed to pass a single line, and if I try to do a Loop, in the function module, it tells me that ity isn't created as an internal table.
    So please - what is the "best practice" here ?
    Regards
    Morten Nielsen

    Hi All,
    I followed Steps 1 and 2 but when I use the following select statement I get a dump with the error enclosed.
    Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
    Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
    Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
    Step 4. When I use the following select clause I am getting a dump.
    DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
      SELECT *
      FROM dfkkcohi
      INTO  CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
      WHERE cotyp EQ zcotyp
      AND gpart EQ zgpart
      AND corr_status EQ zcorr_status.
      LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
    *Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
    *Append ZDFKKCOHIOUT.
    *Clear IT_ZDFKKCOHI.
      ENDLOOP.
    What could be wrong?
    Thanks for all your help in advance.
    Regards,
    Divya

  • How to give a value range in export parameter (global class)

    hi all,
    I have created a class-method called get_po_date. In this i had export parameter as qmfe-qmnum. If i give qmfe-qmnum in import parameter in class, i am able to give only one value at one time, but i need a range of values at a time. Instead of qmfe-qmnum in associated type, i have given 'LXHME_RANGE_C12' ( a range table for char 12 ). the thing is i wanted to select this range in select-options. but still iam getting <b>not type compatible syntax error</b>. can any body solve my problem,
    feel free to ask if any confusion with my question.
    Best Regards,
    abhilash.

    Hello Abhilash
    Instead of using a specific range (where field LOW and HIGH are of type QMNUM) you can use a <b>generic </b>select option (of type <b>RSDSSELOPT</b>). Have a look at the following sample report <b>ZUS_SDN_SELOPTIONS</b>.
    *& Report  ZUS_SDN_SELOPTIONS
    REPORT  zus_sdn_seloptions.
    TABLES: qmfe.
    DATA:
      gt_data          TYPE STANDARD TABLE OF qmfe,
      gt_data_x        TYPE STANDARD TABLE OF qmfe,
      gt_selopt        TYPE rseloption,  " generic table type for selopts
      gs_selopt        TYPE rsdsselopt.
    START-OF-SELECTION.
      SELECT        * FROM  qmfe INTO TABLE gt_data
             WHERE ( qmnum BETWEEN '000000000001' AND '000000000500' ).
      gs_selopt-sign   = 'I'.
      gs_selopt-option = 'BT'.
      gs_selopt-low    = '000000000001'.
      gs_selopt-high   = '000000000500'.
      APPEND gs_selopt TO gt_selopt.
      SELECT * FROM qmfe INTO TABLE gt_data_x
        WHERE ( qmnum IN gt_selopt ).
      IF ( gt_data = gt_data_x ).
        WRITE: 'Selected data are equal.'.
      ELSE.
        WRITE: 'Selected data are NOT equal.'.
      ENDIF.
    END-OF-SELECTION.
    Since RSDSSELOPT and RSELOPTION are global DDIC objects they can be used in <i>public </i>methods.
    Regards
      Uwe

  • (internal) Tables obsolete as parameter in function modules in ECC 6.0

    Hi All,
    I followed Steps 1 and 2 in the thread  but when I use the following select statement I get a dump with the error enclosed.
    Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
    Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
    Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
    Step 4. When I use the following select clause I am getting a dump.
    DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
    SELECT *
    FROM dfkkcohi
    INTO CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
    WHERE cotyp EQ zcotyp
    AND gpart EQ zgpart
    AND corr_status EQ zcorr_status.
    LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
    *Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
    *Append ZDFKKCOHIOUT.
    *Clear IT_ZDFKKCOHI.
    ENDLOOP.
    Error: Das laufende ABAP-Programm wollte eine Open SQL-Anweisung ausführen,
    bei der die Treffermenge mit 'INTO CORRESPONDING FIELDS' in
    namensgleiche Felder der Zielbereichs gestellt werden soll. Hierbei
    müssen die namensgleichen Felder des Zielbereichs einen flachen Typ
    haben, oder vom Typ STRING oder XSTRING sein.
    Im vorliegenden Fall enthält der Zielbereich " " aber ein
    namensgleiches Feld "MANDT " mit dem verbotenen internen Typ "l".
    What could be wrong?
    Thanks for all your help in advance.
    Regards,
    Divya

    Translating the error message -;)
    The running ABAP-program wanted to carry out an opus SQL-direction, with which the hit quantity with 'INTO
    CORRESPONDING FIELDS' is supposed to be placed into name same fields the goal area.  Herewith the name same
    fields of the goal area must have be a flat type, or of the type STRING or XSTRING. 
    In the existing case, the goal area "" contains however a name same field "MANDT" with the forbidden internal type "l".
    You should check you structures and assign the correct TYPE to the fields -:)
    Greetings,
    Blag.

Maybe you are looking for

  • How to transfer single device from one iTunes account to new iTunes account on another computer?

    I have been successfully using a single iTunes account to sync & back-up two different iPhones. One of those iPhones belongs to a now ex-boyfriend (no longer living with me), and naturally he would like to transfer the back-up data for his device to

  • SCCM 2012 monitoring - Site Status - Reporting Services Point - Status Critical

    Hi all, I have noticed that the Site Status under Monitoring shows Reporting services point as in Critical state though we do not see anything wrong with SCCM as such (at least we haven't been reported any problems thus far). There is nothing in the

  • Acrobat Pro 9 e-sign and SharePoint 2010 integration

    Hello, I cannot get an Acrobat Pro 9 created document with electronic signature fields to open in SharePoint 2010 so it can be checked out, signed, saved and checked back in. I have seen discussions on this subject from 2011, but have not come across

  • High load on iPS GW on a Netra t1

    Hi all, we have a Portal Server SP3 distributed among 3, webserver + portal server + gateway. The thing is that everything works fine (fast and responsive) but on the GW the load is always very high, always above 7 ( reported by the uptime command).

  • Can't connect by wired connection

    I just moved into a new house, and ordered a fios connection through Surewest. I bought a LinkSys E3000 Wireless-N Router, and my iMac is connecting fine to the internet wirelessly...however I'm not getting anything when it's wired to the router. In