Вы находитесь на странице: 1из 22

Coding Block

Skip to end of metadata

Created by Gladys Xing, last modified by Bret Halford on Apr 22, 2014

Go to start of metadata
1. What is coding block.
2. About coding block sub-screen and its limitation.
3. How to create a customer own fields.
4. How to Add customer field into Customer created sub-screen.
5. Main debug points.

1. What is coding block.

The coding block is a tool used to enter additional account assignments, for example, cost center,
order or project and customer fields. The coding block is supported by Accounting (AC) and used
by other application components such as HR, CO, FI-SL
2. About coding block sub-screen and its limitation.
(1) Check all SAP standard coding block Sub-screen and maintain customer own screen in Tcode
(2) It is not necessary to maintain customer own screen, by default sub-screen:9999 is used.
(3) After you have generated a coding block subscreen, the changes carried out and valid in all clients
of the system and for all transactions.
(4) Max. 18 Customer own fields can be created.
(5) Customer fields from the coding block can be added without modification in Enjoy transactions, but
Max. 5 fields can be added.
3. How to create a customer own fields.
Using basic mode or expert mode to define customer fields in Tcode OXK3
Basic mode:
In OXK3->press Add field button:
(1) Enter Development Class.
(2) Field name: Must begin with ZZ or YY.
(3) Field description: that is to appear on the sub-screen
(4) Data type: CHAR or NUMC are offered as data types for a coding field (CHAR can defined as an
ALPHA conversion in expert mode only, by creating DOMAIN with Conversion routine: ALPHA,
that is numerical values are portrayed internally with leading zeros).
(5) Choose the function Test run to check whether your entries are valid.
(6) Remove the flag from the Test run field, the PROC. Run will be automatically set.

(7) Choose Execute.

(8) Check the log for confirming the generation is done correctly or not.
Expert Mode:
The expert mode allows you to perform step-by-step all the functions which the basic mode carries out
automatically in the background. This affords you greater freedom when defining the various parameters
you require. But ABAP Dictionary knowledge is necessary.
In OXK3->menu: Account Assignment Fields->Expert Mode->next screen->Account Assignment Fields:
(1) Create domain for a new customer fields(Optional).
(2) Create data element for a new customer fields(optional).
(3) Add field->add the new field in the Include structure CI_COBL.
(4) Add field BI: if this new field is used in Batch input as well, then do this step.
(5) Add field to BSEG->the new field must be added to the end of the field and before append structure
in BSEG.
(6) Add control entry-> for making this new field available for customizing.
Example in Basic mode:Create Z field as below:

Example in Basic mode: check the log in Test Run mode:

Example in Basic mode: Run in Proc. Mode, check the log.

Example in Basic mode: Run in Proc. Mode, check the log. Pay attention to the generation PRG, if any
inconsistency happens, just run one of these PRG.

Example in Basic mode: check in BSEG and CI_COBL table for ensuring the ZZGlADYS field generated.

Example in Basic mode: check field status in Tcode OB14.

Example in Basic mode: check ZZgladys is available in coding block sub-screen, ZZgladys is displayed
in sub-screen:9999 by default.

4. How to Add customer field into Customer created sub-screen.

Which Sub-screen are used by system depends on the required entry fields and optional fields and Priority
of sub-screen.
Example create sub-screen as 9997 with all possible fields in Tcode OXK1

Sub-screen 9997 is displayed in Tcode FB01 as follow:

5. Main debug points.

The Main PRG:SAPLKACB, and the main FM:COBL_SEND_PBO, within this FM, the coding block is called
by COBL_EX_SEND_PBO, and then check the required fields and their field status, get modification number
of fields and Priority, and so on, then at last which screen is used as default one is determined according to the
number of required fields and Priority etc.
(1) Mapping the coding block fields and Check field status in main PRG SAPLKACB, source code of LKACBF01.

(2) Check internal table: gt_coblf ( 0 = false ; 1 = true ).

(3) Make the customer created sub-screen 9997 (ZZGLADYS included) as default one for coding block screen.

(4) Check the required fields, optional fields and priority for the sub-screen in internal table TREFFER, in this
case 9997 is the default sub-screen for coding block.

(5) If ZZGLADYS is suppressed , check the result in internal table TREFFER after sorting, the required fields
lowered from 5 to 4 due to ZZGLADY is not included anymore, so the dynnr No. with small one will be selected
as default sub-screen. In this case, it should be 1014.

(6) The selected sub-screen will be transferred to field of TREFFER-DYNNR as default one to be used after
(this is1014).

SAP FI Coding Block Config !!

Coding Blocks
In the coding block of the system you can create your own fields.
The new coding fields can then be used in FI General Ledger
accounts, MM Inventory Management and MM Purchasing, and
are also updated in the line items created in the Controlling

These fields can then be used to input data you want to record
when entering documents in SAP.
Activity Edit Coding Block
Path IMG -> Financial Accounting (NEW) -> Financial Account
Basic Setting (New) -> Ledgers -> Fields -> Customer Fields
In the below example, we are going to be adding a field to record
the Users HR ID. This will be updated by the user when entering
the document in the user, with his/her own HR ID.
Note : It is vital that the fields to be added in the Coding Block be
decided before hand and the relevant modification made before
other customization efforts, since adding a new field will update
the tables in SAP.
Step 1 : Add Field

Step 2 : Enter the

Development Class and the Field attributes.

Step 3 : Execute in Test Run to check for any errors.

Step 4: Create a Coding Block Field and save the Transport
Request ID. This would be a workbench request.

Step 5 : Next make the FIELD as Optional/ Mandatory in the Field

Status of the Posting Key and the Field Group.

And thats it, now you would get this field every time you enter a
transaction for this posting key and the account with the field
status group to which this field has been made available.

Hope this you found this post informative. Feel free to drop me an
email on the below address for any quick clarifications.
Have a nice day !!
Posted By : Suren