Guidence regarding creating  a test data and running any function module

hi pals,
   can you plz tell me how to create a test data, commit and run any function module, in details(step wise) ??

Hi yawmark,
I appologise for including a poor code example ealier on, i had to come up with something quick. I will however, visit the sugeted sites you mentioned, thank you.
I did however, create a simple class that compiles and can be used to set, return, reset and print a few details about a person. I hope that is of better use than my previous example. here it is:
public class SimplePerson {
    int age = 0;
    String firstName = "";
    String lastName = "";
    /** Creates a new instance of SimplePerson */
    public SimplePerson() {
    /** Sets the age of this person */
    private void setAge(int takeAge){
        age = takeAge;
    /** Returns the age of this person */
    private int getAge(){
        return age;
    /** Sets the First Name of this person */
    private void setFirstName(String takeName){
        firstName = takeName;
    /** Returns the First Name of this person */
    private String getFirstName(){
        return firstName;
    /** Sets the Last Name of this person */
    private void setLastName(String takeName){
        firstName = takeName;
    /** Returns the Last Name of this person */
    private String getLastName(){
        return firstName;
    /** Resets the details of this person back to back to
     *  the default form.
    private void resetAll(){
        age = 0;
        firstName = "";
        lastName = "";
    /** Prints all the details this person has */
    private void printAll(){
        System.out.println("Age: " +Integer.toString(age)
                + "\n First Name: " + firstName
                + "\n Last Name: " + lastName );
}Cheers mate

Similar Messages

  • How to create a generic data extractor using standard function module

    Hi,
    I have to generate report based on Function module(standard FM),client know only Fm Name n they have given FM Name n asked reports based on that, so can any one give me steps to create DS based on that.
    Thanks,
    Swapna

    check this blog
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    and this pdf:
    Generik extraction: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    Generic delta:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Edited by: Aduri on Dec 17, 2007 4:04 PM

  • Generic data extractor using a function module

    Hi All,
    I want to create a generic data extractor using a function module within the BW system. i.e. the extractor will run in BW and and store the data in a cube( in BW). No R/3 is invloved. I proceeded as follows:
    1. Created a structure through se11.
    2. Created a function module. But while defining "E_T_DATA" in the "Tables" section of the function module, I am getting the error "TABLES parameters are obsolete". I defined as follows:
    E_T_DATA TYPE ZBW_EXTRACT 
    ZBW_EXTRACT is the name of the structure.
    What should i do in this case ?
    Thanks,
    Satya

    Hello Satya,
    The message "TABLES parameters are obsolete" is just a warning and not an error. The structure of the interface is strict (defined by SAP). You should opt to proceed even if you receive the warning.
    Hope this clarifies.

  • Test data for the ABAP Function

    Hello Experts,
    Can you please provide me the valid test data for the function modules?
        /SCA/BIF_WORKINPROCESS_BO
                           and
        /SCA/BIF_WORKORDINF_MS
    Thanks and Regards,
    Kuldeep Verma

    Hi ,
    If u want to use the same data to test your function module then we can use this button. To use this button simply press F8 --> give the test data --> And then save this test in the test directory using the SAVE button.
    --> Next time when retest it then their is no need to give all the other information just press Test Data directory..
    Hope you understand.
    Kuldeep

  • Any Function Module to get date by passing week and year

    Hi,
       Is there any Function Module available to get date by passing week and year. For example, Week 24, Year 2005 and you get the date.
    Regards,
    Mira

    WEEK_GET_FIRST_DAY
    pass 'YYYYWW' (200524) to WEEK parameter it will give you the week start date
    Raja

  • Any function module to get Stock and value of material on a given date?

    Hi Friends
    Is there any function module available to get Stock/and  value of material on a given date?
    Thanks
    Harish

    Sorry I didn't elaborate the requirement.
    I am asked to develop a custom report for inventory management. For range of materials it is required to display stock and value on particular date and GRs GIs for the range.
    I need function module to use in Zreport.
    Thanks
    Harish

  • How to run ABAP Function Module in Background FOR LONG TIME?

    I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE
    RSDRT_INFOCUBE_DATA_COPY.
    I used SE37 and then executed the module, I supplied  the parameters on the form which opped-up and then  program started running. . Program was however interrupted after 10 minutes by ABAP. How can I run  it in background without interruption?
    THANKS A LOT.

    Change parameter rdisp/max_wprun_time.
    Default value for this is 600 seconds (10minutes).Change it to a time which you think you need for copying infocube data.
    May be 5 hours.
    PS:You can not run Function Module in background directly,but you can create a Z* program and call that FM from within that program and then run the program in background.
    Hope this answers your query. Best of Luck!
    Thanks and Regards
    Anindya
    Edited by: Anindya Bose on Jun 30, 2009 1:24 PM

  • How to create Inbound Idocs in a ABAP program? Any function Module?

    Hello Experts,
    My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
    I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
    If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
    I populated T_EDIDD with data records from  IDOC_INBOUND_WRITE_TO_DB.
    To the function module IDOC_INPUT_ORDERS,  T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
    I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
    I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
    Can anybody please provide inputs?
    Regards.

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • How to run the Function module Parallelly at a time.

    Hi all,
    LOOP AT ITAB.
    call function 'Z_SAMPLE'
    ENDLOOP.
    Here if ITAB is having 4 records, Function module Z_SAMPLE will be runned 4 times one by one .
    My requirement is If ITAB is having 4 record ,Function module should be runned 4 times parallely(parallel process) .
    Please tell me how i can do this  Can i run that statement 4 times by removing the loop or
    Can i Create 4 different jobs and run that jobs at a time if yes please tell me how to creat the jobs and run parallelly.
    Please suggest me the solution
    Please do ask  me if question is not clear
    Thanks in Advance
    Ajay

    Is it possible ?
    DATA : f1 TYPE string VALUE '1',
           f2 TYPE string VALUE '2',
           f3 TYPE string VALUE '3',
           f4 TYPE string VALUE '4'.
    DATA : f1o TYPE string ,
           f2o TYPE string ,
           f3o TYPE string,
           f4o TYPE string.
    PERFORM call_fm USING f1 CHANGING f1o.
    PERFORM call_fm USING f2 CHANGING f2o.
    PERFORM call_fm USING f3 CHANGING f3o.
    PERFORM call_fm USING f4 CHANGING f4o.
    WRITE f1o.
    WRITE f2o.
    WRITE f3o.
    WRITE f4o.
    *&      Form  CALL_FM
    *       text
    *      -->P_F1  text
    FORM call_fm  USING f1 CHANGING f1o.
    * FUNCTION Z_TEST_MULTI.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(A) TYPE  STRING OPTIONAL
    *"  EXPORTING
    *"     VALUE(B) TYPE  STRING
    *b = a.
    *ENDFUNCTION.
      CALL FUNCTION 'Z_TEST_MULTI'
        EXPORTING
          a = f1
        IMPORTING
          b = f1o.
    ENDFORM.                    " CALL_FM

  • Data Services XI3.1 function module files for SAP R/3 is not working

    Hi guys,
    Thank you for the quick response so far. I am very grateful to you all. 
    I got an issue and will try to explain as detail as I could and 
    hope ur guys won't mind. :P
    I pass the functions module to SAP tech guy to install to SAP using CTS 
    method, and using 900086.R63 file type because my chinese client is 
    running SAP on unicode environment.
    My DS installed on my laptop client; job server plus db2 is on HP 
    unix. SAP is on another HP Unix server. The function module I used is 
    supplied from Data Services XI3.1.
    Anyway, the installation is successfully done with GUI wizard windows of 
    SAP Workbench instead of tp command line method.
    1)However, I checked the ZAW0 function group, I opened and can't see any functions
    listed under it, although the table structures ZACTA, ZTAB2048 and other items
    were created.
    2)So I tried to create SAP Datastore, Transport Target, etc and tried to 
    extract file. It failed and log said "can't open file --- 
    /db2/temp/curcode.txt". I checked and SAP working directory /db2/temp didn't have 
    curcode.txt, because the result file supposed to be extracted and stored there. 
    The SAP tech guy checked SAP and cant find generated ABAP program of 
    ZCURCD is running anyway, although my local CURCD ABAP program is 
    created.
    3)Is it the 900086.R63 not complete? Is my function installation correct? I could view data
    on datastore, but just cant run job to extract. Another non-unidcode 900200.S08 group
    has larger file sizes. Should I try to install also this 900200.S08 files? Will it corrupt SAP
    and cause system errors?
    4)After that, I had tried to install the functions manually into ZAW0 
    one by one using cut and paste, however after that, I cant view the data view anymore with 
    error. Besides, I tried to run Check on the functions and they all returned 
    syntax errors, so I cant Activate any of them with SAP. Maybe dependency is missing??
    Then, I deleted the manually installed functions and can view data again, but just cant extract 
    data by job.
    5)Another side issue is all these SAP datastore creation and viewing is  
    through DI 11.5 old installation. The new Data Services X3.1 unable to 
    create datastore with database error, although the function module 
    installed is came from Data Services. Does anyone know the issue?
    Thank you very much to read it patiently. :P

    Hi,
    Thank you for the informative link. It did help a lot in solving the problem.
    (1) to (4) --- The Sap tech guy didnt install the function programs correctly, and he redo the transport again using CTS. Now I can see all the functions inside the function group ZAW0. While for the problem of cannot generate extracted file to SAP working directory for downloading, it is due to unix directory access permission setting. And also have to include the ftp username into SAPSYS user group as the help link suggested.
    (5) For this problem, I reinstalled again the DS with all required components like Server Manager. The network technical guy helped me with the first installation, and the installation was not complete. So now the issue is solved, I can create R/3 Datastore with DS.

  • Is there any function module to convert the date format

    Dear ABAPers,
    Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
           I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
    Thanks & Regards,
    Ashok.

    hi,
    create custom function module or copy the below code in the report ..and use it
    the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
    FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(DATE) LIKE  SY-DATUM
    *"       EXPORTING
    *"             VALUE(FORMATTED_DATE)
    *"       EXCEPTIONS
    *"              INVALID_DATE
    TABLES: TTDTG.
    DATA: BEGIN OF T_DATE,
            YYYY(4) TYPE C,
            MM(2) TYPE C,
            DD(2) TYPE C,
          END OF T_DATE.
    DATA: DAY(3) TYPE N.
    DATA: VARNAME LIKE TTDTG-VARNAME.
    IF DATE IS INITIAL.
      CLEAR FORMATTED_DATE.
      EXIT.
    ENDIF.
    check document date format
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        DATE = DATE
      EXCEPTIONS
        PLAUSIBILITY_CHECK_FAILED = 1.
    IF SY-SUBRC NE 0.
      RAISE INVALID_DATE.
    ENDIF.
    MOVE DATE TO T_DATE.
    CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
    SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
    WRITE T_DATE-DD TO DAY.
    CONCATENATE DAY ',' INTO DAY.
    CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
      SEPARATED BY SPACE.
    ENDFUNCTION.
    the output is :--Convert a DATE field into a full format date eg. March 23, 2000
    Regards,
    Prabhudas

  • Custome BAPI - declare ITAB and define the Function Module and Subroutine

    Hello Experts
    I want to create a Custom BAPI and it has the following scenario:
    1) a Function Module which collects some records into it internal table, say ITAB
    2) a Subroutine which moved the records from ITAB to BAPI table
    Now, I want to declare ITAB and define the Function Module and Subroutine.
    Where and How can I do this?
    Plz suggest.
    Regards
    BD

