Skip to Content

Exit Function

Hi, I am converting FOX code to ABAP code. I am trying to read a Price from one cube (based on key fields) and updating a total field in another cube (material row based on the key fields). The xth_data table is populated with the material fields but the price row is not populated in the xth_data table. Does anyone how to fix this? Thanks in advance,

Finbarr

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2005 at 11:43 AM

    Hi,

    are you saying, that you're reading and updating InfoCubes using your own abap-programs instead of using the update rules?

    I think that what you're trying to do is also possible using the update rules.

    regards

    Siggi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 02, 2005 at 11:53 AM

    Hi,

    I am using the Exit Functions instead of Fox functions.

    The xth_data contains all the transactional data but in this case, the Price row is not being populated.

    Here is the fox code which does this..

    DATA BUS TYPE 0BUS_AREA.

    *DATA CST TYPE 0CUST_SALES.

    DATA MAT TYPE 0MAT_SALES.

    DATA PLN TYPE 0PLANT.

    DATA RTO TYPE 0ROUTE.

    DATA SLO TYPE 0SALES_OFF.

    DATA SEQ TYPE ZACCSEQNC.

    *DATA ADJ TYPE ZADJTYPE.

    DATA CND TYPE ZCONDTYPE.

    DATA FSW TYPE ZFISCWEEK.

    *DATA SHP TYPE ZSHIPSALE.

    DATA VOLAREA TYPE AREA____.

    DATA VALAREA TYPE AREA____.

    DATA CURSORG TYPE 0SALESORG.

    DATA CURSEQ TYPE ZACCSEQNC.

    DATA CURCOND TYPE ZCONDTYPE.

    DATA DCH TYPE 0DISTR_CHAN.

    DATA KFN TYPE KEYFIGURE_NAME.

    DATA TVAL TYPE F.

    DATA RVAL TYPE F.

    DATA PRICE TYPE F.

    • Current Access Sequence Number, Condition Type, key Fig.

    CURSEQ = 20.

    CURCOND = 'ZREM'.

    KFN = '0G_AVV208'.

    • Current Sales Organization

    CURSORG = VARV(ZSALORGN).

    IF CURSORG = 'CHIL'.

    • PLANNING AREAS : 'ZBPSVO02', 'ZBPSVA02'

    VOLAREA = 'ZBPSVO02'. VALAREA = 'ZBPSVA02'.

    ELSEIF CURSORG = 'DAIR'.

    • PLANNING AREAS : 'ZBPSVO01', 'ZBPSVA01'

    VOLAREA = 'ZBPSVO01'. VALAREA = 'ZBPSVA01'.

    ENDIF.

    PRICE = 0.

    • Calculate Price

    BREAK-POINT.

    PRICE = {ZCONDPERC,#,#,#,#,#,CURSEQ,CURCOND,#,ZBPSPR01}.

    IF PRICE <> 0.

    *Proceed if a Condition Record exists

    FOREACH

    BUS,MAT,PLN,RTO,SLO,CND,FSW,SEQ.

    RVAL = 0. TVAL = 0.

    • Calculate reference value

    RVAL =

    {ZSEMTOTAL,BUS,MAT,PLN,RTO,SLO,#,SEM2,FSW,VALAREA}.

    • Calculate Value

    {KFN,BUS,MAT,PLN,RTO,SLO,CURSEQ,CURCOND,FSW,

    VALAREA} = (RVAL * PRICE) / 100 .

    • Update Reference Value

    {ZSEMTOTAL,BUS,MAT,PLN,RTO,SLO,CURSEQ,CURCOND,FSW,VALAREA}

    = RVAL.

    ENDFOR.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

    • Dirk,

      Yes, we are using a multi planning area. When changing from FOX to ABAP (Exit function), does any of the planning area / level have to change to reflect this? It is strange as the FOX function gets the price value but the Exit function does not.

      P.S. When the report finishes both functions show he number of records read to be the same. E.g. If you have two material rows, both will show 2 rows read. The only difference is when you use Trace, the FOX shows Price as Reference data but the Exit does not.

      Also, Price is not based on an individual customer but set at a high level,irrelevant to customers while the material is based on individual customer.

      Any help would be much appreciated.

      Finbarr.

  • Posted on Feb 03, 2005 at 09:33 AM

    Hi,

    I was told that reference data is not automatically pulled into an exit function. you need to program the exit function or init function to read the reference data.

    Does anyone know how to do this?

    An example would be great.

    Any help would be much appreciated

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      From the FOX documentation at

      http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm

      BEGIN OF QUOTE

      For the formula calculation, the values of the characteristic that you are using for addressing are not restricted to the values in the package.

      This is how formula Plan = 1.15 * actual, for example, works even if the package is restricted to data of type Plan, data of type Actual is read automatically too.

      END OF QUOTE

      So I guess that PRICE is not available in your planning package. FOX is smart enough to read the data anyway, the Exit function does not read it (because it doesn't know what you need in the exit).

      Best regards

      Dirk

  • Posted on Feb 07, 2005 at 03:50 PM

    Hi,

    I am trying to read reference data in an exit function by using the init function and passing in, the relevant characteristic combinations. However, the reference row is not being returned. When i debug the code before the init function runs, the reference row is not contained in the xth_data table either.

    how do i get the reference row into my main exit function?

    any help would be much appreciated.

    thanks,

    ilen

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello All,

      One more comment...

      Reference data is brought in from outside the planning level restrictions in FOX functions. The data is specified distinctly and read from outside the level (You can see the multiple reads with a trace). When using a Planning Function type Exit, you can mimic this feature by specifying distinctly the characteristic values in a read in the init function and saving the reference data to a global variable / table in the Function Group once. You can then in each Function Module call reference that global variable / table.

      Something to remember is that you cannot generate data outside the characteristic combinations specified within the Planning level however you can use this reference data for calculations.

      Cheers,

      Scott

  • Posted on Feb 14, 2005 at 10:22 AM

    Cheers All,

    Thanks very much for all the help.

    The problem was: I was restricting the reference data being entered byt my planning level selection. I had to set some of them to # and this enabled the data to entered into xth_data.

    Again,

    thanks all.

    Add a comment
    10|10000 characters needed characters exceeded

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.