Você está na página 1de 18

11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Community

Ask a Question Write a Blog Post Login

RAHEEM BAKSH
April 22, 2013 6 minute read

Automatic account assignment OKB9 does not work


Follow RSS feed Like

24 Likes 35,269 Views 29 Comments

Applies to:

All releases of SAP for Financial postings made from a various applications like SAP-Logistics, SAP-Financials,
etc for more information, visit the Enterprise Resource planning homepage

Summary

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 1/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Automa c assignment occurs during pos ngs in external accoun ng (with in the FI, MM, or SD components) if you did
not enter a CO account assignment object (cost center, order, or project) for a cost accoun ng relevant pos ng. This is
always the case if the R/3 System automa cally created the pos ng row in ques on.

This paper highlights an alterna ve approach where standard default account assignment (OKB9) based on Valua on
area or Profit Center is not sufficient and a default account assignment based on Valua on area and Profit center is
required.

Author: Raheem Baksh

Company: NovelERP Solu on Pvt.Ltd.

Created On: Apr 2013

Standard SAP – Default Account Assignment (OKB9)

The standard SAP offers to specify a default account assignment (Cost Center/Internal Order)

1. Per company code


2. Per Business area
3. Per Profit Center
4. Per Valua on area

In cases, where a default account assignment is to be specified below the company code, then “Account Assignment
Detail” field in OKB9 is used to specify a default CO object per Business area or Profit center or Valua on area.

But system does not determined Default cost object from OKB9 for automa cally generated lines that reference the
en re document and not individual items.

For More Information Read SAP Notes 105024, and 32654

Example: Key-

“DIF” (minor differences)

“UPF” (unplanned delivery costs)

“KDT” (tax exchange rate difference)

“OFF” (GTA)

“KDR” (exchange rate rounding)

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 2/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Default Account Assignment in OKB9

You can define automa c account assignments In OKB9 or defaults in the cost element masters data record .The cost
element master data record can determine these assignments per controlling area, and the IMG per company code,
business area, and/or valua on area.

Transac on Code – OKB9

Here it is mandatory to set Minimum One Combina on to call Default Account Assigned Object

1. Valua on Area is mandatory


2. Business Area is mandatory
3. Profit center is mandatory

Here we have set as “1”Valua on Area is mandatory

Here whenever Prerequisite met from your Transac on System will pickup default cost center as per Valua on area.

De ne Substitution OKC9

In subs tu on, the SAP System checks whether par cular input values sa sfy one or more user-defined condi ons. If the
condi on is fulfilled, the values are automa cally replaced by other values.
https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 3/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Standard se ngs

The following callup points are defined in the standard SAP System for Controlling:

0001 – Document row : Used for all CO-relevant pos ngs in external accoun ng as well as for manual pos ngs in CO.
0010 – Order: Used for order background processing and irrelevant for account assignment checks.
0100 – Document header: Used for manual pos ngs in CO, such as repos ng costs or ac vity alloca on.

Ac vi es

1. 1. Determine in which controlling area you want to subs tute values.


2. 2. Create a subs tu on.

Proceed as follows:

a) Choose the “New entries” func on.

b) Enter the controlling area in which the subs tu on is to be executed.

c) Enter a callup point.

d) Save your entries

e) Choose “Environment -> Subs tu on”.

f) Enter a name and a callup point for the subs tu on.

You can use an exis ng subs tu on as a reference.

g) Change the model data to meet your specifica ons, or copy them without changes.

h) Save your entries.

i) If you do not use a reference, proceed as follows:

j) Verify your entries by freeing the data for release.

k) Enter a descrip on of the subs tu on.

l) To define the subs tu on steps, choose “Insert entry”.

m) Choose the subs tu on fields in the dialog box that appears.

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 4/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

You can choose “Exit only” or database fields. “Exit only” ensures that all fields allowed for subs tu on are available only
in this USER-EXIT. Otherwise, you can replace one field only, using a value defined in the USER-EXIT.

n) Transfer one or more of the displayed subs tu on fields.

o) Enter a descrip on of the subs tu on step.

p) Enter one or more condi ons under “Prerequisites”.

Use the func on “Fields for condi ons” to do so. You may also maintain rules by choosing the corresponding func on.

q) Enter constant values for the fields to be subs tuted, or store a subs tu on exit.

r) Save the subs tu on steps.

s) Return to the ini al screen.

t) Enter the subs tu on’s name for your controlling area and set an ac va on level.

Ac va on level “1” ensures that the subs tu on is ac ve in the correct controlling area.

u) Save the subs tu on.

Note on transport

To transport subs tu ons, a separate func on is available in the IMG for “General Controlling”

Transaction Code – OKC9

Subs tu on-

Prerequisite – Company code =1000 and Controlling area =1000

