Passing Range to Function

Hi all
I would thank and reward with points to a correct answer.
I have one range with many lines. Example of one line:
  mob-sign = 'I'.
  mob-option = 'EQ'.
  mob-low = '50010031'.
  append mob.
Then I have to pass this range to a Function module to use in it. This means I will check some values if it's in this range. For example:
  IF xpto IN mob.
  ENDIF.
How do I pass the range? Through tables? Parameter?
And do I define in FM?
Message was edited by:
        André Jordã

Hi,
We have standard Structures
/SDF/RANGES                    Ranges for data selection
/SDF/RANGESC1                  Ranges for data selection CHAR 1
/SDF/RANGESC10                 Ranges for data selection CHAR 10
/SDF/RANGESC14                 Ranges for data selection CHAR 14
/SDF/RANGESC4                  Ranges for data selection CHAR 4
/SDF/RANGESC5                  Ranges for data selection CHAR 5
/SDF/RANGESD15                 Ranges for data selection DEC 15
/SDF/RANGESD18                 Ranges for data selection DEC 18
/SDF/RANGESI1                  Ranges for data selection INT 1
/SDF/RANGESI2                  Ranges for data selection INT 2
/SDF/RANGESI4                  Ranges for data selection INT 4
You can make use of these and create the parameter in the TABLES, so that we can get more than 1 data at a time
Regards
Sudheer

