Changing the G/L Account while Posting the Goods Receipts in MIGO

Hi All,
I have requirement in which G/L Account needs to be changed based on some validation while Posting the Goods Receipt in MIGO.
I have created exit in OBBH by copying the standard SAP Program RGGBS800 in view V_T80D.
I changed following entry in view V_T80D:
GBLS     ZGGBS800     Val/sub:Exits for substitution
Now Inside program ZGGBS800, I have written the logic to change the BSEG-HKONT value with the new G/L Account which gets called inside the standard function module G_VSR_SUBSTITUTION_CALL.
FORM U999.
   DATA : V_HKONT TYPE BSEG-HKONT.
   clear : V_HKONT.
   SELECT SINGLE SAKNR FROM ZMASH1 INTO V_HKONT WHERE MATNR = BSEG-MATNR AND WERKS = BSEG-WERKS.
     IF SY-SUBRC EQ 0.
       BSEG-HKONT = V_HKONT.
     ENDIF.
ENDFORM.
After the execution of the above code the value of BSEG-HKONT changes with new value of V_HKONT but after this when I go further in Standard SAP code of function module G_VSR_SUBSTITUTION_CALL, there is one subroutine FORM EXP_TAB_009_BSEG  being called which changes the value of BSEG-HKONT to initial value of HKONT also while moving the data from BSEG to TEMP_STRUCT it doesn't passes the HKONT value, which I want it be passed as I want the changed value to be passed finally to OUT_RESULT. Please look at the code below.
Following is the SAP standard code of subroutione FORM EXP_TAB_009_BSEG :
FORM EXP_TAB_009_BSEG
         USING
           IN_ORIG STRUCTURE        BSEG
        CHANGING
           OUT_RESULT STRUCTURE     BSEG
           B_RESULT.
  DATA:  ORIG LIKE BSEG.
  DATA:  BEGIN OF TEMP_STRUCT,
         ABPER                          LIKE   BSEG-ABPER,
         AUGGJ                          LIKE   BSEG-AUGGJ,
         DOCLN                          LIKE   BSEG-DOCLN,
         FIPOS                          LIKE   BSEG-FIPOS,
         FISTL                          LIKE   BSEG-FISTL,
         FKBER                          LIKE   BSEG-FKBER,
         FKBER_LONG                     LIKE   BSEG-FKBER_LONG,
         GEBER                          LIKE   BSEG-GEBER,
         GMVKZ                          LIKE   BSEG-GMVKZ,
         GRANT_NBR                      LIKE   BSEG-GRANT_NBR,
         HKTID                          LIKE   BSEG-HKTID,
         HZUON                          LIKE   BSEG-HZUON,
         INTRENO                        LIKE   BSEG-INTRENO,
         MEASURE                        LIKE   BSEG-MEASURE,
         PARGB                          LIKE   BSEG-PARGB,
         PPA_EX_IND                     LIKE   BSEG-PPA_EX_IND,
         PPRCT                          LIKE   BSEG-PPRCT,
         PRCTR                          LIKE   BSEG-PRCTR,
         PRODPER                        LIKE   BSEG-PRODPER,
         PRZNR                          LIKE   BSEG-PRZNR,
         PSEGMENT                       LIKE   BSEG-PSEGMENT,
         SAMNR                          LIKE   BSEG-SAMNR,
         SCTAX                          LIKE   BSEG-SCTAX,
         SEGMENT                        LIKE   BSEG-SEGMENT,
         SGTXT                          LIKE   BSEG-SGTXT,
         SRTYPE                         LIKE   BSEG-SRTYPE,
         UZAWE                          LIKE   BSEG-UZAWE,
         XREF1                          LIKE   BSEG-XREF1,
         XREF2                          LIKE   BSEG-XREF2,
         XREF3                          LIKE   BSEG-XREF3,
         ZUONR                          LIKE   BSEG-ZUONR,
         ZZBUSPARTN                     LIKE   BSEG-ZZBUSPARTN,
         ZZCHAN                         LIKE   BSEG-ZZCHAN,
         ZZLOB                          LIKE   BSEG-ZZLOB,
         ZZLOCA                         LIKE   BSEG-ZZLOCA,
         ZZPRODUCT                      LIKE   BSEG-ZZPRODUCT,
         ZZREGION                       LIKE   BSEG-ZZREGION,
         ZZSPREG                        LIKE   BSEG-ZZSPREG,
         ZZSTATE                        LIKE   BSEG-ZZSTATE,
         ZZUSERFLD1                     LIKE   BSEG-ZZUSERFLD1,
         ZZUSERFLD2                     LIKE   BSEG-ZZUSERFLD2,
         ZZUSERFLD3                     LIKE   BSEG-ZZUSERFLD3,
         END OF TEMP_STRUCT.
  IF IN_ORIG = BSEG .
    B_RESULT = B_FALSE.
    OUT_RESULT = IN_ORIG.
    EXIT.
  ENDIF.
  MOVE-CORRESPONDING BSEG TO TEMP_STRUCT.
  OUT_RESULT = IN_ORIG.
  MOVE-CORRESPONDING TEMP_STRUCT TO OUT_RESULT.
  IF IN_ORIG = OUT_RESULT .
    B_RESULT = B_FALSE.
  ELSE.
    B_RESULT = B_TRUE.
  ENDIF.
  BSEG = OUT_RESULT.
