Variable based on attributes of another variable (using Exit & CMOD)

Hello,
Another coding question (while I get the previous one to work!)
I have a query with amongst others, 2 variables.
one is a require year variable in the query only ZREQYEAR
another is a module ZMODULE
ZMODULE have two attributes
   Year of start ZYEAR_START
   Year of end ZYEAR_END
I need to write a enhancement in CMOD which does the following.
When the query runs, it asks the user for a year (ZREQYEAR), lets say they those 2010 for this example.
Based on this, the enhancement needs to populate the variable for ZMODULE with entries where
ZMODULE-ZYEAR_START = 2010
OR
ZMODULE-ZYEAREND = 2010
and then display the query for just these modules.
is this possible? if you can think of  better way then I am open!
I am very new to CMOD and ABAP so please keep any responses in baby language!  THANKS!!

Hi,
You can follow the below given steps,
1) You will have to do all the coding in enhancement RSR00001, for using this enhancement you will have to create a project in CMOD transaction and do the coding in the available EXIT.
2) Inside the EXIT write your code for customer exit variable created on ZMODULE (You will have to create a customer exit variable on ZMODULE infoobject).
3) In the exit use your variable name for doing coding,
When "ZMODULE_VARIABLE".
  IF I_STEP = 2.
    Loop at i_t_var_range into wa_var_range where vname = "ZREQYEAR_VARNAME".
    wa_data-sign = 'I'.
    wa_data-option = 'EQ'.
    wa_data-low = wa_var_range-low.
    append wa_data to e_t_data.
    EXIT.
    endloop.
    Endif.
The value of ZREQYEAR is assigned to variable created on module. You can use following document for reference,
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d]
Regards,
Durgesh.

