Customer exit : i_vnam table empty

Hi,
I have a specific requirement where I need a customer exit variable to be processed twice (once in i_step = 1 and the second time in i_step = 2 ).
The problem I am facing is that after the i_step = 1 is processed for both my customer exit variables, it never reaches i_step = 2 , but only i_step = 3.
So I have changed my coding so the second step is processed at i_step = 3. The problem here is that the i_vnam table seems to be empty when i_step = 3 is reached, so it never executes the code below my WHEN statements for i_step = 3.
The code is :
when 'ZCEM_MARG1'.
    IF i_step = 1.
      l_range-sign = 'I'.
      l_range-opt = 'EQ'.
      l_range-low = '0000000075'.
      append l_range to e_t_range.
    ELSEIF i_step = 3.
      IF l_range-low CO '1234567890'.
      ZCL_IM_VC_RAGSTA=>zvar_marg1 =  l_range-low.
      ELSE.
        MESSAGE I010(ZB).
      ENDIF.
    ENDIF.

Hi ,
The code after i_step = 3 needs to be processed after input in the selection screen, so I cannot remove this statement.
i_step = 1 assigns default values to the variables.
Is it feasible to process the same variables in two steps ? Or should I do it with two variables ?
kr,
Wouter

Similar Messages

  • Authorizations by use of customer-exit: in  i_step = 3,   i_vnam is empty

    Hello all,
    I have checked multiple scenarios and they do not work:
    Current situation/setup:
    1. <b>Creation of several variables and adding each of them to different queries</b> :
    Variable   Type   Processing      Infoobject                     Selection  ready for input
    COB     1     6     ZCCOSTCTR__ZCCOB     S     
    CB2     1     6     ZCCOB                                     S     
    CBV     1     3     ZCCOB                                     S     
    2. <b>Adding values in a role</b> (currently 3.0 is used and we want to check the exit and if it works before upgrading to 7.0) and assign it to the user:
    Old active Object:ZCKS_COB:
    1KYFNM    *                                                                            
    9ZCCOB    $C-B2, $C-OB , $C-BV    
    added new object without 1KYFNM:                                                                               
    ZCCOB      $C-B2, $C-OB, , $C-BV             
    3. <b>Marked the used object auth. relevant</b> for the cube of the query
    4. Enhanced ZXRSRU01 via CMOD with coding and activated also the project:
      WHEN 'COB' or 'RESPNO'.
       IF I_STEP = 0.
        IF I_STEP = 1.
       IF I_STEP = 3.
          CALL FUNCTION 'Z_VARIABLE_BY_AUTH'
            EXPORTING
              I_VNAM           = I_VNAM
            TABLES
              E_T_RANGE        = E_T_RANGE
            EXCEPTIONS
              NO_AUTH          = 1
              NOT_VALID        = 2
              MISSING_OPERATOR = 3
              OTHERS           = 4.
          IF SY-SUBRC = 1.
            MESSAGE W007(EYE).
          ENDIF.
          IF SY-SUBRC = 2.
            MESSAGE W707(BRAIN).
          ENDIF.
          IF SY-SUBRC = 3.
            MESSAGE W999(BRAIN).
          ENDIF.
          IF SY-SUBRC = 4.
            MESSAGE W649(BRAIN) with I_VNAM ''.
          ENDIF.
        endif.
    The function 'Z_VARIABLE_BY_AUTH' was tested separately and fills in E_T_RANGE as expected.
    I also changed the variable names each time to all the other existing variables while debugging.
    If I use a variable of <b>type customer-exit</b> and process it with <b>i_step =1</b> the value selection and query result is OK.
    But this <b>scenario works without roles</b> and authorization values triggered by a variable $<VARIABLE> and is not the intended and documented way proposed by SAP. The documentation says to create a variable of type authorizations and to process it in I_Step = 3. But in this step I_VNAM is empty and so there is no processing ot the function module.
    Has anyone a solution? I could not find the issue during several debugging sessions. One strange thing is the protocol of rssm: the authorization buffer is not reflecting the enhanced role but only the value $C-B2 for object ZCKS_COB.
    Thanks in advance to have a look on this tricky issue.
    Bye,
    Petra

    Try this:
    IF i_s_rkb1d-compid = 'Query Name'
    Validation of data for the value entered in your Variable
        READ TABLE i_t_var_range INTO yourworkarea
                    WITH KEY vnam = yourvariable
        IF sy-subrc = 0.
          IF w_s_var_range-low(4) <>  w_s_var_range-high(4).  " Your condition or Logic
            l_msgv1     = c_qtr_com1.  " Your message
            i_handle = 9998.
            CALL FUNCTION 'RRMS_HANDLE_MESSAGE_INIT'
              EXPORTING
                i_handle         = i_handle
                i_msg_handler_id = sy-uzeit.
            CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
              EXPORTING
                i_class  = 'RSBBS'
                i_type   = 'I'
                i_number = '000'
                i_msgv1  = l_msgv1
            RAISE again.
          ENDIF.
        ENDIF.
      ENDIF.

  • Customer-Exit for analysis Authorizations: i_step = 3, i_vnam is empty

    Hello all,
    I have checked multiple scenarios and I cannot figure out the mistake I've done:
    Current situation/setup:
    1. Creation of several variables and adding each of them to different queries :
    Variable Type Processing Infoobject Selection ready for input
    COB 1 6 ZCCOSTCTR__ZCCOB S
    CB2 1 6 ZCCOB S
    CBV 1 3 ZCCOB S
    2. Adding values in a role (currently 3.0 is used and we want to check the exit and if it works before upgrading to 7.0) and assign it to the user:
    Old active Object:ZCKS_COB:
    1KYFNM *
    9ZCCOB $C-B2, $C-OB , $C-BV
    added new object without 1KYFNM:
    ZCCOB $C-B2, $C-OB, , $C-BV
    3. Marked the used object auth. relevant for the cube of the query
    4. Enhanced ZXRSRU01 via CMOD with coding and activated also the project:
    WHEN 'COB' or 'RESPNO'.
    IF I_STEP = 0.
    IF I_STEP = 1.
    IF I_STEP = 3.
    CALL FUNCTION 'Z_VARIABLE_BY_AUTH'
    EXPORTING
    I_VNAM = I_VNAM
    TABLES
    E_T_RANGE = E_T_RANGE
    EXCEPTIONS
    NO_AUTH = 1
    NOT_VALID = 2
    MISSING_OPERATOR = 3
    OTHERS = 4.
    ENDIF.
    The function 'Z_VARIABLE_BY_AUTH' was tested separately and fills in E_T_RANGE as expected.
    I also changed the variable names each time to all the other existing variables while debugging.
    If I use a variable of type customer-exit and process it with i_step =1 the value selection and query result is OK.
    But this scenario works without roles and authorization values triggered by a variable $<VARIABLE> and is not the intended and documented way proposed by SAP. The documentation says to create a variable of type authorizations and to process it in I_Step = 3. But in this step I_VNAM is empty and so there is no processing ot the function module.
    Has anyone a solution? I could not find the issue during several debugging sessions. One strange thing is the protocol of rssm: the authorization buffer is not reflecting the enhanced role but only the value $C-B2 for object ZCKS_COB.
    Thanks in advance to have a look on this tricky issue.
    Bye,
    Petra

    Hi Petra,
    You are correct.  I_VANM is not stored at I_STEP 3.  However, to access that value at I_STEP3, use the following code.
    IF I_STEP = '3'.
         READ TABLE I_T_VAR_RANGE INTO L_RANGE WITH KEY VNAM = '...variable name.....'
         IF SY-SUBRC = 0.
           ...code here to alter values...
          .....for example:  L_RANGE-LOW = 'S'
         ENDIF.
    ENDIF.
    Kind Regards,
    Larry

  • Customer exit for calling a database a table

    Hi Friends,
    I want to write a customer exit code for customer exit variable which should call a database table which i have created. The database table  consist of two fileld username and the material value assign to that user.
    and when a  perticuler user execute a query using this customer exit variable the customer exit code will  check the user who is log in and will get filled by value assigned to it in the database table.
    i am new to the customer exit can any one send me the sample code for this.
    Points will be assign to helpful answer.
    Regards,
    Deepak

    Hay Diogo,
    here is the code.even if i put I_step = 2 i can not see any value in the variable as default and when i try to select it.i can not see any value in selection screen and i see message that You must have authorization for at least one characteristic value for the characteristic PLD_MPLAN.
    Database table created is ZPLDVALUES with following entries
      USERNAME     PLD_MPLAN
      TEST_DW03       000000000000101628            not working  when no I_Step in coad
      TEST_DW04       000000000000101628
      TEST_DW15       000000000000101628
    FUNCTION zpldvarexit_pld_mplan_u01.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_VNAM) TYPE  RSZGLOBV-VNAM
    *"     VALUE(I_VARTYP) TYPE  RSZGLOBV-VARTYP
    *"     VALUE(I_IOBJNM) TYPE  RSZGLOBV-IOBJNM
    *"     VALUE(I_S_COB_PRO) TYPE  RSD_S_COB_PRO
    *"     VALUE(I_S_RKB1D) TYPE  RSR_S_RKB1D
    *"     VALUE(I_PERIV) TYPE  RRO01_S_RKB1F-PERIV
    *"     VALUE(I_T_VAR_RANGE) TYPE  RRS0_T_VAR_RANGE
    *"     VALUE(I_STEP) TYPE  I DEFAULT 0
    *"  EXPORTING
    *"     VALUE(E_T_RANGE) TYPE  RSR_T_RANGESID
    *"     VALUE(E_MEEHT) TYPE  RSZGLOBV-MEEHT
    *"     VALUE(E_MEFAC) TYPE  RSZGLOBV-MEFAC
    *"     VALUE(E_WAERS) TYPE  RSZGLOBV-WAERS
    *"     VALUE(E_WHFAC) TYPE  RSZGLOBV-WHFAC
    *"  CHANGING
    *"     VALUE(C_S_CUSTOMER) TYPE  RRO04_S_CUSTOMER OPTIONAL
      "DATA material LIKE zpldvalue-pld_mplan.
      DATA: l_s_range TYPE rs_s_range,
            l_s_var_range LIKE LINE OF i_t_var_range.
    *if i_step = 2.
      DATA: BEGIN OF usevalue OCCURS 0,
            username LIKE zpldvalues-username,
            pld_mplan LIKE zpldvalues-pld_mplan,
            END OF usevalue.
       " Variable nach Selektionsbild bearbeiten
        SELECT pld_mplan FROM zpldvalues
        INTO  usevalue-pld_mplan
        WHERE username = sy-uname.
        ENDSELECT.
        refresh e_t_range.
        CLEAR l_s_range.            " Range-Tabelle füllen
        l_s_range-low  =  usevalue-pld_mplan.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'EQ'.
        APPEND l_s_range TO e_t_range.
    *endif.
    ENDFUNCTION.
    -Deepak
    Edited by: Deepak warbhe on Sep 2, 2008 5:18 PM
    Edited by: Deepak warbhe on Sep 2, 2008 5:28 PM

  • Customer exit variable - internal table in BEX

    Hi,
    i am running a report and using variables in it.
    The report runs over a info cube. There are few challenges in it.
    One of the variable is posting date, and when user enters posting date i need to negate it with current system date.
    If the negated value is greater than 28 then i need to exclude documnet type 'YG' and display the query, else i need to include the dcumnet type 'YG' and document type '  '.  The above logic can be well implemented via a customer exit variable(for posting date) using an internal table. We have internal tables like C_T_DATA which is used in data source enhancement, which help us to implement our own desired logic.
    Do we have such kind of internal tables, based on which the report output (result set) is derived?
    i know that we have l_t_range and e_t_range, but dont know their usage, some one can explain in detail about them?
    Thanks in advance.

    Hi Selva & Lakshmin,
    The code given by Selva is almost correct . If my understanding is clear , you also wanted to include  document type ' ' when the negated value is less than 28 .
    Modification in Selvas Code :
    Variable 'V_DOCTYP' must be of type Multiple Single Values.
    DATA : V_DATE LIKE SY-DATUM.
    DATA : V_DAYS TYPE I.
    if i_step = 2.
    when 'V_DOCTYP'.
    READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZV_PDATE''.
    IF SY-SUBRC = 0.
    V_DATE = loc_var_range-low.
    ENDIF.
    V_DAYS = SY-DATUM - V_DATE.
    IF V_DAYS > 28.
    l_s_range-low = 'YG'
    l_s_range-sign = 'E'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ELSE.
    l_s_range-low = 'YG'
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    clear l_s_range.
    l_s_range-low = ' '.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDIF.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh

  • Updating custom field in table EKKO within user exit when PO is saved

    I am trying to update a custom field in table EKKO when a PO is saved.  I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005.  Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN where I assign a field symbol to the calling program variable and then am able to access data within EKKO table.  But when I pass this data back into the field symbol, for some reason this field is not getting saved when the PO is saved.  In debug mode, it looks like this field is getting updated, but when I look in the table after the PO is saved, it is not there.  My code sample is below.  What I am doing wrong?
    data:
      CHAR(50) VALUE '(SAPLMEPO)EKKO-ZHDRCSTCENTER',
      g_zhdrcstcenter like ekko-zhdrcstcenter,
      FIELD-SYMBOLS <F1> type any.
    if i_ekko-ekorg = '5401'.
      ASSIGN (char) to <F1>.
      g_zhdrcstcenter = <F1>.
      move '0000113322' to g_zhdrcstcenter.
      <F1> = g_zhdrcstcenter.
    endif.
    Thanks!
    Sarah Smyth.

    Firstly, have you investigated using EXIT_SAPMM06E_008 to set any custom fields you have added in the EKKO_CI / CI_EKKODB structure?.. that might work more easily.
    In terms of doing an assign back into a calling program's memory, it can work but it's probably worth setting a break point in your code then stepping through watching the values in EKKO - sometimes you can find subsequent code that re-writes an earlier copy of values back into the structure, thereby preventing you doing your change...  SAP does warn this method is for "internal use".  Also check in your debugger that it's SAPLMEPO and not SAPMM06E you need.

  • BADI or User exit  for FB50 to update custom field in table COEP

    Hi all,
    i have added one custom field in table COEP through include CI_COBL .
    when i do posting through sales order(VA02) or purchase order(ME22n) that custom fields in COEP get updated with controlling document
    and through BADI AC_DOCUMENT i m updating that custom field in COEP.
    but when i do manual posting through FB50 controlling document is generated in COEP but i m not able to update that custom field
    because in this case BADI AC_DOCUMENT  is not get triggered.
    is there any BADI or User exit or enhancement spot for FB50 through which i can update that custom field in table COEP

    Hi Sandy,
    Thanks for u r reply,
    RFAVIS01 is not getting triggered through FB50
    and F180A001 ( EXIT_SAPLF048_001) is getting triggered but it doesnt contain COEP field in its parameter
    import - F180A_DOC_HEAD_TAB
                 F180A_DOC_ITEM_TAB
    changing - RELATION_TAB

  • Customer exit variables using the Table

    Hi Experts,
    I'm having the following scenario.
    I have created the below table
    OGVERSION   Fiscal Year1  OGVERSION1  Fiscal Year2   OGVERSION2
        001                   0                   100                  -1                  100
        002                   0                   100                    2                  200
          007                  3                     200                 1                   300   
    Now i need to create four customer exit varibles by using the OGversion value which is  the variable by fillign with manula input.  Here Fiscal year1 & Fiscalyear 2 fields having the values like 0,1,2,-1 means 0 -->  Current Year, 1 --> CurrentYear +1 , 2 --> Current Yr +2, -2 --> Current Yr-2...like that.
    Please let me know If anybody knows  the ABAP for create these customer exit variables.
    Regards,
    Navin Achanta

    Thanks for the reply. following is the code that is used in the exit.
    does the code below affect the performance.
    select FIELD1 from TABLE into table INT_TABLE
                                           where TCTUSERNM = SY-UNAME.
          if sy-subrc eq 0.
            loop at INT_TABLE into WA_INT_TABLE.
              l_s_range-LOW = WA_INT_TABLE-field1.
              l_s_range-SIGN = 'I'.
              l_s_range-OPT = 'EQ'.
              append l_s_range to e_t_range.
            endloop.
          endif.

  • Formel Variable - how to fill with Customer Exit from control table

    Hello Experts,
    I have create in BEx-Analyser a formel Variable ZEXRATE1 filled through Customer Exit. In BW I had a "control tabel" with keyfigures.
    In the query definition I have include 0FISCPER, 0FISCVARNT and 0VTYPE. This
    are the keys which should give the values for the selectstatement to select my keyfigure from the "control table" to fill ZEXRATE1.
    If it possible to do with Customer Exit (CMOD -> RSR00001 -> ZXRSRU01) or do I have to implement a Bapi. Perhaps someone can give me a code example.
    Regards Dieter

    Hi,
    Code may look like this
    WHEN 'ZEXRATE1'.
    check i_step = 2.
        LOOP AT I_T_VAR_RANGE INTO L_S_RANGE.
          CASE L_S_RANGE-IOBJNM.
            WHEN 'ZFISCPER'. GV_ZFISCPER = L_S_RANGE-LOW.
            WHEN 'ZFISCVARNT'. GV_ZFISCVARNT =  L_S_RANGE-LOW.
            WHEN 'ZVTYPE'. GV_ZVTYPE =  L_S_RANGE-LOW.
          ENDCASE.
        ENDLOOP.
        SELECT SINGLE RATE into INTO GV_RATE
                  FROM ZTABLE
                  WHERE 0FISCPER = GV_ZFISCPER
                  AND   0FISCVARNT = GV_ZFISCVARNT
                 AND 0VTYPE = GV_ZVTYPE   .
    Assumptions : ZTABLE name of control table
                          ZFISCPER name of variable represents fiscal period
                          'ZFISCVARNT' name of variable representing fiscal year variant 
                          'ZVTYPE'. name of variable representing value type
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • Table look up using value from customer exit variable

    I have a customer exit variable, CURRMON, which the user enters in the format MM/YYYY. From this entry, I would like to do the following to calculate and display the number of business days in the selected month:
    Do the following to get Business Days in month.
    Use the KF "FBA Day"  (CTAFBAD) from the CTA_M01 infocube and write ABAP routine.
    1. Based on user entry cal month get the last calendar day .
    2. Do a master data look up (CTAFBAC is the master data object), using the last calendar day from step 1.
    3. CTAFBAD is the attribute of CTAFBAC so move the value of CTAFBAD to the result, and display this result
    Can anyone help me with this?

    Hello,
    You can use i step = 1 in SMOD transaction and write the code there.
    l_s_range-low = sy-uname.
    append ls_range to e_t_range.
    regds,
    Shashank

  • Error Message : " No value could be determined for Customer Exit Variable "

    Hello BI Experts ,
    I have created a "ZYTD_PERIOD" Customer Exit Variable  Interval  Mandatory and ready for input check mark removed.
    The reference character is '0FISCPER' .
    I want to have YTD figures when the user enter single Fiscal Year Period for variable 0P_FPER.
    So I have written below code in SE37 : EXIT_SAPLRRS0_001 and include program : ZXRSRU01
    ==================================================================
      case i_vnam.
                  WHEN 'ZYTD_PERIOD'.
                  IF I_STEP = 2.
                  LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = '0P_FPER'.
                  CLEAR L_S_RANGE.
                  L_S_RANGE-LOW0(4) = LOC_VAR_RANGE-LOW0(4).
                  L_S_RANGE-LOW+4(3) = '001'.
                  L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
                  L_S_RANGE-SIGN = 'I'.
                  L_S_RANGE-OPT = 'BT'.
                  APPEND L_S_RANGE TO E_T_RANGE.
                  EXIT.
                  ENDLOOP.
                  ENDIF.
    ===================================================================
    After that I use this 'ZYTD_PERIOD' variable in the query .
    Also I have used the variable 0P_FPER in another structure.
    When I execute the query by entering the value of 0P_FPER as 010.2009 or any other value ,
    I am getting below error message ,
    *No value could be determined for variable ZYTDPERIOD*_
    Below is details of this Error message ,
    Note that I have proper Master and Text data for 0CO_AREA and 0COMP_CODE loaded into BI.
    =======================================================================
    Diagnosis
    This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
    Termination message BRAIN 632 appears:
    Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
    System Response
    1. Operation method of SAP-Exit-Variables 0P_FVAEX or 0P_CTPCA
    With queries from the CO application, both SAP-Exit-Variables look for an entry for 'controlling area'. With this controlling area from the selection screen, the SAP-Exit-Variables program reads the attributes for InfoObject 0CO_AREA (controlling area).
    With queries from the FI application, the SAP Exit Variable 0P_FVAEX looks for an entry for 'company code'. With this company code from the selection screen, the SAP Exit Variables program reads the attributes for InfoObject 0COMP_CODE (Company Code).
    0P_FVAEX determines the fiscal year variant (attribute 0FISCVARNT) from the attributes for 0CO_AREA (CO queries) or 0COMP_CODE (FI queries). 0P_CTPCA determines the currency type of the profit center local currency (attribute 0CURTP_PCA) from the attributes for 0CO_AREA.
    2. Cause of Error
    The attributes for the controlling area (InfoObject 0CO_AREA) or company code (InfoObject 0COMP_CODE) were not loaded into the BW system, or the attributes for the controlling area are not active in the BW system.
    Check whether this is the cause of the error in your BW system. Display the contents of table /bi0/mco_area or /bi0/mcomp_code using transaction se16.
    Application CO:
    Check whether the attributes 'fiscal year variant' (field FISCVARNT) and 'profit center local currency currency type' (field CURTP_PCA) are filled in the 'A' version (field OBJVERS) for the selected controlling area. If the fiscal year variant in the OBJVERS = 'A' is empty, then the error is with variable 0P_FVAEX. If the currency type of the profit center's local currency in OBJVERS = 'A' is empty, then the error is with variable 0P_CTPCA.
    Application FI:
    Check whether or not the attribute 'fiscal year variant' (field FISCVARNT) is filled in the 'A' version (field OBJVERS) for the selected controlling area. If the fiscal year variant is empty in OBJVERS= 'A', then the error is with variable 0P_FVAEX.
    Procedure
    Using InfoSource 0CO_AREA, load the attributes for the controlling area or company code into your BW system.
    Afterwards, activate the attribute changes in your BW system. To do this, use transaction rsa1, path 'Tools > Hierarchy/Attribute changes', functions button 'InfoObject list'. Choose InfoObject 0CO_AREA or 0COMP_CODE from this list, and activate the attribute changes.
    =====================================================================================
    Is there any special settings needed before writing BEx Customer Exit ?
    I have already created a project in CMOD and assinged a proper RSR00001
    and EXIT_SAPLRRS0_001 and project is active.
    Any help please ....
    Regards ,
    Amol

    My Code is as below ,
              case i_vnam.
                  WHEN 'ZYTD_PERIOD'.
                  IF I_STEP = 2.
                  LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = '0P_FPER'.
                  CLEAR L_S_RANGE.
                  L_S_RANGE-LOW0(4) = LOC_VAR_RANGE-LOW0(4).
                  L_S_RANGE-LOW+4(3) = '001'.
                  L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
                  L_S_RANGE-SIGN = 'I'.
                  L_S_RANGE-OPT = 'BT'.
                  APPEND L_S_RANGE TO E_T_RANGE.
                  EXIT.
                  ENDLOOP.
                  ENDIF.
                  ENDCASE.

  • Changes to Variable in Customer exit

    Hi Experts,
    We have two variables in the ready for input query.
    First  Variable : Customer exit variable which gets populated based on user login details.
    Second Variable: Input ready variable. The values  will be populated depending on the first variable.
    Suppose the  user belongs to Sales Org India, the first variable will be populated in the back ground  with value IND.
    So the second variable(input ready) on  sales hierarchy   shows the available values only for INDIA in the format   Region->State->city etc  .
    Now the problem is, even the user selects city  in the second variable, the  result set is being locked at the INDIA level  . As a result the other  users are not allowed to lock the data  even if they select any other city.
    Is it possible to delete value of the First variable  in the customer exit after the user input the value for the second variable ?
    I mean the  Sales org should be set to  empty after the user input to the second variable, so that the lock will apply at the region /city level .
    Please let me know If I can provide any more information.
    Thanks and regards,
    Babu v

    Hello,
    Pl see if you can use first variable as authorisation variable
    and second variable as i_step =2 as follows
    INCLUDE ZXRSRU01 *
    Enhancement: MultiProvider using InfoProvider Variable
    include YBW_INFOPROVIDER_VARIABLE.
    *& Include YBW_INFOPROVIDER_VARIABLE *
    DATA:
    ls_var TYPE rrs0_s_var_range,
    ls_range TYPE rsr_s_rangesid,
    l_contained TYPE c,
    ls_mapping TYPE ybw_mapping,
    lt_mapping TYPE TABLE OF ybw_mapping.
    Called after variable popup
    IF i_step = 2 AND i_vnam = 'INFOPROV'.
    - 13 -
    Read mapping table
    REFRESH lt_mapping.
    SELECT * FROM ybw_mapping INTO TABLE lt_mapping.
    Process all selection for country variable
    REFRESH e_t_range.
    LOOP AT i_t_var_range INTO ls_var WHERE vnam = 'S_COUNT'.
    Process all mapping rules
    LOOP AT lt_mapping INTO ls_mapping.
    Always fill LOW and HIGH, Otherwise logic below will not work
    IF ls_mapping-high IS INITIAL.
    ls_mapping-high = ls_mapping-low.
    ENDIF.
    Check if selection is contained in the defined InfoProvider
    CLEAR l_contained.
    CASE ls_var-opt.
    WHEN 'EQ'.
    IF ls_var-low BETWEEN ls_mapping-low AND ls_mapping-high.
    l_contained = 'X'.
    ENDIF.
    WHEN 'BT'.
    IF ls_var-low <= ls_mapping-high AND
    ls_var-high => ls_mapping-low.
    l_contained = 'X'.
    ENDIF.
    ENDCASE.
    Add InfoProvider to return table
    Note: Use COLLECT to avoid duplicates
    IF l_contained = 'X'.
    CLEAR ls_range.
    ls_range-sign = 'I'.
    ls_range-opt = 'EQ'.
    ls_range-low = ls_mapping-infoprov.
    COLLECT ls_range INTO e_t_range.
    ENDIF.
    ENDLOOP. " lt_mapping
    ENDLOOP. " i_t_var_range
    EXIT.
    ENDIF.
    Thanks and regards

  • Customer exit in BEx Query

    Hi,
    I've created a BEx query and added a variable MCE9004 in field Ref.org.unit and this variable is mapped to a customer exit code via CMOD step 2 (post_popup).
    Basically how I want it to work is, I will select an org.unit value e.g. org.unit = A1 in tcode RSRT variable selection screen and this value will be passed in the customer exit code as shown below and retrieve the look up values and pass it to the field ref.org.unit via e_t_range.
    CASE i_vnam.
         WHEN 'MCE9004'.
    ****      IF i_step = 2.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0CALMONTH'.
           l_date = LS_T_VAR_RANGE-low.
           IF l_date IS NOT INITIAL.
             CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
               EXPORTING
                 day_in            = l_date
               IMPORTING
                 last_day_of_month = ld_last_day
               EXCEPTIONS
                 day_in_not_valid  = 1
                 OTHERS            = 2.
           ENDIF.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0ORGUNIT'.
           SELECT /BIC/ORGUNT_PR FROM /BIC/AMPA5AX0000 INTO lv_org "l_s_range
             WHERE ORGUNIT = LS_T_VAR_RANGE-low
             AND DATETO LE ld_last_day.
             l_s_range-SIGN = 'I'.
             l_s_range-OPT = 'EQ'.
             l_s_range-LOW = lv_org.
    *          l_s_range-HIGH =
             APPEND l_s_range TO e_t_range.
           ENDSELECT.
    ***** To clear value of org.unit field
    ****      READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
    ****      WITH KEY IOBJNM = '0ORGUNIT'.
    ****      IF sy-subrc EQ 0.
    *****        CLEAR LS_T_VAR_RANGE-low.
    ****        DELETE i_t_var_range index sy-tabix.
    ****      ENDIF.
       ENDCASE.
    ENDFUNCTION.
    Once this code has been executed it goes back to the selection screen and there is still an org.unit value on the screen even though I have removed it in my code in red above in i_t_var_range.
    Therefore when I execute the query, the value for org.unit field is not emptied.
    Can you please teach me how to clear that value of org.unit field?
    Let me know if you need further details.
    Thanks,
    Rebekah

    hi thomas,
    yes i get your point but the thing is i need to modify a value in the import table. coz the export table is not for the org.unit field but the ref.org.unit field.
    Basically i pass in org.unit = A1 and e_t_range will have the lookup values to be passed in ref.org.unit field which is B2 and C3.
    Then when i click execute, i want my filter only to have the values B2 and C3 and A1 shud be removed.
    is there any way i could do that?
    please advice.
    Thanks,
    Rebekah

  • ABAP Help for customer exit

    Hi All, I need help with ABAP code for customer exit for formula variable. I have ZVKDATE as formula var from customer exit. user enters date in ZVKEYDT(this is selection type var). I have the below code, I debugged it the l_var_range-low get the date but when I append it to e_t_range the table doesn't gets the date. The report shows the ZVKDATE has empty demarcation. kindly help.
    data l_var_range like rrrangeexit.
    data: l_s_range type RSR_s_RANGESID.
    data: w_day(2) type c,
          w_mth(2) type c,
          w_year(4) type c.
    define append_range_table.
    l_s_range-low = &1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    end-of-definition.
    *Activities performed before selection screen pop-up window
    if i_step = 2.
    Calculate the current date based on system date
      case i_vnam.
        when 'ZVKDATE'.
          read table i_t_var_range into l_var_range
                            with key vnam = 'ZVKEYDAT'.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          w_day = l_var_range-low+6(2).
          w_mth = l_var_range-low+4(2).
          w_year = l_var_range-low(4).
          concatenate w_year w_mth w_day into l_var_range-low.
          append l_s_range to e_t_range.
      endcase.
    endif.
    puneet

    Hi,
    Check your code again. You are not appending l_var_range but l_s_range. Also I think the concatenate statement should contain l_s_range-low instead of l_var_range-low.
    Hope this will help you.
    Regards,
    Vaibhav

  • Customer exit for post_popup

    Hi,
    I've created a BEx query and added a variable MCE9004 in field Ref.org.unit and this variable is mapped to a customer exit code via CMOD step 2 (post_popup).
    Basically how I want it to work is, I will select an org.unit value e.g. org.unit = A1 in tcode RSRT variable selection screen and this value will be passed in the customer exit code as shown below and retrieve the look up values and pass it to the field ref.org.unit via e_t_range.
    CASE i_vnam.
         WHEN 'MCE9004'.
    ****      IF i_step = 2.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0CALMONTH'.
           l_date = LS_T_VAR_RANGE-low.
           IF l_date IS NOT INITIAL.
             CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
               EXPORTING
                 day_in            = l_date
               IMPORTING
                 last_day_of_month = ld_last_day
               EXCEPTIONS
                 day_in_not_valid  = 1
                 OTHERS            = 2.
           ENDIF.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0ORGUNIT'.
           SELECT /BIC/ORGUNT_PR FROM /BIC/AMPA5AX0000 INTO lv_org "l_s_range
             WHERE ORGUNIT = LS_T_VAR_RANGE-low
             AND DATETO LE ld_last_day.
             l_s_range-SIGN = 'I'.
             l_s_range-OPT = 'EQ'.
             l_s_range-LOW = lv_org.
    *          l_s_range-HIGH =
             APPEND l_s_range TO e_t_range.
           ENDSELECT.
    ***** To clear value of org.unit field
    ****      READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
    ****      WITH KEY IOBJNM = '0ORGUNIT'.
    ****      IF sy-subrc EQ 0.
    *****        CLEAR LS_T_VAR_RANGE-low.
    ****        DELETE i_t_var_range index sy-tabix.
    ****      ENDIF.
       ENDCASE.
    ENDFUNCTION.
    Once this code has been executed it goes back to the selection screen and there is still an org.unit value on the screen even though I have removed it in my code in red above in i_t_var_range.
    Therefore when I execute the query, the value for org.unit field is not emptied.
    Can you please teach me how to clear that value of org.unit field?
    Let me know if you need further details.
    Thanks,
    Rebekah

    Hi,
    I dont think check button is meant for this purpose.
    If you want to lookup from BIC/AMPA5AX0000 and restrict org_unit.
    you can directly click execute and pass the corresponding values.
    I understand your idea, but that wont happen I think
    -Sriram

Maybe you are looking for