ENDFORM.                               " EXP_TAB_009_BSEG
I need the value of BSEG-HKONT should be passed to OUT_RESULT-HKONT.
I am not able to find any userexit or BADI for this.
Please guide me on this.
Thanks,
Chandravadan
Edited by: Chandravadan Jaiswal on May 8, 2009 2:18 PM
Edited by: Chandravadan Jaiswal on May 8, 2009 3:45 PM

Hi
I also need to change hkont while posting MIGO and MIRO transaction..
Any suggestion for this?
Here's my problem.. Substitution of account(HKONT) when posting in MIGO/MIRO

Similar Messages

  • Error while posting the payroll results to accounts

    Dear all,
    Im facing a issue while posting the payroll results to the accounts in T.code PC00_M99_CIPE,
    The error log says...
    Inconsistence in payroll results (tables V0/RT)
    Diagnosis:
    An inconsistency results has been found during the evaluation of the payroll results. No referenced entry has been found in table V0.
    Can anybody suggest me wat i hav to do...
    Thanks & regards
    Gopinath.Balakrishnan

    Hi
    Check whether the user is having the authorisation for the t.code PC_PAYRESULT or PC00_M40-PAYRESULT.
    Because some times HR user will run the payroll and FI user will do the postings. If FI user is doing the postings, in general he will not have the authorisation for HR T.codes, then system will give such kind of errors.
    If not check the paryoll results and control record.
    Thanks & Regards
    Bharathi

  • Error  in document number while posting the material

    Dear experts
    while posting the stock  MB1C  for the material  the error  is  " incorrect doc number $  1 .select doc number between   800000100  and 800000199.
    how to  correct  this  error. where  to check this  number ranges  of  document.
    Thanks  &  Regards.
    Erfan.

    Hi
    The document type, which is integrated for Material related posting is appears to be configured as "External Document Number Ranges".  In the event of external number ranges, MM transaction tries to post same document number individually at MM system and propose same number in FI for Accounting Posting.  If the proposed number is not within document number ranges, then you would expect this kind of errors.
    What you need to do is:
    1.  See the document type, which is being posted and set correct number ranges as per MM transaction document type number ranges  or
    2.  change MM transaction number rages in order to FI document number rages
    Hope this helps

  • Alternative Reconcialtion account while doig the MIRO

    Hi All,
    One of the cleint required alternative Reconcialtion accoutn while doign the MIRO. Scenario like this there is one Vendor 'A' used supplies Raw material and Serives to company. Business is not intrested to create new vendor. But they needs different reco accounts for one vendor master.
    I did mentioned customization in SPRO :-
    1. Maintain the Alternative Reco accounts
    2. Select the ready for input check box of Recon accounts.
    But still system is not accepting to change reco account while doing the MIRO. Change happens while doign the FB60
    Rgds
    SumaMani

    HI sumamani,
    As you are aware that it is not possible to change the reconciliation
    account in MIRO.In transaction FB60, it is possible to change the field
    value. SAP give us only the permitted account maintained in the
    customizing table THKON.
    In MM, the accounts are automatically determined from the
    customizing in transaction OMWB, or taken from the purchase order
    account assignment data.You can also have a quick look in tr OMRMB,
    you will notice that field INVFO-HKONT is not there to be customized.
    There is no solution available within the SAP standard system for the
    change of the reconciliation account for the vendor.
    According to the information I got from the responsible development
    department I can only inform you that the required functionality will
    not be implemented in SAP standard for MM invoice verification.
    Field in question is hard coded and can not be changed.
    MM invoice verification was developed to finish the external procurement
    process in logistics and check the invoice data sent by the vendors for
    correctness (differences) and to post the corresponding accounting
    document in FI additional.
    Creating manually creditor invoices in FI have no relation to a logistic
    process.
    Therefore not all functions included in FI (FB60) are included in MM
    invoice verification (MIRO) as well.
    reg
    Madhu M

  • Pricing carries out again while posting the invoice

    The pricing carries out again at the time of posting the invoice and sometimes changes the values of original invoice. Is there a way we can restrict pricing to only creation of billing document and it should not be carried while posting the same
    Thanks in advance,
    Mohit

    Hi,
    Check your copy control settings from delivery to Billing Item.The Pricing type assigned over here.
    You can change the pricing type using the user exit if you do not want to control by config.If the pricing type has to behave based on your conditions then you can use the user exit to acheive the same.
    Also as suggested in one of the thread could impose posting block through Billing type and check and release to accounting.
    Regards,
    Saju.S

  • I changed the name of my imac to reflect it's new location, but inadvertently, it unchecked the box to allow the administrative user account to administer the machine.  I am trying to reinstall with a time machine backup and am unable

    I need a little help.  I changed the name of my imac to reflect it's new location, but inadvertently, when I saved the change, the system unchecked the "allow this account to administer the computer" so now I can't make any changes....  I tried to reinstall the OS, but it wants me to go online while installing and use my apple id, but this is not my iMAC, so I don't want to use my account.  Also, I am working in a building that will not allow me network access until I authenticate, which can't be done unless I open the browser first.  So I'm stuck at this point.  I can't even restore a time machine backup that I have because it gives the error message that the system encountered an error.  Any suggestions?

    Ask the admin/owner to sign in. 

  • Vendor with multiple bank details....paid to the 1st bank account while inv

    Hello Experts,
    We have a vendor with two bank accounts in the vendor master. Now while making the payment, I mean, which account will the money goes? at the time of F110 , we paid to the 1st bank account in the vendor master..
    Settings in vendor master:
    I 'name' the bank accounts in the vendor master, in the field Bank Type. While posting through MIRO, insert this code into the line item 'Patner bank' and the payment program will pick up the bank account accordingly BUT If I don't add this information to the Patner bank account, than always the first bank account will be picked up..
    I want that even if don't add any info in partner bank in the line item,  at the time of F110 , it should paiy to the 2nd bank account in the vendor master..
    This is a very stupid requiremnt but our users wants like this only.
    Kindly show me some light in this dark tunnel...please.
    regards,
    nupur

    Hi Nupur,
    In vendor master data under 3rd tab where we record all bank details of the vendor left hand side you will find one column 'C' .i.e., Collection authorisation......kindly check this option for your second bank to which you want to make the payment.
    Hope this helps you.
    Regards,

  • While posting the Asset in f-90 the serives tax is not calculting

    hi experts,
    While posting the Asset in f-90 the serives tax is not calculating,even i entered in bussiness place?
    thanks in advance
    satya

    hi expert
    i didnot get the field to enter the tax code while postring the f-90 even i went through the related g/l account and tax code assigned in master data,i went through the field status varient and posting key.
    but i am unable to get serives tax field,i am entering the business place field also.
    thanks in advance
    satya

  • Error while posting the Goods Receipt

    Hi Friends,
    I am having an issue while posting the Goods Receipt.
    I am getting the error "Balance not zero: 1.000,00- debit: 0,00 credit: 1.000,00". I am using the Purchase Order with Account Assignment category P and K. When ever I used the account assignment category, I am getting this type of error. I have checked the configuration and every thing is OK. System is not able to debit the G/L account which is mentioned in the Purchase Order, hence the problem. However, I think system is able to get the G/L account (to Credit the amount) from Automatic Account determination.
    Would like to know if any one come across similar type of problem and resolved it.
    We have recently upgraded the system from 4.7 to ECC 6.0.
    Apprciate the help.
    Thank you,
    Prakash

    Hi
    Thank you for the reply.
    I have checked what you have mentioned. While creating PO it is determining the G/L account automatically through the assignments in OBYC. Even then I am getting the error while doing the Goods Receipt.
    Any one is having any idea?
    Thank you,
    Prakash
    Edited by: Prakash KM on Dec 17, 2010 6:26 PM

  • Issue while posting the invoice in background using the WF-BATCH user

    Hi Friends,
      I am facing an issue while posting the invoice in background using the WF-BATCH user. I am using a invoice approval workflow where in when the approver approvers the invoice the invoice document get posted using a background method, which uses BO FIPP and Method POST and i am returning the Message Text to my workflow container from this method. When i see the log an exception is rasied from this method with an error  message "V004: You are not authorized to change this document", but WF-BATCH is having SAP_ALL and SAP_NEW authorizations. If i try to post the invoice using the method from my user id it is getting posted. What could be the issue. Please advice.

    Hi Sapient,
    The Parameter, Roles would be different for the LOGIN USER and WF-BATCH.. So ask your administrator
    to set the Roles & Parameters similar to that of LOGIN USER to WF-BATCH.
    For further refrence check in SU01 giving the LOGIN USER and then check with WF-BATCH... you would
    find the difference...
    Hope this would help you..
    Good luck
    Narin

  • Dummy Profit center issue while posting the transaction in FB60

    Dear SAP friends,
    We have implemented ECC6.0 version,
    I have the below issue:
    I am posting the document in FB60 transaction: after simulating the document system is throwing the error "Profit center 9937/FIREPRODMY does not exist for 14.08.2009"
    Message no. KM700
    Document spilitting active at Business area level..
    In 0KE5( maintain controlling area settings) I have not given the Dummy profit center.
    Eventhough it is asking for Dummy profit center while posting, Please let me know apart from the 0Ke5 settings do i need to remove the dummy profit center anywhere in the Config.
    I have not maintained any settings in FAGL3KEH, 3KEH and OKB9.
    No sunstitutions are active in the system.
    Please let me know from where i need to remove the dummy profit center.
    My client going live on 17th Aug 2009.
    Regards,
    Anand

    Hi,
    Check the validity period of the Profit Center 9937/FIREPRODMY. The valid from period should have the date same or earlier than 14.08.2009
    If not then change the profit center master data to be valid from an earlier date (Tcode KE52). Steps-
    KE52 - Profit Center FIREPRODMY
    Click Change Validity Period (Ctrl +F1)
    Valid from - put a date earlier or equal to 14.08.2009
    Click Activate (Shift + F1)
    Thanks,

  • Error while posting the IDoc for Customer Invoice.

    hi,
    I m posting Customer Invoice through LSMW using IDocs.
    Basic type is FIDCCP02 and message is FIDCC2.
    While posting the Idoc I m getting error as:
    'Document or line item does not exist for invoice reference'.
    I m not getting the error why it is asking for invoice reference because
    in FB01 it is not asking for any reference or anything.
    Even in f-22 also it is not asking for the same.
    In Idoc all the item level values are coming prorperly.
    If anybody worked on such issues then please reply.
    -Thanx.
    -Umesh

    Hi,
    Where you able to resolve your issue, I would appreciate if you can share the solution.
    Thanks

  • HT5787 My apple id has been hacked. hacker has changed all information in the apple id so I can not change the password. Account information from the apple id created is still in my mail. How do I regain apple id. Thanks

    My apple id has been hacked. hacker has changed all information in the apple id so I can not change the password. Account information from the apple id created is still in my mail. How do I regain apple id. Thanks

    Contact Apple support: Apple ID: Contacting Apple for help with Apple ID account security

  • Posting period 011 2013 is not open while posting the document using F-02 getting the error

    Hi SAP Captains,
    Pls help me here.
    While posting the document using T-code F-02 getting the error "Posting period 011 2013 is not open.
    Please help me how to do, can you provide step by step.
    Rgds..Suresh

    Hi Suresh,
    You can search google and will get number of posts on this. This will lead to duplication of similar posts on forum.
    The message says "FI posting period is closed for 11th period of 2013". In which period you are trying to post the transaction?
    If it is past, open the FI posting periods in OB52.
    BR, Srinivas Salpala

  • ERROR  WHILE POSTING  THE STOCK  OF MATERIAL

    Dear experts
    while  posting  the stock  of  material  iam  getting  the error  'number ranges for transevent type WA in year 2011 does not exist.
    what  transaction  should  be  used  .
    Thanks & Regards.
    Erfan.

    Dear,
    First of all please go to T-code FBKP, click on Document Type, double click on document Type "WA" and check what is the value in Number Range.
    For Example there it is 01, then got to FBN1, enter company code and give  give 01 and against this maintain number.
    Hope this helps!!!
    Br,Vivek

Maybe you are looking for

  • How do I get "Pages (Beta)" documents I put in iCloud to show up on my iPhone5S?

    How do I get "Pages (Beta)" documents I've already put it in iCloud to show up on my iPhone 5S?

  • Create pdf from html, how to adjust page size

    I have a large html file that I need to convert to a pdf. I am able to open the html in acrobat and save as pdf, but I cannot find where to adjust the page size. When I save the html in acrobat, the saved file is still a single page, but when I open

  • Excel Import problem

    I'm having trouble with importing data from excel. I'm using HiQ version 4.5 and during import spurious data seems to appear after import. doesn't inspire confidence in software quality

  • Hooking up mini to home theater

    Good afternoon. I have a 1st gen Mac Mini. I want to hook it up to my home theater setup to be able to stream my videos, music, photos to my HDTV. What's the best way to connect this to my setup (i.e., what cables, connectors, etc.)? Thanks.

  • PDF to epub not converting correctly

    After I change my PDF to an epub file, it does not look the same. I have two photos per page in the PDF, and when it converts to epub it shows only one picture per page with double the amount of pages?