Question on Function module

Hi,
I have a set of ECC tables from which I need to extract the data from. Some calculations need to be made on the fly based on some of these fields. and the entire set need to be loaded into BW.
Can any one tell me what is the best way to handle this scenario?
In ECC there is a program which extracts the data from multiple tables and does the calculations. But, this is a non-executable Program and this is executed by a ZTCode.
I thought of writing a function module to execute the Tcode and build an extractor based on the Function module, but the problem is, the ZTcode when executed has input value screen and can accept only one value at a time.
I need to calculate the data for all the records not one at a time.
Any suggestions....

Hi,
Create FM with required fields and then use it in DataSource and extrat then data.
Note: Please keep Month/Fy Period in Selections so we can go for Selection wise extraction.
Thanks
Reddy

Similar Messages

  • QUESTION REGARDING FUNCTION MODULE

    what is the use  ' IT_EVENTS' in the function module 'REUSE_ALV_GRID_DISPLAY'

    Hi,
    Go to SE37 and Give your Fm Name -> Display.
    Go to Function Module Documentation.
    It will help you.
    Thanks.

  • Question about Function Module ME_PO_PRICE_SIMULATION

    Hi experts,
    I am trying to solve an issue concerning the importing parameter I_ROLL_BACK of the function module ME_PO_PRICE_SIMULATION.
    Inside the coding of the user-exit ZXM06U44 (executed after saving a purchase order) there is a call to the function module ME_PO_PRICE_SIMULATION with this importing parameter set to true. In that case, purchase order is not created. Otherwise if I modify this value into false the order is created appropriately.
    Could someone more functional explain me what is the meaning of this parameter. I try to read the documentation but is in German, so I don't understand anything.
    Lots of thanks,
    Javier

    This is what happens inside the FM using I_ROLL_BACK:
    To understand what a rollback statement does, have a look at this:
    https://help.sap.com/abapdocu_70/en/ABAPROLLBACK.htm

  • Question about function Module

    Hi Expert,
             First tell me What is function Module & its working?
    And second is how to call dynamically function module?
    Moderator message : Search for available information, read forum rules before posting.  Thread locked.
    Edited by: Vinod Kumar on Nov 9, 2011 4:57 PM

    This is what happens inside the FM using I_ROLL_BACK:
    To understand what a rollback statement does, have a look at this:
    https://help.sap.com/abapdocu_70/en/ABAPROLLBACK.htm

  • A question about function module

    hi everyone,
    if i want to know the meaning of a function module and how it work,
    for example,function'HRHAP_DOCUMENT_GET_DETAIL'
    i must use it,but i don't know its meaning,
    what should i do ?
    thanks

    but,in program,import and export are reverse.
    for example:
    CALL FUNCTION 'HRHAP_DOCUMENT_GET_DETAIL'
        EXPORTING
          plan_version                  = plan_version
          s_appraisal_id                = ls_appraisal_id
        IMPORTING
        S_DOC_PROCESSING              =
        S_HEADER_TEXTS                =
        T_HEADER_APPRAISER            =
          t_header_appraisee            = lt_header_appraisee
        T_HEADER_PART_APPRAISER       =
        T_HEADER_OTHERS               =
        S_HEADER_STATUS               =
          s_header_dates                = ls_header_dates
        T_HEADER_ADD_DATA             =
        S_HEADER_DISPLAY              =
        T_BUTTONS                     =
          t_body_columns                = lt_body_columns
          t_body_elements               = lt_body_elements
        T_BODY_ELEMENT_BUTTONS        =
        T_BODY_ELEMENT_DESCR          =
          t_body_cells                  = lt_body_cells
        T_BODY_CELL_VAL_VALUES        =
        T_BODY_CELL_VAL_RANGES        =
        T_BODY_CELL_VAL_C_LIKE        =
        T_BODY_CELL_VAL_DESCR         =
          t_body_cell_notes             = lt_body_cell_notes
          s_return                      = s_return
      CHANGING
        MODE                          =
    why?

  • Question with function module / Bapi

    I am trying to test function module/ Bapi:
    BAPI_BILLINGDOC_CREATEMULTIPLE in se37. I gave all the basic parameers required.
    BILLING_DATA_IN-SALESORG
       BILLING_DATA_IN-DISTR_CHAN
       BILLING_DATA_IN-DIVISION
       BILLING_DATA_IN-DOC_TYPE
       BILLING_DATA_IN-ORDBILLTYP
       BILLING_DATA_IN-SOLD_TO
       BILLING_DATA_IN-ITEM_CATEG
       BILLING_DATA_IN-REQ_QTY
      BILLING_DATA_IN-SALES_UNIT
      BILLING_DATA_IN-CURRENCY
    But when I execute, it says 'Company code not defined' in the error messages. I don't see any company code field in the above structure. What am I doing wrong?
    Please give your input.
    Thanks,
    Krishen

    Might be the company code is not defined for the sales organization..
    Thanks,
    Naren

  • Question reg. function module

    I am trying to send email via ABAP using funciton module SO_NEW_DOCUMENT_SEND_API1.
    Now the problem is it looks like it is not possible to send an email with a subject line more than 50 characters in length because the field OBJ_DESCR in the structure DOCUMENT_DATA seems to be only 50 characters!
    What can I do to be able to send an email with a subject more than 50 characters in lenght?
    Please help with this.
    Thank you very much,
    Krishen

    Refer this thread:
    Re: Urgent, how to send a mail from SAP with subject line more than 50 chars
    Regards,
    Ravi

  • Function Modules Used in BW?  (Two Questions)

    I have two function Modules that were used in SAP R3:
    G_SET_GET_ID_FROM_NAME
    G_SET_GET_ALL_VALUES
    G_SET_TREE_IMPORT
    Question 1) Are there cross referenced FMs in BW that we can use in place of these?
    Question 2) Is here a XREF lift of Cross-Functional Function Modules that can be used - or similar- in BW that were used in SAP/R3?
                   Thank-You.

    hi aravind,
    the main Function modules used in smart forms are
    1. SSF_FUNCTION_MODULE_NAME.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'Z_FL004_BANK_DRAFT'
    IMPORTING
    fm_name = fm_name.
    CALL FUNCTION fm_name
    EXPORTING
    rgds
    anver.
    if helped mark points.

  • Question about destination parameter in RFC function module

    Greetings,
    For execution of RFC function module such as MD_STOCK_REQUIREMENTS_LIST_API  on local server, the destination parameter is not required or it can be DESTINATION 'NONE'. I observe that the second option is much slower than the first option. My question is why the second is much slower.
    Thanks,
    Hung

    I've tested it with se37 by leaving RFC target system blank or filling it with 'NONE' , I saw 53000 microseconds versus 45000 microseconds.
    Hung

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • Function module - basic questions

    Hi Experts ,
    I wanted to know some basic concepts of the function module :
    My question is :
    1) What is the "Type ref " in a function module import or export ?
    2) An example of a standard function module where type ref is used.
    3) What is the use of changing tab ? what do we use this tab for ?
    4) An example of a standard function module where a parameter is declared in Changing tab.
    5) what is the use of a Exception tab ? is it any thing similar to exceptions in java ?? can you throw the excetion and write a common code in a catch to handle the exception ?
    Can anyone help me ?
    Regards,
    Ashish Shah

    Hi
    Hi,
    Function Modules;
    Check this matter.
    Function Modules are Glopbal ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
    You can create them from TCode SE37.
    Go through the following doc:
    Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
    Function Module Interfaces
    The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
    Syntax
    ... [IMPORTING parameters]
    [EXPORTING parameters]
    [CHANGING parameters]
    [TABLES table_parameters]
    [{RAISING|EXCEPTIONS} exc1 exc2 ...]
    The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
    Interface parameters
    The interface parameters are defined on the relevant tab pages in the Function Builder.
    IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
    EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
    CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
    TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
    Exceptions
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    Note
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    RFC is a technology which is used to access a functions (Modules) from
    the remote systems.
    If a function module is set as remote enabled which can be access from
    the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
    A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
    But Normal function modules can not accessd from the remote system.
    Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
    Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
    CALLING A FUNCTION MODULE:
    1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
    --> Write the Corresponding FM name --> Hit Enter
    2)The appropriate import ,export Parameters will be displayed in ur editor
    3)Pass the Values Here.
    Also check these links.
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    See the following links:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    Regards,
    Sree

  • Help! Question on calling a function module

    Hi,everybody.
    I have a problem about function module. I created a normal function module which would call itself when user double clicked some screen elements. But when I exit the function called in second time, the value of the global variants in function called in first time changed to the value in function called in second time. It seems that they shared the global variants. So is there any ease approach to recover the data to the original value?
    Thanks for any help!

    Hi Dan,
      you can use field-symbols instead.
    check the following code
    IM_TEST is the importing parameter
    EX_TEST is the exporting parameter
    FUNCTION ZTEST_RECURSION.
    *"*"Local interface:
    *"  IMPORTING
    *"     REFERENCE(IM_TEST) TYPE  C
    *"  EXPORTING
    *"     REFERENCE(EX_TEST) TYPE  C
    field-symbols : <var> type c.
    if im_test = 1.
    assign im_test to <var>.
    *<var> = 4.
    elseif im_test = 3.
    assign im_test to <var>.
    endif.
    if im_test = 1.
    CALL FUNCTION 'ZTEST_RECURSION'
      EXPORTING
        IM_TEST       = '3'
    endif.
    ex_test = <var>.
    ENDFUNCTION.
    i hope this will help you.
    regards,
    Kinshuk Saxena
    PS reward points if you find the post helpful

  • Questions regarding update function module

    Hello experts,
    I am on customer site to help them investigate one issue: they have a background job which runs periodically.
    In the report database table A is changed firstly ( new entries are inserted ), then a update function module is called via keyword CALL FUNCTION ... IN UPDATE TASK.
    Inside the function module database table B is updated. ( existing entries are updated )
    Customer issue:
    sometimes they find A is updated as expected, however B remains unchanged at the same time.
    customer could not find exact steps to reproduce the issue. However the issue does exist there and occur from time to time.
    the issue could only be reproduced in their production system, but works perfectly well in dev & Q system. It is difficult to debug in their production system for trouble shooting.
    After analyzing related code, I have one doubt: according to ABAP help on CALL FUNCTION aaa IN UPDATE TASK, I know the function module aaa is called in a new update work process. I wonder whether there is any possibility there this issue might be caused because the update function module fails to get called at all? ( perhaps due to heavy system load so no free update function module could serve the table B update ? )
    If update function module fails to execute, is there any system utility to record this? That is to say, will it be recorded in such as SM13 or SM21?
    Looking forward to your expertise on this topic!
    Best regards,
    Jerry

    Hello friends,
    Thanks a lot for your interests on this issue. I update all my findings:
    1. issue background: this issue occurs in SAP CRM Channel manageement Solution, software component CRM-CHM-POS.
    2. due to some limitations, the table CMSD_CI_HISTORY and history table are not updated in the same LUW. Instead the first one is updated in normal work process while the other is done in update work process. Since I am not the original developer I didn't know the whole complex scenario ( I did see this is done delibrately in note 1764006 - CMS:Sell In Release creating PB with zero available quantity ).
    So for the moment we have to accept this design.
    3. during our testing ,we ensure COMMIT WORK is always called.
    4. So why sometimes the first table update fails, however there is no hint at all for this failure in the system like ST22 and SM21 ?? ( forget SM13, since it is updated in normal work process ).
    The root cause is the flaw of SAP code below.
    The code has planned to raise exception if insertion failed due to duplicate records to be inserted.
    Unfortunately, the fact is if we use "INSERT db FROM TABLE xxx" to insert records into database and some record already exists with the same key, it will result in a termination but SY-SUBRC is STILL 0; Just compare it with single insertion using "INSERT db FROM <work area>", in the same error situation, processing does not terminate, and SY-SUBRC is set to 4.
    As a result in this case even the insertion fails, line 29 will never be executed as sy-subrc is always 0. Since the insertion fails and the exception is caught without any notification, so customer sufferred because they do not know what has happened.
    Best regards,
    Jerry

  • Process Chain Review Question: function module/ABAP program/Event

    Hi,
    1. Can you tell me a bit more about function modules such as RSPC_CHAIN_ACTIVATE_REMOTE
    2. What are function modules in general terms. i.e.  What is their role?
    3. How do I see all function module available?
    4. When is function module used instead of ABAP program?
    5. How do they help in the support and monitoring of Process Chains?
    6. I am getting confused over the following under process chains “job”, “event”, “function module” and “ABAP Program”
    Thanks

    2. What are function modules in general terms. i.e. What is their role?
    Function module return a value ( most of the time), they return some value either a single value of rane of value or even a table. Example: FM to return fiscal period gieven the fiscal vaeiant and system date.
    3. How do I see all function module available?
    Go to Se37 and this is function builder. You will find FM starting with RS* more useful. You cna also create your own in Se37.
    4. When is function module used instead of ABAP program?
    In addtion to answer I gave in 3 above, program is used to check some logic and update some tables or give screen output.
    You may note FM is also a program.
    5. How do they help in the support and monitoring of Process Chains?
    As I said, for monitoring chains, use Sm37  and logs in RSPC.
    6. I am getting confused over the following under process chains “job”, “event”, “function module” and “ABAP Program”
    I am not clear what are you looking for.
    You cna schedule a FM or a program to run in a chain. Is that what you mean?
    Ravi Thothadri

  • Question about exceptions in function module GUI_DOWNLOAD

    To all,
    I add the function module 'GUI_DOWNLOAD' in the ABAP report program. After the user download the data to excel, the program also displays a report on the screen for print output.
    If the user keep the excel file open and tries to replace the file on download, the program gives an error message 'Access to file denied' and the program ends without displaying a report on the screen.
    Is there any way not to end the program even if download is failed?
    I would like the program displays a report after it gives an error message.
    So I am trying to use exceptions. But if I code to give messages, the programs ends as above. And if I just make exit when it happens, no error message and the program displays a report but the user don't know if the excel file was updated or not.
    Could anybody kindly let me know how to code exceptions and messages if it is possible the program works I hope.
    Thank you very much in advance.
    Best regards,
    Miki Komatsu

     I figured out how to do that.
      Thanks.
      Best regards,
      Miki

