Dynamic construction of include names within sapscript

I want to be able to set up the name of an include dynamically but within the sapscript rather than using abap code. Is it possible?
My existing code is :
/: include ZM_TERMS_OBLIG3_DDD ID etc...
I want to change this to use a variable:
/: include &include_name& ID etc...
Preceding this I've got code in like so
/:   DEFINE &OBLIG_SUFFIX& = ''.                                   
/:   IF &EKPO-ZZDELVTYPE& = 'AC'.                                  
/:   DEFINE &OBLIG_SUFFIX& = '_AC'.                                
/:   ENDIF.                                                        
/:   DEFINE &INCLUDE_NAME& = ' '.                                  
/:   IF &EKKO-BSART& = 'DDD'.                                      
/:   DEFINE &INCLUDE_NAME& = 'ZM_TERMS_OBLIG3_DDD&OBLIG_SUFFIX&'.  
/:   ENDIF.                                                                               
If I print out the value of &include_name& it does hold the name which I I want it to but the include doesn't resolve properly. Got any ideas?

<b>Answer:</b>
I found a variation in the assignment statement which fixed it. In debug I found that although printing the correct value internally the variable &include_name& actually still held the string &oblig_suffix& rather than the contents of &oblig_suffix&. Changing the define to use the ':' option gave me the desired results. Note the subtle difference, ':=' instead of the usual '='.
/:   IF &EKKO-BSART& = 'DDD'.                                              
/:   DEFINE &INCLUDE_NAME& <b>:=</b> 'ZM_TERMS_OBLIG3_DDD&OBLIG_SUFFIX&'.         
/:   ENDIF.

