Passing INLCUDE name dynamically

Hi,
Is there any way of passing the INCLUDE name dynamically?
Scenario is as follows
Requirement is to consolidate approx 6 enhancements (user exits) of the same name from 6 different systems into 1system . Objective is to put each of the code in an INCLUDE and then call the relevant INCLUDE based on some data maintained in a z-table
Z-table would have entries like this
Scenario      Include
S1                I1
S2                I2
S3                I3
Hence final enhancement code should read the entry from z-table and accordingly pass the relevant INCLUDE name
INCLUDE <include name from z-table>
Valuable suggestions are needed.
Poonam

Hi Poonam,
<li> Create one function group.
<li> Write your 6 includes code in 6 function modules. function module is nothing but include in Function group.
<li>Try to give importing and exporting parameters are same.
<li>Try the below way.
REPORT ZTEST_NOTEPAD.
DATA: BEGIN OF IT_FUNC OCCURS 0,
        NAME TYPE RS38L-NAME,
      END OF IT_FUNC.
"Build your it_func with function modules.
LOOP AT IT_FUNC.
  CALL FUNCTION IT_FUNC-NAME "You can call fm dynamically
    EXPORTING
      DAY_IN            = IMPORTING
      LAST_DAY_OF_MONTH = EXCEPTIONS
      DAY_IN_NO_DATE    = 1
      OTHERS            = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDLOOP.
Thanks
venkat.O

