Need a code for Customer exit for extractor 0WBS_ELEMT_ATTR

Hi Guys,
I need a code for following requirement.
I have appended some fields to standard extractor 0WBS_ELEMT_ATTR which normally takes data from PRPS table. But the new fields will be getting data from PRTE and PROJ table. with common keys. Following is my code which is not working. Please help me out, I am not good in abap. Please note some lines are commented.
Thanks,
H
CODE:::::
form 0wbs_elemt_attr  tables i_t_data structure biw_prps.
  data: it_wbs_prps like biw_prps occurs 0.
  data wa_prps like it_wbs_prps.
data: begin of it_wbs_prps occurs 0,
         PSPNR like prps-pspnr,
         POSID like prps-posid,
         PBUKR like prps-PBUKR,
         IZWEK like prps-IZWEK,
         USR10 like prps-USR10,
         USR00 like prps-USR00,
         USR02 like prps-USR02,
         OBJNR like prps-OBJNR,
       end of it_wbs_prps.
data wa_prps like it_wbs_prps.
  data: begin of it_wbs_prps1 occurs 0,
          PSPNR like prps-pspnr,
          POSID like prps-posid,
        end of it_wbs_prps1.
  data wa_prps1 like it_wbs_prps1.
  data: begin of it_wbs_prte occurs 0,
          posnr like prte-posnr,
          PSTRT like prte-PSTRT,
          PENDE like prte-PENDE,
          ESTRT like prte-ESTRT,
          EENDE like prte-EENDE,
          ISTRT like prte-ISTRT,
          IENDE like prte-IENDE,
        end of it_wbs_prte.
  data wa_prte like it_wbs_prte.
  data: begin of it_wbs_proj occurs 0,
          PSPNR like proj-pspnr,
          PLFAZ like proj-plfaz,
          PLSEZ like proj-plsez,
        end of it_wbs_proj.
  data wa_proj like it_wbs_proj.
refresh: it_wbs_prte, it_wbs_proj.
*it_wbs_jest.
if i_t_data[] is not initial.
Get data from PRPS WBS Master Data
     select pspnr posid PBUKR IZWEK USR10 USR00 USR02 objnr
       into corresponding fields of table it_wbs_prps
       from prps
        for all entries in i_t_data
      where POSID = i_t_data-POSID.
     sort it_wbs_prps by posid.
Get data from PRPS1 WBS Master Data
      select pspnr posid
       into corresponding fields of table it_wbs_prps1
        from prps
        for all entries in i_t_data
     where POSID = i_t_data-POSID.
    sort it_wbs_prps1 by posid.
Get data from PRTE Scheduling Data for Project Item
     if it_wbs_prps1[] is not initial.
     select posnr PSTRT PENDE ESTRT EENDE ISTRT IENDE
       into corresponding fields of table it_wbs_prte
       from prte
        for all entries in it_wbs_prps1
      where posnr = it_wbs_prps1-pspnr.
     sort it_wbs_prte by posnr.
     endif.
Get data from PROJ Project Master Data
     if it_wbs_prps1[] is not initial.
     select pspnr PLFAZ PLSEZ
       into corresponding fields of table it_wbs_proj
       from proj
       for all entries in it_wbs_prps
      where pspnr = it_wbs_proj-pspnr.
     sort it_wbs_proj by pspnr.
     endif.
loop at i_t_data.
   clear: wa_prps1, wa_prte, wa_proj.
   read table it_wbs_prps into wa_prps with key
              posid = i_t_data-posid binary search.
   read table it_wbs_prte into wa_prte with key
              posnr = wa_prps1-pspnr.
   read table it_wbs_proj into wa_proj with key
              pspnr = it_wbs_proj-pspnr.
         i_t_data-zzPBUKR = wa_prps-pbukr.
         i_t_data-zzIZWEK = wa_prps-IZWEK.
         i_t_data-zzUSR10 = wa_prps-USR10.
         i_t_data-zzUSR00 = wa_prps-USR00.
         i_t_data-zzUSR02 = wa_prps-USR02.
          i_t_data-zzPSTRT = wa_prte-PSTRT.
          i_t_data-zzPENDE = wa_prte-PENDE.
          i_t_data-zzESTRT = wa_prte-ESTRT.
          i_t_data-zzEENDE = wa_prte-EENDE.
          i_t_data-zzISTRT = wa_prte-ISTRT.
          i_t_data-zzIENDE = wa_prte-IENDE.
          i_t_data-zzPLFAZ = wa_proj-PLFAZ.
          i_t_data-zzPLSEZ = wa_proj-PLSEZ.
    modify i_t_data.
