Variable user exit question

Hi all,
i m looking for a code to make an User exit variable  to select the actual month and the previous month , for example in this moment ( september and October )

Hi,
Use Tcode: CMOD, funtion module :EXIT_SAPLRRS0_001 double click on the program ZXRSRU01, start writing ur code. The code which i gave u is for Calculate Month to date, similarly u have change the code as per ur requirement.
Regarding User exits:
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
to calculate "month to date" user input is "Calday" Key Date
sample code:
WHEN 'ZPUTMNTH'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZPDATE'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(6). "low value, e.g.YYYYMM (200606) part of key date (20060625)
L_S_RANGE-LOW+6(2) = '01'. “ low value e..g. YYYYMM01 (20060601)
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.

Similar Messages

  • How can i do a variable User exit that present the values before execute

    Hi Gurus,
    How can i do a variable User exit that present the values before execute, i need this:
    a variable that calculate SYS-DATUM until 30 days before (I got the code) but this  variable run automatic because is user exit, i want this variable but first present the values, not execute automatic, this is because the users want the report that automatic present the values , help

    Hi,
    Refer the below links,
    http://documentation.softwareag.com/natural/nat424mf/pdf/ops_mf/conf_usrex.pdf
    http://www.erpgenie.com/component/content/article/1097
    http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
    Hope it helps you,
    Regards,
    Ravindra.

  • Filters with variables user-exits on queries

    Is it possible to define complex selection criteria by using the EXIT_SAPLRRSO_001?. Something similar to what we may do a select for Sap:
    Select * from table where ((field1 = value1 and field2 = value2) or (field1 = value3 and field2 = Value4)).
    I guess not, it seems that only allows a range for output as a single variable ...
    If this is not possible, is there any way to filter the data before the show?. I do not care who is among the infoprovider and Bex, who between Bex and Excel ...
    Filters with variables user-exits on queries

    The variable can take any combination that can be specified in a select-option. The criteria used to select these values to be populated for the variable can be as complex as any ABAP program. So all combinations in a select statement are allowed.

  • Steps for Variable User Exit

    Hi All,
    I have to do some coding in my variable exit. I have followed the follwing steps to create a project a write the code. Anyone please confirm if my steps are correct or missing anything.
    1. Go to CMOD, give project name and Click on create.
    2. Enhancements -> give RSR00001. and click on Components.
    3. Double click on 'EXIT_SAPLRRS0_001'. This will bring up the functionmodule in which we can find an include.
    4. Double click on 'ZXRSRU01' Include.
    5. Press Enter for the warning message.
    6. It gave me a message saying that 'the Include doesnot exist, Do you want to create it'. Click Yes. This will bring up a blank ABAP editor.
    7. Write the required code using CASE Statement.
    Am I missing anything here?
    I would be grateful if someone can send me any documents relating to the variable User Exits.
    Best Rgds,
    James.

    Hi,
    Directly go se38 and execute ZXRSRU01 program. Then write a case statement. below is the sample code to calculate default year month variable.
    case v_name.
      when 'ZYRMTH'.
        if i_step = 1.
          read table i_t_var_range
          with key vnam = 'ZYRMTH'
               into ld_s_var_range.
          if sy-subrc ne 0.   " no value exists, assigns default
            c_year = sy-datum(4).
            c_month = sy-datum+4(2).
            if c_month = 1.
              c_year = c_year - 1.
              c_month = 12.
            else.
              c_month = c_month - 1.
            endif.
            concatenate c_year c_month into c_monyr.
            l_s_range-low = c_monyr.
            clear e_t_range.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            append l_s_range to e_t_range.
          endif.
        endif. 
    endcase.
    Regards,
    Malli

  • Selection screen values in global variable user exit

    Hi all,
    I made a project report global variable of type 3 (User Exit) and I develop the related code in enhancement KKDR0001 component EXIT_SAPLKYP1_003. In this code I need the value of project definition that user entered on selection screen.
    Does anybody know how can I get this data?
    Thanks!

    Hi,
    You can do the following for getting project in Earlier screen
    Data: l_string(20) type c
    Field-symbols: <fs> type any.
    l_string = '(Screen)variable name'.
    assign l_string to <FS>.
    Just try above...

  • Variable User Exit

    Hi have a user exit variable in a query (It must concatenate two characteristics from the user entry parameters).
    WHEN 'NOMSOLI'.   " nombre solicitante tarifa compras
          CLEAR: l_s_var, l_s_var2.
          READ TABLE i_t_var_range WITH KEY vnam = 'OS_SALON'
                                                    INTO l_s_var.
          IF ( sy-subrc EQ 0 ).
            LOOP AT i_t_var_range INTO l_s_var2 WHERE vnam = 'OS_EDICI'.
              IF ( sy-subrc EQ 0 ).
                CONCATENATE l_s_var-low '.' l_s_var2-low INTO l_s_range-low.
                l_s_range-sign  = 'I'.
                l_s_range-opt   = l_s_var2-opt.
                APPEND l_s_range TO e_t_range.
              ENDIF.
            ENDLOOP.
          ENDIF.
    I must to take care the user entry parameters of the query : LE,BT,GE..... <,>, = , ..etc
    The final result of the variable shows the follow structure data (because the entry parameters user)::
    I   |GE |S028.006  
    I   |LE |S028.008  
    but when I execute the query, it shows an error about the interval result.
    Some one knows how it works when you have more values entry data?
    Because always I create user exit variables like:
    I   |EQ |S028.006

    Hi MP,
    The code seems to be OK as per your current requirement. Please clear below mentioned points are correct as per what i understand.
    User Input
    1. OS_SALON
    2. OS_EDICI
    -> First input is going to be single.
    -> Second input would always be multiple but single values with various options.
    -> you need to concatenate first value with all the second values and the options of just 2nd one.
    -> After concatenation, you need to validate the result value with the data in the infoprovider.
    -> Validated data then needed in output.
    I can suggest you some alternate method if it is same what i understand.
    Regards
    Raj

  • Variable User Exits

    Previously I have only used CMOD to manipulate variables in queries. However, my current client has BW 3.5 and I have read that the direction now is to use the BADI RSU5_SAPI_BADI.
    Can anybody provide an example of a user exit using the BADI? I know enough ABAP to get by in the old user exit but I don't think my knowledge extends this far.
    I am on BW 3.5 SP13.
    Cheers,

    hi,
    sample code
      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.
    sent doc also ...

  • Convert Variable User Exit to ABAP OO

    Hi, I recall an article that demonstrated a better way to implement the Varaible User Exit with ABAP OO, instead of the usual design.  The ABAP OO way would eliminate a single variable code error from shutting down all of the others.   Can anyone point me to the article?
    Thanks

    Hello,
    You can use BADI which is a ABAP OO.
    [Enhancing DataSources with BAdI RSU5_SAPI_BADI|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3001894b-b1fb-2910-77ba-e80b6f2053b7]
    [Implementing a Business Add In (BAdI) in an Enhancement|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702]
    Thanks
    Chandran

  • Formula variable user exit.

    Hello experts;
    I will provide max points for help with this.
    In query designer can I access a key figure from another cube and use it in a formula?
    I cannot use multi-cube in this solution so I was looking into creating a formula variable using a user exit to access a key figure stored in a different cube.
    Ex:
    I have a Tracings cube with customer and material cost information.
    I need to calculate the cost per patient for Absorbent material.
    I can get the customer cost for Absorbent material but the number of patients is stored in a different cube called Census information.
    Since the Census information is not related to a material (only customer) I cannot get the number of patients together with the cost of the absorbent material. I was hoping to access the Census information (number of patients) from the query calculating the cost per patient.
    Thanks
    Den

    I really don't see how you can implement it using exit variable even if you can read data from other cube in exit. If you still want to explore it, refer the following thread - How to read data from an InfoCube in BI 7.0?
    Why can't you build a multiprovider - these kind of requirements are precisely the reason why multiprovider is there (when you need information present in multiple infoproviders in the same report)

  • A user exit question about ck11n .

    I want to get a  user exit  about i can change some  parameters before i run ck11n ,such as in routing date tab ,i want to change the group counter parameter before i run ck11n in user exit ,i found a badi named is DYNPRO_EXTENSION_CK ,but it can't actualize my need,who can give me some cue about it ?thank you very much !

    Hi
    It seems no user exits exist for this transaction
    found the following BADI
    check them
    COSTINGRUN_CK              Edit Costing Run
    COST_APPORTION_CK    Maint Apportionment Structure Joint Production: Dist Rules
    CO_PROD_COSTING_CK    Cost Management for Joint Products (Costing, Target Costs)
    DATA_EXTENSION_CK       For Data Enrichment in Product Costing
    DYNPRO_EXTENSION_CK       BAdI for Interface Enhancement in Costing
    ORDER_COSTING_CK            Enables Header Data Changes in Preliminary Order Costing
    QUANTITY_STRUCT_CK         Enables Quantity/Structure Changes in Costing
    SUR_STOCK_TRANSF_CK     Overhead on Materials with Stock Transfer Between Plants
    CK_KALAMATCON2_CI          BAdI for CI Fields for Table KALAMATCON2
    VALUATION_CK                     BAdI for Valuation in Product Costing
    Reward points if useful
    Regards
    Anji

  • Answer for user exits question please

    hi,
    this is vishnu vardhan
    1. how many ways are there to see the function modules used of enhancements in user exits?
    2.how to print a script on a news paper for 20 lines ,space and 20 lines?
    3.is there any table for storing the source code of reports and MM flow?
    4.wt is QRFC?
    5. how to work on BAPI and BADI ?

    1. how many ways are there to see the function modules used of enhancements in user exits?
    Ans: 1. You can search the standard program with "CUSTOMER-FUNCTION" tag
            2. If you know the exit name you can go to CMOD
    3.is there any table for storing the source code of reports and MM flow?
    Ans: Explore the SAP Help to know the process flow in MM. For example you can check this link:
    http://help.sap.com/saphelp_47x200/helpdata/en/f0/4228f5a97311d2897a0000e8216438/frameset.htm
    TSTC table contains the list of program names and transaction codes. Donno the table which stores source code. Doubt it exists!
    4.wt is QRFC?
    Master the 5 types of RFCs in ABAP. Check this excellent link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f078394a-4469-2910-c4bf-853c75674694
    5. how to work on BAPI and BADI ?
    Check these links:
    http://www.allsaplinks.com/bapi.html
    http://www.allsaplinks.com/badi.html
    And many more in this forum to search.
    Hope the above stuff helps you...
    Thanks,
    Santosh

  • CATS User exit Question

    Hi Guys,
    I have two custom fields in my CATS time sheet called Zclock1 and Zclock2. For a record that already exists I need to pre-populate these fields when I open the time sheet for an employee using CAT2, Which user-exit should I use?
    I tried CAT0002 but this one will trigger only at the time of creating a new record or modifying an existing record.
    Thanks,
    Roy

    hi Avisek Bhardwaj,
    i want to change the data when i use CAT7 to transfer data to CO, before CO document created i must delete some dummy WBS element in a certain user-exit, so i need to find  this user-exit to process the data,
    i've checked the enhancement CATS0002, but it isn't what i want,
    i've found one user exit  PCA00001--EXIT_SAPLPC02_001(EC-PCA: Changes to Document when Transferring CO Actual Data)
    i do delete dummy wbs element in this user exit but when transferring is finished, i find that the dummy wbs element still appears in the co document. it looks like that user exit doesn't work.
    i don't know why,
    regards,
    buffer

  • Variable user exit EXIT_SAPLRRS0_001 not called when I execute my query

    Hi *,
    I have created a variable in my query. Corresponding to that, I have written an exit in EXIT_SAPLRRS0_001. Wanted to debug this exit but unsuccessful.
    I put a breakpoint in  "IF i_step = 2." and started running the query. I thought that the point of execution will be hated at my breakpoint so that I can check my logic.
    But the query simply directly executes. Where is the fault ? What needs to be checked ? Is the exit being called? My debugging technique is right ?
    Will assign points for suggestible remedies.
    Regards,
    Srinivas

    Hi !
    Case 1.
    your cmod project may not be activated.
    a. Go to the cmod "editior" go to change mode and activate your code....
    b. press back button once ...
    c. continue to press activate button at every step till you come to cmod initial screen ...
    At last when you are at cmod initial screen ... press activate again ....
    This is very important as our cmod code (project) should be activated at every level ...
    Case 2.
    If it still does not work ... try using a break point just before the code segment ( case statement or if statement i.e. case 'i_vnam' etc .... ) and try to debug....
    Hope it helps ....
    Regards
    Anshul

  • EHS FM user exit  Question

    Dear experts
    In EHS, we copy FMs and change the configuration to point to the copied FM for modifications. In this case, what happens during an upgrade? How should such a situation be handled.
    Thanks
    Raj

    Please check the following enhancement components.  One of them should suit your requirement.
    LMR1M001
    LMR1M002
    LMR1M004
    MM08R002
    MRMH0001
    MRMH0003
    MRMN0001
    RMVKON00
    WIS60001
    Cheers,
    Balaji

  • User exit question

    Hello, i have seen in my last project that when you go in to cmod. you have the program and when you click on the program it has different datasources listed like 2LIS_02_PUR and then there is one program written under SE38 which is named after 2LIS_02_PUR. some one told me the purpose is so many people can work at the same time in cmod. can someone tell me if i am working on a brand new implementation how can I implement that?
    Example:
    Inside the include program 'ZXRSAU01', there is a line like this "CONCATENATE 'ZBW_TRN_'1_datasource INTO l_prog_name."
    and then
    if you go in SE38 :
    we have programs with names like
    "ZBWI_TR_2LIS_02_HDR" or
    "ZBWI_TR_2LIS_02_ACC" etc. for each data source.
    Would just putting CONCATENATE 'ZBW_TRN_'1_datasource INTO l_prog_name." be enough or I need to write some program?
    Please help. thanks.

    Hi Vik,
    In your project
    they have not used the old technique of writing a Case statement and then a When condition for each datasource as it makes the code quite messy and if several developers/teams are modifying the code then creates challenges for transport management.
    So after using CONCATENATE 'ZBW_TRN_'1_datasource INTO l_prog_name.
    The code in the Include we can simply create a new program starting with ZBWIN_XXXX for each data-source which will be independent from any other enhancement so wonu2019t create any problems.
    Thats the reason why you are able to see the Programs in Se38.
    in the Programs they had written the logic od what fields they had enhanced and select statement to populate the values to the enhanced fileds.
    You can check the document link posted earlier by frank... it shows the earlier way how we used to write the code in the CMOD -include program.
    If its a brand new implimentation there is not much to do from your end, based on the business requirement we check the Business content data source if needed we go for enhancing the Datasource by appending the fields and writing the logic in the CMOD.
    Check the below link which explains you with the new technique that used in your proj
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00c1f726-1dc2-2c10-f891-ddfbffdb1a46?quicklink=index&overridelayout=true
    Regards
    KP

Maybe you are looking for

  • I just upgraded to 6.0 and links that want to open in a new window do not work. Right click and selecting open in new window does work.

    Similarly clicking a link in email does not open a window. I can drag the link to Firefox and a new tab opens. Also clicking Tools -> Add-ons does not open a tab as it used to.

  • Flashplayer on Windows 8.1

    I have Windows 8.1, IE 10 and Flashplayer 11.9. I was playing a game on Facebook and it kept freezing and had to be recovered. I decided to look around to see if I could find a problem. I checked my list of add ons and found Shockwave Flashplayer the

  • Precission error with double 32668.6536

    I have found something really odd adding two double values that add up to 32668.6536. Instead of getting this double Im getting 32669.653599999998. I cant think of a good reaso why the Java is doing this wild conversion. Any tips would be appreciated

  • Cyan update/ software recovery tool firmware

    I may have already asked this question but maybe not in this way. After reading through a lot of resources and articles I have read Microsoft is suggesting everyone running the 8.1 developer preview downgrade to the commercial 8.0 firmware using the

  • Regarding static block

    Hi, I need to get two properties from the properties file and i will use these properties across the application,How can i write the util class which get the two properties and i can use acrross the application. Can i use the staic block in the util