Skip to Content


Hello Everyone,

I have a report where the accounting document needs to be reposted based on the change in the profit center at line item level for the cost objects. The program has to check for the given line item cost object's Proft center is different from the Profit center which are assigned to the cost objects (either IO,Cost center or WBS element) master data.The program is working fine.But when the cost assignment is assigned in the txn OKB9 for the given account the BAPI is taking the first preference for the CO object assigned (which is different from the line item) and posting with wrong PC.


Line item to be reposted in FB03

123456789(Doc Num)

01(Line item No) , ABCD(AUFNR) , 5678(Account) , 789(Profit center)

KO03: The Internal order 'ABCD' is maintained with the Profit center '777' in the master data.

OKB9: For account '5678' is maintained with internal order 'XYZ' which has '666' Profit center in master data.

Now when i run the standard bapi(Bapi account document post):

It is reposting like below:

98765544(Doc Num)

01(line item) , XYZ(AUFNR) , 5678(Account) ,666(Profit center).

The desired reposting has to be like below:

01(line item) , ABCD(AUFNR) , 5678(Account) ,777(Profit center).

I have also checked the FM K_ACCOUNT_ASSIGNMENT_DEFAULT but could not find any help on this.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 17, 2017 at 12:42 PM

    Seems that the FM K_ACCOUNT_ASSIGNMENT_GET is called and not K_ORDER_READ in your case (too much info on OKB9...)

    Set some break-points to check this for your version and Customizing (somewehere just after first FM call).

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Raymond,

      Thank you very much for your quick response. Actually we have designed a custom program to repost the accounting document.Everything is working fine but the only showstopper is for the given line item which has account number(HKONT) in FB03. The Bapi is first checking for any cost assignment in OKB9 else(if it does not maintained) it is going for accounting line item and picking that cost object.Our requirement is to post with the same cost object which is assigned at the line item level but not in OKB9. Neither i can add any exit/enhance the bapi as in most of the program it is been used.

      It would be great help if you could give more details on your above mentioned solution.I need to code the same in my report.