Similar Messages

  • Execute immediate with using clause to pass column name dynamically

    Hai,
    Is there any way using execute immeidate to pass the column name dynamically. I used to pass the column value as dynamic with the help of "Using clause" . But if i use to pass column name, it is giving numberic error at run time. Eg,. for testing has been given below.
    1. Column value as dynamic, which is working correctly.
    create or replace function testexeimm (acctnum char)
    return number as
    acctbal number;
    begin
    execute immediate 'select balance from acct_master where acct_no=:a' into acctbal using acctnum;
    return acctbal;
    end;
    2. Column name as dynamic which is not working
    create or replace function testexeimm (colnam char)
    return char as
    acctbal char;
    begin
    execute immediate 'select :a from ch_acct_mast where rownum=1' into acctbal using colnam;
    return acctbal;
    end;
    Any help in this regard will be highly appericated.
    Regards
    Sridhar

    So the variable has to be numeric too:
    create or replace function testexeimm (colnam char)
    return number as
    acctbal number;
    begin
    execute immediate 'select '|||colnam||' from ch_acct_mast where rownum=1' into acctbal;
    return acctbal;
    end;Max
    http://oracleitalia.wordpress.com

  • Pass column names dynamically in report

    Hello experts,
    I am creating an ALV report where i need to pass the column names dynamically. if the current month is March and year is 2009. the column names should be as below
    March 2009 April 2009 May 2009 June 2009 ..............till Feb 2010 (total columns are 12)
    if the current month is June and year is 2010 it shoud be displayed as
    June 2010 July 2010 Aug 2010................till May2011
    I am actually calculating the forecast qty for each month and displaying in a report from the current month.
    How to write field catelog for this requirement?
    Thanks in Advance.
    Rajesh.

    I think in the fieldcat, at the time of declearation, you can alter the field description depending on the present month.
    If present_month = January
    wa_fieldcat-reptext_ddic = 'January'.       " Field description
    elseif present month = February.
    wa_fieldcat-reptext_ddic = 'February'.       " Field description
    on so on.....................
    Kuntal

  • Passing file name dynamically in Synchronous read operation of FTP adapter in OSB

    Hi,
    We are implementing the integration in OSB 11g and using FTP JCA adapters to check if the file exists in the FTP location or not. We are using Synchronous read operation of FTP adapters. We need to pass the file name dynamically at run time. In the JCA file we can hard code the file name. How that file name can be taken dynamically using OSB.
    Regards,
    Sharmistha

    Hi Sandeep,
    This is possible.
    For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    In the case of receiver file adapaters, you have 5 options for file creation like,
    1.Create
    2.Append
    3. Add time stamp
    4.Add Counter
    5. Add Message ID
    You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Hope this helps

  • Passing file name dynamically to sql loader ctl file

    Hi,
    I am new to scripting and I have a complex requirement involving writing a script.
    Requierment:
    I need to upload a CSV file from a FTP server into oracle table using SQL Loader. The file name resembles like APF0912312359.csv represents 31-DEC-2009 23:59 and there will be multiple files in same day indicated by differnt timestamp as its filename. Once I load a file using SQL loader, I need to move the file to another directory for archival.
    Since the sql loader ctl file has a fixed file name, I would like to know how I can pass the file name dynamically to ctl file to load a new file every time it runs.
    Any help is greatly appreciated..
    Bye
    Sudheer
    Edited by: user2138419 on Oct 28, 2009 4:08 PM

    I agree with Pradeep in regards to declaring the file names on the command line. However, I do have a concern regarding presenting the password on the command line as any user that can issue a ps (assuming Unix ~= Linux here) would be able to read it while the sqlldr command is running.
    Unfortunately, you may not always have the option of declaring the files on the command line. I was recently challenged with this in a Windows 2003 Server environment running SQL*Loader: Release 10.2.0.1.0. In this environment I found that I am able to set a variable file name in a calling batch file and use that value in the control file successfully. Just to demonstrate the approach:
    Batch file:
    set IN_FILE=’c:\inbound\load_me.txt’
    sqlldr user/pswd@db PARFILE=’c:\parameters.txt’
    Parameter file:
    errors=500000
    rows=50000
    control=%CTL_FILE%
    bad=%BAD_FILE%
    discard=%DSC_FILE%
    log=%LOG_FILE%
    Control file:
    LOAD DATA
    INFILE ‘%IN_FILE%’
    INSERT
    INTO TABLE table_to_be_loaded
    I’m really interested to see if this would work on Unix.
    -Luke

  • Passing file name dynamically to the file adapter

    Hi All,
    I'm using a file adapter to create a file from the XML message after mapping in XI. The file name is given in the file adapter configuration. Is it possible to have the file name as a part of the message and pass it to the file adapter dynamically? Or is it possible to have the file name in some variable or something in XI (like a BPM variable) and pass it to the adapter for every message?
    Does someone have any idea?
    Thanks,
    Sandeep

    Hi Sandeep,
    This is possible.
    For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    In the case of receiver file adapaters, you have 5 options for file creation like,
    1.Create
    2.Append
    3. Add time stamp
    4.Add Counter
    5. Add Message ID
    You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Hope this helps

  • Passing procedure name dynalically to DB adapter

    Hi All,
    We are using 11.1.1.6.
    We have a requirement to call 8 procedures for 8 transactions.
    Signature of the procedure is same except the name and each proc has its own business logic.
    So we want to have one db adapter and want to pass the proc name dynamically based on the transaction.
    Do we have any option to pass proc names dynamically to adapter?
    Regards
    PavanKumar M

    implement a custom JCA adapter and build your logic in there.
    --Prasanna                                                                                                                                                                                       

  • How can I pass the web template name dynamically to a container

    Hi Experts ,
    I have a container web item in 7.0
    I would like to pass the name of the web template to be displayed in that web item dynamically .
    how can I achieve the same .
    How can i change the visibility settings of a container using a javascript .
    Thanks in advance for your help .
    Regards
    Nikhil

    Hi Nikhil,
    When you say that you want to display the name of the template for the container item, I think you are talking about the tray caption for the item - is that correct? You can use a text item to access the web template name, but in the caption of the container item, you cannot specify other web items.
    What you can do it to use a group item in the template and embed your container layout in it. In the group item, you have an option of specifying a caption using another web item where you can reference this text item.

  • Can we pass IT table name dynamically to READ and SORT stmt

    Hello All,
      i have a requirement in which i am passing table name using a variable and want to read the same table: so my question is can we execute read and sort stmt with dynamic IT name. please see below for explaination.
    v_itname = <it_2>.
    now read using variable
    READ table ( v_itname ) with key <field>.
    and
    SORT ( v_itname ) by (otab).
    thanks
    Mani

    Hi ,
    This can be done. Please refer to the  codes below. Please note that the code will work if the itabs are of type standard table else it may dump.
    You just need to replace the variables form the values from your internal table.
    DATA: v_table1(10) TYPE c VALUE 'I_MARA',
          v_field(10)  TYPE c VALUE 'MATNR',
          i_mara TYPE STANDARD TABLE OF mara.
    FIELD-SYMBOLS : <fs_tab>   TYPE STANDARD TABLE,
                    <fs_field> TYPE ANY.
    DATA: otab TYPE abap_sortorder_tab,
    oline TYPE abap_sortorder.
    SELECT * UP TO 10 ROWS
      FROM  mara
      INTO TABLE i_mara.
    IF sy-subrc = 0.
      ASSIGN (v_table1) TO <fs_tab>.
      IF sy-subrc = 0.
        oline-name = v_field.
        APPEND oline TO otab.
        SORT <fs_tab> BY (otab).
        READ TABLE <fs_tab>
        WITH KEY (v_field) = '000000000020000989' "
        BINARY SEARCH
        TRANSPORTING NO FIELDS.
        IF sy-subrc = 0.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    Dev.

  • Passing Text name in text includes dynamically in Smartforms

    Hi Experts,
    How to pass text name , text object and text id dynamically while i include text in smartforms.
    I surfed in SDN but still i am not clear.
    I am calling READ_TEXT FM in my print program. When i try to call using the variables which are used in Print program and here i import them to pass it in text module, It gives me error that no variable of that name found.
    Regards
    Swetha

    Swetha,
    it depends how many text combination you want to pass.
    if they are some 4-5 than you can simply pass them like:
    CASE &VBDKR-VKORG&.
      WHEN '1552'.
    INCLUDE ZADDRESS_1552_RT OBJECT TEXT ID ADRS
      WHEN '1454'.
    INCLUDE ZADDRESS_1454_RT OBJECT TEXT ID ADRS
      WHEN '1555'.
    INCLUDE ZADDRESS_1555_RT OBJECT TEXT ID ADRS
      WHEN '1482'.
    INCLUDE ZADDRESS_1482_RT OBJECT TEXT ID ADRS
      WHEN '1483'.
    INCLUDE ZADDRESS_1483_RT OBJECT TEXT ID ADRS
      WHEN '1484'.
    INCLUDE ZADDRESS_1484_RT OBJECT TEXT ID ADRS
      WHEN '1485'.
    INCLUDE ZADDRESS_1485_RT OBJECT TEXT ID ADRS
      WHEN '1486'.
    INCLUDE ZADDRESS_1486_RT OBJECT TEXT ID ADRS
    above example i used to pass address in script.
    else if you dont know how many combination are there than you can write perform routine.
    Amit.

  • How to pass the table name dynamically in xml parsing

    Hi All,
    I have created one procedure for parsing xml file which is working perfectly.
    FORALL i IN t_tab.first .. t_tab.last
             INSERT INTO Test_AP VALUES t_tab(i);Now I want to put the table name dynamically+. For that I have added one query and modify above code as follow:-
    I have already declare dml_str varchar2(800) in declaration part.
    Query is as follows:-
    select table_name into tab_name from VERSION_DETAILS where SUBVERSION_NO=abc;  -- here abc is variable name which contains values.
    FORALL i IN t_tab.first .. t_tab.last
              dml_str := 'INSERT INTO ' || tab_name || ' values :vals';
              EXECUTE IMMEDIATE dml_str USING t_tab(i);But it's not working. How I will resolve this or through which way I achieved the intended results. Anyone can guide me on this matter.
    Thanks in advance for your help...

    Hi,
    But it's not working.Don't you think it would help to give the error message?
    Put the assignment before FORALL.
    FORALL only accepts one subsequent DML statement (static or dynamic SQL) :
    dml_str := 'INSERT INTO ' || tab_name || ' values :vals';
    FORALL i IN t_tab.first .. t_tab.last          
    EXECUTE IMMEDIATE dml_str USING t_tab(i);

  • Passing TABLE NAME as parameter is possible or not?

    I want develop a small/simple report like this
    TABLE NAME :
    WHERE :
    ORDER BY :
    QUERY ROWS
    In the above model i want to pass all the three (TABLE NAME,WHERE and ORDER BY) as a parameter.
    My doubt, is that possible to pass TABLE NAME as a parameter? If so!
    When i enter any TABLE NAME it has to fetch me out the records of that table (Based on WHERE condition and ORDER BY).
    Is that possible to do?
    Need some help!
    Edited by: Muthukumar Seshadri on Aug 10, 2012 6:19 PM

    Yes, it is possible with lexical parameters. Look in the help for examples:
    SELECT Clause
    SELECT &P_ENAME NAME, &P_EMPNO ENO, &P_JOB ROLE  FROM EMP
    P_ENAME, P_EMPNO, and P_JOB can be used to change the columns selected at runtime.  For example, you could enter DEPTNO as the value for P_EMPNO on the Runtime Parameter Form. 
    Note that in this case, you should use aliases for your columns.  Otherwise, if you change the columns selected at runtime, the column names in the SELECT list will not match the Report Builder columns and the report will not run.
    FROM Clause
    SELECT ORDID, TOTAL FROM &ATABLE
    ATABLE can be used to change the table from which columns are selected at runtime.  For example, you could enter ORD for ATABLE at runtime. 
    If you dynamically change the table name in this way, you may also want to use lexical references for the SELECT clause (look at the previous example) in case the column names differ between tables.
    WHERE Clause
    SELECT ORDID, TOTAL FROM ORD WHERE &CUST
    ORDER BY Clause
    SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL  FROM ORD ORDER BY &SORT You have to be really careful with this approach. Dynamic SQL may cause serious performance problems.
    Edited by: InoL on Aug 10, 2012 10:06 AM

  • How to pass a filename dynamically in incoming email and process that file

    Hi,
    We have to process an incoming file with XI, the name of which we don't know to design time. The filename is passed dynamically in an incoming email, in the body section. We can parse the filename from the mail already. However, file adapter-sender does not accept variables (whereas receiver does), so we have no way to pass this name to the file-sender.
    What would be the best way to implement this scenario? I'd really appreciate a bit more explanation than 1-liner answers (e.g. links to help.sap.com We have SAP XI 7.0 SP15.
    TIA

    Thanks. This is similar to our plan B That is, using a wildcard, processing all files in the incoming directory, and moving them after processing. This way, only the unprocessed files would be in the source folder. IMHO, it's not elegant.
    Besides, should a second mail get received, before the first file is processed completely (e.g. due to an error, slow FTPS transfer rate, etc.), the second process would try to pick up the first file as well, which would mess up everything.
    There should be a way to set a parameter for the sender-file adapter...

  • How to pass column name at run time in function.

    how to pass column name at run time in function as parameter.
    thank in advance
    pramod patel

    Hello,
    Using dynamic sql you can pass column name to function. well I am not getting what you really want to do ? Please write in more detail. By the way I am providing one example here. see it uses dynamic sql.
    Create or replace function fun_updtest (p_columnname_varchar2 in varchar2,
    p_value_number in number)
    return number is
    v_stmt varchar2(500);
    begin
    v_stmt := 'update emp
    set '||p_columnname_varchar2||' = '||to_char(p_value_number)||'
              where empno = 7369';
    execute immediate v_stmt;
    return 0;
    commit;
    end;
    call to this function can be like this..
    declare
    v_number               number;
    begin
    v_number := fun_updtest('SAL',5000);
    end;
    Adinath Kamode

  • HOW TO GIVE CLASS NAME DYNAMICALLY???

    Hi all!
    I want to give class name dynamically to my statment
    <jsp:useBean id="myBean" scope="session" class="myPackage.myClass"/>
    now here i want to pass a String as class name how can i do it?
    Jiaa:):):)

    Hi,
    You can't assign dynamically a classname in the instruction jsp:useBean
    S�b

Maybe you are looking for