Variables in Script

Iam new to script can any one tell me the meaning of
&GF_CP_TOTAL_TXBAS(R)& ,,&GF_CP_TOTAL_TXBTR(R)&
here in brackets they used R what does it mean.
Thanks in advance,
RRK.
Edited by: Alvaro Tejada Galindo on Feb 6, 2008 4:55 PM

Hi Ravi,
these are the formatting options available in scripts :
&SYMBOL&      --No formatting
&SYMBOL+4&  --Offset - Output begins here. Offset refers to formatted value
&SYMBOL(5)&  --Length - Output data in the specified length
&SYMBOL(I)&  --Suppress initial value - If the field has been initialized, nothing is output
&SYMBOL(Z)&  --Suppress leading zeros
&SYMBOL(C)&  --Compress blank spaces - Consecutive spaces are compressed into a single space. Leading spaces are suppressed.
&SYMBOL(R)&  --Right align output
&SYMBOL(S)&  --Operators are suppressed
&SYMBOL(*)&   --Dictionary length - The data length is defined by the ABAP dictionary
&SYMBOL(8.2)&  --Decimal format. Length 8 decimals 2
&'text1'SYMBOL'text2'&  --Text can be inserted before and after the symbol
thanks,
satheesh

Similar Messages

  • Doubt in printing variables in script

    Hi Experts,
    I am having small doubt.
    1).I need to write one condition for sales org 'US11' and divisions '20' or '40'. So the below logic is correct or not.
    if vbdkr-vkorg = 'US11' and and vbdkr-vtweg = '20' or vbdkr-vtweg = '40'.
    select........
    endif.
    2). i need th print these variables in script. can i use the logic like this.
    if &vbdkr-vkorg& = 'US11' and and &vbdkr-vtweg& = '20' or &vbdkr-vtweg& = '40'.
    &zkbetr1/ zpery1&
    else.
    &zkbetr/ zpery& (This is for sales org other than US11)
    endif.
    Thanks & Regards,
    Ramana.

    Hi,
    I think your condition would be more apt if you code this way:
    IF vbdkr-vkorg EQ 'US11' AND ( vbdkr-vtweg EQ '20' OR vbdkr-vtweg EQ '40' ).
    ENDIF.
    Also, look at putting the code into a subroutine called from your driver or subroutine program and then returning the value. The "logic" for determining the value to be printed can then be performed within the subroutine rather than the SAP script.
    Cheers,
    Aditya

  • How to access system variables in Script Component in data flow task in SSIS

    Hi,
    I am new to SSIS. Can someone tell me how to access system variable in Script Component in SSIS using C# code.
    Thanks

    You can use the System.Environment.GetEnvironmentVariable(...) to read the variables. An example is here:
    http://msdn.microsoft.com/en-us/library/y6k3c7b0.aspx
    Vikash Kumar Singh || www.singhvikash.in

  • Assigning value to a variable in Script Component.

    I'm pretty new to SSIS development and need to figure out a problem with assigning a value to a user defined variable. I created a pretty simple package. It reads a flat file, extracts date from a header record and subsequently uses derived column component
    to reformat data to the desired output format. One of the columns (FileRunDate,
    string, length 8) in the derived component is defined as a string and in the expression I'm assigning it to a variable I set earlier in the script component -
    @[User::vRunTimeDate]. When the process runs, the output file gets generated, however FileRunDate reflects
    originally set varible's value. It seems that the variable assignment in the script task does not work, even though in the debug mode, I do see how the value is being set. The variable has an attribute of ReadWrite. Is it due to the fact that the value is
    being set in the same workflow?
    Any feedback is greatly appriciated.

    Unfortunately I'm unable to add a screenshot of the process, for some reason I get an error message when I try to do that. In a nutshell the entire workflow consist of flat file source component, following by a script component (this is where I read and
    assign the variable) 
        public override void PostExecute()
            IDTSVariables100 vars;
            base.PostExecute();
            // Set run date
            if (strRunDate != null)
                VariableDispenser variableDispenser = (VariableDispenser)this.VariableDispenser;
                variableDispenser.LockForWrite("User::vRunTimeDate");
                variableDispenser.GetVariables(out vars);
                // Set the variable
                vars["User::vRunTimeDate"].Value = strRunDate;
                //Unlock the variable 
                vars.Unlock();
                //Variables.vRunTimeDate = strRunDate;
    then goes conditional split ( filtering out unwanted records), which is connected to a derived column component (this is where one of the columns get assigned a variable's value), one more script component (this where I identify
    specific data element and do a replace command) and finally flat file destination.
    BTW, the article in the provided URL clearly states that variable won't reflect assigned value till the entire workflow has finished. If that's the case, then I think I know my
    answer. Is there is such a thing as putting execution of different steps in a different step, so anything executed subsequently will see that value?

  • Using variables in script logic.

    Hi,
    I still haven't figured out how to assign a userdefined variable in a script.
    My case is that I in my script commits data several times, after every commit I need to do a new *XDIM_MEMBERSET. Every time the *xdim_memberset is exactly the same.
    Example - what I do now.
    *XDIM_MEMBERSET ACCOUNT="REVENUE"
    *XDIM_MEMBERSET VERSION="90"
    *rec
    *commit
    *XDIM_MEMBERSET ACCOUNT="REVENUE"
    *XDIM_MEMBERSET VERSION="90"
    *rec
    *commit
    Etc.
    It would be much easier, if I the beginning of each script for Account and Version defined a variable, and then having every *xdim_memberset use the variable. Then I only need to change the definition of the variable in the beginning of each script.
    Example - what I want to achieve.
    //Definition of constant variables.
    %ACCOUNT_VARIABLE%= "ACCOUNT = REVENUE"
    %VERSION__VARIABLE% = "VERSION=90"
    *XDIM_MEMBERSET %ACCOUNT_VARIABLE%
    *XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
    *rec
    *commit
    *XDIM_MEMBERSET %ACCOUNT_VARIABLE%
    +*XDIM_MEMBERSET VERSION=%VERSION__VARIABLE%
    *rec
    *commit
    I've looked at the *SELECT and *MEMBERSET - but can't really get the syntax to work.....
    Thank you,
    Joergen
    Edited by: Jørgen Dalby Andersen on Dec 30, 2011 7:58 AM

    Hi,
    when I use *XDIM_MEMBERSET ACCOUNT AS %TEST% = BAS(REVENUE) - it work fine.
    BUT ! after my first commit, it seems like the variable value is lost. And the *Xdim_memberset takes all.....
    Fortunately enough, *select still contains the variable value after *commit.
    Thanks,
    Joergen
    *Correction !
    It actually works, it still contains the variable value after commit !!
    Edited by: Jørgen Dalby Andersen on Dec 30, 2011 1:33 PM

  • Variable in  script logic

    Follow is the script code from previous post
    *XDIM_MEMBERSET ACCOUNT = ACC1
    *FOR %My_Var% = %ENTITY_DIM%
    *WHEN ENTITY
    *IS *
    *REC(EXPRESSION = (GET (ENTITY = %My_Var%.PROP1)), ENTITY = %My_Var%)
    *ENDWHEN
    *NEXT
    I understand that  both %My_Var% and %ENTITY_DIM% are variables, my question is how %My_Var% and %ENTITY_DIM% get the value during the process of the code, do we neeed to define the variable some where else before we use them? I remeber in FOX, we need to define the variable before we can use it.
    also is there a difference if I use $My_Var$ to replace %My_Var%?

    nilanjan,
    Thanks for the explanation,I have another question regarding to the variables.
    I need to get the YTD salary. in BPS the pseudocode code is as following:
    data YTD_salary type amount
    loop at each_month,
       YTD-Salary =  YTD-Salary  + current_month.
       if the  YTD-Salary  > FICA CAP.
       exit.
    Endloop
    How can we archive the same in BPC script logic with a variable to capture the YTD-Salary and pass it to next month?

  • Variable in script not printing

    Hi guys,
    I have form and driver program. while debugging in the driver program I can see the values of the fields, but in the script debugger I can not. Please have a look at my coding. Please correct me if I was wrong.
    SELECT SINGLE ktext
        FROM crtx
        INTO gv_ktext
        WHERE objid EQ iviqmel-arbpl. " value is there for GV_KTEXT which is global
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          device                      = 'PRINTER'
          form                        = 'ZPMF_PMOR'
          dialog                      = space
          language                    = 'E'
          OPTIONS                     = gs_itcpo. " ....
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'HEADER'
          window  = 'MAIN'.   " But not appearing in output
      " Closing forms and other coding here
      /E HEADER
      P1 Category: &GV_KTEXT& " In script, I am printing like this

    Hi Anil,
    Appreciate your reply.
    Here, I declared the variable globally in the print program and I am using only one client for development and testing.
    Here is my declaration part.
    DATA: gs_itcpo TYPE itcpo,
          gv_qmartx TYPE tq80_t-qmartx,
          gv_ktext  TYPE crtx-ktext.

  • Update and Write Back DataTable in Object Variable Using Script Component

    Hi All..
    I'm trying to update an Object Type Variable [ReadWrite] with a Data Flow Task Script Component. Variable is already holding a record set with Column(s) like, ID, Name, IsProcessed.
    Now in my Data Flow Script Component, I'm trying to 1st) Fill a DataTable with my variables value then 2nd) Loop through each Input Rows in Data Flow Component and accordingly if there is a match of ID then updating IsProcessed Column in DataTable. 3rd &Finally,
    Copy datatable back to Object Type Variable.
    Below is the code used and just for your ref. I tried Printing content of whole DataTable after Update. This looks perfect but not sure why my variable is able to capture it.
    using System;
    using System.Data;
    using System.Data.OleDb;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Text;
    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    DataTable dt = new DataTable();
    OleDbDataAdapter adapter = new OleDbDataAdapter();
    List<string> listriuid = new List<string>();
    public override void PreExecute()
    base.PreExecute();
    public override void PostExecute()
    base.PostExecute();
    adapter.Fill(dt, this.Variables.varobjChildPackageLog);
    dt.AcceptChanges();
    foreach (DataRow row in dt.Rows)
    if (listriuid.Contains(row["ID"].ToString()))
    row["IsProcessed"] = "Y";
    // Just to see the Final Data Table Output
    //StringBuilder b = new StringBuilder();
    //foreach (System.Data.DataRow r in dt.Rows)
    // foreach (DataColumn c in dt.Columns)
    // b.Append(c.ColumnName.ToString() + ":" + r[c.ColumnName].ToString());
    //MessageBox.Show(b.ToString());
    this.Variables.varobjChildPackageLog = dt;
    dt.Dispose();
    adapter.Dispose();
    public override void RIUIDInput_ProcessInputRow(RIUIDInputBuffer Row)
    try
    listriuid.Add(Row.ID.ToString());
    catch (Exception ex)
    MessageBox.Show(ex.Message.ToString());
    Regards, Avik M.

    why do you need to do this in script task.
    This is just a matter of using lookup task while you retrive data from source itself to find the matches and use a derived column transform to check and set appropriate value for IsProcessed column. The object variable itself is not required and you dont
    even require a looping statement either!
    If both source and lookup tables are in same server then you can just wrap them inside source sql query itself to do matching and retrieve the value for IsProcessed within select statement itself in OLEDB Source inside data flow.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Session variable and script error

    Hello;
    I am still writting this script that turns a bg sound on and
    aff for the whole site to remember. I have a good start on this
    code, but I am running into issues.
    1. I am trying to use a checkbox to make the selection, and
    when it is clicked, it will function without using a submit button,
    the java script I am using isn't doing the job allowing the
    checkbox to act as a link so to speak.
    2. I need to make this script into a session variable. So
    that when the decision is made, the site will remember it.
    3. there might be a problem in my IF statement.
    Can someone please help me out? I am attaching the code. It
    is using a DB that has a yes/no box in the table this sound code is
    accessing.
    Thank you.
    Phoenix

    A Quess...
    Remove the OnClick in the form
    <form onClick="category.submit();">
    Place it in the input type?
    <input type="checkbox"
    onClick="category.submit();">

  • Use of Variable in Script Logic

    Dear All,
    We are working on a BPC Script Logic involving depreciation calculation, which calls an implementation of the BAdI BADI_UJ_CUSTOM_LOGIC. We are passing some parameters from the script logic to the BAdI. There are two parameters to be passed: an account number (Account in which the posting will happen), and the rate (rate with which depreciation will be affected). The parameters are stored in the Dimension member of the account dimension and need to be fetched from there. We are using the following piece of code to achieve this:
    *INCLUDE FUNCTIONS.LGF
    [#PERC] = PRO([%ACCOUNT_DIM%].CURRENTMEMBER,DEP_PERCENTAGE)
    [#DEPACCOUNT] = PRO([%ACCOUNT_DIM%].CURRENTMEMBER,DEP_ACCT)
    *START_BADI DEPR
    QUERY = ON
    WRITE = ON
    DEPACCT = [#DEPACCOUNT]
    PERCENTAGE = [#PERC]
    *END_BADI
    Here, FUCNTIONS.LGF contains the PRO function, which fetches the account and percentage properties from the account dimension member. Problem is, when we refer to the temporary variables within our code using the variables [#DEPACCOUNT] and [#PERC], we encounter a short dump for CX_SY_CONVERSION_NO_NUMBER. We suspect that instead of passing the parameter values, the logic is passing the variable name as the value. How do we rectify this? What is the correct syntax for passing such a parameter to the BAdI? Any ideas?
    Thanks in Advance,
    Sid

    Hi Ethan,
    Thanks for the answer. Unfortunately, even after trying out your solution with K2 variables, we are getting the same dump, this time the log says:
    An exception with the type CX_SY_CONVERSION_NO_NUMBER occurred, but was neither handled locally, nor declared in a raising clause
    The argument '%PERC%' cannot be interpreted as a number
    We are starting to think that maybe only substitution variables can be passed as parameter to the BAdI call, because whenever we use a local variable, we end up in passing the variable name to the BAdI, and not the variable value. We digged through the SAP Help, following is the excerpt from there:
    Run the following instruction to call custom ABAP programs: where filter_value_of_your_BADI_implementation is the name of the filter you provided during the BADI implementation of UJ_CUSTOM_LOGIC BADI.
    *START_BADI <filter_value_of_your_BADI_implementation>
    <key1> = <value1>
    <key2> = <value2>
    *END_BADI
    where filter_value_of_your_BADI_implementation is the name of the filter you provided during the BADI implementation of UJ_CUSTOM_LOGIC BADI.
    Does this mean we can only pass <key>:<value> pairs, and not <key>:<variable> pairs? Is there any instance / documentation which points to this (or the contrary)?
    Awaiting answers.
    Thanks and Regards,
    Sid

  • Add variable to script

    I have a script that will be animating 5 different movieclips
    those will have the names:
    klok1, klok2, klok3, klok4, klok5
    and i have a function called "roteren" which will animate klok1
    to animate the others, i will have to copy paste that long script 5 times, once for each movieclip
    isnt there a way to somehow add a variable to the script?
    like this:
    mc_klok("kloknr").rotation = mc_klok("kloknr").rotation + snelheid;
    where ("kloknr") would be the variable inserted after the name, so it could say: mc_klok1.rotation or mc_klok2.rotation or mc_klok3.rotation etc.
    how can this be done?

    yeah, but when i change that this[blabla] to mc_klok1 again, it all works just fine...
    this is driving me crazy :/
    let me just post the whole script:
    stage.addEventListener(Event.ENTER_FRAME, roteren);
    mc_klok1.addEventListener(MouseEvent.CLICK, klok1klik);
    mc_klok2.addEventListener(MouseEvent.CLICK, klok2klik);
    mc_klok3.addEventListener(MouseEvent.CLICK, klok3klik);
    var geklikt;
    var kloknr;
    var snelheid = 10;
    var draai = 0;
    var klok1_klaar = 1;
    var geluid1:geluid_klok1= new geluid_klok1(); //geluid van klok1
    var geluid2:geluid_klok2= new geluid_klok2();
    var geluid3:geluid_klok3= new geluid_klok3();
    //Klikken op klok -> roteren toestaan, en zorgen dat die kan draaien
    function klok1klik (evt:MouseEvent) {
        kloknr = 1; draai = 0;
        if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
            geluid1.play();    }
        geklikt = 1; roteren(null);
    function klok2klik (evt:MouseEvent) {
        kloknr = 2; draai = 0;
        if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
            geluid2.play(); }
        geklikt = 1; roteren(null);
    function klok3klik (evt:MouseEvent) {
        kloknr = 3; draai = 0;
        if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
            geluid3.play(); }
        geklikt = 1; roteren(null);
    function klok4klik (evt:MouseEvent) {
        kloknr = 4; draai = 0;
        if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
            geluid2.play(); }
        geklikt = 1; roteren(null);
    function klok5klik (evt:MouseEvent) {
        kloknr = 5; draai = 0;
        if (geklikt == 0){ //alleen geluid spelen als de bel niet beweegt
            geluid3.play(); }
        geklikt = 1; roteren(null);
    //Checken of er geklikt is, en dan laten draaien
    function roteren (evt:Event) {
        trace(kloknr,this["mc_klok"+1],this["mc_klok"+kloknr],mc_klok1);
        if (geklikt == 1) {
        if (draai < 2) { //Alleen  als er niet al op en neer is gegaan
    //    mc_klok1.rotation = mc_klok1.rotation + snelheid;
        this["mc_klok"+kloknr].rotation = ["mc_klok"+kloknr].rotation + snelheid;
        if (mc_klok1.rotation > 45) {
            snelheid *= -1;
        if (mc_klok1.rotation <-45) {
            snelheid *= -1;
        if (mc_klok1.rotation == 0) {
            draai = draai+1;
        if (draai == 2) { //Na op en neer gaan zorgen dat het opnieuw kan
            geklikt = 0;

  • What is command to format variables in script layout?

    Hi all,
    Can anybody let me know, What is the command we use to format the varialbles in script layouts?
    like if i want to delete leading or trailing spaces(condence) from a variable in the layout, there are some command like (c) for condence
    But, i dont remember how to use it exactly. Can anybody help me on this?
    thanks

    Space Compression
    The symbol value is viewed as a sequence of u2018wordsu2019, each separated from the next by either one or a string of space characters. The C option has the effect of replacing each string of space characters with a single space and shifting the u2018wordsu2019 to the left as necessary to close up the gaps. Leading spaces are completely removed. The results are the same as those of the ABAP command CONDENSE.
    Syntax:
    &symbol(C)&
    Assuming ' Albert Einstein ' is the symbol value,
    &symbol& -> Albert Einstein
    &symbol(C)& -> Albert Einstein
    Regards,
    Joy.

  • Applescript "go to" command or pull variables from script?

    Is there a "go to line" command in Applescript?  I want to be able to create a dialog box to jump back to the previous box if a mistake was made.  I don't want to do a repeat because that will cause multipule chained repeats and it won't work.  I tried creating seperate scripts and that works fine for jumping around within the program.  But the variables get lost when a new script is ran.  is there a way to bring variables from other scripts into one script?

    This is what I have right now.  as you can see there are 3 variables that carry the needed info.  U
    ltimatley I'd like to have about 8 variables, all with different info. 
    I can do a repeat for each one until something is entered, but I cant do a back command for each entry. 
    That's the purpose for the "run 'script'" line in each section.  I'd have to do a repeat inside of a repeat and then overlapping repeats. 
    It won't let me do overlapping repeats.  what's the solution?
    run script fn
    script fn
              set first_name to ""
              set fName to display dialog "first name" default answer "" buttons {"cancel", "next"} default button "next"
              set first_name to text returned of fName
              if first_name = "" then
      run fn
              end if
    end script
    -- Last Name
    run script ln
    script ln
              set last_name to ""
              set lName to display dialog "last name" default answer "" buttons {"back", "cancel", "next"} default button "next"
              if button returned of lName = "next" then
                        set last_name to text returned of lName
              else if button returned of lName = "back" then
      run fn
              end if
              if last_name = "" then
                        run ln
              end if
    end script
    -- street number
    run script sn
    script sn
              set s_num to ""
              set sNum to display dialog "street number" default answer "" buttons {"back", "cancel", "next"} default button "next"
              if button returned of sNum = "next" then
                        set s_num to text returned of sNum
              else if button returned of sNum = "back" then
                        run ln
              end if
              if s_num = "" then
                        run sn
              end if
    end script
    -- ready steady write!
    display dialog first_name & last_name & s_num

  • Local variable in script/MDX logic

    Is it possible to define a local variable which will hold a calculated value temporarily to be used later in the program?

    Hello,
    no, it's not possible to use such kind of variables in BPC for NW script logic.
    Hope this info will help u,
    Dzmitry

  • LMS 3.1 Syslog Automated Action - How to pass variables to script?

    I would like to pass variables to a windows bat file for processing.  The help seems to suggest that there are 2 available, device and message.  I would like to know how to reference them and what syntax to use to pass them to the batch file.  Are Facility, Sub-facility, Severity, Mnemonic and Description also availble? If so, how would they be referenced?  Thanks in advance.

    The syntax for referencing these variables is discussed in the online help.  Essentially, you'll want to use %~1 and %~2 in your batch script to get the device and message respectively.  The message will be the full message, so you will need to do additional processing on that to extract the facility, severity, and mnemonic.

  • Pass package variable to script logic

    Hi expert,
    I have creted a variable in a Package with the statement
    PROMPT(TEXT,%PERCE%,"Revaluation rate",,"")
    the variable appears and properly stores a value.
    However, what statement can be used to pass it to the sript logic?
    I tried 'TASK(Execute formulas,REPLACEPARAM,PERCE%EQU%%PERCE%) but it's somehow wrong.
    Please..any help?
    Thanks,
    Alberto Sabate

    Jeffrey,
    Thanks for your answer.
    I am aware that within the script logic I have to use a variable between $ signs. So $PERCE$ is exactly what I had in my script logic.
    However in order to get a value there we have to enter a command into the dstx file to actually send the value enter by the user into the script logic.
    In the Package I have:
    PROMPT(TEXT,%PERCE%,"Revaluation rate",,"")
    TASK(RUNLOGIC,FORMULASCRIPT,"*FUNCTION PER=%PERCE%")
    In the script I have
    *WHEN *
    IS
    *REC(FACTOR=PER.INPUT)
    *ENDWHEN
    I have also tried $PERCE$ instead of PER.INPUT, but no luck either.
    Still I'm not able to get the variable %PERCE% into the formula. Why?
    Thanks
    Alberto

Maybe you are looking for