Skip to Content
author's profile photo Former Member
Former Member

Customer exit varaible checking between 2 objects

Hi,

I have a requirement where I have to display active assets on the report.

The validation happens this way.

The deactivation date is checked with the fiscal year period entered on the variable screen.

If the asset is deactivated on 09/20/2011. This means the asset is active till 08/30/2011 and from 09/20/2011 it is deactivated

When the user enters the fiscal year period on the variable input screen

Fiscal year/period = 008/2011 the active which does not have the deactivation date starts with 009/2011 should be display.

I know we can do this with the customer exit variable. Can someone helps me with the code . I know little bit abap but as this is checking between the 2 values that is fiscal year period and deactivate date so got struck..

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2011 at 02:16 PM

    Hi,

    Its better to take date in to consideration while reporting active assets.

    Create a variable on deactivation date info object.

    Restrict the deactivated date info object with newly created variable with option (<=) in the Bex query designer and it should display as per the requirement. No coding required in this case.

    Considering the case when fiscalper has to be input

    Create a variable say ZTEST on deactivation date info object and restrict the date info object with this variable and code(pseudo) should look like as follows,

    IF i_step = 2 .
    CASE i_vnam.
    
    WHEN 'ZTEST  
    
    read table I_T_VAR_RANGE with key VNAM = 'Variable used for 0FISCALPER' into WA.
    
    IF sy-subrc = 0 .
    *Get last day of the period
    CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
    *assign fm output here
    L_S_RANGE-LOW
    
    l_s_range-sign = 'I'.
    *option should be less than or equal to the deactivated date so LE here
    l_s_range-opt = 'LE'.
    APPEND l_s_range TO e_t_range.
    ENDIF .
    ENDCASE .
    ENDIF .

    Hope that helps.

    Regards

    Mr Kapadia

    Edited by: Mr Kapadia on Dec 8, 2011 7:47 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I made the chagnes this way while passing the value from the function module i made

       l_s_range-opt = 'EQ'.
      

      and in the query i have restricted the variable with the Non assinged values. It worked for me.

      Thanks for all the help .

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2011 at 01:19 PM

    hi ,

    You can use multiple customer exit variable dynamically .

    Code will be something like this:

    IF i_step = 2 .

    CASE i_vnam.

    *Authorization Variable for fiscal year, fiscper, .

    WHEN 'Z_YEAR' ' OR 'Z_FISCPER' .

    IF sy-subrc = 0 .

    l_s_range-low = '*'.

    l_s_range-sign = 'I'.

    l_s_range-opt = 'CP'.

    APPEND l_s_range TO e_t_range.

    ENDIF .

    ENDCASE .

    ENDIF .

    You need to formulate logic inside this .

    Please refer these docs for help :

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0f9f33c-0f17-2d10-d3a2-ae52ccd00780?QuickLink=index&overridelayout=true

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d09d4588-3832-2c10-e185-f778d9dbea85?QuickLink=index&overridelayout=true

    Regards,

    Jaya Tiwari

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jaya,

      Thanks for reply,

      I have already gone through the documents but issue with my logic is. I have to read the fiscal year period and compare it with the date so that is the issue. The deaction date in not the varibale which we will be passing .

      Secondly there is not authorization check it is compairng the values.

      thanks

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.