Creating ABAP function module in using an automated script

I wish to create very simple ABAP function modules through an automated script. Is there any way I can do this?

[http://code.google.com/p/saplink/]
Greetings,
Blag.

Similar Messages

  • ABAP Function Module where-used in BI-Transformations

    Hi,
    we have developed some ABAP-Z-Function-Modules. These are used in several BI-Data-Transformations and work fine and performant.
    The problem we have now is to find out in which transformation a Function-Module is used.
    The where-used-list in SE37 doesn't report any BI-Transformations althought I check all categories.
    Got anyone a solution for our problem?
    Christian

    Hi,
    see this code for function module where used list only for transformation . i used the same code as bhaskar specified..but little modification..here u used "date_get_week" function module..
    TYPE-POOLS slis.
    DATA fcat1 TYPE slis_t_fieldcat_alv.
    DATA: BEGIN OF t_display OCCURS 0,
             targetname LIKE rstran-targetname,
             sourcename LIKE rstran-sourcename,
             tranid LIKE rstran-tranid,
             routine LIKE rstran-startroutine,
             line_no LIKE rsaabap-line_no,
             line LIKE rsaabap-line,
    END OF t_display.
    data : input(75) type c.
    DATA : input_pattern1(75) TYPE c.
    DATA : input_pattern2(75) TYPE c.
    DATA : same_source(30) TYPE c.
    **Internal table declerations**************************************
    TYPES:  BEGIN OF t_trans_lookup_finder,
             targetname TYPE rstran-targetname,
             sourcename TYPE rstran-sourcename,
             tranid TYPE rstran-tranid,
             routine TYPE rstran-startroutine,
             line_no TYPE rsaabap-line_no,
             line TYPE rsaabap-line,
    END OF t_trans_lookup_finder.
    DATA: i_lookup_finder TYPE STANDARD TABLE OF t_trans_lookup_finder,
      wa_lookup_finder TYPE t_trans_lookup_finder,
      i_trans_lookup_finder TYPE STANDARD TABLE OF t_trans_lookup_finder,
      wa_trans_lookup_finder TYPE t_trans_lookup_finder,
      i_trans_final TYPE STANDARD TABLE OF t_trans_lookup_finder,
      wa_trans_final TYPE t_trans_lookup_finder.
    DATA : i(7) TYPE n.
    DATA  old_cube(20) TYPE c VALUE ' '.
    DATA  old_source(20) TYPE c VALUE ' '.
    **Selections for update rules**************************************
    SELECT DISTINCT  targetname    sourcename  tranid        endroutine       line_no       line
           INTO TABLE i_trans_lookup_finder FROM
           rstran AS a  INNER JOIN rsaabap AS b ON aendroutine = bcodeid
                           WHERE
                           aobjvers = 'A' AND bobjvers = 'A'.
      APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.
    **Selections for Transformations(Expert routine)*******************
    SELECT DISTINCT        targetname       sourcename       tranid       expert       line_no       line
           INTO TABLE i_trans_lookup_finder FROM
           rstran AS a  INNER JOIN rsaabap AS b ON aexpert = bcodeid
                           WHERE
                           aobjvers = 'A' AND bobjvers = 'A'.
      APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.
    Edited by: Sakthi Jaganathan on May 20, 2009 6:25 PM

  • Issue in creating web service for a ABAP Function Module

    Hi,
    now i'm learning how to create web service for a ABAP Function Module. I used the following steps.
    1. select the Function Module, named "zws_test".
    2. in the context menu, select "create->proxy object". so we enter into wizard.
    3. in the wizard, press the radio button "Service Provider".
    4. in the next page, press the radio button "Existing ABAP Objects(Inside Out)".
    5. In the next page, Enter the "zws_test_prvider" as Service Definition and select "Function Module" as Endpoint Type.
    6. in the next page, enter "zws_test" as Function Module and mark the "Mapping der Namen" button
    7. in the next page,select "PRF_DT_IF_SEC_LOW" as Profile and mark "Deploy Service".
    8. Save in the local package.
    9. then it will pop up a window with title "WSDL Source". i selected "URL/HTTP Destination" and press "OK".
    10.in the next page, i enter the URL as "http://hostname:portnumber/", and press "OK".
    11. then it will pop up a window with title "Display logs". A record with error message "HTTP error(return code 404, message "Not found")" appears.
    12. i press "ok" and a service provider with name "zws_test_prvider" appears in my local package.
    13. i use "zws_test_prvider"'s URL to create a service consumer "ZCO_WS_TEST_CONSUMER" and logic portal "LP1".
    14. But when i test my service consumer "ZCO_WS_TEST_CONSUMER", it will throw an exception "cx_ai_system_fault" with errortext "SOAP:14 Unexpected element -el=definitions ns=http://schemas.xmlsoap.org/wsdl/".
    15. I use t-code SM59 to test connection  and get the following info.
          Status HTTP Response     200
          Status Text                      OK
          Duration Test Call             328 ms.
    who can give me the reasons about item 11 and 14, and explain me how to create service provider and service consumer for a Function Module.
    Thanks in advance
    Johnney

    have you seen this weblog
    /people/thomas.jung3/blog/2004/11/15/bsp-150-a-developer146s-journal-part-xiii-developing-abap-webservices

  • Crystal Reports for VS2010 using a custom SAP ABAP function module data source

    I recently worked with Crystal Reports 2011 and was able to connect and retrieve data from our R/3 system via an ABAP function module. While researching other features, I found this version that can be installed into Visual Studio 2010. The parameters are not very user friendly in Crystal Reports so I was hoping to create a custom dialog to collect my report parameters.
    Does anyone know if I were to install Crystal Reports for Visual Studio 2010, would I be able to design a front-end selection screen in a Visual Basic form and then pass the input to through the Crystal Reports connection to my ABAP function module to retrieve the data filtered on the back-end by the selection screen parameters and return the results to be reported in the Crystal Reports output?
    I am using Visual Studio 2010 Professional Visual Basic with the .NET Framework 4.0 on 32-bit Windows 7. I was able to connect to our R/3 system in Crystal Reports 2011, so if I were to install Crystal Reports for VS2010, would there be a similar way of connecting to SAP?
    Any assistance or direction would be greatly appreciated.
    Thanks,
    Bryan

    Hello Bryan
    I don't know for sure, but I doubt this will work in CRVS2010. Only hope is that the utility available for download in this KBA will point you in the right direction.
    - Ludek
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Share Your Knowledge in SCN Topic Spaces

  • Using a function module i want to create another function module

    Hi all,
            My requirement is by using a function module i want to create another function module(if needs modify action should also be done if i need this is for the created function module) and the main thing is that the function module which we are used to create is should be RFC enabled.
    Thanks,
    Vichu.

    Hi,
    You can do one thing... you write the BDC code in the function module name you are creating... so that if you call the function module in a program and execute that program and if you give the function module to be created in the selection screen of the program... in this way there is chance of creating another function module.
    Hope this would help you.
    Good luck
    Narin

  • Using ABAP Function Modules

    ABAP Function Modules are available to Crystal Reports through the SAP Integration Kit. The look like tables when listing them in the Database Expert.
    How do you use them? Specifically, I am trying to use READ_TEXT to retrieve into a report the contents of STXL.
    Thanks!
    Luis

    Connect the following fields in the database expert:
    STXL
    TDOBJECT
    TDNAME
    TDID
    TDSPRAS
    TO FOLLOWING CORRESPONDING FIELDS OF READ_TEXT
    I_OBJECT
    I_NAME
    I_ID
    I_LANGUAGE
    LATER USE "T_LINES.TDLINE[Text Line]" as output.

  • 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

  • Function module which uses both BAPI's for sales order create and change

    Please name the function module which uses both BAPI's for sales order create and change.
    BAPI_SALESORDER_CREATEFORMDAT2
    BAPI_SALESORDERCHANGE

    Yup.
    you must write a piece of code for this.
    with if else condition.first check if SO is exsist than use second FM to change it else create new SO from first FM.
    logic somethig like this.
    Amit.

  • Passing an XML file from WebDynpro app to ABAP function module

    Hi all,
    I'm stuck with a problem, and am hoping one of you could let me know how to proceed:
    I need to pass an XML file (or at least the entire content of the XML) from my WebDynpro application to a backend ABAP function module. What I tried was this:
    In my WebDynpro app, I read the XML and convert the content into one long string (using java.io.FileReader and java.io.BufferedReader). In my ABAP function module I created an import parameter of type String. I then imported the ABAP Function module into my WebDynpro app as a model. I then tried to pass the XML string to the ABAP module. What happens is this:
    If the size of the string (XML) happens to be less than 255 characters, then it works. That is, the string is passed to the ABAP function module and I can see the contents. However, if the XML string happens to be greater than 255 characters, then it does not work. The string at the ABAP side is empty. Surprisingly, the ABAP module does not throw an error either. It just displays an empty string.
    Could you please tell me what the problem is?
    Thanks & Regards,
    Biju

    Hi Biju ,
    Welcome to SDN.
    If the import parameter is defined as type string it should work, however did you check whether your application pass it properly?
    I have applications using strings as import parameters working fine. (webapplications (BSP) to RFC)
    Regards
    Raja

  • Help on ABAP Function Module (Unit 1)

    Hello ABAP Experts,
    I need help with the below mentioned lesson plan. I donot have source code for The ABAP Function Module - BC401_GET_SEP_STRING. For the Source Code Solution in the Lesson Plan to work, I need the source code for the above mentioned function module.
    The Lesson Plan with Solution is posted below:
    Exercise 1 
    Unit: Data Types and Data Objects in Detail
    Topic: Defining Data Types and Data Objects
    Basic Statements
    Processing Character Strings
    At the conclusion of these exercises, you will be able to:
    u2022     Define structure types locally in the program
    u2022     Define elementary and complex data objects
    u2022     Split strings
    u2022     Use conversion rules
    u2022     Display the contents of data objects in lists
    In this exercise, you will use a template to create a program that receives a single data record from the database table SFLIGHT in form of a character string. The program will split the this character string into its components and display it formatted in a list.
    Because the focus of this exercise is not on the transfer of data as a character string, we will use a function module that will provide us with the required database. This will simulate actual cases, such as data transfer from an external system.
    Program: ZBC401_##_SPLIT_STRING
    Template: SAPBC401_DTOT_SPLIT_STRING
    Model solution: SAPBC401_DTOS_SPLIT_STRING
    is your two-digit group number
    1-1 Copy the program, SAPBC401_DTOT_SPLIT_STRING and give it the new name ZBC401_##_SPLIT_STRING.
    1-2 Familiarize yourself with the main body of the program. Pay special attention to the content of the data object datastring after the function module call. Use the Debugger to do this, and/or display the character string in a list. (The function module itself is here seen as a black box. For this exercise, it is not necessary to understand its construction.)
    1-3 To be able to split the character string into its components you must first remove the ## characters. Remove the two leading separators from the character string first. Then copy the initial part up to the closing separators to the auxiliary variable set_string. For this, set_string has to be defined appropriately.
    1-4 Now use the separators to split the contents of the auxiliary variable set_string into the structure wa_flight_c. The latter is typed with the local program structure type st_flight_c. You still have to comment out the components of this structure type and assign them an appropriate type.
    1-5 As a test, display the fields of the structure, wa_flight_c in a list.
    1-6 In the list displayed in exercise 1-5, you should have observed that some of the fields were displayed without formatting u2013 for example, the PRICE field. Your next step is to change this.
    To do this, convert the data you have extracted by copying it to data objects with suitable types. Also, not all components of wa_flight_c are to be displayed.
    For this purpose, a structure wa_flight has already been defined. It is typed with the structure type st_flight. You must comment out the components of st_flight and find appropriate types for these components for the formatting. Then copy the identically-named components of the character-type structure wa_flight_c to the fields of the structure wa_flight.
    Display the contents of the structure wa_flight in a list. Use the appropriate formatting options for the WRITE statement for the fldate and price components.
    Data Types and Data Objects in Detail Solution 1
    Unit: Data Types and Data Objects in Detail
    Topic: Defining Data Types and Data Objects
    Basic Statements
    Processing Character Strings
    REPORT sapbc401_dtos_split_string.
    TYPES:
    BEGIN OF st_flight_c,
    mandt(3) TYPE c,
    carrid(3) TYPE c,
    connid(4) TYPE n,
    fldate(8) TYPE n,
    price(20) TYPE c,
    currency(5) TYPE c,
    planetype(10) TYPE c,
    seatsmax(10) TYPE n,
    seatsocc(10) TYPE n,
    paymentsum(22) TYPE c,
    seatsmax_b(10) TYPE n,
    seatsocc_b(10) TYPE n,
    seatsmax_f(10) TYPE n,
    seatsocc_f(10) TYPE n,
    END OF st_flight_c,
    BEGIN OF st_flight,
    carrid(3) TYPE c,
    connid(4) TYPE n,
    fldate TYPE d,
    price(9) TYPE p DECIMALS 2,
    currency(5) TYPE c,
    planetype(10) TYPE c,
    seatsmax TYPE i,
    seatsocc TYPE i,
    END OF st_flight.
    DATA:
    datastring TYPE string,
    set_string TYPE string,
    wa_flight_c TYPE st_flight_c,
    wa_flight TYPE st_flight.
    START-OF-SELECTION.
    CALL FUNCTION 'BC401_GET_SEP_STRING'
    EXPORTING
    IM_NUMBER = '1'
    IM_TABLE_NAME = 'SFLIGHT'
    IM_SEPARATOR = '#'
    IM_UNIQUE = 'X'
    IMPORTING
    ex_string = datastring
    EXCEPTIONS
    no_data = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE a038(bc401).
    ENDIF.
    SHIFT datastring BY 2 PLACES.
    FIND '##' IN datastring.
    IF sy-subrc <> 0.
    MESSAGE a702(bc401).
    ENDIF.
    SPLIT datastring AT '##' INTO set_string datastring.
    SPLIT set_string AT '#' INTO
    wa_flight_c-mandt
    wa_flight_c-carrid
    wa_flight_c-connid
    wa_flight_c-fldate
    wa_flight_c-price
    wa_flight_c-currency
    wa_flight_c-planetype
    wa_flight_c-seatsmax
    wa_flight_c-seatsocc
    wa_flight_c-paymentsum
    wa_flight_c-seatsmax_b
    wa_flight_c-seatsocc_b
    wa_flight_c-seatsmax_f
    wa_flight_c-seatsocc_f.
    MOVE-CORRESPONDING wa_flight_c TO wa_flight.
    WRITE: /
    wa_flight-carrid,
    wa_flight-connid,
    wa_flight-fldate DD/MM/YYYY,
    wa_flight-price CURRENCY wa_flight-currency,
    wa_flight-currency,
    wa_flight-planetype,
    wa_flight-seatsmax,
    wa_flight-seatsocc.

    this FM is to get one element value from the XML
    if you want to convert the whole XML use FM SMUM_XML_PARSE
    Regards
    Raja
    Kindly close your previous threads and assing points.
    Re: Creation of SIMPLE TRANSFORMATIO(ST)for deserialisation of XML ->ABAP data.

  • Web Services  from ABAP function modules return values- leading zeros

    I am using several web services from SAP CRM (5.0) that were created from Function modules ( I am assuming that that they are in ABAP).
    I can call the web services fine and they work as expected, but I am seeing a lot of leading zeros in the return values of fields in tables from the Web service.
    The ABAP er’s are telling me that they cannot see the leading zero’s.
    So my question is where these are appended to the values in the whole process. When I execute the Function Module in SAP CRM from transaction SE37 I can see the leading zeros. So I think that this is something that has to be handled by the ABAP er’s and not in the client consuming the web service.
    Are the functions in SAP CRM that can remove leading zeros for fields in a table (that is an export parameter?)
    Jawahar

    Hello Jawahar
    If you run your (RFC-enabled) function modules using the SAP-GUI (i.e. in dialog) then the GUI automatically replaces leading zero when the function module returns any data. However, calling the same function module remotely you will always see these leading zeros.
    These so-called conversion exits are defined as attribute of domains in the ABAP dictionary. If the function module used for the WebService is a standard fm then you have little chances to get rid of the leading zero. Perhaps the WebService has some attribute to suppress conversion exits or activate them when retrieving the data.
    Regards, 
       Uwe

  • 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.

  • ABAP Function Module to perform validation

    Hi Developers,
    I'm am trying to create a function module to be later used by a Web Dynpro application. The function module should be structured as followed:
    Importing
    USER_ID : User ID to be searched that is entered by user.
    TENANT: Tenant ID that is to be searched, also entered by user.
    Changing
    EXIST: A flag that will return the values Y or N based on a return from the function module.
    The function module must be able to access a specified Oracle database table and perform a check on the table with the provided import values. If the combination exists, it should return a Y. If the combination does not exist it should return an N. Assumption is that tenant and userid fields exist in this table in addition to two other. User ID is the primary key.
    Regards,
    JD

    Hi,
    For getting data from oracle the following threads may help you;
    Access external Oracle database with ABAP
    Accessing an external Oracle database from ABAP
    You can get more threads by [Searching|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_library&adv=true] the Forum.
    Regards
    Karthik D

  • Abap function module http_post and umlaut characters

    I am using abap function module HTTP_POST to frame xml and send the data to our middleware system 'CASTIRON'.
    Everything works fine but when there are any umlaut characters in xml, the function HTTP_POPST is unable to transmit the data and is creating SM21 updation failures. We are on ECC 6.0 unicode system.
    Any help is vey much appreciated.

    Are you using a CDATA tag to encapsulate your data. Try doing it.

  • ABAP Function Module generator

    Hi,
    I wonder if there is a ABAP Function Module generator for inbound and outbound adapter data. Can I generate a function module in XI to trigger a adapter.
    regards,
    Richard

    Hi,
    There is no tool to "generate" RFCs.  You will have to use SE37 to create the RFCs as always.
    For outbound RFC, you will need only to define the interfaces, e.g. IMPORT, EXPORT, TABLES.  No ABAP code is required.  Then, just populate the parameters and send to XI.
    For inbound RFC, you can develop the RFC to do whatever it needs to do in ABAP.
    In the IR of XI, you can import the RFC's meta data.
    Regards,
    Bill

Maybe you are looking for

  • Oracle (64 bit) on Windows 2003 ( 64 bit )

    Hi Guys, Im trying to install Oracle Release 2 (9.2.0.2) on Windows 2003 (64 bit) , but failed. It pops up following error. "The image file setup.exe is valid, but is for a machine type other than the current machine." Can somebody help on this. rgds

  • Windows 2008 Failover Cluster - Cannot add a generic service

    Trying to add a generic service in a failover cluster. Select the option Services and Application and it opens the wizard and then displays the error "An error was encountered while loading the list of services. QueryServiceConfig failed. The system

  • Need to reinstall OS on late 2009 27" iMac but I can't locate OS DVD

    Hello, I need to reinstall OS on late 2009 27" iMac but I can't locate OS DVD. The original HDD is toast and I'm going to replace it myself. I simply need to know how I go about working with Apple so they can mail me a copy of the original install DV

  • Doubt in Dataguard concept

    Dear all, Please help me regarding this i am very much confused..... I had couple of doubts in dataguard concepts. 1)When archive log is transferred from primary to standby , a.Whether DBWR will be in active state or not in standby server.To write th

  • Error ORA-01000: maximum open cursors exceeded

    Why Oracle return this error. When I change the OPEN_CURSORS in init.ora from 100 to 1000 without this error. I want to keep Minimum cursors value. How can I change the Java program ? 96 er_write_asp('W349','HK','50112','USD',3.99) 97 er_write_asp('W