How to Create a Function module z_create and to track the error records?

I want to create a function module z_create which will insert the data from the internal tables gt_model_master and gt_model  into the corresponding database custom tables y_model_master.
Secondly if any error is encountered during the above updation, then how to track those error records ?

HI,
check the sy-subrc ,if it is zero the insertion is success,otherwise use 
message class.
if sy-subrc ne 0.
message e052(zmessage).
endif.
Edited by: rakesh dhudipala on Feb 12, 2008 2:33 PM
Edited by: rakesh dhudipala on Feb 12, 2008 2:33 PM

Similar Messages

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • How can create a function module for currency and quantity fields

    hi,
    i want to create a function module with some fields.when i activated it give some errors for 
    netpr,menge,wemng  fields(currency, quantity fields).error is it asks for reference fields. 
    please send me solution for it.
    sreenu.

    Hi Sreenu,
    While creating CURRENCY/QUANTITY fields in the DataBase Table, you have to enter a REFERENCE TABLE and a REFERENCE FIELD to the field.
    For that, after entering the field name and the data type in the correcponding columns, you have to place the cursor on the data type of the required field and click the CURRENCY/QUANTITY FIELDS tab. You will find two columns called REFERENCE TABLE and a REFERENCE FIELD.
    you have to enter a reference table in which a currency/quantity field is used and a reference field which is a currency/quantity field in that table.
    For Example, below is the table details.
    FIELD DATATYPE LENGTH DEC.PLACES REF.TABLE REF.FIELD
    1.SNO     CHAR 5
    2.AMOUNT  CURR 10     2          T001      WAERS
    3.NOS     QUAN 5                 KNA1      /VSO/R_PAL_UL
    Here Field 2(AMOUNT) is a CURR field whose Ref. Table is T001 and Ref. Field is WAERS and Field 3(NOS) is a QUAN field whose Ref. Table is KNA1 and Ref. Field is /VSO/R_PAL_UL.
    Hope this will help you.
    Regards,
    Vaitheeswaran

  • I'm very new tp SAP ABAP, how to create a function module..V.URGENT

    hi folks,
    I'm very new to sap abap.
    I want to create a function module.
    the following is my requirement.
    by passing(eporting parameters to funtion module from pgm point of view) a field, i want to get(importing parameters from the funtion module, from pgm point of view) some 7 fields(of various tables).
    please also tell me how can code an inner join for tables 5 tables(a,b,c,d,e). i'm joining a on b, b on c, c on d,the problem here is that i can not join d on e as there are no common fields in d and e.
    can i join e and c or b, there are no common fields even in a and e.
    please tell me the solution as soon as possible, this very important and urgent deliverable.
    thanks in advance

    Here is link for creating function modules
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm">Creating Function Modules</a>
    Regds
    Manohar

  • How to create ENQUEUE function module for s567 table

    Hi Experts,
    Anyone Plz tell the steps how to create a ENQUEUE function module for the table s567.
    Its somewht urgent, plz help me.
    <REMOVED BY MODERATOR>
    Mohana
    Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:21 PM

    Hi,
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    Hope this will give a basic idea.
    Regards
    Sudheer

  • HOW to create a function module ..... in abap

    pls lemme know ............the steps and procedure in creating a function module

    hi GURU,
    To Create Function Module first you need to create Function Group and Activate it.
    First go to SE37 then
    1. Goto>Function Groups>Create Group.
        Here you need to give Group name and Short Text of group.
    2. After Creating Function Group again:
       Goto>Function Groups>Change Group.
       Enter your Function Group name and press enter.
       a dialog box will appear where you can see its status is inactive.
    So, press <b>Main Program</b> Button and activate your function group.
    NOW you Function Group is activated and and you can create Function Module in it.
    Now Enter your Function Module Name and press create then
    give your Function Group name in respective place and press enter.
    Now you can give your Import/Export parameters and and if you want to use TABLES give it in TABLE section only not in Import/Export Parameters.
    Then Write Logic in Source Code Tab and Activate it.
    if you have any qury regarding it Pls let me know.
    Reward if Useful.
    Sachin.

  • How to create a Function Module

    Hi
    Please tell me the procedure to create a function module.
    Thanks in advance,
    Priya

    Hi Srinivas,
    In order to create a function module firstly you need to assign it to a function group.
    In order to create function group goto t-code se37.
    Choose Goto->Function groups-> Create group .
    Give the function group name.
    Then come back to se37 type in the name of your FM and then press <b>CREATE</b> button.

  • How two create UPDATE FUNCTION MODULE

    Hi,
    I have 2 tables to update one after the other...
    I have geard it is advisable to use update function module for this..
    can any1 tell me how to create and work with update function modules...
    Answers will be rewarded....

    Abhay,
    How an update function module works is, the execution of the FM is delayed to until when a COMMIT WORK statement is executed.
    Hence if you have the data available for updating the two DB tables at the time of calling the FM, you can pass the tables to the same FM and program the DB update for both in the same FM.
    However the COMMIT WORK should be outside the FM further down in the calling program.
    This link is very good and easy to follow
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
    Hope it helps
    Aditya[url=http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm]
    Message was edited by:
            Aditya

  • How to create constrained or unconstrained Kerberos and know whether the back end is constrained or unconstrained Kerberos?

    Hello Community
        I am considering Kerberos Authenication but there seems to be
    2 kinds of Kerberos: constrained and unconstrained.
        Since when creating Kerberos you are only offered things like "Negotiate\Kerberos"
    Or "Negotiate" or "Setspn" the question is how do you create a constrained
    or unconstrained Kerberos and since the back end has to match how do you
    do you know whether the back end uses constrained or unconstrained Kerberos?
        Thank you
        Shabeaut

    Kerb is used for one of several scenarios:
    - connecting SP to SQL databases, which provides assurances around the connection between the SP service accounts and the SQL service accounts
    - connecting SP to external systems (such as SQL databases, which may be used by BCS, Excel, PerformancePoint, PowerPivot, etc).
    Constrained Delegation is not necessary for SP to use Kerb when connecting to SQL. it IS necessary for SP to talk to external systems (since Constrained Delegation is also known as "Kerberos with protocol transition", since it's
    transitioning a Claims based auth token to a kerberos based auth token).
    The difference is a setting in AD's Delegation tab, for the service account that will be collecting the users' login (presumably the webapp), and for the service account that will be performing the double-hop (presumably the service apps)... in addition
    to the kerb setting, you also need to specify EXACTLY which endpoints can be reached using the Kerb + CD... unconstrained delegation (the default) allows the Kerb token to be passed anywhere... constrained delegation only allows the Kerb token to be used
    by the places you specify (in the delegation tab)... such as the SQL server that the PerformancePoint scorecards will be querying.
    Links:
    - Microsoft's Kerberos guide : http://www.microsoft.com/en-us/download/details.aspx?id=23176
    - more links : http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Troubleshooting_Kerberos_and_External_Data_from_Excel_Services
    - some health analyzers to find problems and recommend solutions : http://sdssharepointlibrary.codeplex.com/releases/view/92022
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • I need to create RFC function module which creates the IDOC

    Hi-
    Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
    Thanks,
    Sony

    My Problem is
    Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
    I have used message type FIDCC1 but this message type is usefull only for Posting documents.
    1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
    2. I have to read entries from those tables and should create IDOC...
    3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
    4. Now I need to write one RFC function module and that FM should create the IDOC's....
    Can anyone please help me out?
    Thanks,
    Sony

  • Creating a function module

    please help me to
    create a function module as follows-
    i) Have the following import parameters
            empnm TYPE zb19rv2_table-empnm ,
            empdj  TYPE  zb19rv2_table-empdj ,
            empad TYPE  zb19rv2_table-empad ,
            empph TYPE  zb19rv2_table-empph ,
            depid   TYPE  zb19rv2_table-depid.
    ii) Have the following export parameter
            empid TYPE zb19rv2_table-empid ,
    iii) Have the following exceptions
            Raise exception if the Name field is blank
    iv)       Source code-
            Check if the import parameter has name given, if not raise exception, else
            Select the latest empid from table zb19rv2_table
            Increment this id by one
            Use the import parameters and the new generated empid to insert record in to the table zb19rv2_table
            If the record is inserted, then move the new generated empid to the export parameter of the function module

    Hi Ravinder ,,
    check this link for step by step procedure to create function module ,
    http://abaplovers.blogspot.com/2008/02/creating-function-module-in-sap-abap.html
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    Reward if useful,,
    Thanks &  regards ,
    Sreekar.Kadiri.

  • Howt 2 delta with the extractor created on Function Module..

    hi there,
    can anybody tell me how to update delta with the extractor created on Function Module..
    rgds,
    amol

    refer to the document at the below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3219af2-0c01-0010-71ac-dbb4356cf4bf
    Generic Extractor using FM with Delta Logic
    hope it helps,
    rgs,
    Parth.
    Edited by: Partho Mukherjee on Jan 12, 2009 6:00 PM

  • Function modules Exit and Init

    Hi Friends,
    What is the purpose of function modules init and exit in the "Exit" functions.
    why two function modules are using in the Exit functions?
    Please give me relevant secanarios?
    will assign the points.
    Thanks
    BPS

    <b>FM Initialization</b>:
    A function module to initialize the planning function. This function module is optional. It is only required if new transaction data records are to be generated in the planning function that are different, in terms of the combinations of values, to characteristics in the previous transaction data that are not to be changed. The keys for these new transaction data records are delivered by the function module in the table ETO_CHAS. The keys are supplemented by the keys of the transaction data that already exist. The data objects for which the planning function is called up are formed from these keys. They also influence how often and with which combinations of transaction data the second function module is called up.
    <b>Function Module:</b>
    A function module that is called up several times and that changes transaction data records. This function module receives a package of transaction data records in each case. These differ only in their characteristics to be changed. They have the same values as far as all other characteristics are concerned. The transaction data is in table XTH_DATA. Only the existing records are transferred. If key combinations were returned by the initialization function module, and no transaction data exists for these, then table XTH_DATA is empty. The key combination is in the table ITO_CHASEL.
    Its not necessary to write a init FM unless you need to generate new records by the exit function.
    regards,
    sanjay.

  • How to create a gui pf status and guititle in module pool programming?

    hi frnds,
    how to create a gui pf status and gui title in module pool programming?
    my problem is i created a screen and wen execute the screen by a tcode.am nt able to activate SAVE BACK EXIT CANCEL COMMANDS?.how to do this can any one explain in detail procedure?
    plz gve step by step process.

    Hi,
    For Title:In PBO...just write
    SET TITLEBAR 'ZTITLE'.
    double click on 'ZTITLE'....give whatever title u want...save it...activate...and check...reward points if useful...
    PF means FUNCTION CODE
    ex; set pf-status 'zrstatus'.
    double click on the zrstatus expand the application server ,
    at the time of execution the default menu(ie system,help),application toolbar buttons like enter,help etc and function keys(by default there will be no function keys)as are there on the normal
    will appear on the screen.
    Details:
    PF-STATUS is used to set the GUI Status of a screen, ie you can control the options on your menu bar, application toolbar, the function keys assigned to various options etc.
    Implementing the status for a screen can be done in 2 ways:
    1) Create the GUI status using the object list of the program or by using the transaction SE41. Then, assign it to the screen using SET PF-STATUS statement.
    2) Create the GUI status by means of forward navigation, ie, use the SET PF-STATUS 'XXX' statement where 'XXX' is the name of the GUI status and double click on it to create it.
    Status names can have a maximum of 20 characters.
    After assigning a GUI status to a screen, this is inherited to all subsequent screens. In order to have a different status for each of the subsequent screens, you have to set a separate status for each screen.
    In transaction SE41,
    1) Give the program name and the status name and click on the Create button.
    2) Go to 'Function keys' and expand.
    3) On top of the save icon type SAVE, on top of the back icon type BACK, on top the the exit icon type EXIT etc ie on top of all the icons that you want to use, type the respective names that you want to give.
    Whatever you have typed now becomes the function codes of these icons and can be used in your program.
    For example you have a screen 100.
    In the 'Element list' tab of the screen, give "ok_code" as the name where "OK" is the type of screen element. Activate screen.
    The flow logic for the screen looks like this:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    Create the modules STATUS_0100 and USER_COMMAND_0100 in the main program by simply double clicking on them.
    The code for these modules can be something like this:
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'Example'. "Example is the name of the GUI status
    ENDMODULE.
    MODULE user_command_0100 INPUT.
    CASE ok_code.
    WHEN 'SAVE'.
    "call a subroutine to save the data or give statements to save data.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.
    Regards,
    Shiva Kumar (Reward If helpful)

  • How to keep multiple function modules under one Web service

    Hi Experts,
    I have Three RFC function modules and i need to create one web service for these three RFC function modules. I know How to crearte a web service for one function module.
    please suggest me How to keep multiple function modules under one Web service.
    Thanks in advance
    Lakshminarayana

    Hi Lakshmi,
    The best way to do it is to assign all the three RFC Enabled FM's to one function group. Later on the top menu in Utilities you get an option to Create a Webservice from a Function Group.
    You can create one single Webservice using all the the 3 FM's.
    I hope this helps.
    Thanks,
    Manu

Maybe you are looking for

  • What happened to the 17" Macbook Pro?

    I have been using the 17" Macbook Pro since they were created and they have suddenly dissapeared, do they still exist?

  • Photo management on latest gen. iPod Touch

    I'm considering to buy a Touch as a pocket-sized portfolio device. I don't need anything fancy just the ability to create albums like in iPhoto and shuffling images between them, and then flick through. I understand that this will be managed through

  • Report on Deviations in 13 weeks or 3 months History data

    Currently we have a deviations in the forecasting for example week 1 has 100 EA and wk2 has 1000 and then wk3 has 110.It's just an example not exact figures but the bottomline is we have large deviations in some weeks. Now the forecaster needs to kno

  • OGG-00204,Missing TARGET specification.

    Hi All, I'm having some issues on my replicat process as I'm encountering this error "OGG-00204, MIssing TARGET specification" when I'm trying to start it, my replicat parameter file includes "TARGET" on table mapping, am i missing something? please

  • Running multiple versions of iTunes on the same PC?

    I like to always have the latest version of iTunes on my machine, but I also need to keep an older version (7.5 or lower) on my machine for compatibility reasons (please don't ask why - I just do). Is it possible to install multiple versions of iTune