Selection routine

Hi all,
I am planning to write a routine for'DELETE Overlapping Requests'.
we have a requirement to delete data from cube before the day.Keep one request for a week though it is running daily.
I am planning to get calweek from system date and it checks the in the same week whether it have  2 requests.
If yes, it deleted the request from the table RSREQDONE.
So, please suggest the code or any pointers for this.
Thanks in advance!

To do selective deletion in cube you can use RSDRD_DELETE_FACTS.
Further info you can check this blog :
Delete records in data target of BI: different options available
Hope this helps

Similar Messages

  • Selection routine in info package

    Hi gurus,
    I need to load last month's data in to BW if I am executing the IP in this month.
    that is if Iam executing in Feb 2009 then it should load Jan 2009,
    and if Iam executing on JAn 2009 then it should pick data for Dec 2008,
    For this logic I had written like,
    data: TEMP_DATE TYPE DATE,
          TEMP_MONTH TYPE CHAR(6).
    TEMP_DATE = SY-DATUM.
    TEMP_MONTH = sydatum+2(6).
    L_T_RANGE-IOBJNM = 0CALMONTH.
    L_T_RANGE-SIGN = 'I'.
    L_T_RANGE-OPTION = 'EQ'.
    L_T_RANGE-LOW = TEMP_MONTH - 1.
    L_T_RANGE-HIGH = TEMP_MONTH.
    APPEND L_T_RANGE.
    Is this OK or I need to change,
    Thanks,
    Pavan

    Hi Pavan,
    This is an example How to ... Write Infopackage selection Routine
    1.Create an Infopackage
    2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen.
    4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    Regards
    Sudheer

  • Selection routine on InfoPak

    Hi All,
    I have to write a ABAP routine in the data selection tab of infopackage for 0FISCPER. In the From Value field, it should always take current fiscal yr per of loading and for in To Value field, i will put a constant selection that will fall in future.
    Can samebody help me with the routine that can use current fiscal yr per of loading.
    Thanks in Advance,
    Rajesh

    hi,
    try the below code. to value I have given as year 9999 and period 012.
    Data: fper(7),
    year(4),
    month(3) type n.
    year = sy-datum+0(4).
    month = sy-datum+4(2).
    concatenate year month into fper.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'FISCPER'.
              l_idx = sy-tabix.
              l_t_range-low = fper.
              l_t_range-low = '9999012'.
              l_t_range-sign = 'I'.
              l_t_range-option = 'BT'.
              modify l_t_range index l_idx.
              p_subrc = 0.
    Note: You can also use the Function Module DATE_TO_PERIOD_CONVERT to get the year & Period.
    Regards, Siva
    Message was edited by:
            Siva Bonam

  • Currency translation routine - pls correct ABAP code

    Hi,
    I am trying to implement a scenario for currency conversion at the transformation level.(i am using BI 7.0)
    My source data is flat file.
    My scenario here is like
    I have 2 masters - country & supplier.
    I added 0loc_currcy as an attribute to the country.
    The master data of country is as below:
    Cid    cname         local currency
    C1     INDIA         INR
    C2     SWISS         CHF
    C3     America       USD
    For supplier master data is:
    supp id  Sname
    S1         raghu
    S2         tej
    S3         harish
    S4         reddy
    I defined 2 key figures one Zprice1 & Zprice2.
    Zprice1 has currency type 0DOC_CURRCY
    Zprice2 has currency type 0LOC_CURRCY
    In the PSA the data is as below:
    cid    sid     0calday         price1         doc_curr
    C1     S1     01.01.2007    300,00        INR
    C1     S2     01.02.2007    400,00        CHF
    C1     S3     03.01.2007    350,00        USD
    C1     S4     15.04.2007    450,00        EUR
    C2     S1     31.05.2007    600,00        INR
    C2     S2     21.06.2007    250,00        CHF
    C2     S3     01.01.2007    900,00        USD
    C2     S4     01.02.2007    1.300,00      EUR
    C3     S1     03.01.2007    1.250,00      INR
    C3     S2     15.04.2007    500,00        CHF
    C3     S3     31.05.2007    50,00         USD
    C3     S4     21.06.2007    300,00        EUR
    I am expecting my data in the cube to be as below:
    cid  sid  0calday     price1 doc_curr   price2    loc_curr
    C1  S2  01.02.2007 400,00   CHF      350,00    INR
    (bcoz c1->INR)
    C3  S1  03.01.2007 1.250,00 INR       25,00     USD
    (bcoz c3->USD)
    Based on cid the loc_curr value(amount & currency after conversion) should be displayed.
    in the transformation i assigned
    /BIC/zprice1 -> zprice1
    DOC_CURRCY -> zprice1
    /BIC/zprice1 -> zprice2
    DOC_CURRCY -> zprice2
    For zprice2 i selected rule details.
    In IOassignment of source fields i assigned ZPRICE1
    and 0DOC_CURRCY.
    In currency tab of rule details now it is like :
    Target Currency                 0LOC_CURRCY
    Currency                           from source
    Source Currency                DOC_CURRCY
    Now in rule type i selected routine and inserted code shown below:
    data: ZResult_Val type f,
    CALMONTH type rsgeneral-chavl .
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
      EXPORTING
        I_CTTNM                = 'ANYCALMON'
        I_AMOUNT              = SOURCE_FIELDS-/BIC/ZPRIC1
        I_SCUR                = SOURCE_FIELDS-DOC_CURRCY
        I_TCUR                = 'EUR'  --- (what should i give here for target currency should be taken based on cid)
        I_TIME_IOBJVL         = CALMONTH
      I_SCUR_IOBJVL         =
      I_TCUR_IOBJVL         =
      I_PERIV               =
        I_RATE                = 'M'
      I_VDATE               =
      IR_MSG                =
      I_MSG_TYPES           =
    IMPORTING
        E_AMOUNT              = ZResult_Val
        E_RATE                = 'M'
        E_SCUR                = SOURCE_FIELDS-DOC_CURRCY
        E_TCUR                = 'EUR'
    EXCEPTIONS
      SCUR_NOT_FOUND        = 1
      TCUR_NOT_FOUND        = 2
      DATE_NOT_FOUND        = 3
      CTT_NOT_FOUND         = 4
      SCUR_CONFLICT         = 5
      TCUR_CONFLICT         = 6
      DATE_CONFLICT         = 7
      INVALID_SCUR          = 8
      INVALID_TCUR          = 9
      RATE_NOT_FOUND        = 10
      X_MESSAGE             = 11
      INHERITED_ERROR       = 12
      OTHERS                = 13
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    RESULT = ZResult_Val.
    I am new to ABAP coding; infact this is my first peace of code.
    Can any one tell me some tips of writing code-
    ->how to see all the syntax error at a time ; By clicking on check(ctrl+F2) i could see only the first syntax error.
    -> how to check what each perameter mean? like what does I_CTTNM in this function call 'RSW_CURRENCY_TRANSLATION'. mean?
    please help.
    Thanks,
    Raghu

    I have written a test program as below:
    <code>
    REPORT  ZCURRENCY.
    data: tgtcurr type /BI0/OILOC_CURRCY,
          ZResult_Val type F.
    select LOC_CURRCY into tgtcurr from /BIC/PZCONTRY1 where /BIC/ZCONTRY1 =
    'C3'.
    endselect.
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
        EXPORTING
        I_CTTNM = 'TEJ5' --currency trans type defined in RSCUR
        I_AMOUNT = 10
        I_SCUR = 'INR'
        I_TCUR = tgtcurr
    *I_TIME_IOBJVL = CALMONTH
        IMPORTING
        E_AMOUNT = ZResult_Val
        E_TCUR = tgtcurr.
        write: ZResult_Val
    </code>
    It is working fine
    But the following code is not working for my scenario can some debug pls:
    <code>
    data: ZResult_Val type f,
    ZSrc_val type f,
    locvar type /BI0/OILOC_CURRCY.
    Zsrc_val = SOURCE_FIELDS_RULE-/BIC/ZPRIC1.
    select LOC_CURRCY into locvar from /BIC/PZCONTRY1 where /BIC/ZCONTRY1 =
    SOURCE_FIELDS_RULE-/BIC/ZCONTRY1.
    endselect.
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
    EXPORTING
    I_CTTNM = 'TEJ5'
    I_AMOUNT = 10
    I_SCUR = 'INR'
    I_TCUR = locvar
    IMPORTING
    E_AMOUNT = ZResult_Val
    E_TCUR = locvar
    RESULT = ZResult_Val.
    </code>

  • Getting syntax error while executing keyfigure routine BI 7.0

    Hello,
    I am writing a very simple keyfigure routine to calculate sales revune using sales quantity and sales price, I am getting error as follows
    - I am in 'Rules Details' screen and I have selected 'Routine' as the rule type. I enter the following code in routine
         RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU *
         SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC .
    - I hit the check button on the routine page, it says no syntax errors
    - Now I am back in the 'Rules Details' page and I hit the 'Check' button it gives me the following error
    Rule(target IO_VB_REV, group: Standard Group): Syntax error in routine
    Please tell me what is wrong. what should i check

    Hi Vaibhav,
    Here are the details
    - I am loading data from flatfile to an Infocube with 3 keyfigures: IO_VB_PRC (Sales Price) , IO_VB_QU (Sales Quantity), IO_VB_REV (Sales Revune). Getting values for IO_VB_QU and IO_Vb_PRC from flatfile and calculating for IO_VB_REV using routine
    - I created Transformations, and under  Rule Group: Standard Group box I see 'X' sign against 'IO_VB_REV' field, meaning not mapped to any datasource field
    - In rules detail screen, I add two source fields of Rule , IO_VB_QU and IO_VB_PRC. I see IO_VB_REV already added under 'Target fields of Rule' section
    - I then add the only following line to routine
    RESULT = SOURCE_FIELDS_RULE-/BIC/IO_VB_QU *    SOURCE_FIELDS_RULE-/BIC/IO_VB_PRC .
    Clicking on check button it gives no syntax error message. I save and exit back to Rule Details page.
    - I specify 'USD' as the Conversion Type and then click on check button it initially gives me 'Incorrect Input'  written in an information message box and then error that Syntax error in routine
    Let me know what is that I am missing
    Thanks for helping

  • Access to Abap routine in infopack

    Dear Experts,
    Is there no way to control access to change the data selection routines of one selection field if an id can access and change other input fields in the infopack selection?
    By the way, what does 'Required entry field' mean?
    Are there documentation for these functions?
    regards,
    Pascal

    Hi All
    my CTO found the following option
    function module that is "remote-enabled module "
    then you call CALL FUNCTION 'Y_FM_IDOC_CATSDB' DESTINATION 'SAP4.7E'
    you need to define it in SM59
    code example
    data: BEGIN OF IT_SOBSL OCCURS 0,
          SOBSL(2),
          END OF IT_SOBSL.
    DATA: ls_range type STANDARD TABLE OF rssdlrange WITH HEADER LINE.
    SELECT /BIC/ZSPEPROCI FROM /BIC/SZSPEPROCI INTO TABLE IT_SOBSL
                          WHERE /BIC/ZSPEPROCI NOT BETWEEN 'AA' AND 'ZZ'
                          AND /bic/zspeproci ne '' .
    BREAK-POINT.
    LOOP AT IT_SOBSL.
    ls_range-IOBJNM = 'SOBSL'.
    ls_range-LOW = IT_SOBSL-SOBSL.
    ls_range-SIGN = 'I'.
    ls_range-OPTION = 'EQ'.
    APPEND ls_range .
    ENDLOOP.
    loop at ls_range.
      append ls_range to l_t_range.
    endloop.

  • ABAP Routine  for 0FISCPER  slect options in InfoPackage

    Hi,
    I am trying to write an ABAP Routine for 0FISCPER as select options (range) dynamically.
    Ex:
    0FISCPER selection for this year as 001.2008 to 012.2008
    0FISCPER selection for next year as 001.2009 to 012.2009.
    Now  we are changing InfoPackage every year manually, so I need to write a routine for 0FISCPER in InfoPackage to handle dynamically every year
    Thanks,
    SK.

    Hi
    write an ABAP routine to get that value..But are you getting any planned data(why you want till end of the year...till infopackage runs is o.k i think, if you don't have planned data)...Any way you can check the below code, which can be useful...
    You can see the below code at->your infopackage selections>Ty-->choose variable type as 6 and enter any ABAP routine name( to create) and then there is a button on the application tool bar called 'routine info'..this give you the following information...
    Definition
    You can define complex selections for InfoPackages and control the automatic deletion of requests from InfoCubes in the scheduler, by using routines.
    Routines are processing blocks in ABAP programs that consist of a pre-defined data declaration section and an ABAP subroutine (form routine). In the subroutine you can use all of the ABAP programming functions.
    You can use the following routines for making selections in InfoPackages:
    1. Selection routines for fields, on the Data Selection tab page
    2. Selection routines for file names, on the External Data tab page
    3. Selection Routines for selecting the from and to dates for time-dependent data, on tab page Update
    4. Selection routines for determining old requests to be deleted after successfully loading a new request, on the Data Target tab page
    Program frame:
    After you have called up the Editor for routine maintenance, you get the following program frame:
    1. Selection routines for fields, on tab page Data Selection:
    program conversion_routine.
    '$*$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line    -
    FORM COMPUTE_<Fieldname>
      tables l_t_range structure rssdlrange
      changing p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line       -
      data: l_idx like sy-tabix.
            read table l_t_range with key
                 fieldname = <Fieldname>.
            l_idx = sy-tabix.
            modify l_t_range index l_idx.
            p_subrc = 0.
    $$ end of routine - insert your code only before this line       -
    ENDFORM.
    2. Selection routines for file names, on tabstrip External Data:
    FORM compute_flat_file_filename
         changing p_filename like rsldpsel-filename
              p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
              p_filename =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    3. Selection routines for selecting the from and to date for time-dependent data, on tabstrip Update:
    form compute_time_dependent_dates
         changing p_datefrom type d
                  p_dateto   type d
               p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    4. Routines for determining the old requests to be deleted after successfully loading a new request, on tab page Data Targets:
    form compute_<InfoCube-Name>
      tables l_t_request_to_delete structure rsreqdelstruc
      using l_request like rsreqdone-rnr
      changing p_subrc like sy-subrc.
    *Insert Source Code to decide if requests should be deleted.
    *All Requests in table l_t_request_to_delete will be deleted
    *from Infocube <InfoCube-Name>.
    *Add new requests if you want to delete more (from this cube).
    *Remove requests you did not want to be deleted.
    $$ begin of routine - insert your code only below this line-
         loop at l_t_request_to_delete.
         endloop.
         clear p_subrc.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    Note:
    Those fields flagged with <...> are dependent on the selection fields and are filled automatically by the system when you call up the Editor.
    Procedure
    Make the following entries:
    1. Between $$ begin of global ... and $$ end of global ... you can define data declarations. These are the declaration sections for the local data in the routine. This data is only visible in the routines.
    2. The subroutines begin with FORM and end with ENDFORM.
    The subroutines for the particular routines are:
    Selection routines for fields on tab page Data Selection: FORM COMPUTE_<Field name>
    Selection routines for file names on tab page External Data : FORM compute_flat_file_filename
    Selection routines for selecting the from and to dates for time-dependent data on tab page Update: FORM compute_time_dependent_dates
    Routines for determining old requests to be deleted after successfully loading a new request on tab page Data Target: FORM COMPUTE_<InfoCube-Name>
    The subprograms have the following parameters:
    Subprogram FORM COMPUTE_<Field name>:
    l_t_range
    In the table l_t_range the routines for all selection fields that are filled, or have a routine, are made available.
    The routines are executed in the scheduler last of all and therefore, you can change all the selections that you have carried out previously.
    p_subrc
    Using the variable p_subrc you can report errors to the scheduler. p_subrc <> 0 signals an error and means the data request is terminated.
    Subprogram FORM compute_flat_file_filename:
    p_filename:
    You give the name of the file that is to be loaded in parameter p_filename.
    This is useful if your file name contains date dependencies that should be determined by sy-datum and calculated during runtime.
    p_subrc
    You can inform the scheduler of an error with variable p_subrc. p_subrc <> 0 signals an error and means that the data request is terminated.
    Subprogram FORM compute_time_dependent_dates:
    p_datefrom and p_dateto
    Fill these parameters with the from and to dates for time-dependent master data and texts.
    p_subrc
    You can inform the scheduler about an error using variable >LS>p_subrc. p_subrc <> 0 signals an error and means the data request is terminated.
    Subprogram FORM COMPUTE_<InfoCube-Name>:
    l_t_request_to_delete
    You give the request number of the request that is to be deleted in parameter l_t_request_to_delete. You can also delete requests from the table. These are then not deleted.
    p_subrc
    You can inform the scheduler about an error with the variable p_subrc. p_subrc  signals an error and means the data request is terminated.
    3. Insert your program code for the routines between $$ begin of routine ... and $$ end of routine ... so that the respective subprogram variables are supplied with the corresponding values.
    4. Check the syntax of your routine with the Check function.
    5. You can then transfer the routine with the Save function.
    You end routine maintenance when you exit the Editor.
    Hope it helps
    Thanks,
    Teja

  • InfoPackage ABAP Routine - compute_time_dependent_dates

    I would like to populate start and end date for time dependent master data using ABAP. BI help / documentation says that it can be done with ABAP as mentioned below:
    InfoPackage
    Selection routines for selecting the from and to date for time-dependent data on tab page 'Update Parameters'.
    form compute_time_dependent_dates
         changing p_datefrom type d
                  p_dateto   type d
               p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    I am unable to find the ABAP routine section or window on the update tab in the InfoPackage. Can someone let me know if i am looking at the right tab in the InfoPackage?
    Note: I can see ABAP routine section or window on the extraction tab, where we can write code for form compute_flat_file_filename.......
    Thanks in advance.
    RK.

    Dennis,
    Thanks for your feedback.
    The option you mentioned in the Data Selection tab will help me to filter the start and end dates - as long as i have start and end date as selection fields in the data source. But i was actually looking for the ABAP routine / window where i can populate the start and end dates in the form compute_time_dependent_dates....
    BI help / documentation says that it can be done with ABAP as mentioned below:
    InfoPackage
    Selection routines for selecting the from and to date for time-dependent data on tab page 'Update Parameters'.
    form compute_time_dependent_dates
    changing p_datefrom type d
    p_dateto type d
    p_subrc like sy-subrc.
    $$ begin of routine - insert your code only below this line-
    p_datefrom =
    p_dateto =
    p_subrc = 0.
    $$ end of routine - insert your code only before this line-
    ENDFORM.
    I am looking for ABAP window where i can see  form compute_time_dependent_dates...
    Let me know if you have any questions.
    Thanks,
    RK.

  • How to write a routine in infopack to restrict a date range !!!!

    Hi
    I want to load the data for a speicific date range ,i.e , i want to load the data between created on some date range which is not in between the same range for changed on...so i want to restrict that date range for changed on....Please le tme know the routine logic to restrict a date range....
    regards...

    How to ... Write Infopackage selection Routine
    1.Create an Infopackage 2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen. 4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    **$$ end of routine - insert your code only before this line -
    7. Syntax check and Save.
    Hope it Helps
    Srini

  • Data selection tab of infopackage

    hi all,
    how do we select data from infopackage if you do not want a certain value?
    I wrote ABAP code to select not as:
    L_t_RANGE-SIGN = 'I'.
    L_t_RANGE-option = 'NE'.
    L_t_RANGE-low = 'Y'.
    But I got errors. Sign 'I' with 'NE' is not allowed. Please advise.
    Linda

    Linda,
            <b>Exclude Option won't work in the Infopackage data selection routine.</b>
    You can use SIGN equals to I only and option values EQ, CP and BT.
    Try append all the required values. use BT as well as eq.
    If you want to permenantly exclude those to BW. you have 3 good options along with Infopackge Selection.
    1. <b>User Exit in the Source System.</b>
    2. Start Routine in the Transfer Structure.
    3. Start Routine in the Update Rules.
    all the best.
    Regards,
    Nagesh Ganisetti.
    *assign points if it helps.

  • Vofm fomula routin activation error.

    i have complete a formula via tc:'VOFM', and i would like to active the routin, but get error message" Report/Program statement missing, or program type is i (include)". what can i do?

    Hi,
    You have to create the routine via VOFM, an include will automatically be created in the required main include/program. Put you your codes in the routine/form activate it. then got back to VOFM :
    - select routine
    - Click on EDIT and activate
    This will activate your codes and routine.
    Regrads,
    Dev.

  • FI routines

    Hi
    Update rules between 0FIAR-O03 and 0FIAR_C03 contains some of routines.
    When i created transformation between 0FIAR-O03 (Source) and 0FIAR_C03(Target). These rules are not coppied. The status of that keyfigure is no update mode in transformation.
    Can anyone suggest what is the right way to get those routines in transformation.
    Regards
    Annie

    Hi
    I got your problem, that is the reason i asked you to reinstall,if there is any business content tranformation exists,you will get this,if you still want those routines into your transformation..right click on the rule..you will get options like
    routine,formulae,constant etc..select routine..write the code for this routine(you can copy it from your update rules and can paste it here with some modifications
    here instead of COMM_STRUCTURE  you need to give SOURCE_FIELDS-field name...
    Hope it helps
    Thanks
    Teja
    Message was edited by:
            Teja badugu

  • COGS update on other GL Account at the time of Free goods or Sample goods

    Hello,
    In sales process, Usually the at the time of Delivery, material document is created as
    DR COGS
    CR INVENTORY
    But in the case of free goods or bonus goods or samples: the account should not determines COGS instead it should determine another GL Account called as Free good -COGS expense A/c.
    How can we solve the issue.
    Regards,
    SK

    Hi Yasar,
    You need to create a new routine for calculate type.
    Do as below:
    1. Go to VOFM>Formulas>calc.rule Rebate InKd to create a new routine for calculate type.  for example 601.
    2. add the following code in this routine 601 and then save.
      USING L_FRM STRUCTURE KONDN_FRM.
    DATA: VORKOMMA  LIKE KONDN-KNRMM,
           NACHKOMMA LIKE KONDN-KNRMM.
      L_FRM-NRMENGE = 0.
      L_FRM-NRRUND  = 0.
      L_FRM-NRMENGE = ( L_FRM-MGLME / L_FRM-KNRNM * L_FRM-KNRZM ).
    business rounding
        VORKOMMA = FLOOR( L_FRM-NRMENGE ).
      L_FRM-NRRUND  = L_FRM-NRMENGE - VORKOMMA.
      L_FRM-NRMENGE = VORKOMMA.
    3. Select routine 601 in field "Calc.Rule" when you create free goods condition record.
    Hope it helps.

  • Free goods - Exclusive - Quantity of free goods

    I want to give free goods by the condition record I have made at the tcode VBN1. Free godds will be given by the exclusive technique. The material code of the main material with active prcing is 100005 and the material that I will give as free good is 700001. For every 4 pieces of 100005 I will give 1 piece of 700001. I have entered 100005 at the "Material" column, 4 at the "Min. qty" column, 4 at the "For" column st at the "Unit" column, 1 at the "add. FG" column, ST at the "AddQTYUnit" column, 1 at the "Calc.Rule" column, 2 at the "FreeGoods" column, 700001 at the AddMatFrGd" column. The system gives 2 free goods (700001) for 6 priced material (100005) or 4 pieces of 700001 for 14 pieces of 100005. On the other hand I want the system to give free goods for the exactly enough piece of price material. I mean: 2 pieces of 700001 for 8 or 9 or 10 or 11 pieces of 100005; not 2 pieces of 700001 for 6 or 7 pieces of 100005 but the system behaves this way. can anybody help me abput this subject?
    Thanks in advance for the answers....

    Hi Yasar,
    You need to create a new routine for calculate type.
    Do as below:
    1. Go to VOFM>Formulas>calc.rule Rebate InKd to create a new routine for calculate type.  for example 601.
    2. add the following code in this routine 601 and then save.
      USING L_FRM STRUCTURE KONDN_FRM.
    DATA: VORKOMMA  LIKE KONDN-KNRMM,
           NACHKOMMA LIKE KONDN-KNRMM.
      L_FRM-NRMENGE = 0.
      L_FRM-NRRUND  = 0.
      L_FRM-NRMENGE = ( L_FRM-MGLME / L_FRM-KNRNM * L_FRM-KNRZM ).
    business rounding
        VORKOMMA = FLOOR( L_FRM-NRMENGE ).
      L_FRM-NRRUND  = L_FRM-NRMENGE - VORKOMMA.
      L_FRM-NRMENGE = VORKOMMA.
    3. Select routine 601 in field "Calc.Rule" when you create free goods condition record.
    Hope it helps.

  • Rule missing in Transformation

    Hi Experts,
    When i was created the transformation (for cube in bi.7) the following error occured, plz give me proper solution.
    Rule 3 (target field: Z_PRI): Field /BIC/Z_PRI must be assigned to an InfoObject
    Message no. RSTRAN526
    Diagnosis
    No InfoObject is assigned to field /BIC/Z_PRI. This is mandatory if you want to use the corresponding rule type.
    System Response
    The rule is invalid.
    Procedure
    Assign an InfoObject to the field
    Thanks
    David

    Hi,
    In Transformation you have to select rule detail and write routine like for exp:
    My fields are z_prc & z_qty i have to calculate revene.
    Routine:
    go to revene field in traformations -> select Rule Detials -> Select Routine
    Write Routine:
    Result = source_fields-/bic/z_prc * source_fields-/z_qty.
    like you have to write routine your problem is solved.
    Thanks & Regards,
    Venkat.

Maybe you are looking for

  • Major delay in audio for notifications causing no sound.

    Major delay in audio for notifications causing no sound. Email text and app notification sounds are so quick thT with the new ios4 update there is now a delay in audio to the Bluetooth so I don't know when I get one. Phone ringer works fine and so do

  • No headphones in Windows Vista/7

    This has been bugging me for a long time now and it's time to ask. My Windows 7 speaker setup doesn't include an option for headphones: Using onboard audio will allow me to choose Headphones. ?Using the same Creative driver under Windows XP will allo

  • One of My External Drive Icons is invisible how do I get it back

    Hi. I have a couple of External (USB and Firewire) drives. Recently my Firewire drive (a WD My Book Studio 1Tb Drive) disappeared from the desktop and finder. If I look in Disk Utility it is there and I can reveal it or open it from Disk Utility and

  • PO Cancelation problem

    Create PO, Goods Receipt, invoice verification, then cancellation for that goods. I want after invoice verification, User are not allowed to cancel that PO anymore. IMG : t-code : ombz, uncheck mvtype 102 and 122 then process po to miro me21n, migo,

  • Maintain a common email list at one place  for all the process chains

    Hello BW Gurus, I have built a process chain and listed the email ids and pager numbers to be notified should an error occur. But I need to provide the same list for other process chains( around 15) and to avoid me adding the same id's and pager numb