IP - Problem in FOX formula: how to use 0FISCPER3 counter of a DO function?

Hi,
IP 7.0:
I'd like to define a top-down function which distributes the values in 0FISCPER3 = # to the periods selected by the user with two variables (period from and period to variable).
-> Problem I experience is the conflict in different data types. How can I use the value of the selection variable for 0FISCPER3 in a counter of a DO function. Here is the code:
formula example:
change the value of the keyfigure ZQUANTITY of PRODUCT11
to the value of ZQUANTITY of PRODUCT09 times 1.1
assumption for fields to be changed: ZPRODUCT
                 ==> operand: {name of keyfigure, ZPRODUCT}
  DATA L_FACTOR TYPE F.
  L_FACTOR = 1.1.
  { ZQUANTITY, PRODUCT11 } = { ZQUANTITY, PRODUCT09 } * L_FACTOR.
DATA LV_COUNTER TYPE 0FISCPER3.
DATA LV_PERIODS TYPE  0FISCPER3.
DATA LV_PERIOD_FROM TYPE 0FISCPER3.
DATA LV_PERIOD_TO TYPE 0FISCPER3.
*Transfer variable period from and period to into local variable and count interval of periods.
LV_PERIOD_FROM = VARV(Z_PERIOD_FR).
LV_PERIOD_TO = VARV(Z_PERIOD_TO).
LV_PERIODS =  LV_PERIOD_TO - LV_PERIOD_FROM.
Do top-down distribution for all adjustment values on period = #
LV_COUNTER = (LV_PERIOD_FROM).
DO.
<b> { 0G_QVVGRM, LV_COUNTER} = { 0G_QVVGRM, # } / LV_PERIODS.</b>
<b> LV_COUNTER =  LV_COUNTER + 1.</b>
    IF LV_COUNTER >= LV_PERIOD_TO.
        EXIT.
  ENDIF.
ENDDO.
-> the lines indicated in bold give errors. If I change the datatype of LV_COUNTER to I, how to start the do function the value of the first period selected by the user?
function TMLV is also not supported apperantly in IP.
Help would be very appreciated
regards
D

Small extension:
function TMVL does work, but I still have the problem to use the difference in periods solely for calculation in a key figure. I cannot switch from type 0FISCPER into F or I. In SAP R/3 ABAP this is no problem but apperantly in FOX it is???
Hereby revised coding:
DATA LV_COUNTER TYPE I.
DATA LV_PERIODS TYPE  0FISCPER3.
DATA LV_PERIOD_FROM TYPE 0FISCPER3.
DATA LV_PERIOD_TO TYPE 0FISCPER3.
DATA LV_FISCPER3 TYPE 0FISCPER3.
*TRANSFER VARIABLE PERIOD FROM AND PERIOD TO INTO LOCAL VARIABLE AND COUNT INTERVAL OF PERIODS.
LV_PERIOD_FROM = VARV(Z_PERIOD_FR).
LV_PERIOD_TO = VARV(Z_PERIOD_TO).
LV_PERIODS =  LV_PERIOD_TO - LV_PERIOD_FROM.
DO TOP-DOWN DISTRIBUTION FOR ALL ADJUSTMENT VALUES ON PERIOD = #
LV_COUNTER = 0.
DO.
  LV_FISCPER3 = TMVL(LV_PERIOD_FROM,LV_COUNTER).
<b>{ 0G_QVVGRM, LV_FISCPER3} = { 0G_QVVGRM,#} / LV_PERIODS.</b>
{ 0G_QVVGRM,#} = { 0G_QVVGRM,#} - { 0G_QVVGRM, LV_FISCPER3}.
IF { 0G_QVVGRM, #} < 0.01.
EXIT.
ENDIF.
LV_COUNTER = LV_COUNTER + 1.
ENDDO.
ERROR: conflict between operation type F and 0FISCPER3

Similar Messages

  • How to use union statement with declare & set function?

    Hi Experts,
            i  have small query about how to use union statement with declare & set function?
    Example as below :
    DECLARE @name AS date
    Declare @name2  AS date
    /* SELECT FROM [2013].[dbo].[OINV] T0 */
    /* WHERE */
    SET @name = /* T0.DocDate */ '[%1]'
    SET @name2 = /* T0.DocDate */ '[%2]'
    select  '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2013.dbo.orct t1
    inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2013.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]
    Union
    /* SELECT FROM [2014].[dbo].[OINV] T0 */
    /* WHERE */
    SET @name = /* T0.DocDate */ '[%1]'
    SET @name2 = /* T0.DocDate */ '[%2]'
    select  '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2014.dbo.orct t1
    inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2014.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]

    You have to create stored procedure in SQL only .
    Like u must have create for Crystal .
    You can execute procedure in query manager but you have to enter parameter manually..
    example
    Exec @Test '20140101' '20140501'
    Every time user has to enter it manually in yyyymmdd format in case of date parameters.
    Example
    Create Proc [@Test]
    as begin
    DECLARE @name AS date
    Declare @name2  AS date
    /* SELECT FROM [2013].[dbo].[OINV] T0 */
    /* WHERE */
    select  '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2013.dbo.orct t1
    inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2013.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between @Name and @Name2
    Union
    /* SELECT FROM [2014].[dbo].[OINV] T0 */
    /* WHERE */
    select  '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2014.dbo.orct t1
    inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2014.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between
    between @Name and @Name2
    end

  • How to use Output Transmission Medium 8 (Special Function)

    Hi All,
    May I get how to use output transmission medium 8(Special Function) in Output Determination.

    Hi,
       configure output type with transmission medium 8
        in nace transaction and assign it to driver program
        and so that entry exist in table tnapr and use
       RSNAST00 program to send output as email.
      Before you have create entry in va02->header-output->
      with processsing status 0 . 
    Regards
    amole

  • How to use "url.openStream()" . What this function does?

    how to use "url.openStream()" . What this function does?
    Edited by: sahil1287 on Apr 16, 2009 10:02 PM

    http://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream()
    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

  • HT1725 after purchased MOVIE, Down LOAD MAY have problem. PLS ADV HOW TO USE DOWN ROAD and HOW TO OPEN it.

    I have purchased 1 MOVIE first time from ITUNE. but maybe some problem in Downroad.
    It mentione some error and I don't Know How to solve and How to use Purchased Movie when I want watch the Movie.   Thanks.

    I have purchased 1 MOVIE first time from ITUNE. but maybe some problem in Downroad.
    It mentione some error and I don't Know How to solve and How to use Purchased Movie when I want watch the Movie.   Thanks.

  • How to use Compare and Swap (CAS) atomic function(Solaris specific) in C

    Hi,
    I have found cas32() atomic function in (solaris 10) </usr/include/sys/atomic.h> (and also there is another atomic.h header file in </usr/include/atomic.h> but this header file does not have any cas32() function declarations) the declaration of cas32 in <sys/atomic.h>
    is as follows
    extern uint32_t cas32(uint32_t *target, uint32_t cmp, uint32_t newval);
    extern ulong_t caslong(ulong_t *target, ulong_t cmp, ulong_t newval);
    extern uint64_t cas64(uint64_t *target, uint64_t cmp, uint64_t newval);
    extern void casptr(void target, void cmp, void newval);
    extern uint8_t cas8(uint8_t *target, uint8_t cmp, uint8_t newval);
    But the problem is when iam using these functions in c programs and compiling
    using gcc it is showing the following error.
    Undefined first referenced
    symbol in file
    cas32 /var/tmp//ccQcsnev.o
    And if i use the function other than cas32 group of instruction
    such as atomic_or_uint()
    whose declaration is extern void atomic_or_uint(uint_t *target, uint_t bits);
    in <sys/atomic.h> it is giving no error where as for CAS32 it showing as undefined symbol.Why it is giving like that we are not able to know.Is it the case that CAS32 instruction only available in Kernel mode and not available to user mode.Please inform us if anyone knows how to use cas32() instruction in the user C programs.As this is usefull for writing Nonblocking versions of stacks and Queues.Is there any way to write
    our own atomic functions?
    Rama

    You are trying to use the old kernel-only CAS functions, use the correct ones like:
    atomic_cas_32.
    DS

  • How to use the structure in the EXIT_SAPMM06E_013 function module

    Hello Experts,
    Please guide me how to use the structure defined in function modules under  table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
    Best Regards,
    Sandesh.Sreyamsh

    Can you please elaborate little bit more what is the actual requirement?

  • How to use a counter to build a Logic Analyzer?

    Hi guys, i have heard that we can use a counter as a Logic Analyzer based on an incoming signal and its clock frequency. Anyone know how this works?
    I am trying to read a set of signals, which I have no knowledge of  except that there would a Clock, reset and a data line; and I want to develop a Logic Analyzer to 'know' these signals.
    Thanks, Anoop
    Solved!
    Go to Solution.

    Lynn,
    I have a PXI-7813R, which along with its FPGA is sufficient I believe for this purpose.
    How many digital signals do you need to examine simultaneously?
    Well, I am not sure, but based on the signals generated by similar devices, I would guess between 4 and 6. I expect there to be a Clk, Rst, Data and some other signals.
    What is the maximum frequency?
    I have no idea or how to even come up with a guess on this one.
    What is the maximum and minimum number of samples per signal that you need to capture?
    Again, not a clue. Would it not depend on the Clk frequency?
    Are any of the signals ever in a high impedance (tri-state) mode?  
    Again, don't know, sorry.
    Is the minimum pulse width for non-clock signals the clock period, half the clock period, or something else?
    Sorry again.
    How would you go about in this situation?

  • Summation problem in fox formula

    Hi friends,
    My requirement is....I have GL Account, PO Number, Vender, costcenter  Scroll number and amount is displaying in layout.
    I have one more field let say TotalAmount. in this field i have populate sum of GL and PO Combination...
    I have writen code in fox. Keeping GL Account, PO Number and amount in chaged fields..
    DATA SUM TYPE F.
    DATA SUM1 TYPE F.
    DATA SUM2 TYPE F.
    DATA PO TYPE EBELN.
    DATA GL TYPE 0GL_ACCOUNT.
    SUM = 0.
    *BREAK-POINT.
    FOREACH GL,PO .
    SUM1 =  {0AMOUNT,GL,PO}.
    SUM = SUM + SUM1.
    ENDFOR.
    {0PRICE,GL,PO} = SUM.
    As it is not giving me Accurate result....
    Itried in debug mode...and in trace ....fox is picking total cube values like GL Account, PO Number, Vender, costcenter  Scroll number  and summing up...But i want GL Account, PO Number wise.....
    One more thing if i remove GL Account, PO Number  from changed field...fox proposing for changed field...
    Thanks
    Raju

    Thanks for response...
    UR right....Please suggest me...the variables i have created on PO and GL should have which properties like
    Text Replacement - Characteristic Value.
    Replacement Type - User Defined right.
    Question 1 . should i restrict these variables in level or not. if  not so i have to remove PO and GL in changed fields and call variables in Fox right.
    Question 2. IF so what about my layout...
    or else please give a example if i create  variables for both..what exactly i have to do after that to effect the result values..

  • Problem in Fox Formula..

    Hi,
    Total field i require GL and PO Combination wise SUM(amount).
    Variables     
    Provisions - Circle     MU
    Fiscal year/period     003.2010
    Company code     RIL
    Controlling Area     RIL
    Header     
    Provisions - Circle     MU
    Fiscal year/period     003.2010
    Company code     RIL
    Transactions
    GL Acct     PONumbr     Costcenter     Vendr     SN     SD     Startdate     enddate     Amount     Total
    7145090     15958060     902604NM     284410     38     #     29.04.2010     31.05.2010     2000     3000
    7145090     15958060     902605NM     284410     39     #     29.04.2010     31.05.2010     1000     3000
    7145090     15958060     902607NM     284410     40     #     29.04.2010     31.05.2010     0000     3000
    7145090     15963284     902601NM     518274     49     #     29.04.2010     31.05.2010     4500     9500
    7145090     15963284     902601NM     345413     51     #     29.04.2010     31.05.2010     5000     9500
    7145090     15964545     902603NM     345413     52     #     25.05.2010     31.05.2010     8000     9600
    7145090     15964545     902603NM     345413     45     #     25.05.2010     31.05.2010     1600     9600
    Fields to be changed
    GL, PO , KF
    Fox Code
    DATA PO TYPE EBELN.
    DATA GL TYPE 0GL_ACCOUNT.
    DATA SUM TYPE F.
    SUM = 0.
    FOREACH GL,PO.
    SUM = SUM + {0AMOUNT,GL,PO}.
    endfor.
    {TOTAL,GL,PO}  = SUM.
    IF I SEE IN DEBUG MODE ..LOOP IS ACCESSING GL Acct,PONumbr     ,Costcenter,Vendr,SN,SD,Startdate,enddate WISE. AND IT IS NOT SUMMING UP BASED ON GL,PO........ EXPERTS PLZ PROVIDE UR SUGGETIONS.. Values should store in Cube...Not display mode.
    Edited by: Madhu YL on Jun 23, 2010 10:52 AM
    Edited by: Madhu YL on Jun 23, 2010 10:55 AM

    Hi,
    Can you try this fox code:
    fields to be changed : keyfigure,Costcenter, Vendr, SN, SD, Startdate, enddate
    foreach gl.
    foreach po.
    SUM = 0.
    foreach Costcenter, Vendr, SN, SD, Startdate, enddate.
    SUM = SUM + {0AMOUNT,Costcenter, Vendr, SN, SD, Startdate, enddate}.
    endfor.
    {TOTAL,Costcenter, Vendr, SN, SD, Startdate, enddate} = SUM.
    " i dnt know on which particular record you want to store the total. Please check this part.
    endfor.
    endfor.

  • How to Use Row Count Transformation

    Environment: SQL Server 2008 R2
    Purpose: Track number of records, which were loaded into each destination, entity tables or affected by data transaction. Record each table name and the number of records for each  table. 
    Code:
    CREATE TABLE dbo.PkgAudit
    PkgAuditID INT IDENTITY(1, 1),
    PackageName VARCHAR(100),
    LoadTime DATETIME DEFAULT Getdate(),
    Status1 Varchar(50),
    Status2 varchar(20),
    Status3 Varchar(20)
    ETL process: See the following pictures. I have two DFT. Reference to the code in details.
    Click here
    The first one as below
    The second DFT
    Logic: Load the data from the staging table/ If matched with SSN then status is record exists in the pkgAudit table. If not matched, records the number of records and the status is inserted table in the DFT#1 (Step#1)
    In DFT#2, record the name of the tables and number of records for each table
    Expected Results:
    1, Pakage, 20140304 10:24:12:17, 4 loaded, 3 inserted in individual and SSN table, 1  exists in SSN
    Problem: In DFT #1, I placed RowCount Transformation. It generated a couple errors. I also dont know how to concatenate the name of the table and the number of records and the status of the affected table (inserted or exists or loaded).
    I am here to learn as my level of competency is novice. I appreciate the support to ease my learning process. Screen shots is highly appreciated. 
    ~ I tried to load more than picture but the editor allows only 2 pic per post. hope MSDN peeps improve it

    Hi Sandra,
    Thank you for your reply.
    The expression is used for a variable, then the variable can be used in your INSERT statement. According to your screenshot, the PkgAudit table has five columns that you need to insert into. Please refer to the following steps:
    1. Create three Int32 type Package scope variables @TotalCount, @InsertCount, and @MatchCount, and specify their initial value to 4, 3, 1 respectively.
    2. Create three String type variables @NumberofRecords, @Status1, and @Status2. Then, set the ValidateAsExpression property of each variable to True, and set the expression for the three variables as follows:
    NumberofRecords:  (DT_STR,10,1252)@[User::TotalCount] + " loaded"
    Status1:  (DT_STR,10,1252) @[User::InsertCount] + " inserted in individual and SSN table"
    Status2:  (DT_STR,10,1252) @[User::MatchCount] + " in SSN"
    Please refer to the following screenshot:
    3. In the Execute SQL Task, modify your SQLStatement to:
    INSERT INTO dbo.PkgAudit(PackageName
    ,LoadTime
    ,NumberofRecords
    ,Status1
    ,Status2
    ) VALUES(?,?,?,?,?)
    4. Click the Parameter Mapping tab of the Execute SQL Task, and set the parameter mapping as follows (supposing all the columns in the PkgAudit table use varchar data type):
    Regards,
    Mike Yin
    TechNet Community Support

  • Simple Question -- How to use global variables in an another function??!

    Function named globalLeftMargin that has:
    Global NumberVar LeftMargin := 5;
    HOW DO I USE THIS IN ANOTHER FUNCTION?  B/C IT DOES NOT RECOGNIZE IT AND GIVES THIS ERROR:
    The ) is missing.
    The other function is:
    Space(LeftMargin)

    Hi Ajay,
    Add WhilePrintingRecords at the beginning of each formula like:
    WhilePrintingRecords;
    Global NumberVar LeftMargin := 5;
    WhilePrintingRecords;
    Global NumberVar LeftMargin;
    Space(LeftMargin)
    Good luck,
    Brian

  • How to use timestamp column in a xmltable function?

    i have a relational view over a xml table and in the view definition i use a virtual XMLTable. my problem is the timestamp value in the xml is in the format like '2001-12-17T17:30:47Z". therefore the view is running into problems. how do i do to_date() kind of function in a XMLTable definition? Thanks.
    XMLTable(
    COLUMNS name VARCHAR2(6) PATH '@ename',
    id NUMBER PATH '@empno'
    time TIMESTAMP PATH '/order/timestamp'

    Export with timestamp check?

  • ** How to use XSLT Stylesheet Ver 2.0 functions in XI 7.0?

    Hi friends,
          There are numerous built-in functions in SALT ver 2.0. Functions like upper-case, index-of, etc. They are very useful when use XSLT Mapping. But, unfortunately we are not able to use this functions in XSLT Mapping in XI. i.e XI throws an error like 'Transformation Configuration Error Occured'.
          Friends your experience, kindly share your idea how do we to do in XSLT? Is any other alternate way there ?
    Thanking you.
    Yours friendly,
    Jeg P.

    You could of course try to import your own Java XSLT 2.0 processor in a .jar file and in the same or another .jar, you could import the .xslt files.
    Regards,
    Henrique.

  • How to use Fuzzy Logic Controller for transfer function in labview control and simulation loop?

    I am facing problem with fuzzy PD logic controller for transfer function in control and simulation loop.
    Plz Help me in this regard...................
    i have attache snapshot of my program
    Attachments:
    fuzzy in simulation loop.JPG ‏52 KB

    Hi Sankhadip,
    Sorry for the late response. I was looking at your code and
    I noticed that the graph scale does not start from zero. That might be the
    reason why you don't see the transient in the simulation. To change the scales
    simply double click on the lower limit and set it to zero. If this is not the
    expected results, can you please post the expected results, so we can see what are the
    differences between the results . Also, you might be using different
    solvers, and that gives different results as well.    
    Thanks and have a great day.
    Esmail Hamdan | Applications Engineering | National
    Instruments

Maybe you are looking for

  • Can't drag files. Help!

    Hoping someone can help me. I came the other day to find that none of the files on our iMac G5 could be dragged. Stuff on the desktop couldn't be moved, re-arranged, etc. Even in iTunes, files couldn't be dragged to new playlists. I'm not sure what h

  • How to stop a triggered process chain

    Hi, Does anyone know how to stop a process chain? It was accidentally triggered twice and we need to stop it. Thanks.

  • Cannot add data

    I received the following error message when I tried to open a CS3 Indesign document that I had worked on last week. The document has some images in it and uses a lot of different script types. i cannot add data "unknown document" I am working on an I

  • Dbms Advisor - Segment Advisor Task over db links

    Good morning to everybody, i'm wondering why if is it possible to execute dbms advisor (segment advisor) task from a database to others one with PL SQL. My problem is that i have 13 Databases on different Servers and i have 13 db links. Now i have to

  • Message control attributes for EDI 846, 947

    Hi experts,     I need to configure partner profile for these EDI transactions: EDI 846 and EDI 947. What should be entered in these fields of message control tab: Application, Process code, Message type? Also what are the IDOC types for these? Thank