endloop.
endif.
endform.                    " 0wbs_elemt_attr

Hi,
it_wbs_prps1 .
If you are going to use this internal table to check for a null condition, shouldn't you first assign the data package to it?
For example,   it_wbs_prps1 = i_t_data[].
Because you are now using  it_wbs_prps1 to select data from a table and it doesn't have any data.
Please check.
-RMP
Edit : Please ignore this. I didn't see that you are actually filling the internal table. Sorry!
Edited by: RMP on Oct 18, 2010 12:16 PM

Similar Messages

  • Problem in creating include program for customer exit for BC425_01

    Hi,
         I want to write a customer exit for transaction BC425_01. For identifying the include program for exit , i go to System->Status.There I double click on the program name(GUI).Then I perform a 'FIND' in main program for 'customer-function' keyword. I get 3 search results with "CALL CUSTOMER-FUNCTION '001' " , "CALL CUSTOMER-FUNCTION '002' " , "CALL CUSTOMER-FUNCTION '003' ".
    Now i double click on CALL CUSTOMER-FUNCTION '001'  and i am taken to the code of program where this function is called in MODULE cust_check INPUT. I double click on CALL CUSTOMER-FUNCTION '001'  and then I am taken to the function module code which contains a single statement 'INCLUDE ZXBC425G01U01 .' .
    Now I double click on this include program so that I can write my own code. But when i double click on it , a message displayed 'Program names ZX.. are reserved for includes of exit function groups'. Hence I am not able to creates this include program and write my coding.
    Kindly Help
    THANKS

    Hi Amber,
    Then you click enter button.It is asking to create object with that include name ZXBC425G01U01 in a pop-up.You  should select YES option.It will ask package . Give the package name and save.Then include program is created and allowed you to write your own code.
    Thanks,
    Prasad GVK.

  • 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

  • Need for customer exit code to go to previous date

    In the ODS there is a date which is a user entry on my report. I need to write a customer exit which goes to previous date.
    In other words let's say user entered 07/07/07 at the user entry, and there is no activity for the entered date. The previous activity date in ODS data is 07/05/07. The report should run based on the previous date. ( Date is the key by the way )
    I will appreciate any help with points,
    Regards,
    Mike

    I just wrote this quickly and I limited to 10 loops because something is wrong if it is further back than that and I think another solution should be done.  This is also assuming the volume of data is not too large.  If so you may want to take the year off the date and add that to the select statement.
    Can the previous date be any date?  So lets say the user entered 07/07/07 and the last activity was 01/01/07?  Is date the only key? 
    If so you can do something like this.
    date_ 1 like <date_ field in ODS>
    date_ 2 like <date_ field in ODS>
    counter(2) type n
      DATA:    BEGIN OF data_all OCCURS 0,
                 Date_ 3 like date_ 1
               END OF data_all
    date_ 1 = user enter
    counter = 10
    Select <date_ field> from <ods backend table> into data_all
    Sort ascending
    While counter > 0
       Read data all where data_all-date_3 = date_1
    If sy-subrc <> 0
      Date_ 1 = date_ 1 – 1
    Counter = counter - 1
    Continue.
    Else
    date_2 = date_1
    Exit.
    Endif
    End loop
    Return date_2

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • Code for Customer exit in a variable is required

    Hi Guys,
      Document numbers are flowing in to two OD's. These doc numbers are available in 'X' and 'Y' ODS's.
    We are missing some doc nos both the ODS's. we want to display those doc nos in a report.
    We Created an infoset on these two ODS's.We want to write a Code for the Ccustome exit on this document number.
    Can anybody suggest how to get these doc nos in areport.
    Can anybody help me in writing a code on customer exit.
    Pleas give suggestions how to display rhes doc nos in areport.
    Thanks,
    Nela

    Hi,
    case I_VNAM.
    when 'ZPRYRPER'.
    if I_STEP = '2'.
    loop at i_t_var_range into temp.
    append temp.
    endloop.
    read table temp with key vnam = '0S_FPER'.
    if sy-subrc eq 0.
    move temp-low to l1_period.
    move temp-high to l_period.
    endif.
    if l_period-gjahr = 0000.
    l_period-gjahr = 2020.
    endif.
    if l1_period-gjahr = 0001.
    l1_period-gjahr = 1990.
    endif.
    CLEAR E_T_RANGE_WA.
    l1_period-buper = '001'.
    l_period-gjahr = l_period-gjahr - 1.
    l1_period-gjahr = l_period-gjahr.
    E_T_RANGE_WA-SIGN = 'I'.
    E_T_RANGE_WA-OPT = 'BT'.
    E_T_RANGE_WA-HIGH = L_PERIOD.
    E_T_RANGE_WA-LOW = L1_PERIOD.
    APPEND E_T_RANGE_WA TO E_T_RANGE.
    endif.
    Regards,
    Marasa.

  • Where do I write the code for customer exit variable?

    Hi Gurus,
    Can anyone tell me where and the procedure that I have to follow to get to the include ZXRSRU01 where I can write customer exit variable code.
    I know its written in ZXRSRU01, but in my system it seems like its not active or does not exist. How do I get to start working in this include for customer exit variables?
    Any help is appreciated. Thank you.
    Regards
    Reddy

    hi Reddy,
    variable exit use enhancement RSR00001 not RSAP0001. EXIT_SAPLRRS0_001.
    try to follow some steps in 'how to' doc related to this, and sample code may useful for you
    https://websmp206.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
    https://websmp206.sap-ag.de/~sapdownload/011000358700002765042003E/HowToVerifyVariableInput.pdf
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'CUMMONTH'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'MONTH'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.   "high value = input
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    hope this helps.

  • How to select data from an aggregate in a customer exit for a query?

    Hi,
    I have written a virtual key figure customer exit for a query. Earlier the selection was from the cube, where there was severe performance issue. So I have created an aggregate, activated and have loaded the data.
    Now when I select that data I find that the Key table is different in development and production. How do I resolve this.
    My code is attached below. The table in developemnt is KEY_100027 and in production is KEY_100004. This code is activated and running in BW development server.
    SELECT
        F~KEY_1000041 AS K____035
         F~KEY_1000271 AS K____035
         F~QUANT_B AS K____051
         F~VALUE_LC AS K____052
    INTO (xdoc_date, xval1, xqty1)
    UP TO 1 ROWS
    FROM
    FROM
    */BIC/E100004 AS F JOIN
    /BIC/E100027 AS F JOIN
    /BIC/DZMM_CGRNU AS DU
    ON FKEY_ZMM_CGRNU = DUDIMID
    JOIN /BI0/SUNIT AS S1
    ON  DUSID_0BASE_UOM = S1SID
    JOIN /BI0/SCURRENCY AS S2
    ON DUSID_0LOC_CURRCY = S2SID
    JOIN /BI0/SMATERIAL AS S3
    *ON FKEY_1000042 = S3SID
    ON FKEY_1000272 = S3SID
    JOIN /BI0/SMOVETYPE AS S4
    *ON FKEY_1000043 = S4SID
    ON FKEY_1000273 = S4SID
    JOIN /BI0/SPLANT AS S5
    *ON FKEY_1000044 = S5SID
    ON FKEY_1000274 = S5SID
    JOIN /BIC/D100004P AS DP
    *ON FKEY_100004P = DPDIMID
    ON FKEY_100027P = DPDIMID
    WHERE
    WHERE
    ( ( ( ( F~KEY_1000041 BETWEEN 20051230 AND 20060630  ) ) AND  ( (
    ( ( ( ( F~KEY_1000271 BETWEEN 20051230 AND 20060630  ) ) AND  ( (
             S3~MATERIAL = <l_0material> ) ) AND  ( (
                s2~movetype BETWEEN '101' AND '102' OR
             s4~movetype BETWEEN '921' AND '922' OR
             s4~movetype BETWEEN '105' AND '106' OR
             s4~movetype BETWEEN '701' AND '701' OR
             s4~movetype BETWEEN '632' AND '632' ) ) AND  ( (
             S5~PLANT = <l_0plant> ) ) AND  ( (
             DP~SID_0RECORDTP = 0  ) ) ) )
    GROUP BY
        ORDER BY F~KEY_1000271 DESCENDING.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
        ENDSELECT.
    How do I transport the code and make it work?
    Whats the reason that the two key fields are different.
    I had transported the aggregate from development to production. Activated it and filled the data.
    What is the way out? Please help.
    Regards,
    Annie.

    Hi Sonu,
    The main task is to move the contents of the one internal table to another with some condition.
    First sort and delete the duplicate entries from the First Internal table like below : 
    sort it_tab by material ascending date_modified descending.
    delete adjacent duplicates from it_tab.
    Then move that Internal table contents to another internal table.
    Define another internal table with the same structure as you have first internal table and then
    Second Step :
    it_itab1 = it_itab.
    If you are using seperate Header line and Body then you can do like below :
           it_itab1[] = it_itab[].
    This will fix the issue.
    Please let me know if you need any further explonation.
    Regards,
    Kittu
    Edited by: Kittu on Apr 24, 2009 12:21 PM

  • 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.

  • How to Write a CUstomer Exit for a variable in BEx

    Hi,
    How to write a customer exit variable in bex Query designer
    Do i need developers key for this (If so what type of key do i need so that i can ask basis tean to generate)
    Info Object: ZEXP_DTE (Expiry Date)
    Variable on ZEXP_DTE :
    ZEDTE
    Type: Customer Exit
    Can any one please tell me how to write a code in CMOD from this (Step-by Step)
    Expiry Date > Current Cal Day
    As arun said
    'l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.'
    I want to insert the above code for the above customer exit but as i am new to BW as  ABAP please explain me what are the steps involved in CMOD
    Thanks

    Hi,
    To write customer exit for a variable, you require Access key.
    Contact your BASIS to get that.
    Access Key,BASIS?
    To write Customer exit,
    User Exits
    User Exit for Variable
    /thread/809285 [original link is broken]
    Hope these helps u...
    Regards,
    KK.

  • Variable Offset for Customer Exit??

    Hi,
    is it possible to have a variable offset for customer exit time variables?
    E.g. I have a variable current month but can I also create a one-year offset of that?
    In our system that doesn't work (but also the current month variable doesn't work...)
    thanks
    Sabine

    Hi,
    As it is mentioned by Mr.Voodi,it definately works.
    You only has given the answer for your problem .i.e you need to make sure the Customer exit variable is working proper.So take a look on the code used for it.
    With rgds,
    Anil Kumar Sharma .P

  • Customer Exit for Calendar Month based on the day (system Date)

    Hello,
    I need help in creating a customer exit for Calendar month without the user input. The logic is as follows:
    For the BEx variable created with customer exit option and no user input:
    If the day on the system date falls in between 1 to 14 take the calendar year/month value as previous month.
    If the day on the system date falls in between 15 through 31 then take the calendar year/month as current month.
    eg if report is run on March 24th2009 the calendar year/month variable should be calculated as 03/2009 (March 2009)
    if the report is run on March 1st2009 the calendar year/month should be calculated as 02/2009 (Feb 2009).
    The code should be effective when run in the first 15 days of Jan when the previous month would contain the previous year as well.
    Thank You
    Srishti

    Thanks Shanthi. I am trying to incorporate the logic when the query is run in beginning of Jan when the year should be the previous year.Following is the code.please let me know if it would work. Is there a way I can test it as well?
    CASE I_VNAM.
    WHEN 'ZCURCALMON'.
    IF i_step = 2.
    data: mm(2),
            dd(2),
            yy(4),
            FM(6).
    if sy-datum+4(2) EQ 1.
    sy-datum(4) = sy-datum(4) - 1.
    else.
    sy-datum(4) = sy-datum(4).
    endif.
    if sy-datum+6(2) LE 15.
      mm = sy-datum+4(2) - 1.
      concatenate sy-datum(4) mm into FM.
    else.
      concatenate sy-datum(4) sy-datum+4(2)  into FM.
    endif.
    l_s_range-low = FM.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    Endif.
    ENDCASE.
    Thanks
    Srishti

  • Customer exit for difference of weeks

    Hi All,
    I have two formula variables with processing from customer exit.
    1. ZVAR_FV1 = getting current calendar week from system
    2. ZVAR_FV2 = getting user entry week in formula variable
    Now I want to find the difference between the two.
    So if current week is 012011 and user entry week is 502010
    then ZVAR_FV1 = 201101
           ZVAR_FV2 = 201050
    I need the difference of the two weeks as 3
    Can u please advise how can i get that ?  is it possible to find the difference of the two in the query level?  if i need to write a customer exit can u please advise the code for it as I am not an ABAP expert...
    Many thanks!
    Tanu

    Hi,
    As per you mail you have two variables.
    ZVAR_FV1 & ZVAR_FV2.
    Take a new variables ZVAR3 till ZVAR7
    ZVAR3 = ZVAR1_FV1+0(4).
    ZVAR4 = ZVAR1_FV2+0(4) .
    ZVAR5 = ZVAR3 -ZVAR4.
    ZVAR6 = ZVAR5 * 52.
    ZVAR7 = ((ZVAR1_FV1+4(2)) + ZVAR6) - (ZVAR1_FV2+4(2)).
    By the above code you will have your 3 in the variable ZVAR7.
    Thanks & Regards,
    Vishnu

  • How to write customer exit for the variable

    Hi Experts,
    I have a requirement to create the variable, the scenaria is like this..
    I need to create the variable which gives the period/year values,if yours enters the values 05.2007 then the variable should return the first monthe the year i.e.01.2007.
    I hope it can be done by writing the customer exit..but iam unware how to achieve this.
    Please explain me step by step and cope for customer exit to done this.
    Points will be awarded
    Suraj.

    hi Suraj,
    there should variable sap exit for first month,
    for customer exit, check this how to doc for steps
    https://websmp210.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
    your code may look like
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'your 1st month variable'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'your user input variable'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    hope this helps.

  • How to find CUSTOMER EXIT for a Standard SAP program

    How to find CUSTOMER EXIT for a Standard SAP program

    Hi
    To introduce the techniques of enhancement in standard SAP system. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
    They do not affect standard SAP source code.
    When you add new functionality to your SAP System using SAP’s exits, you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. These customer objects are linked to standard applications, but exist separately from SAP’s standard software package.
    They do not affect software updates.
    When you add new functionality to your SAP System using SAP’s exits, your objects (called customer objects) must adhere to strict naming conventions. When it comes time to upgrade a to a new software release, customer objects’ names ensure that they will not be affected by any changes or new additions to the standard software package.
    Customer exits are not available for all programs and screens found in the SAP System.
    Any change made to an SAP object in a customer system is called a modification. Customers usually modify their systems for one of two reasons. Either they make changes to the SAP standard in order to adjust the R/3 System to their specific business needs (actual modifications), or they alter individual SAP objects in order to correct an error (as recommended in an SAP error note).
    You should only modify the SAP standard if the modifications you want to make are absolutely necessary for optimizing work flow in your company. Be aware that good background knowledge of application structure and flow are important prerequisites for deciding what kind of modifications to make and how these modifications should be designed.
    SAP application programmers create SAP enhancements in transaction SMOD using function module exits, menu exits, and screen exits.
    Customers are given a catalog containing an overview of existing SAP enhancements. They can then combine the SAP enhancements they want into an enhancement project using transaction CMOD.
    SAP enhancements are made up of component parts. These components include function module exits, menu exits, and screen exits. A specific component may be used only once in a single SAP enhancement (this guarantees the uniqueness of SAP enhancements).
    Customer enhancement projects consist of SAP enhancements. Each individual SAP enhancement may be used only once in a single customer enhancement program (this guarantees the uniqueness of a customer project).
    SAP application programmers preplan function module exits, menu exits, and screen exits for their applications and combine them to create useful enhancements for the R/3 System.
    Customers create their own enhancement projects for their systems using SAP enhancements. You can customize the individual components of an enhancement project by creating your own include programs (for function module exits), texts (for menu exits), and subscreens (for screen exits).

Maybe you are looking for

  • How to transfer my iTunes Library from a Mac to a PC and keep all the Metadata?

    I need to transfer my music library from my macbook to a desktop PC running Windows 7. I have tried using Home Sharing as well as transfering the whole iTunes folder over using an external hard drive. Neither attempt kept all my metadata. Is there an

  • Error in Master data load

    hello gurus, where my service order attribute had loaded successfully But now i got strucked in loading text for the same, request got all the data but shows still running where in detail tab it is showing mess as follows <b>>Extraction (messages): E

  • ORA-20011: Approximate NDV failed:

    Following errors written to the Alert log file. can anybody tell u what is the reason & how we can resolve ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error Thanks in advance..

  • Error on My Services page Total BB Option 1

    When I log in to my account there is an error on My Services broadband section it says 40GB but Option 1 is only 10GB. Copied & pasted below: BT Total Broadband Option 1 Part of your Broadband and Calls bundle 40GB usage Advanced anti-virus security

  • PJC tab-key navigation problem within bean  (FORMS intercepting tab key??)

    Using Forms 10.1.2.3, IE7, JRE 1.6 When attempting to navigate within the bean area, it appears as if FORMS is suppressing the keyEvent when the tab key is pressed. This means that I cannot use tab or shift-tab to navigate within the PJC's editable f