    Hi,
      1) Got to SE37 and create an RFC .
      2) Declare the ITAB directly in the TABLES tab of the FM.
      3) Inside the FM source Code tab, collect all the data using SELECT query and directly or by using logic, put the data into the
          ITAB.
      4) Since the data collected is directly put into the itab you dont need a subroutine to be written.
      5) If subroutine is a necessity, then just write PERFORM SUB ROUTINE NAME.
           AND DEFINE THE FORM ENDFORM OF THE SUBROUTINE AFTER THE ENDFUNCTION OF THE FM
       Let me know if any issues....
    Regards,
    Vimal.

  • How to create Billing Plan in sales order using Function module /BAPI

    hi,
    How to create Billing Plan in sales order using Function module /BAPI
    i hv check few FM such
    BILLING_SCHEDULE_READ
    BILLING_SCHEDULE_GET_NUMBER
    BILLING_SCHEDULE_SAVE
    But unable to create billing plan for a sales order.....any other method to create???

    Hi,
    Use this link.
    Create sales order with billing plan via LSMW and BAPI BUS2032
    BAPI or Function to update Billing Plan in Sales Order Items
    Hope this will help you.
    Regards,
    Vijay

  • Calling and executing a function module in the Portal iview development

    Hello Portal development gurus...
        I am very new to portal iview development and am learning a lot of stuff.. I now have a requirement to do the following:
      1. I need to use the NWDS to create java code in developing an iview
      2. I need to call and execute a function module and display the parameters pulled in from the function module onto a Jsp.
    3. I need to create an iview based on this deployed component.
    Could anybody please explain me how to do the coding on this front?
    I appreciate if anybody can share documentation about this kind of a development.
    As always, points galore for useful and helpful suggestions.
    Regards,
    ~~~LB

    Hi,
    Firstly Have you searched in SDN for the same, anyhow please go through the link to work on the requirement
    [/docs/DOC-8061#15|/docs/DOC-8061#15]
    Go through the thread which will talk in detail
    [https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955|https://forums.sdn.sap.com/click.jspa?searchID=19551584&messageID=6348955]
    Hope this helps.
    Cheers-
    Pramod

  • How to run ABAP Function Module in Background Wchich Takes Long Time to Run

    How to run ABAP Function Module in Background FOR LONG TIME
    I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE
    RSDRT_INFOCUBE_DATA_COPY.
    I used SE37 and then executed the module, I supplied  the parameters on the form which opped-up and then  program started running. . Program was however interrupted after 10 minutes by ABAP. How can I run  it in background without interruption?
    THANKS A LOT.

    Hi,
    You can call this FM in a program and run that program in background.
    Regards,
    Raju

Maybe you are looking for