Variable of type user exit

Hi all,
I have a variable of type user exit which is used to let the user enter a characteristic value in a popup-box.
I am able to display the box and let the user enter a value, but then I'm stuck. Where does this value go?? How can I make sure that this value actually is used in the variable??
I am attaching my current code cause I feel like something is missing with regards to exporting the correct value.
Thanks and regards,
TM
DATA: i_sval Like sval occurs 0 with Header Line.
data: v_subrc like sy-subrc.
i_sval-tabname = 'ZASSET_AREA'.
i_sval-fieldname = 'AREA'.
i_sval-fieldtext = 'Asset Area'.
i_sval-field_obl = 'X'.
append i_sval.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
NO_VALUE_CHECK = ' '
POPUP_TITLE = 'Asset Area'
START_COLUMN = '5'
START_ROW = '5'
IMPORTING
RETURNCODE = v_subrc
TABLES
FIELDS = i_sval
EXCEPTIONS
ERROR_IN_FIELDS = 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.

Hi,
From the code you have written, I observe that after capturing the value in the pop-up, you are not passing the value back to the variable table.
What I would suggest is, pass the variable value to the upc_var_cha_act table explicitly. This might resolve the problem.
Sunil

Similar Messages

  • Calculating with formula variables of type user exit

    I created the following query:
    Rows: Characteristic = Employee
    Column: KYF = Status
    Filter: Year, Month
    The KYF ist a formula containing a formula variable. This variable of type user exit should return a value recording to the value of employee and has to be read in a customizing (data-) table by the user exit.
    Is it possible to read the values of employee row by row from the internal table which contains the amount of data before processing to output screen and fill the 'Status'-KYF or should I create a virtual keyfigure for this case.
    Thanks for all your feedback,
    Angelika

    Hi,
    It seems like Status is master data of Employee.
    As per your process, if you do either formula variable or virtual keyfigure you will face query performance problem. More over you cant simply access record by record characteristic value in formula variable. It will be another complex process like you have to call the characteristic value via replacement path.
    You have the following choices:
    You mentioned master data is availabe in custom table. Try to pull the custom table master data into employee info object. Maintain  status as one of the attribute of the master data. Then you can display Status value simply in the report. This will be global access like you use this Status value n number of info providers which is having Employee as one of the info object in the info provider.
    If the previous way is not possible, include the Status in the info provider level and write a simple update routine to populate the values. This will be info provider level.
    I am not sure whether you are in development environment or productive. If developement, then you can choose simply any one of the above ways.
    Regards,
    Vivek

  • BPS Variable for hierarchy type User-Exit

    I try to make this type of variable.
    The variable is NCSTOPU, hierarchy is
    NHSTOPU like
    NHMAIN
    -- 4
        -- 401
        -- 402
        -- 403
      -- 5
         -- 501
         -- 502
         -- 503
    So The ABAP is
    FUNCTION ZCCB_AHR_VAR_HIER.
    *"*"Ëîêàëüíûé èíòåðôåéñ:
    *"  IMPORTING
    *"     REFERENCE(I_TYPE) TYPE  UPC_Y_VAR_TYPE
    *"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
    *"     REFERENCE(IS_HIE_KEY) TYPE  UPC_YS_HIE_KEY
    *"  EXPORTING
    *"     REFERENCE(ET_HIE_NODES) TYPE  UPC_YT_HIESEL
    DATA ZHIER type upc_ys_hiesel.
    *CHANM  UPC_Y_CHANM
    *HIENM     UPC_Y_HIENM
    *HIEVER     UPC_Y_HIEVER
    *DATETO     UPC_Y_DATETO
    *NODENAME     UPC_Y_NODENAME
    *HIECHA     UPC_Y_CHANM
    *DUMMY_LEAF     UPC_Y_DUMMYLEAF
    *TO_CHADEP     UPC_YTO_CHADEP
    ZHIER-CHANM      = 'NCSTOPU'.
    ZHIER-HIENM      = 'NHSTOPU'.
    ZHIER-NODENAME   = '5'.
    ZHIER-HIEVER     = 'A'.
    ZHIER-HIECHA     = '5'.
    ZHIER-DUMMY_LEAF = ''.
    ZHIER-DATETO     = '99993112'.
    INSERT ZHIER INTO TABLE ET_HIE_NODES.
    ENDFUNCTION.
    But it doesn't work.
    The mistake is
    Selected node 5 does not exist
    The node 5  selected as the start value for characteristic 5 with the specified compound table does not exist in hierarchy NHSTOPU.
    What is the problem?

    Configuration of the variable:
    Variable Type - Hierarchy node,
    Characteristic - NCSTOPU,
    Hierarchy - NHSTOPU,
    Replacement type - user-exit,
    FUNCTION MODULE NAME - ZCCB_AHR_VAR_HIER.
    In the planning level the characteristic NCSTOPU is set with this variable.
    In the Layout  1) the characteristic NCSTOPU - Lead Column,
                         2) Hierarchy in the lead column -  Hierarchical Data Model, BW Hierarchy

  • Variable declaration in user exit?

    Hi,
    How can i declare variable in user exit? Is it the same way we declare in report?
    Thanks & Regards,
    Abhijit

    Well Vamshi,
    I got a question regarding user_exit. How can u declare the variable in Save_Document_prepare user exit? How can you import or export fields in to that subroutine?  And also if version changed then whether the user exit, customer exit and screen exit will work properly?
    Thanks & Regards,
    Abhijit
    Edited by: Abhijit Mandal on May 4, 2009 11:41 AM

  • Numeric value variable problem with user exit

    Dear experts,
    I've created a variable (numeric value, user exit) and I want to get the value of variable from an user exit.
    Actually, I want to convert "0calyear" to a number to be albe to calculate (multiplying, dividing etc).
    If there is a possible solution only in FOX, the solution will be the best. However I couldn't find anything.
    So, the next solution I am trying is user-exit. But I am in stuck here.
    The problem is that I have no idea whether the numeric value variable has any sturcture like other variables(char. value) or not. If yes, what structure it has?
    I know, the characterisc value variables have the structure as blow,
        ls_varsel-chanm =
        ls_varsel-seqno =
        ls_varsel-sign  =
        ls_varsel-opt   =
        ls_varsel-low   =
    I've tried several times with the same way like above, but it doesn't work when I call the variable in "BPS0" or "UPSPL".
    How can I solve it? Please let me know.
    I am using SEM_BW 4.00.
    Many Thanks.
    Bruce

    Hi Ravi,
    Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
    It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
    Krzys, Is the option <i>Can be changed in Query Navigation</i>  available for Exit variables. I'll check that and get back to you.
    Boujema, Thanks for the OSS note.
    Thanks
    Hari

  • Types User-exit

    Hi my Friends
    Plz can Give me exmples type User-exit.
    - What's la difference betwen Use-exit and Baddi ?
    Said
    <THREAD LOCKED. Please stop asking interview questions. There is already a lot of information out there, refer to the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to ask a good question and learn to search>
    Edited by: Mike Pokraka on Oct 14, 2008 3:16 PM

    Hi,
    the user exit ZXPADU01  is for all infotypes , it should work for all infotypes ,
    one more things is this will  triggered only for create and copy operation only,
    means automatically it will be called in PA40 beacuse this is create opration
    and in PA30 it will be worked for create and copy operation only,
    so try to activate this include and respective function and its function group .
    and try to test by including break-point in this code.
    dynamic actions will be used for creating infotypes and respective default values based on other infotype .
    please do the same and let me know so that we can think for other solution.

  • BPS Attribute as Variable filled with User-Exit

    Hello,
    how is it possible to set a variable from the type "attribute" in BPS with an User-Exit?
    Example: Characteristic = Material, Attribute = Material class
    How can I set valid entries for Material class in a User-Exit?
    Thanks for help in advance
    Eckhard

    Eckhard,
    You can solve this by using characteristic relationship type exit. there you can put a function where you can find the values for the attribute material class.
    greets,
    Jeroen

  • How to display text variable of type customer exit

    Hi to all,
    I have created a query in query designer which display sales value according to plant.
    There i have also used a variable which will take input from user and restricted on 0CALDAY.
    I have also created 2 text variable to display the text for sales based on input in variable.
    I need when user enter the 01.02.2010 - 31.12.2010 value in variable , text variable should display SALES FROM 01.02.2010 TO 31.12.2010
    i knew how to do that by using text variable of processing type customer exit.
    But display of text variable is like SALES FROM 01022010 TO  31122010  ,
    But i need that SALES  01.02.2010 TO 31.12.2010
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Dec 22, 2010 7:46 AM
    Edited by: pavneet rana on Dec 22, 2010 8:03 AM

    Hi,
    Give Description on Sales Amount  as SALES FROM &ZVAR_YEAR1& TO &ZVAR_YEAR2&.
    ZVAR_YEAR1 & ZVAR_YEAR2 are the two text variables. These two variables should NOT be input enabled.
    In the Exit - under I_STEP = 2, write the below code.
    WHEN 'ZVAR_YEAR1'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-low.
      APPEND l_s_range to e_t_range.
    WHEN 'ZVAR_YEAR2'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-high.
      APPEND l_s_range to e_t_range.

  • Variable to find user-exit name???

    Hello everyone,
    I have a simple query for user-exits. Suppose we are executing a main program SAPLZ*** which has multiple user-exits(ZXVV**02, ZXVV**03, ZXVV**04, ZXVV**05), Is there any standard variable defined to know the name of the user-exit currently running or executing?? I tried with variable sy-repid but it gives the name of the main program i.e. SAPLZ***, we are executing and not the name of the user-exit ZXVV**02/03/04...
    Any help would be highly appreciated...

    Thanks Glen, I actually want to know is the name of the exit is captured in any variable. As my motive here is I will be putting a SELECT query in that user-exit and the table will have entries for multiple user-exits. So when selecting the data from table I don't wants to hardcode the exit name in WHERE clause and hence looking forth that is there any variable which captures the exit name automatically, and I can use that variable.
    tried with sy-cprog and sy-repid but they gives the name of the main prog, not useful here.

  • Variable of Type Customer Exit

    HI All,
       Below is the code to derive a Time Band through a Customer Exit. But when i execute the query its going to Debugging mode automatically..... and throwing a message
    Value " is too long for variable XMON12
    >> Row: 73 Inc: LRRMSU13 Prog: SAPLRRMS
    System error in program SAPLRRS2 and form GET_SID-1- (see long text)
    WHEN 'XXXXXX'.
           read table i_t_var_range with key vnam = 'DATE_1' INTO i_s_var.
           L_S_RANGE-LOW   = '00000000'.
           L_S_RANGE-HIGH  = I_S_VAR-LOW.
           L_S_RANGE-SIGN  = 'I'.
           L_S_RANGE-OPT   = 'BT'.
           APPEND L_S_RANGE TO E_T_RANGE.
           WHEN 'XMON12'.
           L_S_RANGE-LOW   = 0.
           L_S_RANGE-HIGH  = 365.
           L_S_RANGE-SIGN  = 'I'.
           L_S_RANGE-OPT   = 'BT'.
           APPEND L_S_RANGE TO E_T_RANGE.
    Did i miss anything.
    Regards.

    Ramana,
    Variable: XMON12 for Days or Months ....??
    Write code below I_STEP = 2, and remove variable for ready for input(value will be populated via user exit).
    WHEN 'XMON12'.
    IF I_STEP = 2 "Variable get populated after providing input values.
    L_S_RANGE-LOW = 0.
    L_S_RANGE-HIGH = 365.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Hope it Helps
    Srini

  • Purchase requisition document type- USER EXIT

    Hi,
    I want to create two separate document type for material and services for PR that is created from PS. What is the user exit I shall use for the purpose or any other way to do.
    Zinni

    Hi
    Check this link for user exit.
    http://sap.niraj.tripod.com/id21.html
    Thanks
    S.Murali
    Edited by: S. Murali on Jul 8, 2009 2:30 PM
    Edited by: S. Murali on Jul 8, 2009 2:30 PM

  • Global Variable in a User Exit

    Folks, I have a small problem. I have a Exit and there are several includes with in the exit. Due to modularization they have written Forms in One Include and actual call is happening at someother include. I need to code in a logic based on a value of variable. The variable is flag which is updated at Form Include.
    I couldnt add the field at the top include and it does not allow me to due a Implicit enhancement at Beginning or the end.
    Can you please suggest how to add this field which could be visible through out the function group.
    Thanks,
    Balakumar

    Hi,
    Access the variable using dynamic referencing.
    constant: field(50) type c value '(program name)flag'.
    here program name is main where variable is declared.
      field-symbols: <flag>.
    * Assign an individual variable
      assign (field) to <flag>.
    if <flag> is assigned.
    endif,

  • Populating text variable of type Customer Exit dynamically

    Hi,
    I have a report with 3 columns as following.
    "Current period", "Previous period" and "Previous period - 1".
    The text variable name is "ZQTR_TXT".
    My input variable name is "ZALLOC_PRD".
    If I enter 200709 as input, I want to see column headings as
    2007Q3    2007Q2    2007Q1.
    but I am getting 2007Q3 for all 3 columns though I use variable offset to -1 and -2 for other columns.
    Could you please throw some light here as I got stuck with this issue quite a long time? I am using BI 7.0 Query Designer.
    Thanks in advance,
    Hanuma

    There is another variable "ZCUST_QTD" where "ZQTD_TXT" variable is restricted by offsets.
    Input variable is "ZALLOC_PRD" ex: 200709
    I have written Customer exit for the following.
    when 'ZCUST_QTD'.
    ZCUST_QTD will be low 200707 high 200709.
    when 'ZQTD_TXT'.
    "ZQTD_TXT" is 2007Q3.
    But I want "ZQTD_TXT" to be dynamic and different for 3 columns.
    Thanks for your reply.
    Thanks,
    Hanuma

  • User-exit in sem-bps

    In SEM-BPS, I have a layout for manually entering data. The purpose is to enter values for a list of cost centers. This list
    of cost centers should change according to a SKF (statistical key figure) entered in the layout's header.
    The list of cost centers linked to a given SKF is read from a database table.
    This whole process is achieved with the use of a variable of type user-exit.
    However, I have two problems:
    1) If I change the SKF in the layout's header, I'm not beeing able to force another read to the database table, in order to
    refresh the cost center list;
    2) I'm not being able to detect the SKF selected in header, altough I'm using the function API_SEMBPS_VARIABLE_GETDETAIL to
    do so, wich returns all the SKF's (statistical key figures)
    Can anybody help me ?
    Thank you,
    Ricardo
    PS: Here is the exit, in its present state:
    <b>FUNCTION ZLACT_SFK_CC.
    ""Interface local:
    *"  IMPORTING
    *"     VALUE(I_AREA) TYPE  UPC_Y_AREA
    *"     VALUE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
    *"     VALUE(I_CHANM) TYPE  UPC_Y_CHANM OPTIONAL
    *"     VALUE(ITO_CHANM) TYPE  UPC_YTO_CHA
    *"  EXPORTING
    *"     REFERENCE(ETO_CHARSEL) TYPE  UPC_YTO_CHARSEL
      DATA: ls_charsel TYPE upc_ys_charsel,
            seqno type i,
            tab_val_sel LIKE UPC_YS_API_VARSEL occurs 0 with header line,
            tab_val_sel_all LIKE UPC_YS_API_VARSEL occurs 0 with header line,
            head like UPC_YS_API_HEAD occurs 0 with header line.
      CLEAR:
      eto_charsel, eto_charsel[] ,
      tab_val_sel, tab_val_sel[] ,
      ls_charsel, char_value, seqno,
      t_ccusto, t_ccusto[],
      t_iest, t_iest[].
      case i_variable.
        WHEN 'PRVCCIE'.
    Get value of statistical key figure entered in layout's header****
    CALL FUNCTION 'API_SEMBPS_VARIABLE_GETDETAIL'
       EXPORTING
         I_AREA                   = 'PRRVS'
         I_VARIABLE               = 'PRVSK'
       TABLES
         ETK_VARSEL              = tab_val_sel.
    select cost center list from database table ***********************
        select
          from ZPR_CC_IE_CG
          appending corresponding fields of table t_ccusto
          where iest = tab_val_sel-low.
          clear:seqno.
          loop at tab_val_sel.
            ADD 1 TO seqno.
            ls_charsel-low   = tab_val_sel-low.
            ls_charsel-seqno = seqno.
            ls_charsel-opt   = 'EQ'.
            ls_charsel-sign  = 'I'.
            ls_charsel-chanm = '0STKEYFIG'.
            INSERT ls_charsel INTO TABLE eto_charsel.
          endloop.
          loop at t_ccusto.
            ADD 1 TO seqno.
            ls_charsel-low   = t_ccusto-ccusto.
            ls_charsel-seqno = seqno.
            ls_charsel-opt   = 'EQ'.
            ls_charsel-sign  = 'I'.
            ls_charsel-chanm = i_chanm.
            INSERT ls_charsel INTO TABLE eto_charsel.
          ENDLOOP.
      when others.
    *do nothing
      ENDCASE.
    endfunction.</b>

    Hello,
    I use the exit in the planning level and I link the exit to a variable for "0FISCPER".  I copy the data from a "Non-transactional Cube" to a "Transactional Cube" derictly of the period end closing.  I still need the data in previous month for calculations in BPS.  Maybe, I can use your code.
    Thanks and best regards
    Constant

  • Passing Multiple Single values in User Exits

    Hello All,
    I have a requirement where in, a user could enter either a single value, multiple single values or a combination of a range and single values.
    This set of values need to be passed on to a variable with in a user exit. I have been able to get either one single value to pass or one single range. I am unable to pass on multiple single values or a combo of a range and single value from the user entry.
    I would appreciate if anyone could help me with the structure of the code to pass multiple single values or combo.
    I was wondering if I would need to pass the values into an internal table first and then pass it to the user exit variable. However, as I am not a strong ABAP resource, I am struggling.
    Any and all help is deeply appreciated.
    Warm regards
    Sunil

    Hello Marc,
    There are two requirements which I was trying to address.
    1. IN few queries, the users enter either a range of profit centers or multiple single values in the pop-up window. I need to pass those values from that variable to an variable of type USer Exit to derive partner profit center values with in the query.
    For this I have been able to pass values for either a single value or a single range. I am unable to pass on values for multiple single values or a combo of a range and single values.
    2. I am trying to create a query for the top 5 customers to be used in the Corporate Performance Monitor. However, when I am trying to use the variable of type "replacement path", the system does not allow me to release it for OLE DB for OLAP.
    To obviate this problem, I was hoping to create a variable of typeUSer Exit" and then pass the values from the variable of type "replacement path" to this variable.
    Is it a workable solution? I was hoping that the method to pass the values in both the above scenarios might be similar.
    Please guide me.
    Warm regards
    Sunil

Maybe you are looking for