Execute function from custom table value ?

Hi,
I have custom table with following field
FUNNAME        CHAR    1000
That contains records like the following
CALL FUNCTION 'ZMATF' EXPORTING MATNR = P_MATNR IMPORTING MATDESCRIPTION = V_MATERIALDESC.
CALL FUNCTION 'Y_CHECK_EXIT' EXPORTING USEREXIT = 'EFNDTAXWAR' IMPORTING EXECUTE  =  EXECUTE TABLES I_ZA01   =  I_ZA01.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'.
CALL FUNCTION 'RS_TABLE_LIST_CREATE' EXPORTING TABLE_NAME = TABNAME.
My requirement is according some of the user conditions i need to select entry from this table and execute the corresponding function module
Any info highly appreciated.
aRs

Hi,
I believe it should not be a problem...
As the subroutine is not physically created in the program..
Also check this link for a sample program..
http://help.sap.com/saphelp_46c/helpdata/EN/9f/db999535c111d1829f0000e829fbfe/frameset.htm
Thanks,
Naren

Similar Messages

  • Execute function module from Custom Table Value?

    Hi,
    I have custom table with following field
    FUNNAME        CHAR    1000
    That contains records like the following
    CALL FUNCTION 'ZMATF' EXPORTING MATNR = P_MATNR IMPORTING MATDESCRIPTION = V_MATERIALDESC.
    CALL FUNCTION 'Y_CHECK_EXIT' EXPORTING USEREXIT = 'EFNDTAXWAR' IMPORTING EXECUTE  =  EXECUTE TABLES I_ZA01   =  I_ZA01.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'.
    CALL FUNCTION 'RS_TABLE_LIST_CREATE' EXPORTING TABLE_NAME = TABNAME.
    My requirement is according some of the user conditions i need to select entry from this table and execute the corresponding function module
    I tried to use GENERATE SUBROUTINE POOL itab NAME name. But this have limitation of 36 subroutine pools for one program.
    Any info highly appreciated.
    aRs

    If you can put the name of the FM in a variable and the parameters and exceptions in separate internal tables, then you can call the function modules using the statement:
    <b>call function NAME
      parameter-table
        PARA_TAB
      exception-table
        EXCP_TAB.</b>
    See a small example:
    Example
    type pools ABAP.
    data NAME type STRING value `READ_SPFLI_INTO_TABLE`.
    data PARA_TAB type ABAP_FUNC_PARMBIND_TAB.
    data PARA_LINE like line of PARA_TAB.
    data EXCP_TAB type ABAP_FUNC_EXCPBIND_TAB.
    data EXCP_LINE like line of EXCP_TAB.
    data CARRIER type SPFLI-CARRID.
    data JTAB type SPFLI_TAB.
    CARRIER = 'XYZ'.
    PARA_LINE-NAME = 'ID'.
    PARA_LINE-KIND = ABAP_FUNC_EXPORTING.
    get reference of CARRIER into PARA_LINE-VALUE.
    append PARA_LINE to PARA_TAB.
    PARA_LINE-NAME = 'ITAB'.
    PARA_LINE-KIND = ABAP_FUNC_IMPORTING.
    get reference of JTAB into PARA_LINE-VALUE.
    append PARA_LINE to PARA_TAB.
    EXCP_LINE-NAME = 'NOT_FOUND'.
    EXCP_LINE-VALUE = 1.
    insert EXCP_LINE into table EXCP_TAB.
    EXCP_LINE-NAME = 'OTHERS'.
    EXCP_LINE-VALUE = 4.
    insert EXCP_LINE into table EXCP_TAB.
    call function NAME
      parameter-table
        PARA_TAB
      exception-table
        EXCP_TAB.
    case SY-SUBRC.
      when 1.
        message id SY-MSGID type SY-MSGTY number SY-MSGNO.
      when 2.
        message E888(SABAPDOCU) with 'Error in  function module'.
    endcase.
    REgards,
    Ravi

  • Calling function from list of values section?

    can i call a function from list of values(LOV) section as well? I know we can sql query but udf is supported?

    See this recent thread: Display as Text (LOV) or join
    Scott

  • Powershell error while importing module and executing function from module

    powershell error while importing module and executing function from module
    Function called in uncertain order..
    VERBOSE: The 'Function1' command in the MyModule module was imported, but because its name does not include an approved verb, it might be difficult to find. The
    suggested alternative verbs are "Clear, Install, Publish, Unlock".
    VERBOSE: Importing function 'Function1'.
    VERBOSE: The 'Function2' command in the MyModule' module was imported, but because its name does not include an approved verb, it might be difficult to fin
    d. For a list of approved verbs, type Get-Verb.
    VERBOSE: Importing function 'Function2'.

    First of all those errors look more related to HBR, though if it worked before I would restart services then log into the planning app and then try again.
    Have you tried a different form as well one without an ampersand &.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Value Help for a field from custom table in BSP

    Please let me know, the procedure to create value help for a field from a custom table in BSP using HTMLB.
    Thanks

    hi prodigy,
    check this code using drop down list.
    <b>layout for first page</b> 
    <htmlb:dropdownListBox id                = "ddlist"
                                  table             = "<%=t_mara%>"
                                  nameOfKeyColumn   = "matnr"
                                  nameOfValueColumn = "matnr"></htmlb:dropdownListBox>
    <b>event Oninitialization event of first page</b>
    SELECT MATNR UP TO 10 ROWS
      INTO TABLE T_MARA
      FROM MARA.
    <b> event Oninputprocessing event</b>
    **Load the manager class
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    DATA: V_EVENT TYPE REF TO CL_HTMLB_EVENT.
    DATA: DATA TYPE REF TO OBJECT.
    DATA: V_DATA TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
    CALL METHOD CL_HTMLB_MANAGER=>GET_EVENT
      EXPORTING
        REQUEST               = RUNTIME->SERVER->REQUEST
      RECEIVING
        EVENT                 = V_EVENT
    IF V_EVENT->NAME = 'button' AND
       V_EVENT->EVENT_TYPE = 'click'.
    DATA ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST =
                                          RUNTIME->SERVER->REQUEST
                                          NAME     = 'inputField'
                                          ID       = 'matnr'
        V_DATA ?= DATA.
    IF V_DATA IS NOT INITIAL.
         V_MATNR = V_DATA->SELECTION.
    ENDIF.
    NAVIGATION->SET_PARAMETER( NAME = 'v_matnr' VALUE = V_MATNR ).
    NAVIGATION->GOTO_PAGE( 'detail.htm' ).
    ENDIF.
    <b>in the onInitialization event for detail page</b>SELECT MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           LVORM
           MTART
      FROM MARA
      INTO TABLE T_MARA
    WHERE MATNR = V_MATNR.

  • Problem while downloading file from custom table

    Hi All,
    Im trying to download the file from the custom table where i have stored the uploaded files through apex.
    I have created the download procedure as mentioned in the oracle docs ,
    And given the execute grant for public user.
    and calling that procedure by calling the URL -- #OWNER#.download_my_file?p_file=#ID#
    But im getting the below error
    Forbidden
    You don't have permission to access /pls/apex/owner.download_my_file on this server.
    Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at servername Port number
    Can any one tell whats the problem here.
    Thanks in advance
    regards,
    Arumugam KR

    Your function apex_util.get_blob_file_src under region, the first argument must be the name of page item anywhere in your application that is of type "file browse." So if your form for uploading the blob content is on page 11 and the file browse item is "P11_FILE_NAME" then your query would look like below:
    SELECT FILE_ID
         , FILE_NAME
          , CASE WHEN NVL(dbms_lob.getlength(BLOB_CONTENT),0) = 0
           THEN NULL
            ELSE
                  CASE WHEN attach_mimetype like 'image%'
                THEN '<img src="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'" />'
                ELSE
                     '<a href="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'">Download</a>'
               end
           END new_img
        FROM TABLE_NAME
    GET_BLOB_FILE_SRC FunctionAs an alternative to using the built-in methods of providing a download link, you can use the APEX_UTIL.GET_BLOB_FILE_SRC function. One advantage of this approach, is the ability to more specifically format the display of the image (with height and width tags). Please note that this approach is only valid if called from a valid Oracle Application Express session. Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.>
    [url http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm]GET_BLOB_FILE_SRC

  • File download from custom table - privileges

    In the How-to and the Developer's Guide, the instructions for downloading a file from a custom table suggest granting execute on the download procedure to PUBLIC.
    This seems a bit drastic. I have found it is sufficient to grant execute to HTMLDB_PUBLIC_USER (though strangely, granting it to APEX_PUBLIC_USER does not work).

    Hello,
    I agree...granting to PUBLIC is slight 'overkill', it's usually sufficient to grant access to the user specified in the DAD.
    though strangely, granting it to APEX_PUBLIC_USER does not workIt does for me...if it doesn't then it tends to suggest one of two things -
    1) You do not have an APEX_PUBLIC_USER
    or
    2) The APEX_PUBLIC_USER is not the user being used by your DAD

  • Need help for record deletion from custom table

    Hi friends
    I have to write a custom program which will be generic to delete any table record with date field.
    This program needs to be generic (should be able to delete records from any custom table) in nature with selection screen parameters as:
    Table Name and Number of Days prior to which records are deleted, both mandatory.
    Program Flow:
    1.     From number of days calculate date before which records are deleted, ( current date u2013 no. of days = past date).
    2.     Custom table have date field, delete records prior to that date.
    3.     Program may be scheduled for background job, put default values for both fields. No. of days should not be less than 60.
    4.     Classical Report output with number of records deleted.
    My query is how will I know the name of the Date field so that I can write a DELETE query.
    If I use 'DDIF_FIELDINFO_GET' it gives me all field names but how to filter out?
    with regards
    samikhya

    Hi
    I have added  field on the selection screen as p_fieldname and got the F4 help for it , so that the user will get the field name run time as per the table name.
    Now I am facing problem while writing the DELETE query.
    I wrote like
    DELETE (fp_tab)
    where (fp_fieldname) LE date
    It is not working. I also tried with taking a string to concatenate fp_fieldname, LE and date to l_string
    when I write like this:
    DELETE (fp_tab)
    where (l_string) , sy-subrc is getting 4 and no records are getting deleted.
    I do not understand where the dynamic Delete is failing??
    with reagards
    Samikhya

  • Is Custom_authentication blocking me to retrieve password from custom tabl

    Hi
    All i am using custom authentication function which i got in forum and is as below:
    /* Formatted on 2007/02/28 16:54 (Formatter Plus v4.8.0) */
    CREATE OR REPLACE FUNCTION custom_auth (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2
    RETURN BOOLEAN
    IS
    l_password VARCHAR2 (4000);
    l_stored_password VARCHAR2 (4000);
    l_expires_on DATE;
    l_count NUMBER;
    BEGIN
    -- First, check to see if the user is in the user table
    --select count(*) into l_count from ap_users where login_id like p_username;
    SELECT COUNT (*)
    INTO l_count
    FROM my_table
    WHERE UPPER (user_name) = UPPER (p_username);
    IF l_count > 0
    THEN
    -- First, we fetch the stored hashed password & expire date
    SELECT PASSWORD, expires_on
    INTO l_stored_password, l_expires_on
    FROM my_table
    WHERE UPPER (user_name) = UPPER (p_username);
    -- Next, we check to see if the user's account is expired
    -- If it is, return FALSE
    IF l_expires_on > SYSDATE OR l_expires_on IS NULL
    THEN
    -- If the account is not expired, we have to apply the custom hash
    -- function to the password
    -- l_password := custom_hash (p_username, p_password);
    -- Finally, we compare them to see if they are the same and return
    -- either TRUE or FALSE
    IF p_password = l_stored_password
    THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    ELSE
    RETURN FALSE;
    END IF;
    ELSE
    -- The username provided is not in the DEMO_USERS table
    RETURN FALSE;
    END IF;
    END;
    I have created a user table my_table for managing user . I have created a from on table with report for creating,updating,deleting users .
    Whenever i am trying to update the first name which is one column of my custom table then for each update asking for password but my client want that once he login as an employee without asking password he should update any column.
    If he desire he can change the password also .
    but when i am enetring as an employee and trying to update any user each time asking password . So is it due to Custom_Auth function or any other problem.
    Please can any one tell me the reason.
    Thanks in advance,
    Amit

    Hi all my problem get solved thanks i am allowing this report to admin so making password as text field working fine thanks

  • Displaying record from custom table

    I have a custom table ztable (kunnr, vbeln, erdat, erzet, flag). Using these values I would like to display the following
    Client Number (4) = '1234'
    Filler (6) = space.
    Record Type (1) = 'A'
    Client Number (15) = vrkpa-kunnr
    Customer Name (30) = adrc-name1
    This information should be displayed in the following way:
    1234  A0012345        Walmart
    Can someone help me with this code.
    Thank you!

    Okay, I see.  Is your client number always going to be '1234'?  If not, then do not assign a value to it.  Otherwise, you'll want to assign the value during your selection statement because the field will be emptied each time you clear the itab line.The same thing goes for your record type 'A'.  You need an address number, a date, and a nation as the key for table ADRC (so you need to put the necessary values into w_nation and w_begda).  I'm not sure if your customer number corresponds to the address number.  Try this:
    DATA wa_ztable TYPE ztable.
    DATA wa_adrc TYPE adrc.
    DATA w_nation type adrc-nation.
    DATA w_begda type sy-datum.
    DATA: begin of itab occurs 0,
    clientnumber(4) type c,
    filler(2) type c,
    recordtype(1) type c,
    customernumber(15) type c,
    customername(30) type c,
    customeraddress1(30) type c,
    customeraddress2(30) type c,
    customercity(17) type c,
    customerstate(2) type c,
    customerzip(9) type c,
    customercountry(17) type c,
    customercountrycode(3) type c,
    customerphnum(10) type c,
    end of itab.
    w_begda = (put your date here).
    w_nation = (put your nation code here).
    SELECT * FROM ztable INTO wa_ztable WHERE flag = space.
    itab-clientnumber = '1234'.
    itab-filler = space.
    itab-rectype = 'A'.
    itab-customernumber+0(10) = wa_ztable-kunnr.
    itab-customernumber+10(5) = space.
    SELECT SINGLE * FROM TABLE adrc INTO wa_adrc WHERE
    ADDRNUMBER = wa_ztable-kunnr AND NATION = w_nation AND DATE_FROM = w_begda.
    itab-customername = wa_adrc-name1.
    itab-customeraddress1 = wa_adrc-
    itab-customeraddress2 = wa_adrc-
    itab-customercity = wa_adrc-city1.
    itab-customerstate = wa_adrc-regiogroup.
    itab-customerzip = wa_adrc-post_code1.
    itab-customercountry = wa_adrc-
    itab-customercountrycode = wa_adrc-country.
    itab-customerphnum = wa_adrc-tel_number.
    append itab.
    clear itab.
    ENDSELECT.
    LOOP AT itab.
    *Insert your code to display line here (can just list each itab field, or use column numbers if you want to create spaces between the fields)
    ENDLOOP.
    Note on the * lines:  I don't see a field for the country text.  For the address lines, you will probably have to concatenate values from ADRC-HOUSE_NUM1 and ADRC-STREET, and possibly also use ADRC-PO_BOX as well.
    - April
    Message was edited by:
            April King

  • Is it possible to call the Print Quote functionality from Custom ADF page

    Hi,
    We are researching if it is possible to call the Print Quote functionality from the Custom ADF application.
    Goal is to pop up the PDF report upon clicking the Print Quote button on the custom page. Is it possible ?
    Atleast advice on the direction to go forward is appreciated.
    Thanks
    Sai

    Hi ,
    Please check following thread on forum -
    Re: ADF: Calling OAF Page from ADF page
    Check this may also be useful-
    https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    I have not tried yet but Steven Chan (Sr. Director OATG) suggest following methodolgy for this-
    https://blogs.oracle.com/stevenChan/entry/appsdatasource_jaas_ebs
    Thanks,
    Ashish

  • How to delete the records from custom table???

    My requirement is,
    I have a custom table, assume as ZABC, I have updated this by my custom program, This data having table can be extracted by BI etract program(Assume ZZZ). Here I am not writing any code for extracting data from table to BI extract program, That they will do by BI extract program. But I want to write the code for
    <b>Cleanup of Z table—delete records 30 days after the BI data extractor has run.</b>
    How this is possible suggest me any method having for these???
    Thanks Sanju

    Hell Sanjana,
    Ask your basis people to do the clean up after  30 days. If you want the clean up only to be done 30 days after BI extract has been done, then u need some sort of indicator to say that BI Extract has been done , like  flag and date in a custom table which will be set as soon as extract is done. Then based on that info u need to delete a the records.
    Regards

  • User exit for ME21N for displaying the tax code from custom table

    Hi,
      I have a requirement, in our system, the inforecord is not maintain for all the material and vendor combination,  we have a custom table in which we have maintain the
    Compnay code, Pur. Org., Vendor code  Tax code,  juridiction code
    now we want that when a Po is created with ME21 or ME21N  the tax code and jurisdiction code should be come from this table  and if entry not found in this table then it should search as per the regular process like from last Po or info record.  then which user exit we can use for this.
    regards,
    zafar

    CLOSE

  • Deleting entries from custom tables....

    Hello,
    I have a custom table ZCUST (client dependent) from where I want to delete all entries. How do I achieve this ? There are two key fields in this table key1 and key2.
    Regards,
    Rajesh.

    Hi Rajesh,
    try this one...
    DATA: lt_add TYPE zadd OCCURS 0 WITH HEADER LINE.
    SELECT *
    FROM zadd
    INTO TABLE lt_add.
    DELETE zadd FROM TABLE lt_add.
    IF sy-subrc = 0.
      ULINE.
    ENDIF.
    Best regards,
    raam

  • Creating functions from two tables

    So I have these two tables emp and salary. I would like to create a function to accept a grade from salary table
    and return number of employes belonging to that specific.Similarly, I would like to create a function to accept the
    MGR# from the emp table and return number of employees working under that specific manager.
    1.Create function emp_count
    (I_grade in number)
    return number is
    cnt number (2):=0;
    begin
    Select Count (*) into cnt
    from emp, salary e
    where e.grade= I_grade;
    return (cnt);
    end;
    2.Create function mgr_count
    (I_MGR in number)
    return number is
    cnt number (2):=0;
    begin
    Select Count (emp) into cnt
    from emp e
    where e.mgr= I_mgr;
    return (cnt);
    end;
    Thanks

    Joins are same in SQL and PLSQL...
    Additional things you can do in PLSQL..
    1. Select a single row output in PLSQL variable using INTO
    2. Pass a parameter to Select Query
    You can also select multirow output in collection type variable.
    So coming back to your query write a select query joining emp and salary tables on on grade column (I assume this is the common column between 2 tables) and then filter data using grade input parameter.
    Regards
    Arun

Maybe you are looking for