User exit today's date vs. last week

hi all,
Can anyone send me the ABAP code to get the previous week data from today's date (user entry).  I created a variable in qry but i need to write the user exit code.
I'll assign points.
thanks

hi SKB,
just sent 'how to derive var doc' to [email protected],
try
  DATA: L_S_RANGE TYPE RSR_S_RANGESID.
  DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
  CASE I_VNAM.
  WHEN 'yourvar'.
    IF I_STEP=2.    "after the popup
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
              WHERE VNAM = 'variablename where user entry'.
        CLEAR L_S_RANGE.
        L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW - 7.
        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.

Similar Messages

  • V50EPROP User Exit: Foreign Trade Data Proposal

    Hello All,
    I want to use EXIT_SAPLV50E_003 from V50EPROP(User Exit: Foreign Trade Data Proposal in MM and SD) enhancement to update the EXART field of the EIPO table.
    I have written code etc and when I run the VL02n and click on the save button, my code in EXIT_SAPLV50E_003's include does not get called at all. where as the debugger I put in EXIT_SAPLV50E_006's include gets called.
    PLease tell me anything I have missed in configuration of activation of user exit?

    Hi,
    have you create and activate project from CMOD ?
    Bye
    Roberto

  • User exit for component data in ME21n/ME22n

    Hello,
    I have a requirement to issue an error message if a component quantity is not evenly divisible by the end item quantity.  The component data (BOM) is entered after clicking the components button on ME21n/ME22n at the item level detail.  I need to evaluate the data after a user clicks save, but I cannot find a user exit where the data is passed into, or where it is defined as global data where I can reference it in a user exit.  The data is stored on the screen in structure MDPM and stored in the database in table RESB.
    I appreciate any help,
    David

    Thanks for pointing me in the right direction.
    I was able to put my code in EXIT_SAPMM06E_012 and retrieve the component data through (SAPLEINK)XMDPM[]
    Below is the code I used to assign the data to be able to evaluate it.
    FIELD-SYMBOLS: <z_mdpm_x> TYPE ANY.
    DATA: i_mdpm_x TYPE STANDARD TABLE OF MDPM_X.
    Fetching Component data
      ASSIGN ('(SAPLEINK)XMDPM[]') to <z_mdpm_x>.
      CHECK sy-subrc = 0.
    Assigning data into an internal table
      i_mdpm_x[] = <z_mdpm_x>.
      CHECK i_mdpm_x[] IS NOT INITIAL.
    David
    Edited by: David Herrema on Oct 20, 2010 3:03 PM

  • User exit to populate data

    Hii ,
    I have to send IDOC  ORDERS05 to be extended to add custom fields and code an appropriate user exit . Is there any user exit to populate data ??
    They have told me to use RSEOUT00 program to send the orders05 idoc . My main concern is which user exit  will I use to populate data ??what are the basic steps to populate data and send the idoc  Please let me know .
    Thank you

    Hi,
    Please note that user exits provided in the function module IDOC_OUTPUT_ORDERS.
    Use T/Code SE80 and explore function group "XVED". This will give you all the user exit functions in IDOC_OUTPUT_ORDERS.
    You can write your code in Zinclude programs .
    Ex: ZXVEDU03
      CASE SEGMENT-SEGNAM.
        WHEN 'E1EDK01'.
          CLEAR: WK_PLANT, WK_EQUNR, WK_BNDDT,WI_WERKS.
          CLEAR: WK_PLANT_DONE, WK_PRICE_DONE, WK_EQUNR_DONE, WK_BNDDT_DONE.
          CLEAR: WK_BAAN_LINE_PRICE_DONE.
          CLEAR: WK_BAAN_HEAD_PRICE_DONE.
          PRICING_CTR = 3.
        WHEN 'E1EDK14'.
          MOVE SEGMENT-SDATA TO E1EDK14.
          PERFORM Z_EXIT_E1EDK14.
        WHEN 'E1EDP19'.
          XVBAP = DXVBAP.
          MOVE SEGMENT-SDATA TO E1EDP19.
          PERFORM Z_EXIT_E1EDP19.
          DXVBAP = XVBAP.
    and soon....

  • Calculate Dates for Last week and next three weeks

    Hi,
    I have a report where I need to calculate dates between last week and the next three weeks (not counting current week). I'm familar with the first part, it could be done by using the LastFullweek function but not sure how I can avoid the current week and calculate the next three weeks.
    Any help is greatly appreciated.
    Thanks!

    ... and here are a few more...
    Last Week...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    THEN TRUE ELSE FALSE
    The week before...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    THEN TRUE ELSE FALSE
    And the week before that...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    and of course all 3 weeks together...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    If you want the 1st day of the week to be Monday instead of Sunday just change the date of #1/7/190# to #1/1/1900#
    HTH,
    Jason

  • How to pass relative dates (Yesterday, Last week) via Command Parameters in a linked subreport

    I have been struggling with this one and would sure appreciate your help
    I have a report that runs fine but takes to long when running, to optimise it have setup it up as a subreport , created a main report which I linked to it via a relative field ({?ServiceID}) field, this has reduced the report time but I would like to go even further by user selecting date e.g startdate, enddate or relative field eg ‘yesterday’, ‘Last Week’
    I can do the selectable start and end date fine but I’m failing to make use of the ‘Yesterday’,’ last week’ within the command parameters, below is an example of the code I have on the reports select expert but I want a semiliar filtering on the command parameter to avoid the filtering taking place on crystal but straight from the DB.
    IF  {?Relative Date}= "Yesterday" THEN currentdate-1
    ELSE IF {?Relative Date}="Last Week" THEN LastFullWeek

    Good Day Guys,
    Apologies for the late response, I have been looking and trying the different suggestion you pointed out, unfortunately without any success
    Stored Proc
    Nrupal, I tried setting one up but I’m getting a error I cannot seem to get past, below is my condition, any help would be appreciated
    where cd1.Service_ID = @Service_ID
    and cd1.CallStartDt in (
      Case @RelativeDate
      When 'Today' then CONVERT (date, getdate())
      When 'Yesterday' Then DATEADD(DAY,-1,CONVERT (date, getdate()))
      When ‘Last Week’ then between @LastWeekStart and @LastWeekEnd       //sytntax before between, also tried using ‘IN’, same result
      When ‘Last Month’ then between @LastMonthStart and @LastMonthEnd 
    else between @CallStart and @CallEnd
    END )
    End
    Crystal command parameter code
    where cd1.Service_ID in ({?Service_ID}) and
    convert(datetime,cd1.CallStartdt) in (
    Case {?RelativeDate}
    When 'Yesterday' Then GetDate()-1
    else  {?CallStart}
    END)
    Abhilash,
    I have tried both your proposed command parameters but still fail
    I’m getting an invalid column name ‘Yesterday’ error , I’m not sure if Crytsal takes this type of command formatting using the command parameters, would appreciate your help as I would like to stay clear of the SP, unless it’s the only altanative
    Dell
    I will start working in your re
    Thanks Again

  • User exit for additional data B for sale order item .

    Hi., all
    my client requirement is
    (  This business requirement will make the Last Price for a given item be visible during order entry.  )
    u2022Retrieve & display during order entry, the most recent unit price given to a customer for a specific item, from the Billing data.
    . Display the Last Price under Additional Data B Screen
    add new field (last extended price) in additional data b screen.
    after that 1.     Using the Sales Order Material Number (VBAP-MATNR), Sales Order Sales Organization (VBAK-VKORG), Sales Order Distribution Channel (VBAK-VTWEG), Sales Order Division (VBAK-SPART), Sales Order Sold-to Number (VBPA-KUNNR for VBPA-PARVW=u2019AGu2019) to access the Billing Items By Material Index Table (VRPMA) and specify a billing date (VRPMA-FKDAT) of less than 60 days from current Sales Order requested delivery date (if specified at header VBAK-VDATU or at the schedule line level (VBEP-EDATU).  This will result in all the billing documents where the Sold-to bought the item but isnu2019t completely refined as of yet.  Retain the billing document (VRPMA-VBELN), item (VBPMA-POSNR), and billing date (VRPMA-FKDAT) in a temporary table to pass to number 2 as the input.
    2.     Use the billing document (VRPMA-VBELN) and item (VRPMA-POSNR) to read the Sales Document Partners Table (VBPA) where the partner function (VBPA-PARVW = u201CSHu201D) and the Sales Order Ship-To (VBPA-KUNNR for VBPA-PARVW=u2019WEu2019) to select ONLY billing documents that are for that given ship-to location.  This filters out only billing documents relevant for that ship-to location. 
    3.     From the resulting list of billing documents, select the most recent date (VRPMA-FKDAT) which will refine the search for the last Billing Document (VRPMA-VBELN) and item (VRPMA-POSNR).
    4.     Using the most recent Billing Document (VBPA-VBELN), access the Billing Document Item Table (VBRP). To result in the Last Extended Price as VBRP-KZWI1.
    5.     This price will be an extended price which needs to be calculated as a u2018unit priceu2019.  For this billing item, select the sales unit (VBRP-VRKME) to determine if the sales unit is in cases or eaches. 
    a.     If the unit of measure is in cases, then simple math is required to divide the Last Extended Price (VBRP-KZWI1) by the billing quantity (VBRP-FKIMG).  Standard rounding should apply when .005 results in a .01.
    how to achive this ?

    Hi Chakravarthy,
    use the Exits provided in SAPMV45A -includes MV45*ZZ and screen exits as well 8309 8310 8459, 8460. Just be sure to
    use zznnnnnn include in the SAP provided forms instead of coding directly in the forms.
    You can check below user exits:
    MV45ATZZ :For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
    MV45AOZZ:
    For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
    MV45AIZZ:
    For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
    MV45AFZZ and MV45EFZ1:
    For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
    Reddy

  • User exit to calculate Same period Last Year

    Dear gurus,
    can some help me to code the user exit to calculate the same period last year for bex variable
    i.e
    System date :18.05.2010
    Same period last tear : 18.05.2009
    Your help  highly appreciated
    Thank you
    BR

    Hi,
    The above code creates problem only when date is 29th of Feb.
    To find whether year -1 is leap yr or not include following code also:
    l_year = sy-datum(4)-1 .
    l_mod4 = l_year mod 4.
    l_mod100 = l_year mod 100.
    l_mod400 = l_year mod 400.
    if ( l_mod4 = 0 and l_mod100 ne 0 ) or l_mod400 eq 0.
    if( l_date = 29)
    l_date= l_date -1.
    endif.
    endif.
    Modify your code according to youe need. Hope this helps you.
    Thanks,
    Jitender.

  • User Exit for Validity Date for VA41 Tcode

    Hi,
    I am giving order type in VA41 Tcode and then Clicking on 'Create with Reference' .Then  a Pop Up is getting generated. In this i am giving Contract created with validity date lessthan today's date(in Contract Tab).For Example i created a Contract xxxxxx with 'valid to'  9.12.2008. When I am giving this contract and clicking on 'Copy' button a Warning message is getting generated 'The sales document is only valid until 09.12.2008'. Now i have to change this into Error message instead of Warning Message.
    i used User Exits  mv45afzz,MV45AFZA,MV45AFZB. But the debugger is getting started only after Warning message got generated.Is there any User Exit for which debugger gets started  when i give the Contract and then Click on 'Copy' button. Please Suggest.
    Thanks and Regards
    K Srinivas

    Hi,
    One idea. Go to VTAA (copy between sales docs) and create a new VOFM where you manage the copy control. Set a warning/error message in the new VOFM (in your range number), and try it.
    Regards,
    Eduardo
    Edited by: Eduardo Hinojosa on Dec 10, 2008 3:58 PM

  • User Exit for reading data from a hierarchy in BW-BPS

    Hello Forum,
    How can i fetch all the records from a particular node in a Hierarchy using a user exit in a variable in BW-BPS,
    Plz Help,
    Regards,
    KK

    Hi,
    This is a sample code that may help you.
    DATA: BEGIN OF wa_val,
            from TYPE rsleaffrom,
            to   TYPE rsleafto,
          END OF wa_val,
          tb_val LIKE wa_val OCCURS 0 WITH HEADER LINE,
          tb_grpval_ce LIKE wa_val OCCURS 0 WITH HEADER LINE,
            tb_ce_val   TYPE rshi_t_hienode,
            tb_ce_intervl TYPE rshi_t_interval,
            wa_hiedirkey TYPE rshi_s_rshiedirkey,
            tb_node_val TYPE rshi_t_hienode,
            tb_interval TYPE rshi_th_interval,
            wa_interval TYPE rshi_s_interval,
    SELECT SINGLE hieid objvers FROM /bi0/haccount
                    INTO wa_hiedirkey
                    WHERE nodename = group-name.
      CALL FUNCTION 'RSSH_HIERARCHY_READ'
        EXPORTING
          i_rshiedirkey     = wa_hiedirkey
          i_date            = sy-datum
        IMPORTING
          e_t_rsnodes       = tb_node_val
          e_th_rsinterval   = tb_interval
        EXCEPTIONS
          invalid_hierarchy = 1
          name_error        = 2
          iobj_not_found    = 3
          OTHERS            = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    thanks
    pratyush

  • User exit for save data in T.code PA40 ABAP-HR

    Hi Expart,
    what is the user exit which is trigger when we save the data through pa40 transaction which check the latest update in the database.
    Kindly give me exit name .

    Hi Vikash ,
    Please refer to below Exits :
    HRPBAS01            User Exit for HR Master Data
    HRPC0001            HR: PC download authorization
    HRRPAI01            User exit for FB HR_ENTRY_DATE and HR_LEAVING_DATE
    PARA0001            Enhancement for Determining the Number of Periods
    PARA0002            Enhancement for Calculating Annual Salary; IT0008,14,15
    PBAS0001            PA: Pers.Admin./Recruitment: Default values and checks
    PBAS0002            PA: Enhancements for Personnel Administration - Menu
    PBASRP01            PA: User exit distributed reporting
    Hope this will help you.
    Regards,
    Nikhil

  • In CQ 5.4 how to read search trends(keywords) with in specific date (like last week, 30 days...)?

    I have a requirement to display popular search key words with in specific date range. Like search key words searched in last week/ in last 30days/in 90 days.
    how to get date range searched keywords from Search Trends?? is there any other way to get these??

    Issue was due to a syntax error. Case closed.
    Thanks!
    -OS

  • User exit for actual dates in CJ20N

    I have a req,  When i start any activity i enter date in user field in actual dates as displayed in below pic
    Now when i enter date in user field it should be copied to actual  start date field in dates tab as shown in below pic
    Kindly suggest the user exit needed for it
    Best Regards,
    Nitesh H Panchal

    Hi Nilesh,
    Try this with Substitution & Validation rule.
    You want AFVGD-ISDD should have same detail as of AFVGD-USR08.
    However with the help ABAPer you can achieve this easily.
    Regards,
    Pranav

  • User Exit for delivery Date Update in ME41

    Hi,
    I want to Create one User Exit which will Update the Delivery Date of All Line Items ,same as of Item one.
    Detail : When creating RFQ using tcode ME41, create with Reference to PR, add your collective Number and copy few line items from your PR, say 5 items selected, now  when come to RFQ it asks to change item details if require,
    now here i want to change Delivery date of item one and when putting new delivery date, and press enter then it should update all (remaining 4 ) items delivery date same as of item one. so that user do not need to update all items delivery date one by one.
    is there any user exit/Enhancement Spot available which get triggered after pressing enter when changing the items?
    Thanks in advance.
    Regards,
    Sujeet

    Hi,
    Check these enhancements:
    ME590001           
    MEETA001           
    MEFLD004           
    MELAB001
    Jitendra

  • User exit to populate data into append structure of EKET ??

    Hi all,
    My requirement is to extend the table EKET to add few more columns . Is there any user exit available for this ?  I tried appending a structure .After the columns are added what is the exit to be used to populated data into the new fields ?
    Are there any OSS notes which will explain the process on how to extend the table EKET ?
    Please help me with this .
    Regards,
    Varun .

    Hi Varun,
    You can explore this solution.
    - Create new output type for purchase order (for application EF) and assign medium '8' (special function) in transaction NACT.
    - Create new program (SE38) for medium '8' (special function).
    REPORT ZZUPDATE_EKET MESSAGE-ID E0.
    FORM SPECIAL_FUNCTION_PROCESSING USING RC
                                           US_SCREEN.
      DATA: BEGIN OF I_EKET OCCURS 0.
              INCLUDE STRUCTURE EKET.
      DATA: END OF I_EKET.
      RC = 1.
      SELECT *
      FROM EKET
      INTO TABLE I_EKET
      WHERE EBELN = NAST-OBJKY(10).
    *Now you can use FM ME_UDPATE_DOCUMENT to update EKET.
    ENDFORM.                    "SPECIAL_FUNCTION_PROCESSING
    - Maintain condition record for above new output type (NACR) so that new message type would run upon save of purchase order.
    Hope this will help and give an idea.
    Regards,
    Ferry Lianto

Maybe you are looking for