FI Substitution rule on completed document

Hi Everyone,
We're trying to create a substitution rule to change the payment terms on our invoices (fields BSEG-ZTERM and BSEG-ZBD1T).  We're having trouble with our prerequisite:  If any of the expense distributions are being charged against a federal grant (BSEG-GRANT_NBR) then call the substitution rule.   We want our exit to loop through all distribution lines and if it finds any being charged to a grant it should set the condition to true and substitute...if it doesn't find any it should be set to false. 
We've done all of the necessary steps:
-Activated the fields on GB01
-Defined the substitution rules on OBBH
-Build and compiled the user exit.
Problem we're having is that when there are multiple lines it only seems to be reading the last line item to make the determination.
Example 1:
Line 1 Grant
Line 2 No Grant
Result is that payment terms are not substituted.  It should be substituted because line 1 hit a grant.
Example 2:
Line 1 No Grant
Line 2 Grant
Result is that payment terms are substituted correctly. 
My ABAPer says that the problem seems to be that on the completed document he can only see the last line (not all the lines)....does anyone know a way to loop through all the records on a completed document?  It seems that substitution gets called before records get inserted into the database so we're not sure how to make our pre-requisite work.
thanks for your help

Hi,
here is the solution.
Create your user exit.
FORM u280 USING bool_data TYPE gb002_015.
FIELD-SYMBOLS: <ls_bseg> LIKE LINE OF bool_data-bseg,
LOOP AT bool_data-bseg ASSIGNING <ls_bseg>.
* Here is your logic needed
ENDLOOP.
Create a substitution for the complete document in GGB1 and choose no field but "Only exit'.