If Prerequisite is met subs tute by User exit UOKB0

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 5/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Check Client speci c user exit GCX2         

Transac on code: GCX2

Here you need to check assigned program for the Applica on Area GBLS.

You need to some change in Program, First copy from Exis ng program RGGBS000.

Copy from Exiting program SE38

Copy from Exis ng program and change in Z Program, Ask technical guy if you are not familiar on Program, for copy or
change new program you need to developer ID.

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 6/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Change in Z Program as below-

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 7/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Note : see below changes are based on organiza on structure here you need to determine which field you can enter to
get Cost center, if you are using Business area so OKB9 can be determine by Business area .

We have made OKB9 account assignment as per Valua on Area, but here system does not determine profit center and
Valua on Area for auto generated line item,

Our Business Place and Sec on Code is equal to Plant (Valua on Area)

*&
———————————————————————————————————————————————————————
————-*
*&      Form  UOKB9
*&
———————————————————————————————————————————————————————
————*
*       text
*
———————————————————————————————————————————————————————
————–*
FORM UOKB9 .

if COBL–WERKS is INITIAL AND COBL–BWKEY is INITIAL.


COBL–WERKS = bseg–bupla.
COBL–BWKEY = bseg–bupla.
ENDIF.

DATA:
LD_KOSTL LIKE COBL–KOSTL,
LD_AUFNR LIKE COBL–AUFNR,
LD_PRCTR LIKE COBL–PRCTR,
LD_PAOBJNR LIKE COBL–PAOBJNR.

CHECK COBK–VRGNG = ‘COIN’.

CHECK NOT COBL–HKONT IS INITIAL.


https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 8/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

CALL FUNCTION ‘RK_KSTAR_READ’


EXPORTING
DATUM = COBK–BUDAT
KOKRS = COBK–KOKRS
KSTAR = COBL–HKONT
IMPORTING
V_CSKB = CSKBV
EXCEPTIONS
KSTAR_NOT_FOUND = 1.
CHECK SY–SUBRC = 0.

CALL FUNCTION ‘K_ACCOUNT_ASSIGNMENT_GET’


EXPORTING
BUKRS = COBL–BUKRS
WERKS = COBL–WERKS
BWKEY = COBL–BWKEY
GSBER = COBL–GSBER
KSTAR = COBL–HKONT
I_COBL = COBL
IMPORTING
KOSTL = LD_KOSTL
AUFNR = LD_AUFNR
PRCTR = LD_PRCTR
E_PAOBJNR = LD_PAOBJNR.

IF  COBL–KOSTL IS INITIAL              “*!


AND NOT LD_KOSTL IS INITIAL.
COBL–KOSTL = LD_KOSTL.
ENDIF.

IF  COBL–AUFNR IS INITIAL              “*!


AND NOT LD_AUFNR IS INITIAL.
COBL–AUFNR = LD_AUFNR.
ENDIF.

IF  COBL–PRCTR IS INITIAL              “*!


AND NOT LD_PRCTR IS INITIAL.
COBL–PRCTR = LD_PRCTR.
ENDIF.

IF  COBL–PAOBJNR IS INITIAL            “*!


AND NOT LD_PAOBJNR IS INITIAL.
COBL–PAOBJNR = LD_PAOBJNR.
ENDIF.
https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 9/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

ENDFORM.                                                    “UOKB9

*&—————————————————————————-*

Assign Z program in to Client speci c user exit GCX2

Please also refer Next related post Automatic account assignment OKB9 ( Set Acc. Assignment “3 Pro te
center is mandatory”)

Alert Moderator

Assigned tags

FIN Controlling | FIN (Finance) | SAP ERP | account | assignment |

View more...

Related Blog Posts

Automatic account assignment OKB9 ( Set Acc. Assignment “3 Pro te center is mandatory”)
By RAHEEM BAKSH , Feb 04, 2014

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 10/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs
CostElement 11. Real Cost Object.
By arturo senosain , Mar 09, 2014

Combined Pro tability Analysis


By Morten Elle , Dec 11, 2017

Related Questions

OKB9 with PL acct (12 Sales Deduction)


By Former Member , Nov 19, 2008
Account 6xxx requires an assignment to a CO object KI235 MIGO GR
By Former Member , Aug 16, 2010

The Co Account assignment object belong to company code 0050, not 0070
By Former Member , Jun 03, 2010

29 Comments

You must be Logged on to comment or reply to a post.

Former Member

April 23, 2013 at 5:22 am

Hello Raheem,

Good article.

Thanks

Like (0)

RAHEEM BAKSH | Post author

April 23, 2013 at 6:19 am

Thanks Dear ………..

Like (0)

Former Member

April 25, 2013 at 5:27 pm


https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 11/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Dear Raheem,

Very good article. Good work !!!!

Thanks,

Srini

Like (0)

