Testing of Function Module

Hi,
     I want to test the BAPI Function mudule for PO.how to test it in SE37.
please tell me the Step by Step procedure like how to give values and how to know the errors etc.
Regards,
Shobha Henry

hi,
It similar to like testing any function module. after execution you have to check the RETURN parameter to see how the bapi was executed.
you might want to call commit bapi in order to see if bapi really does the changes that you want ot do... In such case you to call commit bapi after your bapi call in se37 itself..
To do so
1. Go to trasanction SE37
2. Menu path:  Function Module --> Test --> Test Sequence..
3. On the popup menu enter the sequence of func mode want to execute in series...
4. For example, for one of my test I executed bapis in these order.
            BAPI_PS_INITIALIZATION
            BAPI_BUS2054_CREATE_MULTI
            BAPI_PS_PRECOMMIT
            BAPI_TRANSACTION_COMMIT
Hope this helps you.
Enjoy SAP.
Pankaj Singh.

Similar Messages

  • Testing custom function modules

    Hi Friends ....
      As I am new to ABAP testing , I need help in knowing how to test custom function modules .
    Below is how I am trying :
      Step : 1 -- >  Open Tcode SE37
      Step : 2 -->  Display the function module
       Step : 3 --> Do its syntax check.....activate it..... execute it
       What if no test data is available???
    I am trying to execute directly where it gives a return parameter for some function modules saying No Entry \ No data available for this ID etc.,
    I am in a confusion whether its correct or not
    I want some ideas regarding this
                                 - Swapna

    >
    Swapna Vadlamani wrote:
    > Hi Anupama...
    >
    >   Thank u a ton for the quick reply...but I have another doubt..if I execute without giving any selection parameter data...it says
    >
    >   No data stored for in the selected period
    >
    >                                 -Swapna
    Ok, so that is what it does if you don't pass it any selection parameter data - I doubt very much if that is how it will be used in Production.  Any function module is just a bit of code that does what it has been programmed to do; to test it you just need to find out what it is supposed to do from whoever has asked for it to be built and then check that it does it.  If there is no test data set up, then you'll need to find out from your functional consultant how to set some up or get them to set it up for you.

  • Testing of function module using secatt ,st30 st03n

    Hi Gurus ,
    i  am new  to  sap testing  , kindly let me know  the complete process of  testing a function module using ecatt ,st30 and st03n s
    kindly provide me with  links for the same.
    thanks in advance ,

    try this link for some information regarding eCatt tetsing using ST30.
    Using ST30 to run ECATT
    thanks
    Venkat

  • How to test a function module?

    how to test a function module?

    hi there,
    ur query is quite old and i think some1 may hav answers it but still i feel this might help you if ur query is still  unanswered.
    its a total description of  how to create a fuction module and executre the same
    its a simple example and might help you to understand  what and how the things are happening.
    see this might be of some help.
    to create function module you have to create a a function group.
    and then you create function module.
    in function module you have to give IMPORT , EXPORT PARAMETER and EXCEPTION.
    and also the SOURCE CODE without which the function module will be sytaxtically correct but you will get processing error.
    here is the procedure of creating Function Group and Function Module
    FOR Group
    goto SE37
    move to GOTO and the to function groups and create .
    just fill the fields poped up.
    FOR Module
    now in the se37 screen put the name of the function module you want to create and press create .
    there will be a pop asking for function group name now here put you function group name which you have created.
    now after pressing save you will have a screen in which you have to enter the import, export,exception and the source code.
    in import parameter you can put this(for example)
    parameter type associate type
    num1 type i
    num2 type i
    export parameter
    parameter type associate type
    res type i
    exception
    parameter type associate type
    not a valid entry.
    source code
    res = num1+num2.
    if num1 eq 0
    raise not a valid entry.
    end if
    save activate .
    and exicute(press8)
    award pionts only if helpful
    anuj

  • Can't use F4 when try to test Z_INPUT_CUSTOMER function module

    Hi!
    I'm buy book "ABAP Objects" 2nd edition 2007 and try to make all exampless my self. All my examples have prefix Y (in program already used prefix Z by book authors). When i'm make reservation car example i have trouble to test my example with function module.
    Can't use F4 when try to test Y_INPUT_CUSTOMER function module.
    And i try to find error in Z_INPUT_CUSTOMERS. Bethween my program and builtint example i found 1 diffirence: built in example have object SREEN 1100 in tree OBJECT NAVIGATOR. When i try to make new srceen happents error (already exist). Because in module declared screen 1100.
    How can i fix error?
    Best Regards.
    [email protected]

    Hi!
    Thank every one. I have found my mistake. I forgot to make search help for id in table customers.
    Best regards.

  • Testing Function Module before using in DataSource?

    Hi Experts,
    After writing a Function module for Transaction DataSouce (by copying RSAX_BIW_GET_DATA_SIMPLE), is there any way to test the Function Module before using in Transaction DataSource? (to see how many records it retrieves).
    Also can somebody please throw some light in understanding the source code of RSAX_BIW_GET_DATA_SIMPLE function module, as it has many declarations like E_T_DATA,
    I_T_SELECT which will be used in the new function module?
    Looks like, the function module RSAX_BIW_GET_DATA_SIMPLE uses only one table SPFLI.
    If it is just one table why do we need to write function module to extract data?
    Forgive me for my lack of ABAP knowledge.
    Thank you,
    Lakshmi

    The generic function moduel is used when there is no BW extractor and you cannot get to the data via a view or table
    The extractor is quite simple
    You create a extract strcuture of data to send to BW
    Then you create the function module - e_t_data takes on the extract structure
    The select options read data via the infopackage selection from BW (and thus when you create your datasource you shoudl click the fields to be select option)
    So in the ABAP
    You read the select option and put them into a range
    You select from which ever tables you need to in R3 and put into an itab
    You then loop aroudn the itab and manipulate the data or read other tables
    The data finally ends up in e_t_data
    The whole thing gets looped around based on the size of the data package - ie if it is 10000 records then the fetch next cursor after 10000 records will send the package of e_t_data out to the refc scheduler and down the line to BW - then the fetch next cursor will get the next 10000 records for the next
    I use this all the tiem (so sorry for the brain dump)
    I especially use it for virtual cubes - ie to get real time data from R3 from within BW - the data is not requested by ipak but by the query at runtime against a Virtual cube which connects to this generic extractor
    Note: this generic extractor can also live on the BW side - ie you can use it instead of APD to snapshot cube or DSO data to send as an ipak into another cube

  • Testing function module

    Hello all,
            iam testing the function module convert_to_local_currency and i gave import parameters but iam not able to see export parameters but iam geeting enter rate 40/21.25 rate type m for 04.04.2008 in system testings?Please help me regarding this.
    Thanks & Regards
       Priya

    Hi Priya,
    Did you read the Function module Documentation thoroughly. Apart from giving the Local currency, local amount, foreign currency and foreign amount, you should also pass the Rate ( Rate is nothing but the Exchange rate)
    Also regarding the type of rate, by default it is 'M' means Average rate. try to pass the value depend on the rate of the currency.
    Type of rate M=Average rate G=Bank buying rate B=bank sellin rate.
    Return ->
    Type of rate M=Average rate G=Bank buying rate B=bank sellin
    By default always pass Average rate.
    data lv_netwr type ekpo-netwr.
    CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
      EXPORTING
       CLIENT                  = SY-MANDT
        DATE                    = sy-datum
        FOREIGN_CURRENCY        = 'SAR'
        LOCAL_AMOUNT            = 1000
        LOCAL_CURRENCY          = 'INR'
       RATE                    = 11
       TYPE_OF_RATE            = 'M'
       READ_TCURR              = 'X'
    IMPORTING
      EXCHANGE_RATE           =
       FOREIGN_AMOUNT          = lv_netwr
      FOREIGN_FACTOR          =
      LOCAL_FACTOR            =
      EXCHANGE_RATEX          =
      DERIVED_RATE_TYPE       =
      FIXED_RATE              =
    EXCEPTIONS
      NO_RATE_FOUND           = 1
      OVERFLOW                = 2
      NO_FACTORS_FOUND        = 3
      NO_SPREAD_FOUND         = 4
      DERIVED_2_TIMES         = 5
      OTHERS                  = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Test Data for Function module

    Hi all , I want to define test data for the function module . Can any one help how or where to define it.
    - Neo

    Hi Neo,
    Are u talking abt testing a functional module separately without implementing in a program.
    If this is the case, then do the following:
    1.go to se37
    2.write name of functional module and press F8.
    3.there would be a screen which would give you place to write in values for the input parameters including internal table rows.
    4.fill in and press F8.
    If I have gt u wrong ,then pls clarify.
    Rgds,
    Shweta

  • Is it possible to call a adobe form inside a function module?

    Hi gurus,
    i am trying to generate the pdf data source inside a custom function module,
    the function module will call the FUNCTION 'FP_JOB_OPEN' , then call the function module of the pdf interface. then get the pdf data back and return.
    but at run time i got the error message:
    FPRUNX101, the job already started.
    then the program stopped.
    i checked the service market place, there is a note for that:858325 Message "Job already started" when you display PDF forms .
    according to the notes,it seems that it's only possible to call the pdf generated function module in a program.
    my question is , is there a way to call that in a funciton module?
    best regards.
    Jun
    the note states that:
    Reason and Prerequisites
    At runtime, a PDF-based form is called using a generated function module. If you use the new interface, it is necessary to set the function modules FP_JOB_OPEN and FP_JOB_CLOSE as control structures with one or several generated function modules. In order for the single test from Transaction SFP to work simultaneously, however, the system checks for the test environment of Transaction SE37 (in which the test ultimately runs) in the single test. In this case, the function modules FP_JOB_OPEN or FP_JOB_CLOSE are called automatically.
    If you then test a function module that calls a PDF based form and therefore calls the function module FP_JOB_OPEN itself, this leads to the error message mentioned above.
    Solution
    The test should be carried out using a program that in turn calls the function module to be tested.

    sorry, i found out the reason.
    the fm can not test direct in se37, it should be wrapped by a program.
    br.
    zj

  • Error "Job already started" when calling a adobe form in Z function module

    Hi All,
    I have a error when calling a adobe form in a custom function module.
    I am using FP_FUNCTION_MODULE_NAME to get the adobe form function module and then i am using FP_JOB_OPEN function module to control the printing parameters such as no print preview or no dialog ..etc.. I dont have any exceptions during the call of FP_JOB_OPEN function module ..
    Later I am calling my function module which was generated for the adobe form and i am getting the error called " JOB ALREADY STARTED".
    I tried executing the same function module in se37 and the PDF form output was generated, and also by commenting FP_JOB_OPEN function module the PDF form output was generated.
    But i need the FP_JOB_OPEN function module to control the output based on the output type which triggers the form output such as the medium from nast record which says print or email or fax.. etc
    Please let me know how to handling this error.

    Just as a followup note. If you are testing a function module from SE37 and the test button you will get a value in SY-CPROG. You must override this value for everything to work.
    If you override the value of SY-CPROG with the main program that will be calling the function module you have no problem.
    John W.

  • Error in BAPI_INCOMINGINVOICE_CREATE Function Module ?

    Hi,
        I got error while testing BAPI_INCOMINGINVOICE_CREATE Function Module as
           "  Enter a reference to a valid goods receipt (line 000001) " for Creating Invoice liike as MIRO.
    Please Tell me how to solve & how to ( MIRO ) Create Invoice for Purchase Order .

    Hello Ramana,
    I encountered this same error.   Your PO GR-Bsd IV (ekpo-webre = 'X') is checked.  You have to add the following fields when you populate your ItemData Table;
          MOVE: rseg-lfbnr  TO i_item-ref_doc,
                      rseg-lfgja  TO i_item-ref_doc_year,
                      rseg-lfpos  TO i_item-ref_doc_it.
    Hope this helps.  Good Luck!
    Dodie

  • Returning Exeptions of a function module in webServices

    Hi,
    I defined a webService for a rfc with the following parameters:
    FUNCTION J_3S_F_RJEDSN.
    ""Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(ABAP) TYPE  J_3SREPORT
    *"     VALUE(VARNAME) TYPE  STRING DEFAULT '?'
    *"  EXPORTING
    *"     VALUE(DSN) TYPE  J_3SDSN
    *"     VALUE(GENERAT) TYPE  J_3SANZ
    *"     VALUE(CPAGE) TYPE  J_3SRJECP
    *"     VALUE(CPOLD) TYPE  CPCODEPAGE
    *"     VALUE(CPNEW) TYPE  CPCODEPAGE
    *"     VALUE(DESTIN) TYPE  TEXT40
    *"     VALUE(CMD) TYPE  TEXT50
    *"     VALUE(FILEFORMAT) TYPE  J_3S_FILEFORMAT
    *"     VALUE(TARGET_SYS) TYPE  SYSYSID
    *"     VALUE(JOBNAME) TYPE  J_3SSYMNAM
    *"  EXCEPTIONS
    *"      NOT_FOUND
    *"      NO_FILE
    *"      NO_GAPS_ALLOWED
    *"      PHYSICALLY_LOCKED
    I tested the webService using transaction wsadmin.
    In case of failure I do not get the declared exception.
    If I test the function module using transaction se37 the exception is returned.

    Hi Saurabh,
    Can you explain your scenario in detail with tcode and function module and all.
    Regards,
    kamalapriya

  • Regarding bapi function module

    Hi to all,
    Tell  me <b>how to test this function module</b>
    <b>BAPI_CAR_PRVD_NUMBER_RANGE</b>
    if possible please <b>provide any example based on this FM</b> .
    thanks and regards,
    surya.

    hi vishnu,
    actually i don't now anything about this fm bcz of that reason only i am asking how to test this fm,what type of input required to test this fm
    if u know please provide solution asap.
    thanks and regards,
    surya

  • Regarding the function module --error is coming.

    Hi All
    I am executing function module and i am getting one error after actvating that FM.
    Error is - REPORT/PROGRAM statement missing, or program type is I (INCLUDE).          
    Waiting for the fovarable reply.

    Hi,
    While creating a FM you will be assigned to a Function Group, that Function Group is not active. If function group is not active then only you will be getting this error.
    To over come this issue. Please do the below process.
    Go to Se80--> Select Function Group from the drop down list --> Select the function group --> Right click on the Function group --> Select activate.
    After above process is completed.
    Test the Function Module.
    Thanks,
    Sriram Ponna.

  • Case sensitive in Function Module

    Hi experts,
    we created  the custom table  and maintaining the data.we saved the data with key as case sensitive which we selected at domain level .we created custom function module in that we have written SELECT statement with where clause .when we are testing the function module in SE37 ,if i enter lower case value in the exporting parameters and  after executing the F.M the input values are changing into upper case. so i am getting wrong data.please help me.

    Hi Vinod,
    I have given interface import parameter reference Z-data element which is already used in the Z-table.For example In the FM
    iv_name type zz_name.
    zz_name is a data element and ZZ_NAME1 is domain name and where i selected the check box as lower case and upper case.
    Please any one help me.

Maybe you are looking for