Similar Messages

  • Can we write Substitution rule during payment document creation

    Hi,
    I have to subsitute a value in a field during f110, is it possible ??

    Thanks for the reply.
    I tried this logic in GGB1.
    SYST-TCODE = 'f110' AND BSEG-DMBTR >= '100000'
    Substitute Payment method supplement with a constant value = 15
    but this is not working.....Actually i need to get the second signature manually on the check amount greater than 100000. so i am using payment method supplement to sort high amount checks.
    this logic is working when i am using rule during invoice processing...but not working during f110.
    please advice.
    Thanks
    Riya

  • How to use Material Group in substitution rule

    Hello,
    Anyone experience in how to use the entry of the material group of a PO, in a substitution rule for accounting documents.
    I have noticed the material number can be used within a substitution rule, and is also available in BSEG... so far have not find a solution to do this for a material group.
    Please note, this is applicable for PO with no materials (ONLY a material group to use for account determination).
    Many thanks,
    Daan

    forget about all varible in essbase CSC
    it's bad practics.^^^Is it?
    Essbase cube are self big array )^^^That's what makes ARRAY so cool -- you can set up an array that encompasses a dimension.
    Example straight from a HBR:
    ARRAY SomeArray["Entity"] ;
    Regards,
    Cameron Lackpour

  • Substitution Rule for F110

    Hi gurus,
    Currently, my substitution rule for tcode 'F110', is not triggered. Because I need to change the value of BSEG-AUFNR (Order Number) to blank after F110. Can you tell me if there's a workaround?
    Thanks gurus.

    Hi,
    Can you please elaborate your scenario. As per my knowledge you can not edit already posted document by using substitution rule.
    Once document is posted substitution is triggered and change that particular documnet, it will not go to any other document whcih is posted earlier and make any changes.
    You can very well go and repost the document or change the document if it is possible.
    Regards,
    Anand Raichura

  • Substitution rule has to triggered after save document in FB70 and FB75

    HI,
      I have a substitution rule for REFNR field  and that will trigger when you make FB70 and FB75 for 2 company codes. In the user exit for subustitution we have a code to get the next object number for some other purpose. because third party will use this generated next number for their legal requirement.
    The real problem comes this substitution rule is triggered before save document. due to this if i came back from the transaction without saving the document I am losing that generated number which i dont want.
    I need some tips on this. is there a way in the substituion settings we will trigger this exit at save document.
    I would appreciate your inputs on this.
    Regards
    PRasad

    Hi Rob,
      I would like to know.
      call point 001 is document header
      call point 002 is document item
      call point 003 is complete document.
    I am assuming 003 triggers after complete the document.
    Any clue on this.
    Regards
    PRasad

  • Check Incompletion Rule and Completion Rule on Sales Document

    Hii Guy...
    where can i check Incompletion Rule and Completion Rule on Sales Document type the backgroud table of Sales order and item category ?

    Hi friend,
    Incompletion procedure you can check in the OVA2 transaction code.
    There you can find the incompletion procedre for the sales document header as well as item.
    Path: IMG-->SALES & DISTRIBTION->BASIC FUNCTIONS---> INCOMPLETION PROCEDURE--->
    There you can find all the settings of the Incompletion procedure.
    If you want to check the incompletion procedre in the document, then goto  EDIT---INCOMPLETION LOG
    FOR item click on the item and goto EDIT---INCOMPLETION LOG
    regards,
    santosh

  • PO down payment is not picking FI substitution rule.

    Hi All,
    We have an issue with PO down payment and clearing. We have a
    substitution rule on line item level as per company code were default profit
    center is set. But while doing ME2DP, profit center is picking from PO account
    assignment and overriding our substitution rule. We did try with complete
    document substitution rule also but not worked.
    Clearing of the pre-payment is deriving the profit center of
    the account assignment on the PO, overriding our profit center substitution.
    This is only happening with PO down payment. Please let me
    know any solution. 

    Hi Rakesh
    If the Down payment GL you are referring to is a Balance sheet account, your substitution should work.. How have you written your substitution? Can you give a screen shot?
    But if you are referring to the Down Payment Cost Element assigned against your Controlling area, system is correct... For a cost element, PC is always derived from the associated CO object
    br, Ajay M

  • CREATE SUBSTITUTION RULE FOR u0093COPYING LINE ITEM TEXT FOR LINE ITEMSu0094

    Hi every body
    When user post transactions in FB60 we have give the line item text, Suppose no.of lineitems are there in tht instnace my client asked to create the substitution rule to “COPYING LINE ITEM TEXT FOR LINE ITEMS”
    pls tell me the processes how to create the substitution rule
    Plz can anyboby help me out...
    laxmi velaga

    sorry,
    link doesn't work:
    here's the content:
    you must add your rules at event 3 (complete document)
    in an exit of ZGGBS000:
    data htext type bseg-sgtxt.
    *find
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt <> space.
      move  bseg-sgtxt to htext.
      ENDLOOP.
    *copy
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt = space.
      move  htext to bseg-sgtxt
    *modify
      MODIFY BOOL_DATA-BSEG FROM BSEG.^
      ENDLOOP.
    http://help.sap.com/saphelp_47x200/helpdata/en/5b/d231a843c611d182b30000e829fbfe/frameset.htm
    please reward useful answers
    thanks and regards
    Andreas

  • Substitution  rule  & validation rule

    Hi
    Please  tell me what steps should be followed in substitution  rule  & validation rule
    Thank You
    Deepika

    For Creation of validation Goto GGB0.
    You should choose in which module you are going to create. Like FA, AA, Cost accounting, Spl Ledgeretc.
    Then at what level you want to do Validation. Like Complete Document level or Line item Level
    Then You need to Define Your
    1. Prerequite
    2. Check and
    3. Message
    For Substitution goto GGB1
    You need to define your Prerequisite and Substituion rule.
    regards
    jay

  • Profit center substitution rule not overriding OKB9

    There is an automatic assignment of a cost center to an expense GL account in OKB9.
    This is cost center is not assigned to any profit center because it is a generic cost center.
    When we try to post to the same account manually using FB50 and when we put the same cost center in, it will of course post to a dummy profit center since the cost center is not assigned to a profit center. The profit center field cannot be changed manually as it gets greyed out after derivation.
    In order to override it , we have created a substitution rule using OBBH where we have introduced the business area.
    We have mentioned that if GL a/c = XXX and business area = YYY , the profit center = ZZZ
    When we now try to post into the a/c using FB50 , it does derive profit center as ZZZ from the substitution rule when you press the enter key.
    But when you try to post the document, it gives a message saying, it has replaced the profit center to dummy profit center and when i click on the message for more info , it says, it will use the automatic assignment rule and so it will by dummy and not ZZZ.
    I would appreciate any help in getting the substitution rule to override the OKB9 in this scenario

    Hi Rajaram,
    First of all profit center field is available in cost center master data and you are saying you have maintained default cost center for the respective GL Account in OKB9.
    Now you are substituting the profit center after OKB9 has derived the Cost Center & Profit center.
    Yes, sap standard behaviour will not allow you to do that even if you notice that in simulation mode you are able to see that substitution is changing the profit center as in complete call it gets reset to the original profit center again back.
    So you can not achieve that with standard boolean logic but only through exit and thats too probably the exit need to get called after the line item value is passed but before posting.
    Thanks & Regards
    Subhasish

  • Substitution Rule.....

    Hi Gurus,
        Can anybody help me how to create Substituion rule for copying line item text for line items... plz give all the steps which r required.
    Thanks in advance.
    Regards,
    siva

    Hi,
    you must add your rules at event 3 (complete document)
    in an exit of ZGGBS000:
    data htext type bseg-sgtxt.
    *find
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt <> space.
      move  bseg-sgtxt to htext.
      ENDLOOP.
    *copy
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt = space.
      move  htext to bseg-sgtxt
    *modify
      MODIFY BOOL_DATA-BSEG FROM BSEG.^
      ENDLOOP.
    A.

  • Trigger substitution rule for a background job

    Hi all,
    I ve written a subroutine in Substitution rules for FI in GGB1 tcode for F110 transaction to replace the section code (bseg-secco) while posting a fi document.
    but the substitution rule is not getting triggered as F110 runs a background job to post the document...
    The substitution is active and the activation level is active all the time.
    Could u please suggest how to get it triggered for a background job...

    Measuring External Processes
    Use
    The runtime analysis allows you to switch into work processes that are already running and to measure the runtime of dialogs running in them as though they were running in the current session. You can have up to ten external sessions, which may be of any type – for example, dialog, update, or spool. This runtime analysis variant is ideal for monitoring long-running background jobs.
    Filename and Directory
    If you do not want to use the default filename and directory to store files, you can change them using the profile parameter abap/atrapath. If the profile parameter does not contain an entry at all, an error occurs when you start the runtime analysis.

  • Substitution Rule not working for invoice receipt

    Hi All,
    I have written a Substitution rule using OBBH T.code for Call point "2" - Line item, The rule details are as below
    For Account "GR/IR Account" And "Business Area=XXXX" Substitute "Profit Center = YYYY"
    When I do Goods Receipt the my substitution is working, it is replacing the existing cost center to "YYYY", but when i do Invoice Receipt the profit center is being derived from the account assignment of the WBS element.
    I tried writing a derivation rule 3KEI and it didn't work either,
    How can i make my above substitution to work on both (GR and IR) accounting documents.
    Any help is greatly appreciated.
    Thanks
    Shasha

    Hello,
    Perhaps your prerequisite need to contain other BKPF values like, company code, t-code, etc (if any).
    Also please run program RGUGBR00 in SE38 to activate programs.
    hope this helps
    Regards
    Ajith

  • FI substitution rule for Business area  on New GL view(FAGLFLEXA)

    Hi Gurus,
    Need a your expertise guidance.
    We have a requirement to substitute u2018Business areau2019 field on GL view(table u2013 FAGLFLEXA) for all FI postings.. I am trying to achieve this by OBBH substitution rule using user exit, Is this possible anyway??
    I have already worked with my developer, but he is not getting any clue to write a logic in the user exits available in OBBH.. can anyone please guide us..
    Actual requirement is to update u2018Business areau2019 field on all FI postings at new GL view for some of the company codes (not all), I am not sure if we can achieve it by activating document splitting by business area field.. we have document splitting active already by profit center and segmentu2026
    Please guide me..
    Many thanks in advance..
    Prasad

    HI pampana,
    If you add the Business area is document splitting char's  with Mandatory check box
    then reach and very line will update the business area value in Doc splitting.
    But you allready have profit center as a doc splitting char's
    If you want to Business area is new doc splitting char's then you need
    go for NewGL migration.
    Please refer the NewGL migration scenario 6, 7 for your case.
    please check the link
    http://wiki.sdn.sap.com/wiki/x/JghNCw    (NewGL Migration Secnarios)
    Regards
    Madhu M

  • Substitution Rule for Payment Term

    Hi Expert,
    I have to have Substitution for payment term the following criteria:
    Company Code = '1000' AND Document Type = 'L1' AND Posting key = '14', then ... substitution bseg-zterm with certain payment term.
    Problem: there is no substitution for bseg-zterm.
    I read the post at http://sap.ittoolbox.com/groups/technical-functional/sap-acct/substitution-rule-for-payment-term-489202
    and found that I need to apply a SAP note 42615 in order to enable the BSEG-ZTERM field in Substitution Rule for Payment Term, and after that run Program RGUGBR00 to regenerate the substitution.
    But, problem again, our SAP is ECC 6.0, and the said SAP note is not applicable.
    Kindly advise is there any other way that I can enable the bseg-zterm field at substituion.
    Thanks,
    sbmel

    Hi
    1. Go to SE16N and enter Table GB01
    2. Enter &SAP_EDIT in the command prompt i..e the space where you type your T code and press enter
    3. BCL TAB = BSEG and Field = ZTERM... Execute
    4. Remove the X for the field BEXCLUDE.. SAVE....
    5. Select this entry and menu Table > Transport > Include in tr request
    6. Run RGUGBR00
    Br, Ajay M

Maybe you are looking for

  • Time limit Exceeded in SM58

    Hi , I have a file to ido scenario.The file size is  suppose to be big (atmost 5mb).I am getting the following error in SM58 Time limit Exceeded . I am able to see my idocs in idx5. Kindly help

  • When entering app store Computer restarts. What to do?

    Help is granted.

  • ROW LOCK IN SQL SERVER 2005

    Please someone explain me how to lock exact row for UPDATE and DELETE. from my java application. I am testing with sql jdbc 2.0. I want in my application prevent simultaneous editing of the same record.

  • Tree Component Drag and Drop

    Hi, I've been playing around with a trail version of flex and was interested to know if anybody had tried to implement the drag and drop functionality of the Tree component to a TileList? After much messing about I noticed the format of the Tree data

  • Online Game Throtelling

     I recently purchased an Online Game (MMO) Final Fantasy XIV and it appears you guys are throttleing the connection at peak times making it impossible to play, this is not a P2P programme or anything like that.  Both BT and EE(Orange) seem to be thro