RAHEEM BAKSH | Post author

April 27, 2013 at 8:36 am

Dear Srinivasa,

Thanks!!!!!

Rate the article if u like it

Regards

Raheem

Like (0)

Jason Shao

April 29, 2013 at 6:40 am

this is very useful

Like (0)

RAHEEM BAKSH | Post author

April 29, 2013 at 8:23 am

Dear Jason,

Thanks!!!!!

Like (0)

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 12/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Sean Xiao

July 18, 2013 at 7:33 am

detailed and systematic, great work!

Like (0)

RAHEEM BAKSH | Post author

July 18, 2013 at 11:21 am

Thanks Sean Xiao      

Regards

Raheem

Like (0)

Former Member

July 18, 2013 at 12:36 pm

Good Job Raheem

Sachin j

Like (0)

RAHEEM BAKSH | Post author

September 5, 2013 at 12:13 pm

Thanks sachin,

Like (0)

Former Member

September 5, 2013 at 12:18 pm

Very Informative…Many Thanks.

Best Regards,

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 13/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Naresh K.

Like (0)

RAHEEM BAKSH | Post author

September 5, 2013 at 12:23 pm

Thanks Naresh,

Like (0)

Former Member

October 10, 2013 at 9:30 am

Really  Good work Yaar!!

.Many Thanks.

Best Regards,

Niran.OK.

Like (0)

RAHEEM BAKSH | Post author

October 10, 2013 at 12:02 pm

Thanks Niran

Like (0)

Former Member

October 10, 2013 at 10:05 am

Hello Raheem,

Very useful and informative article.

Thnx 4 ur fabulous article.

Regards,

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 14/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Satendra

Like (0)

RAHEEM BAKSH | Post author

October 10, 2013 at 12:02 pm

Thanks Satendra

Like (0)

Former Member

February 4, 2014 at 9:21 am

Hi Raheem

Its very good and useful info…

Like (0)

RAHEEM BAKSH | Post author

February 4, 2014 at 9:36 am

Thanks

Like (0)

Lakshmi Sama

February 4, 2014 at 12:31 pm

Hello Raheem,

Its a very good article. Thanks for sharing your knowledge and keep sharing.

Regards,

Lakshmi S

Like (0)

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 15/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

RAHEEM BAKSH | Post author

February 4, 2014 at 12:37 pm

Thanks Lakshmi,

Like (0)

Former Member

February 6, 2014 at 5:25 am

Good one…..

Like (0)

RAHEEM BAKSH | Post author

February 7, 2014 at 5:07 am

Thanks

Like (0)

Pavan Kumar Arvapally

July 1, 2014 at 11:14 am

Hi Ramesh,

Nice document…..

Regards,

Pavan Kumar Arvapally

Like (0)

RAHEEM BAKSH | Post author

July 1, 2014 at 11:43 am

Thanks Pavan,

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 16/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Its Raheem

Regards

Raheem

Like (0)

Former Member

October 9, 2015 at 6:04 am

Hi, Raheem Bhai

Thanks for the Documentation provided by you, My requirement is to update the Center Field & I have done with
every thing  , But I have an issue in the code while substituting the values of BSEG in COBL….. the BSEG is not
Returning values of WERKS & BWKEY….. Its empty while cheking in debugging

Can u help with this??

*&      Form  UOKB9


*&———————————————————————————————————————————————————————————*
*       text
*———————————————————————————————————————————————————————————–*
FORM UOKB9 .

if COBL–WERKS is INITIAL AND COBL–BWKEY is INITIAL.


COBL–WERKS = bseg–bupla.       “””””””””””” over here
COBL–BWKEY = bseg–bupla.     “””””””” over here
ENDIF.

Like (0)

RAHEEM BAKSH | Post author

October 12, 2015 at 7:11 am

Hi Akash,

if COBL–WERKS is INITIAL AND COBL–BWKEY is INITIAL.


COBL–WERKS = xxxxxx      “””””””””””” {identify the value on particular line item (where object is missing ) that can be used to
identify the Valuation area. In case nothing is matching with valuation area / Business area / Pro t center keep Valuation area in
memory id from rst line item and import that ID here
COBL–BWKEY = xxxxxxx     “””””””” Same as above

Like (0)

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 17/18
11/4/2019 Automatic account assignment OKB9 does not work | SAP Blogs

Former Member

October 9, 2015 at 6:10 am

Nice Blog Shared Bro…. Really Descriptive & Helpful

Like (0)

RAHEEM BAKSH | Post author

June 9, 2016 at 3:47 am

Thanks

Like (0)

Former Member

June 29, 2016 at 4:37 pm

hi Raheem

good article nice one ………keep it up

Regards

Raj

Like (0)

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2013/04/22/automatic-account-assignment-okb9-does-not-work/ 18/18

Você também pode gostar