Similar Messages

  • Adobe Form: Dynamic vlaue for Include text name. Script Coding

    Hi,
    Situtation:
    Need to print  an 'Include Text' in the Adobe form.
    The key texname for the include name is dynamic -  invoice number + position number.
    I have created a Global Data variable item_textkey and assigned it to the inculde textname in 'Context'.
    The Problem is I dont know how or where to assign a value to this global data variable at runtime, so the right include text is pulled up.
    I tried the code in the "FormCalc' of the text field. But it doesnt work.
    $record.ITEM_TEXTKEY = Concat ($record.IS_VBDKR.VBELN, $record.IS_VBDPR.POSNR)

    Try the following in initialize event of the main subform
    $record.ITEM_TEXTKEY.rawValue = Concat ($record.IS_VBDKR.VBELN.rawValue, $record.IS_VBDPR.POSNR.rawValue)
    Chintan

  • Dynamically construct Target/Source Directory in File Adapter

    Hi All,
    Is it possible to Dynamically construct target/Source Directory in File Adapter? If yes can anyone plz provide details about the same.
    regards
    Vinay

    Hi vinay,
    have a look @ these threads..u may get some help!!
    Re: Dynamic directory name in Receiving File adapter
    Dynamic FileName and Directory - UDF
    Re: Dynamic Directory and File Naming in Receiver Adapter
    Re: target directory in file adapter
    Regards
    BILL

  • How to read include names of modules in a function group

    Dear All,
    I'd like to read programatically the include names of all function modules within one function group, with given function group's name.
    Does anybody know a module or class providing this functionality?
    Best regards
    Wolfgang
    Message was edited by: Ralf Wolfgang Geithner

    You can do a select from TFDIR table.
    DATA PANME LIKE TFDIR-PNAME.
    DATA INCLUDE_NAME LIKE TFDIR-PNAME.
    PNAME(4) = 'SAPL',
    PNAME+4 = <FUGR_NAME>.
    SELECT * FROM TFDIR WHERE PNAME EQ PNAME.
    CONCATENATE 'L' <FUGR_NAME> 'U' TFDIR-INCLUDE
    INTO INCLUDE_NAME.
    ENDSELECT.
    INCLUDE_NAME will conatin the include name of Function Module.
    Cheers

  • How to dynamically resize virtualbox console (Arch within Arch setup)

    My host is Arch, and my guest is Arch.  The guest running console without X.  I got 1024x728 resolution by adding vga=772 in guest's menu.1st file.  Is there a way to dynamically resize the guest's console dimensions by dragging virtualbox's window corner, as you can with a windows guest OS?

    Dynamic resizing only works from within X, it doesn't work when in console mode, as it requires the Guest Additions installed.  It might of course work in the future if Virtualbox includes a framebuffer driver with guest additions, but somehow I very much doubt they will

  • Address Book, including names with Companies.

    It seems like I should be able to print out companies with the associated contact person but it seems this app. doesn't allow that. Am I missing something or is it a terrible oversight? I'm trying to do a mailing list that is addressed to various people at their workplace.
    The workaround I'm currently using has me selecting "Company" and including the contact name within the address field.

    I haven't printed out labels, just the list of my Address contacts on several pages. But, the Contact name appears in the left column, the contact info in the middle, and the phone in the last column. This printing does not have the Business name followed by the contacts name as the Busi
    Now thinking through this, I went through the exercise of making a PDF of
    this info that I created as a sample in my Address Book:
    "A Sample - Being the Company
    Miss Jones - Being the Contacts name
    mobile 999-xxx-xxxx
    work [email protected]
    home [email protected]
    work 333ruthere (AIM)
    work 894UV Boulevard - Business ADDRRESS
    FunnyUAsk Delaware vwxyz-stuv
    home 24 Thorobred Road - Home ADDRESS
    Anywhere Colorado abcde-fghi
    Note:"
    After I created the PDF, it showed my own name, address, state, etc. as the return address and the A Sample as the Addressee.
    Now, the Business would have to be the name on the Administrator of the Computer for this to work out, because that is the name that appears on the return address field, as thus:
    "Business Name
    Address
    City St. Zip
    A Sample
    894UV Boulevard
    FunnyUAsk, Delaware wxyz-stuv"
    When you click on the word "Work" field in the Address Book, you will see a drop down menu with choices, and "Copy Mailing Label" is the middle choice.
    But it is also on the out put when you check "Print" from the Address Book Menu under "File." When the Print Dialogue Box appears on your desktop, you will see toward the middle right side "Layout/Label/Orientation."
    Choose "Label" and you will see your name (if you are using your personal computer, or the Administrators name/Company perhaps if you are using your companies computer.)
    I see the Label section saying to choose(second choice under "Print my address", Addresses - All or home/work/other. Then Print in Alphabetical Order.
    I am trying to get to my point the slow way, and I an trying to think through this to solve it.
    I just unchecked the "Print my address" selection and my name from the Return Address field name is no longer present, only the Addressee.
    "Miss Jones"(for example only) name doesn't appear in the Addressee's address below the Business Name unless she is listed in the Address Book as the Company as:
    "Miss Jones
    894UV Boulevard
    FunnyUAsk, Delaware wxyz-stuv"
    I am having a bit of a problem getting this solved. Did I shed any light on anything that may perhaps work at all? This is definitely a puzzler. Maybe something needs to be added to the Address Book fields or another function added.
    I thought I was close, but I do not think so, Paula
    iMac 1.9 GHz PowerPC G5 1.5 GB DDR2 SDRAM (Owned a Mac since 1984!)   Mac OS X (10.4.6)   Slot Loading 8X Dual Layer SuperDrive, iSight & Apple Remote; iPod Video

  • Dynamically pick the table names in data flow task SSIS

    Hi All,
    I want to create a SSIS package which loads the data to a table on the other server every day. I have around 250 tables to load everyday and source and destination table names are available in a metadata table, table names have to read from the metadata
    table and data should be loaded. Is there a way that we can configure the source and destination table names dynamically in Data flow task?
    I am newbie to SSIS can any help with the solution for this problem.

    You can do that, not a big deal. The underlying problem is say suppose you constructed a ETL based on some x source and y destination and have put x(3 columns) as source and y destination(3 columns).. As you said if we have choice of dynamically pick the
    table names.. ETL might fail when you face below situation
    source x(3 columns)   destination y (4 columns) and there will be no mapping as it is dynamic. Sometimes mapping also fails even if the source and destination have same number of columns. If you still want to do... follow below steps:
    Create two variables:
    1.variable1 , datatype string
    2.variable datatype string  
    take one execute sql task, pick your source table names dynamically as you desired from metadata table \
    "SELECT sourcetblname as Res FROM @metadata WHERE ID=1" in sql statement and then go to name the result name as Res (I meant same as table alias) and map it to variablename1
    And in variable2 go to expression and write "Select * from "+@[User::variable].. and this will be your constructed dynamic command for oledb destination.
    And connect that execute sql task to (Data flow task)oledb source and choose data access mode as sql command with variable,and choose variable2. below is the diagram.
    - please mark correct answers

  • How to determine InfoCube name within the update rule start routine?

    We are attempting to delete all the records where all key figure values are zeroes. We have about 15% of such records and we really don't need them.
    We have yearly InfoCubes. We copy the InfoCube and update rules at the end of every year. So, we don't want to hard code any field names within the update rules.
    If I could determine the target InfoCube name within the update rule start routine, I can find out all the key figures dynamically. But, I don't see a way of finding out the InfoCube name.
    If you would share any ideas, I would really appreciate.
    Thanks.
    Sudhi Karkada.

    Hi Sudhi,
    I dont know if this is what you are looking for.
    if you want to delete a record from being inserted when all the Key figure values are ZERO then you can use a Update Routine for some characteristic in the below way
    If looking for the InfoCube:
    if COMM_STRUCTURE-KF1 = 0 and COMM_STRUCTURE-KF2 AND....
      RETURNCODE = 4.
    else
      RESULT = COMM_STRUCTURE-ChanracteristicObject.
    endif.
    If it is to an ODS / InfoCube in the start routine.
      DELETE DATAPACKAGE where KF1=0 and kf2=0 and .....
    Hope it helps.
    Regards,
    Praveen.
    ENDLOOP.
    Message was edited by: Praveen

  • How to Dynamically construct the conditional IF statement in java

    Is there a way to dynamically construct a conditional IF statement in java?
    For example:
    Suppose i have a 2D array like:
    Array[the actual values to search for][the column number in the table to perform the search on].
    e.g.
    Array {
                 {"x"} , {1},  
                 {"y"} , {2},  
                 {"z"} , {3},  
    }How can i construct the if statement like:
    Looping over table rows (tableRow) {
        Looping over array {
            IF ( {"x"}. equals( tableModel.getValueAt( tableRow, {1})   &&
                   {"y"}. equals( tableModel.getValueAt( tableRow, {2})   &&
                   {"z"}. equals( tableModel.getValueAt( tableRow, {3})  )              
            return true;
    }The array can grow or shrink based on the values in it so therefore IF statement will grow or shrink. How can i achieve it?
    If not then how can i achieve this?

    My understanding (feeble at best) is that a sieries of && elements will be evaluated in order until the first false value is encountered. So, in an "if a && b && c" statement where b is false c will never be evaluated and the conditional executable will not run. Is that what you mean?
    Yes, logical expressions will not evaluate unnecessary operands. So you can safely write the following, for instance, without getting an error,
    if ((anArray != null) && (anArray.length > 0)) { ... }because the second operand of the '&&' will never be evaluated if 'anArray' is null.
    Also, is there a difference between & and &&?
    & is a bitwise operator, && is a boolean operator.

  • Change Document Object ICDTXT_ include name

    Hi fellow developers.
    What is the purpose of each field in ICDTXT_<include name> when preparing to call the function F<include name>_WRITE_DOCUMENT? For example, I have an IT called ICDTXT_ZCD_CONFIG_CV and this is how I am filling the fields:
       UPD_ICDTXT_ZCD_CONFIG_CV = UPD_Z00_CONFIG_CV.
       wa_log_info-teilobjid = 'Producto'.
       wa_log_info-textart = ' '.
       wa_log_info-textspr = sy-langu.
       wa_log_info-updkz = UPD_Z00_CONFIG_CV.
       append wa_log_info to ICDTXT_ZCD_CONFIG_CV.
    I am not sure at all what to set in textart. And teilobjid is the table key as far as I know. But I want to be sure I am doing this correctly.
    Thank you for your time.

    Yes you must call the FM via the generated include in your update program, change document are programmatically managed. in the "SAVE" form use some CALL FUNCTION IN UPDATE TASK to call the FM that updates database and the FM that creates change documents - look at [Update Techniques|http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4cba79e11d1950f0000e82de14a/frameset.htm] and [BC414|http://www.sap.com/services/education]
    - without programming you can fill DBTABLOG via SE11 options
    - Also look at [Defining Change Document Objects|http://help.sap.com/SAPHELP_nwmobile71/helpdata/EN/2a/fa018f493111d182b70000e829fbfe/frameset.htm] and [Integrating the functionality into the program|http://help.sap.com/SAPHELP_nwmobile71/helpdata/EN/2a/fa01b6493111d182b70000e829fbfe/frameset.htm]
    Regards,
    Raymond

  • Allowable Characters in the file names within Oracle iFS

    What characters are allowable in file names within Oracle iFS?
    Are slashes (/ \) possible?
    Thanks,
    Sai Mummalaneni.

    Be carefull with file and directory names in iFS. You might be able to create folders and add document to it through the web interface that the windows explorer interface might not be able to interpret. Like a directory named '.'.
    Tamas Szecsy

  • How to find an EXIT with the Include name ?

    Hi everybody
    If i have an Include name (like ZXMLUU16) , how can i find the FM Exit or the program where this include is used ?
    (NOTE: If i use SE38 and 'Where used' option , this
           only tell me 'Include ZXMLUU16 not found in
           selected search area')
    Thanks
    Frank

    I don't think there is a way to find that out, particularly if the include is not yet created. Typical with function module user exits is that, even though you see the line INCLUDE ZXMLUU16 statement in the function module code, the include itself is not created yet. Only when you double click, you will be creating it and then your 'where-used' should work.
    You just have to go by a hunch based on the name itself. Unn is a typical naming convension used for function module includes. So, I will take a wild guess that this include is in a function module that is in the function group XMLU. So if you look at this program SAPLXMLU and do a 'Find' 'In main program', you will see that the statement is in EXIT_SAPLMLSP_030.

  • How to know Global zone name within Non-Global zone?

    Hi everybody.
    My answer is very simple: How can I (command or file) to know Global zone name within Non-Global zone? zoneadm command with all its options don�t work fine to me for this information. Thanks a lot for any idea with my question. Regards.

    Hi. Global Zone�s name is unknow for me from Non-Global zone. I don�t know it, but "Global" isn�t name neither hostname, is just Solaris 10 OS in my machine. However, your link was useful for me.
    Thanks a lot.

  • Dynamically changing the flatfile name..

    Hi friends,
    I 'm Getting data from 30 Flat files...all are with same structure but different data.. .. all these files are now in Application server...
    now i want to upload data into with a single DataSource and to ODS with process chains..
    so, how can i dynamically change the file name in Data Source level.. i saw previous threads.. in that.. through Routines.. we can solve this problem.. but I dont know ABAP code... so, can any one plz give me the exact code.. what i have to write...exact coding..
    <b>
           I already post this question in forums.... but evry one gave different options.. some  one gave the function module..
    BAPI_IPACK_CHANGE    and BAPI_IPACK_START.
      and some one gave  other function module.. like .. EPS_GET_DIRECTORY_LISTING
    i tryd for All these options.. but i'm not getting the exact solution... even i'm unable to pass the parameters also.. beacuse.. in that function what parameters can i pass....</b>
    can u plz suggest me the solution..
    Thanks
    Babu

    Hi  Friends,
      for the above requirement i had write the bellow coding in the routine.. it is working.. but the problem is.. it was loading  only  the last file..(30 th file  data only..)
    data : z1(50) type c,
             z2 type c,
             z3(50) type c,
             z4(50) type c.
             Z2 = 1.
       Do 5 times.
              z1 = 'C:\Documents and Settings\e10035\Desktop\'.
              z3 = '.csv'.
              concatenate z1 z2 z3 into z4.
              p_filename = z4.
              z2 = z2 + 1.
        Enddo.
    SO, CAN YOU PLZ SUGGEST ME.. when ever the file name was changing in the loop.. that automatically should load into the  PSA ..
    plz... plz.... help regarding this..
    Bbau

  • Dynamically Pass the Column Name cursor. || Dynamic Column Name

    Hi,
    I need to dynamically pass the column name based on a Mapping table in a loop ( Right now i have hardcoded stuff )just like using Execute immediate.... Inside the procedure, I have commented as where i hit the problem.
    Thanks for all of your time...
    Thanks
    Muthu
    CREATE OR REPLACE PROCEDURE xml_testing_clob AS
    doc xmldom.DOMDocument;
    main_node xmldom.DOMNode;
    root_node xmldom.DOMNode;
    user_node xmldom.DOMNode; item_node xmldom.DOMNode;
    root_elmt xmldom.DOMElement;
    item_elmt xmldom.DOMElement;
    item_text xmldom.DOMText;
    item_test xmldom.DOMText;
    nodelist xmldom.DOMNodeList;
    sub_variable varchar2(4000);
    x varchar2(200);
    y varchar2(200);
    sub_var varchar2(4000);
    CURSOR get_users IS
    SELECT FIRST_NAME,LAST_NAME,ROWNUM FROM USER_INFO_TBL WHERE WEIN_NUMBER = '1234' ;
    CURSOR get_cdisc_name IS
    select CTS_COL_NAME,CDISC_NAME from CTS2CDISC_DICTIONARY where CTS_TABLE_NAME = 'USER_INFO_TBL';
    BEGIN
    -- get document
    doc := xmldom.newDOMDocument;
    doc := xmldom.NewDomDocument;
    xmldom.setVersion(doc, '1.0');
    xmldom.setStandalone(doc, 'no');
    xmldom.setCharSet(doc, 'ISO-8859-1');
    -- create root element main_node := xmldom.makeNode(doc);
    root_elmt := xmldom.createElement(doc,'AdminData');
    root_node := xmldom.appendChild(main_node,xmldom.makeNode(root_elmt));
    FOR get_users_rec IN get_users LOOP
    item_elmt := xmldom.createElement(doc,'User');
    xmldom.setAttribute(item_elmt,'OID' , get_users_rec.rownum);
    user_node := xmldom.appendChild(root_node,xmldom.makeNode(item_elmt));
    FOR cv_get_cdisc_name IN get_cdisc_name LOOP
    EXIT WHEN get_cdisc_name%NOTFOUND;
    sub_var := cv_get_cdisc_name.cts_col_name;
    sub_variable := 'get_users_rec.';
    sub_variable := 'get_users_rec.'||cv_get_cdisc_name.cts_col_name;
    x := sub_variable;
    dbms_output.put_line(x); -------------- Here i just see the literal string
    y := get_users_rec.FIRST_NAME;
    dbms_output.put_line(y); -------------- Here i just see actual value ( data )
    item_elmt := xmldom.createElement(doc,cv_get_cdisc_name.cdisc_name);
    item_node := xmldom.appendChild(user_node,xmldom.makeNode(item_elmt));
    item_text := xmldom.createTextNode(doc,x ); ---- This is the place i am hitting with an error .
    If i use variable X then i am able to see only the literal
    string in the output. BUT if i put cursor name.coulmname,
    then the resumt (XML) is fine.I wanted acheive this
    dynamically just like execute Immediate
    item_node := xmldom.appendChild( item_node , xmldom.makeNode(item_text));
    END LOOP;
    END LOOP;
    -- write document to file using default character set from database
    xmldom.WRITETOCLOB(doc,);
    xmldom.writeToFile(doc, 'c:\ash\testing_out.xml');
    -- free resources
    xmldom.freeDocument(doc);
    END;
    +++++++++++++++++++++++++++++++++++ XML OUTPUT +++++++++++++++++++++++++++++++++++++++++
    <?xml version="1.0" ?>
    - <AdminData>
    - <User OID="1">
    <FirstName>get_users_rec.FIRST_NAME</FirstName>
    <LastName>get_users_rec.LAST_NAME</LastName> </User>
    - <User OID="2">
    <FirstName>get_users_rec.FIRST_NAME</FirstName>
    <LastName>get_users_rec.LAST_NAME</LastName>
    </User>
    - <User OID="3">
    <FirstName>get_users_rec.FIRST_NAME</FirstName>
    <LastName>get_users_rec.LAST_NAME</LastName>
    </User>
    - <User OID="4">
    <FirstName>get_users_rec.FIRST_NAME</FirstName>
    <LastName>get_users_rec.LAST_NAME</LastName>
    </User>
    - <User OID="5">
    <FirstName>get_users_rec.FIRST_NAME</FirstName>
    <LastName>get_users_rec.LAST_NAME</LastName>
    </User>
    ++++++++++++++++++++++++++++++++++++++++++++++++++++ MAPPING TABLE DETAILS +++++++++++++++++
    CTS_COL_NAME     CDISC_NAME     CTS_TABLE_NAME     XML_TAG     -----------> Column Name
    FIRST_NAME     FirstName     USER_INFO_TBL     Element     -----------> Records
    LAST_NAME     LastName     USER_INFO_TBL     Element     -----------> Records

    My scenario is little different, let me explain:
    My columns will remain same but values changes (based on column formula) according to the selected prompt value
    If I select 'Oct' from prompt then
    Curr will contain data for 'Oct' only
    Next1 will contain data for 'Nov' only
    Next2 will contain data for 'Dec' only
    Next3 will contain data for 'Jan' of next year only.
    Later if I select 'Jul' from prompt then
    Curr will contain data for 'Jul' only
    Next1 will contain data for 'Aug' only
    Next2 will contain data for 'Sep' only
    Next3 will contain data for 'Oct' only.
    I don't have different columns for each months but the columns are capable to reflect data for any month.
    So, how can I reflect the column name as month name for which that contains data.
    Regards,
    S Anand

Maybe you are looking for

  • Hide row in planning book

    Hi experts, I have the following requirement in DP planning book. the planning book has 3 KF (KF1, KF2 & KF3) and 2 characteristics (CHAR1 & CHAR2).  Now for KF1 I need to display drill down for all the values in CHAR1 and then to all the values in C

  • In product order costing what is the role of CO consultant

    Dear Sir, Pl explain in detail about product order costing from creation to settlement in CO. I am confused what a CO consultant should do. Moderator: help.sap.com

  • Simple linkchecker in jsp

    Thanks in advance, Hello, in order to build a simple jsp, that enables to check links, i tried to modificate the class "GetURLInfo". The idea is simply reading out the http-header, and print out the Response Message and Code. Unfortunately i dont kno

  • How to hide the command line arguments from solaris process

    Hi All, When I execute a JAR application from a java file using the Runtime.getRuntime, the command line arguments (user ID and Password details) which I passed for executing the application displayed on Solaris process (ps -ef). Could anybody please

  • DATABASE  REFRESH ACTVITY FROM EP PRD TO QAS

    Hi Experts, I am planning to db refresh from PRD to QAS on Enterprise portal systems.My environment is Windows/DB2/Unicode/SR2. Is db refresh process is same for ECC and EP or diifer? please provide me information for db fresh and is quite urgnet....