Similar Messages

  • Export RANGES to function module

    Can anyone tell, how to pass RANGES to function module.
    i have report program in ,
    DATA : BEGIN OF ITAB OCCURS 0,
               MATNR LIKE MARA-MATNR,
              END OF ITAB.
    SELECT-OPTIONS  : S_MATNR FOR MARA-MATNR.
    I want all the values in S_MATNR in ITAB.
    Note that S_MATNR has any value( Include, Exclude,Between, Equal etc.)

    Hi,
    Define a type in the global data declaration of the function module as follows :
    TYPES : BEGIN OF t_range_matnr,
            sign(1) TYPE c,
            option(2) TYPE c,
            low TYPE mara-matnr,
            high TYPE mara-matnr,
    END OF t_range_werk.
    " Define a table type
    types matnr_tab type t_range_matnr occurs 0.
    Once done, define the importing parameter of t_matnr in the function modules signature, lets call it matnr
    In your program where you would call the function, lets say you have the select option as follows
    SELECT-OPTIONS matnr FOR ekpo-matnr.
    " In the call function simply pass matnr[]
    call function 'select_mara'
    exporting
       matnr = matnr[].
    Done.
    P.S. Do not forget the square brackets.
    regards,
    Advait
    Edited by: Advait Gode on Apr 16, 2009 10:05 AM

  • Ranges in function module

    HI All,
      how can we use ranges in function module.
    please send sample code for this.
    regards,
    amit.

    Hi,
    If you have range, you can convert the contents of ranges into internal table.
    And then Pass the internal table to FM.
    Thanks,
    Sriram Ponna.

  • Can I pass a table function parameter like this?

    This works. Notice I am passing the required table function parameter using the declared variable.
    DECLARE @Date DATE = '2014-02-21'
    SELECT
    h.*, i.SomeColumn
    FROM SomeTable h
    LEFT OUTER JOIN SomeTableFunction(@Date) I ON i.ID = h.ID
    WHERE h.SomeDate = @Date
    But I guess you can't do this?... because I'm getting an error saying h.SomeDate cannot be bound. Notice in this one, I am attempting to pass in the table function parameter from the SomeTable it is joined to by ID.
    DECLARE @Date DATE = '2014-02-21'
    SELECT
    h.*, i.SomeColumn
    FROM SomeTable h
    LEFT OUTER JOIN SomeTableFunction(h.SomeDate) I ON i.ID = h.ID
    WHERE h.SomeDate = @Date

    Hi
    NO you cant pass a table function parameter like this?
    As When you declare @date assign value to it and pass as a parameter it will return table which you can use for join as you did it in first code 
    But when you pass date from some other table for generating table from your funtion it doesnt have date as it is not available there
    Ref :
    http://www.codeproject.com/Articles/167399/Using-Table-Valued-Functions-in-SQL-Server
    http://technet.microsoft.com/en-us/library/aa214485(v=sql.80).aspx
    http://msdn.microsoft.com/en-us/library/ms186755.aspx
    https://www.simple-talk.com/sql/t-sql-programming/sql-server-functions-the-basics/
    http://www.sqlteam.com/article/intro-to-user-defined-functions-updated
    Mark
    as answer if you find it useful
    Shridhar J Joshi Thanks a lot

  • Passing values to function module

    Hello Everybody!
         I have defined a function group ZSUB_FGROUP1 and within that, I have defined a function module ZSUB_FMOD1. I wish to pass one set of values of following types:
    VBELN, POSNR, MATNR, ARKTX, KWMENG, VRKME, NETWR   from VBAP
    and  WAERK from VBAK.
    from my main report ZSUB_REP1 to ZSUB_FMOD1, which will then print those values in the form of a list. When I processed the list from within the main report, I used regular methods like top-of-page and all. But, I am not sure how to handle things from within the function module. Please help!

    Hi...
    When u create the function module , we generally provide the import and export parameters....
    <b>Import parameters :</b> Which we pass to the function module ..
    <b>Export parameters:</b> Which we receive from the function module...
    <b>Tables parameters:</b> Tables to pass and to receive to and from the function module...
    <b>Changing Parameters:</b> Which we pass to the function module and change these values in the function module and receive those from function module...
    So define the fields
    VBELN, POSNR, MATNR, ARKTX, KWMENG, VRKME, NETWR ,WAERK in the import parameters with LIKE declaration and corresponding type..
    <b><u>Field  ||  Type  || Associated Type || Optional || Default ||</u></b>
    vbeln  || like  ||  vbak-vbeln ||
    <b>Optional : </b>If u check this then this field is not mandatory to receive the value..
    If uncheck then we have to pass value to this field from the program !! otherwise it gives an error.
    In the <b><u>source code</u></b> tab u can write the list output related code with these imported and exported parameters !!
    To call the function module we use<b> PATTERN </b>which is present on the application tool bar of the SE38-Editor screen..
    Click on this .. u will get a popup ..IN this check the <b>CALL FUNCTION</b> and in the input field of this,, give the function module name... and press enter ...Here u can give values for these imported fields...
    reward if it helps u...
    sai ramesh

  • Problem in passing customer Partner Functions from ECC to CRM

    Hi to all, I am facing the following error in the crm system
    1.Partner 0000080059(DCEAB7AC31DA22F1B7CE001372368B21): the following errors occurred
    Message no. BUPA_MW_EXCHANGE010
    2.Status exists already for this business partner
    Message no. CRM_BUPA_FRG0050012
    3.Validation error occurred: Module CRM_BUPA_MAIN_VAL, BDoc type BUPA_MAIN.
    Message no. SMW3018
    My scenario in ECC is: I use a custom BTE copy of VMD_VENDOR_BTE_1421_IMPL which is executed when I save a new vendor. In this BTE I use the FM SD_CUSTOMER_MAINTAIN_ALL to create a customer with the same attributes as the vendor, because only customer informations (not vendor informations) pass as Business Partners in CRM. The problem is that when I pass only master datas to the FM SD_CUSTOMER_MAINTAIN_ALL, the customer passes to CRM as a Business Partner with the same number, but when I pass also Partner Functions to FM SD_CUSTOMER_MAINTAIN_ALL, no Business Partner is created in CRM, and the error I get is that up.
    What can I do?
    Thank you very much,
    Antonio

    Hola Antonio,
    I have a same problem.
    You can tell me the solution.
    Please.

  • PLease guide me to use vendor sub range with functionality

    Dear All,
    PLease guide me to use vendor sub range with functionality
    thx

    Hi,
    The basic concept of Vendor Sub Range is to use different Purchasing Data as well as Partner Functions for a particular range of products supplied by individual your vendor.
    In SPRO you can activate  Vendor Sub-range in following path
    SPRO->Logistic General->Business Partner->Vendors->Control->Define Account Group & Field Selection
    In this screen Select your Vendor account group and double click, sys will take to new screen and here you select check box of Vendor sub-range relevant in data retention level-poaching tab and save.
    Now create following master data:
    Let’s say you’re purchasing two pumps from your Vendor (V), HDPE and SS manufactured by different company (HDPE and SS ) & they have different purchasing data like payment terms, delivery term etc…
    1. Create two materials HDPE and SS
    2. Create Vendor (V)
    3. Create Info record (ME11) M1 & M2 with vendor (V) and here in each material maintain vendor sub range
    4. Now create PO (ME21), all related data you will get in PO w.r.t. material and save.
    Regards,
    Biju K

  • I am passing range table from the method of ODATA Service to FM but In FM range table is becoming initial.What would be the reason for the same?

    I am passing range table from the method of ODATA Service to FM but In FM range table is becoming initial.What would be the reason for the same?

    Vinod, Can you share detail on how are you sending and how are you reading.

  • What are minimum passing parameters for function module CS_BOM_EXPL_MAT_V2

    Hi
    Im going to use FM: CS_BOM_EXPL_MAT_V2 and I want to only pass WERKS, but when I execute FM is gives exception as CALL_INVALID.
    I saw all the Import parameters are Optional, but I think I need to pass more inputs to FM.
    Please let me know what are MINIMUM input parameters required to run this FM
    Thanks

    Hi
    In my requirement, there are range of WERKS and MATNR which has to be given from selection screen, where as In CS_BOM_EXPL_MAT_V2 function module I can only give single value for WERKS and MATNR.
    Can any one guide me how can I implement this?

  • How to import a range in Function module?

    I am using a Function module in which material is getting imported.
    In the import tab we have
    Parameter Name    Typing     Associated Type       optional          pass value
    IM_MATERIAL       TYPE       MATNR                 <checked>         <checked>
    So when the Function module is execute we can enter only one value into the IM_MATERIAL.
    But now it has to be enhanced for entering multiple values. How to import the material as a range?
    Please throw light.
    Thanks.

    Hi
    If you are using a select-options you can use this approach.
    TABLES: MARA.
    DATA: RANGE TYPE WRF_MATNR_RANG_TTY.
    SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.
    START-OF-SELECTION.
      RANGE[] = SO_MATNR[].
    CALL FUNCTION 'ZTEST'
    EXPORTING
       I_RANGE       = RANGE.
    Where I_RANGE is defined using this table type WRF_MATNR_RANG_TTY
    Parameter Name    Typing     Associated Type     optional          pass value
    I_RANGE       TYPE       WRF_MATNR_RANG_TTY      <checked>     <checked>

  • Date range in function module

    Hi guys,
                 i have a selection screen where i need to give range of date.
    say from 01.01.1998 to 01.02.2007.
    i need to pass this date range to 'Z' funtion module how can i do it.
    do i need to define it in tables declaration. if yes what will be the reference type of this field.
    I want this range of dates in function module.
    Please explain.

    Hi ahmed
           Let us assume s_date is the select option for the date range defined like  
           DATA: s_date for p0001-begda.
           Now while calling the FM pass the s_date-low and s_date-high as 2 parameters for the FM.In the FM create 2 parameters begda and endda of type begda. Use the low value and high value in the FM to populate the range table and u can use this range table for further processing of the dates in the FM.The range table can be forwarded as follows:
    r_date-low = begda.
    r_date-high = endda.
    also provide the sign and options for the ranges table.

  • Can arguments be corrupted on passing in to function?

    Hello,
    I'm seeing something that's got me stumped. Maybe you folks can advise.
    What appears to be a valid arguments are getting corrupted when passed to a different function.
    Here is my set up:
    - LibA.a
    - LibB.a
    - SampleApp
    - MyApp
    The bad function call is going from LibA in to LibB.
    LibA, LibB and SampleApp have all been pre-complied (thankfully in debug mode) by an older version of Sun Studio on Solaris x86/64. SampleApp uses both LibA and LibB and runs just fine on my system.
    MyApp uses both LibA and LibB in a manner similar to SampleApp. Yet, MyApp crashes due to this pointer corruption.
    When single stepping the code, I see the pointer in the caller being valid and being passed as a parameter. In the callee, the value of the passed-in parameter pointer in simply wrong.
    Note: The caller is in the pre-compiled LibA.a and the callee is in the pre-compiled LibB.a I'm never even touching that code to recompile it. Further, the code itself must be correct since SampleApp uses those functions, and runs fine.
    Thus, I'm thinking that my error is in the linking stage, but I'm not sure what it could be.
    Any ideas?
    Thank you,
    David
    Edited by: 878694 on Aug 11, 2011 3:52 PM

    It's impossible to say what is wrong without a fairly complete example, preferably one that could be compiled and run to see the problem. Some generic guesses:
    1. Compiler bug. The code should be recompiled with a new compiler where the bug has been fixed. Impossible to say what sort of bug that might be without a test case.
    2. As in my original comment, the two libraries see inconsistent declarations. For example, after one library was built, a declaration in a common header was changed and the other library, or some binary in it, was built using the different declaration. This kind of error is common when makefiles do not express all the needed dependencies. The fix is to delete all binaries and recompile everything (to be sure no change is missed).
    2a. A related error is when common declarations are repeated in .cc files instead of being placed only in header files and included where needed. What are supposed to be identical declarations get out of sync. The fix is to reorganize the source code to eliminate copies of declarations, delete all binaries and recompile everything (to be sure no change is missed).
    3. You are not seeing what you think you are seeing. For example, if the address of a derived class is passed to a pointer-to-base-class, the address might need to be adjusted. In this case, the difference in values is correct, and something else is causing whatever incorrect program behavior you see.

  • How to pass parameters into Function module : CLOI_PUT_SIGN_IN_FRONT

    Hello friends,
    I am displaying values ie, amounts in the screen using write statements here i have to display the
    sign left side , i am using  Function module   'CLOI_PUT_SIGN_IN_FRONT'    
    Does anybody help me - How to pass paramter into this Function module.
    Regards,
    Phaneendra

    If you look to the code of the function module, you can see it is condensing the value.
    I would make a copy of this function, and remove the condense lines to give the result you want.
      data: text1(1) type c.
      search value for '-'.
      if sy-subrc = 0 and sy-fdpos <> 0.
        split value at '-' into value text1.
        condense value.
        concatenate '-' value into value.
      else.
        condense value.
      endif.

  • Passing report filter function in Open Doc URL

    Hi All,
    I have a requirement that the values entered in the input control on one report the same values should be passed to another report.For this I created a document linking from the first report to the second and passed ReportFilter([name of the object]) for that prompt on which I have applied input control.When we navigate from one report to another via the hyperlink we get a error saying that internet explorer have modified this page to help prevent cross site scripting.We realized that this is due to the ReportFilter function passed by us in the Open Doc linking because when we do not pass ReportFilter() function the link works properly.Any other method to capture the values entered in the Input control.
    I hope I have made myself clear.
    Thanks in advance.

    Hi,
    Yes both the reports are based on the same universe.I tried storing the values of the input control to a variable.But that too is giving me that cross site scripting error.I cannot add a second tab to the existing report and want it through OPEN DOC URL itself.
    Please help.

  • Passing parameter to Function in select clause BIP 11g

    Hi,
    I am developing a dataset where i ahave to pass Parameter to a function which retrives the cursor in BIP 11g
    below is the SQL:
    select cizcompfn(:P_USER_ID) COMPANY_INFO,
    cizinstfn(:P_REPORT_CD, :P_USER_ID) CURRENCY_INFO,
    sysdate AS PRINT_DATE_TIME_INFO,
    cizlballfn(:P_REPORT_CD, :P_USER_ID) LABEL_INFO,
    cipacsvpfn(:P_USER_ID, to_char(:P_FROM_DT,'yyyy-MM-dd') ,
    to_char(:P_TO_DT, 'yyyy-MM-dd')) RETURN_CODE_INFO, rpt_option_val SERVER
    FROM ci_rpt_option where rpt_opt_flg = 'RPSV'
    I have created the 4 parameters :P_USER_ID, :P_REPORT_CD , :P_FROM_DT and :P_TO_DT
    I am not getting the result generated.
    If develop the dataset in BIP 10g, this working fine.
    Please, let me know what needs to changed so that it works in BIP11g.
    Regards,
    Hemanth

    I am getting the result like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- Generated by Oracle BI Publisher 11.1.1.5.0
    -->
    - <DATA_DS>
    <P_TO_DT>2010-01-01T00:00:00.000-05:00</P_TO_DT>
    <P_FROM_DT>2000-01-01T00:00:00.000-05:00</P_FROM_DT>
    <P_REPORT_CD>CI_ACSVPR</P_REPORT_CD>
    <P_USER_ID>CDX</P_USER_ID>
    - <G_1>
    <PRINT_DATE_TIME_INFO>2012-05-11T07:22:57.000-04:00</PRINT_DATE_TIME_INFO>
    <SERVER>http://server-name:port-number</SERVER>
    </G_1>
    </DATA_DS>
    Value for two columns:
    sysdate AS PRINT_DATE_TIME_INFO
    rpt_option_val SERVER
    which are straight forward columns.
    When i pass hardcoded values instaed of parameters I get the XML:
    Below is the SQL:
    select cizcompfn('CDX') COMPANY_INFO, cizinstfn('CI_ACSVPR', 'CDX') CURRENCY_INFO, sysdate AS PRINT_DATE_TIME_INFO,
    cizlballfn('CI_ACSVPR', 'CDX') LABEL_INFO,
    cipacsvpfn('cdx', to_char('05-may-1900') ,to_char( '05-may-2012')) RETURN_CODE_INFO,
    rpt_option_val SERVER from ci_rpt_option where rpt_opt_flg = 'RPSV'
    Edited by: 931007 on May 11, 2012 7:29 AM

Maybe you are looking for

  • How can i print a JTree ?

    Hi, I am trying to print a JTree in a TreeTable. I only get the header and footer info but not the tree content. But when used a tablemodel as my data model, it is printing the table with data. Can anyone please help me in getting the table printed a

  • How To Create A Technical And Business Systems For Web AS ABAP ???

    Hi Experts, How To Create A Technical And Business Systems For Web AS ABAP ??? Please Let me Know All the Step-By-Step Process to Create ???? Points Will be Given Regards Khanna

  • Logic Won't Let Me 'Drop' .Wav Files Into A Session??

    Hi all, Trying to simply drag and drop .wav files from a folder on an external hard drive into an empty Logic Pro 9 session.  The audio tracks are stereo (have also tried mono) and the input/outputs seem to be fine.  The session is also saved to the

  • Character encode problem

    how can i encode turkish character ���� .in j2me. � can connect my xm l file via IIS server by using inputStream class. but when � use readUTF() method in DataInputStream class to read file ,null pointer execption occur but not read method in Data�np

  • New user need some help.

    I am a brand new user, have a video by someone else, how do open the file to edit?  I would like to explode the video to make additions and deletions?