Maybe you are looking for

  • Time Capsule Won't Allow Some Programs to Open

    I have a 1TB TC with less than 25GB in one sparse bundle on it. Free space is +/- 930GB. My system is as follows: eMac 1.25Ghz, 500GB internal drive, 2GB memory, OS X 10.4.11, all updates are current. 3TB of storage connected to the eMac via Firewire

  • Error 1430 when adding a new VI to the program

    I have a program I developed in LV 2009 in 2009 and now I am updating it.  I accidently opened it up in 2010 and saved it.  There are Microsoft office tools that were built into LV 2009 that are removed in 2010 that I had used in my program.  So I ha

  • MaxRaiseSize in database adapter

    Experts, I want to read single record on each polling frequency using database adapter as we do using FTP to read single file on each polling frequency by setting the property MaxRaiseSize to 1. But i could make it to work in database adapter . It is

  • Computer reboots when i launch iTunes

    Almost every time i run iTunes (70-80%) my computer imediately reboots, just like presing the reset button. Aparently something causes a Windows Stop Error witch reboots the system to protect it. After the reboot a get a Microsoft Crash Analisys wind

  • Drop Down Menus Don't Drop Down

    I am having a problem with my Spry Menu Bar. (Using CS5). In my template, all of the submenu items of the menu bar show as being there and I can navigate through them. However, when I save the file so I can preview (using F12) it working on my homepa