Similar Messages

  • Assigning stroke attribute from one shape to fill attribute of another shape using eyedropper tool?

    Unalbe to use eyedropper tool to pick up stroke attribute from one shape to use in fill of another shape. I shift click with my eyedropper tool on stroke but does not transfer that color to my fill color of other shape. Fill color shows correctly in tools panel but not in shape or control panel.

    I have through trial and error discovered as a fifth step to JamArtz instructions, if I go to the color panel flyout menu and click on CMYK, my effect will take effect: I know this to be a band aide solution not a fix. Can’t see anything in my preferences to cause the issue.
    1.Select the destination object (the one for which you want to change the fill).
    2. Make the fill swatch in the Color Panel active (important step).
    3. Select the eyedropper.
    4. Shift-click on the stroke of the source object (the one whose stroke you want to apply to the fill of the destination object).
    5. From the Color Panel fly out menu, click on CMYK (which is already toggled on) the change will take effect.

  • MDS Filter entity based on attribute from another domain

    Hi,
    I hope you could provide me with a solution to my problem. I have an entity (A), in which I use domain based attribute. The second entity (B) has several attributes. My problem is that, I would like to filter the first entity (A) based on an attribute that
    belongs to the second entity. The only way I can filter it (in MDS Excel add-in or Explorer) is by using Code or Name from the second entity.
    I have in mind a couple of solutions, but they require some coding with xml saved query from Excel.
    Is there out of a box solution that comes with MDS? 

    Hi,
    There is no out of box solution for the scenario you described. The MDS filtering is on single entity and to be precisely, the filtering to a select statement on view viw_SYSTEM_x_y_CHILDATTRIBUTES.
    So filter would only work on Name and Code attribute.
    One possible solution is create a business rule dependent on Domain attribute and copy the other DBA attribute value to current entity.
    For example,
    Entity A, Attribute A1 refer Entity B, And Entity B has Attribute B1.
    Then you can create attribute A2 on Entity A1 and setup a business rule to copy B.B1 to A.A2 when A.A1 changed.
    And can you show how dynamic xml query looks like?

  • Update one table based on condition from another table using date ranges

    Hello!
    I have two tables:
    DateRange (consists of ranges of dates):
    StartDate            FinishDate
            Condition
    2014-01-02
          2014-01-03           true
    2014-01-03     
     2014-01-13          
    false
    2014-01-13      
    2014-01-14           true
    Calendar (consists of three-year dates):
    CalendarDate    IsParental
    2014-01-01
    2014-01-02
    2014-01-03
    2014-01-04
    2014-01-05
    2014-01-06
    2014-01-07
    2014-01-08
    2014-01-09
    2014-01-10
    I want to update table Calendar by setting  IsParental=1
      for those dates that are contained in table DateRange between
    StartDate and FinishDate AND Condition  IS TRUE.
    The query without loop should look similar to this but it works wrong:
    UPDATE
    Calendar
    SET IsParental = 1
     WHERE
    CalendarDate   BETWEEN
    (SELECT
    StartDate 
    FROM  DateRange
    WHERE Calendar.  CalendarDate   = DateRange. StartDate
               AND   
    (SELECT StartDate 
    FROM  DateRange
    WHERE Calendar.  CalendarDate   = DateRange. FinishDate
    AND Condition
     IS TRUE
    Is it possible to do without loop? Thank you for help!
    Anastasia

    Hi
    Please post DDL+DML next time :-)
    -- This is the DDL! create the database structure
    create table DateRange(
    StartDate DATE,
    FinishDate DATE,
    Condition BIT
    GO
    create table Calendar(
    CalendarDate DATE,
    IsParental BIT
    GO
    -- This is the DML (insert some sample data)
    insert DateRange
    values
    ('2014-01-02', '2014-01-03', 1),
    ('2014-01-03', '2014-01-13', 0),
    ('2014-01-13', '2014-01-14', 1)
    GO
    insert Calendar(CalendarDate)
    values
    ('2014-01-01'),
    ('2014-01-02'),
    ('2014-01-03'),
    ('2014-01-04'),
    ('2014-01-05'),
    ('2014-01-06'),
    ('2014-01-07'),
    ('2014-01-08'),
    ('2014-01-09'),
    ('2014-01-10')
    select * from DateRange
    select * from Calendar
    GO
    -- This is the solution
    select CalendarDate
    from Calendar C
    where EXISTS (
    select C.CalendarDate
    FROM DateRange D
    where C.CalendarDate between D.StartDate and D.FinishDate and D.Condition = 1
    UPDATE Calendar
    SET IsParental = 1
    from Calendar C
    where EXISTS (
    select C.CalendarDate
    FROM DateRange D
    where C.CalendarDate between D.StartDate and D.FinishDate and D.Condition = 1
    [Personal Site] [Blog] [Facebook]

  • Using a variables value as the name of another variable

    Hi, i'm new to java and i've been trying to write a little program. I was wondering whether it is possible to use the value of a variable as the name of another variable.
    This is what i have so far: When i run my java program numerous Animal objects are created with names like ani01, ani02, ani03. These objects have functions like getName() etc. When i type in one of these codes into the command line it gets stored in a variable called 'input'. Everything's fine up to here.
    But i need a way to access the correct Animal from my input. instead of doing countless switch statements on the input.
    If i type "ani02" i want it to return the animals name by calling ani02.getName()...
    how do i do this? i'd appreciate any help. thanks.

    If you were doing this based on user input, then you
    wouldn't have to do a lot of typing. Mmm?I'm sorry i don't get your meaning... ? I am doing this based on user input am i not?
    All i want to do is access the correct Animal object depending on the user's input... so if they type in ani01 it would return 'Elephant' (or whatever) using ani01.getName().
    Maybe i'm going about this the wrong way or something?.. I have about 30 animals. they each have a name, continent, quantity. I have an Animal class that has functions like getName(), setName() etc. When the program starts, 30 objects are created
    Animal ani01 = new Animal("Elephant",3000,"India");
    Animal ani02 = new Animal("Panda",200,"China");etc...
    I want to be able to get information about any one of these animals by typing something at the command line...
    so i type in something (i just thought the name of the object would be the best thing to type in) and i get the info about elephants (or whatever) from the relevant object.
    how would you do this?

  • Restrict variable values based on another variable in the bex query...

    I am struggling to restrict the variable values from other varaible in the selection criteria. I have a variable which restricts he organisation(0ORGUNIT) and another to restrict employees.
    When the user selects any organisation unit form the hierarchy, I want only those employees related to that organsation in the varaible selection options.
    Is there any way I can make a variable values dependant on the another variable value in variable selection screen?
    Thanks,
    Your help in this matter will be much appreciated.
    Edited by: Kthapa on Nov 25, 2010 11:08 PM

    Hi Kthapa,
    Did u try using cmod?
    i_step = 1? Used to provide default values for the selection screen variables and
    i_step = 2 for filling up the variables after selection screen.
    Try using based on ur requirement.
    Hope this helps. Revert back for any queries.

  • Using a variable inside another variable

    I'm trying to use one two variable in a package with one variable feeding its value to another variable as follows:
    Variable 1 = Count
    Variable 2 = File_Name
    Variable 1 counts up from 1;I would like to use this value as an input to Variable 2 as follows:
    SELECT LOAD_FILENAME FROM DIMSTATS_FILENAME WHERE (SELECT ROW_NUMBER() OVER (Order by FILE_ID) AS RN FROM DIMSTATS_FILENAME) = #DIMSTATS_TEST.count.
    How ever I am getting the following Error :
    +ODI-1228: Task File_Name (Variable) fails on the target  connection DDBSTAGE.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]The multi-part identifier "#DIMSTATS_TEST.count" could not be bound.+
    I have also noticed that the value of Variable 1 is not being passed to the Select statement above through SQLServer Profiler. If I hard-code the value of #DIMSTATS_TEST.count (Variable1) the query is successful.
    How can I get the value of Variable 1 to be passed to Variable 2?
    Could someone please help
    Thanks

    You did not mentioned how you are using those variable .
    You need to have these variable inside a package .
    It will be like
    Variable 1 (Refresh) -------OK-------->Variable 2(Refresh) ------------OK-----> Some other operation .
    Thanks,
    Sutirtha

  • Assigning variable value to another variable

    I want to assign value from one variable with type DATETIME to another variable which has type STRING.
    E.G: I need to convert this variable P_CreatedDate of type DATETIME to STRING variable CreatedDate.
    Can someone help me in C# script. Im using SSIS script task.
    Thanks in advance.
    ZK

    I have a requirement where I need to convert following datetime variable value into the string vaiable format.
    Here is the example: 
    7/23/2014 11:24 PM
    I need above datetime to be converted into following string format
    2014-01-01 03:15:01.470
    yyyyMMdd HHmmssFFF
    Thanks in advance.
    ZK

  • Use-exit to update

    Hi
    I seek another to use-exit to update the zone kna1-bahns.
    gv_n = 0.
      IF i_kna1-bahns IS NOT INITIAL .
      ELSE.
        gv_bahns = i_kna1-name1+0(4).
       DO gv_n TIMES.
          gv_n = gv_n + 1.
          SELECT SINGLE kunnr FROM kna1 INTO kna1-kunnr
            WHERE kunnr <> i_kna1-kunnr
            AND   bahns = gv_bahns.
          IF sy-subrc <> 0.
            i_kna1-bahns = gv_bahns.
          ELSE.
            CLEAR gv_bahns.
            CONCATENATE i_kna1-name1+0(3) gv_n into gv_bahns.
            SELECT SINGLE kunnr FROM kna1 INTO kna1-kunnr
            WHERE kunnr <> i_kna1-kunnr
            AND   bahns = gv_bahns.
          ENDIF.
       ENDDO.
      ENDIF.
    ENDIF.
    THANKS

    Apps crashing
    See:
    iOS: Troubleshooting applications purchased from the App Store
    Restore from backup. See:
    iOS: How to back up              
    Restore to factory settings/new iPod

  • To use two presentation variables based on the period selection in OBIEE

    Dear All,
    I have period prompt in my report, based on the period prompt selection in my report I need to get the start and end dates of the period and apply in the report filter.
    For e.g. Period Name selected in the prompt is "2010 - Q1" (For this Period, Period Start Date = 01/01/2010 and Period End Date is 30/03/2010, which is not going to be displayed in the prompts).
    How can I get the start and end dates of the period into my report filter. I tried using the presentation variable for the period name, but unable to resolve the requirement.
    Your help is highly appreciated.
    Best Regards,
    Rajesh

    Hi Rajesh,
    Create a report A which will give you the period start date and end date and filter it using the period prompt.
    Then filter the main report using the report A start date and end date, using Filter -> Advanced ->Filter based on results of another request .
    Add the report A in separate section on the dashboard along with main report and hide report A section.
    Thanks,
    Vino

  • Restriction of f4 help of a bex variable based on another variable input

    Hi,
    Could you please let me know if there is any possibility to restriction of f4 help of a bex variable based on another variable input.
    eg: when i select particular company code in one variable, i need to restrict the f4 help for another variables eg: pur. group based on selected company code.
    Regards
    Kasi

    Hi,
    Try using replacement path option in bex with replace variable with variable selction.
    Thanks.

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to use the value of a variable to set another variable

    Hello Experts,
    Is it possible to access the value of variable set by the user and set the default value of another variable using the user entered value for the first variable? Example:
    Date variable
    Week variable
    Month variable
    User enters one of those and the other two are automatically prefilled with the correct values?
    Thanks
    Rado

    Hi Rado,
    Gothrough following code
    Which reads year from user input and converts it to factory calendar week , following which you should able to convert user inputs to required parameters.
    DATA:  v_year1 TYPE i,
            v_int   TYPE i,
            v_week1 TYPE kweek,
            v_qurt  TYPE i,
            v_perd  TYPE /bi0/oifiscper,
            v_iweek TYPE i,
            v_periv TYPE periv VALUE 'Z4'.
    DATA : v_vweeks  TYPE /bi0/oicalweek,
            v_vperd   TYPE /bi0/oifiscper,
            v_vperiv  TYPE /bi0/oifiscvarnt VALUE 'Z4'.
    DATA : vit_weeks LIKE /bi0/scalweek OCCURS 0 WITH HEADER LINE.
    DATA : v_perd1   TYPE umc_y_fiscper,
            v_weeks   TYPE umc_ys_dimvals,
            v_pweeks  TYPE i.
    CASE i_vnam.
       WHEN 'WPIYWEEK'.                "Variable name of char. in Bex
    *Check for Step 2 (After user gives inputs on selection screen)
         CHECK i_step = c_after.                                "Step:2
         CLEAR :  v_year1,
                  v_week1,
                  v_iweek.
    *Read the value of variable which used has entered on sel. screen
         READ TABLE i_t_var_range INTO wa_var_range
                                     WITH KEY vnam = 'WPIFYEAR'.
         v_year1 = wa_var_range-low.
         CALL FUNCTION 'TIME_GET_LAST_WEEK'
           EXPORTING
             if_year     = v_year1
           IMPORTING
             ef_week     = v_week1
           EXCEPTIONS
             fatal_error = 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.
    *Get the no. of week from YYYYWW format
         v_iweek = v_week1+4(2).
         l_s_range-low  = v_iweek.
         l_s_range-sign = c_include.
         l_s_range-opt  = c_equal.
         APPEND l_s_range TO e_t_range.  "This is the output structure in which u have to add the result
    Endcase.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • Looking to set the result of a variable based on the content of another (new to scripts)

    Hi,
    I'm new to scripts, new to acrobat forms to be honest, so be gentle with me
    I have a text field Acc1pnt which can accept either Y or N as an entry. Based on the answer, text field Acc1snd would always be N/A if the result of Acc1pnt is N. I'm looking for a script that will add N/A to the second text field and skip over it (make read only?) if the answer to the first field is N.
    Sorry if I'm making this look like hard work. Basically a check is made as to whether an accessory is received and, if it is, whether it is 'sound' or 'damaged'. Obviously if it isn't received then it's condition is irrelevant hence N/A in the senond text field.
    Also, is there something simple I can add to convert an entry to a capital letter?
    Thanks in advance
    Cliff

    Hi Gilad
    I've shied away from radio buttons as the users are used to tabbing through the fields and 'clicking' a radio button would mean taking their hands from the keyboard, I will certainly consider it though.
    Acc1snd (the 2nd variable) should be editable ONLY if the answer to Acc1pnt (the 1st variable) is Y. If the value of the 1st variable is N then Acc1snd can only be N/A (not applicable) and should not be editable.
    Obviously if the user makes an initial mistake and needs to change the value of the 1st variable to Y then the 2nd variable would then need to be editable.
    I will run through the tutorials this evening

  • Variable based on another varable does not change at runtime

    Hi.
    I have Foreach Loop container with a EXEC SQL task inside.
    The Foreach Loop loops through a directory containing flat files and and maps the filename to a "FileName" variable.
    The filenames have a datestamp in the filename that I want to extract.
    Because of that I have also another variable called "FileDate" which basically is an expression with substrings based on the FileName variable. The expression works fine when evaluating.
    The EXEC SQL task inside the Foreach Loop does an insert to a log table (two columns - FileName and FileDate) based on the two variables mentioned above. The trouble is, however, that only FileName is populated correctly in the table.
    For example: I have 5 files with different datestamps. In the log table the FileName column is populated correctly (5 different values), but the FileDate column has the same value for all 5 rows.
    Any ideas why ?
    dakine

    Hi Dakine,
    Your expression works well in my test package. It’s really odd that it doesn’t work in your package. You could add a Script Task into the Foreach Loop Container to show the value of the FileDate variable in a MessageBox, and check whether its value is correct
    for each loop of the container. The script is simple (select User::FileDate as ReadOnlyVariables for the Script Task):
    MessageBox.Show(Dts.Variables["User::FileDate"].Value.ToString());
    By the way, you can also try to recreate the package from scratch.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

Maybe you are looking for