Agenda:
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 assignment, 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-SI.....
2. About coding block sub-screen and its limtation
(1) Check all SAP standard coding block sub-screen and maintain customer own screen in Tcode OXK1.
(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 changed carried out and valid in all clients of the system and for all transactions.
(4) Max. 18 Customer own fields can be created. Each field must be no longer than 22,else you can obly choose the tool of field groups.
(5) Customer fields from coding block can be added without modification in enjoy trassactions, but Min. 5 fields can be added.
3. How to create a customer own field.
Basic mode
In OXK3 -> press add field button
(1) Enter developments class
(2) Field name : must begin with 'ZZ' or 'YY'
(3) Field description : that is appear on the sub-screen
(4) Data type : CHAR or NUMC are offered for coding field ( CHAR can defined as an ALPHA conversion in expert mode only,by creating domain with conversion routine )
(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
(7) Choose Execute
(8) Check the log for confirming the generation is done correct or not.
Expert Mode
Warming: hign level way
In OXK3 -> menu: Account Assignment Field -> export mode -> next screen -> Account Assignment Fields
(1) Create a new domain and a data element for a new customers fields( optional ).
(2) Add field -> add new field in the includes structure CL_COBL
(3) Add field BI : if this new field is used to Batch input as well, then do this step.
(4) Add field to Bseg , the new field must be added to the end of the field and before append structure in BSEG.
(5) Add control entry -> for marking the new field available for customizing.
Basic Mode example:
Create ZZ* or YY* field as blow
测试执行,如果仔细阅读了配置文档,应该不会有大问题,警告消息中会有激活步骤完成后需要对MSEG视图需要特殊处理的note
Check log in test run mode
测试执行如果无错误,则正式执行,此步骤会将激活包入请求中,并且持续半个小时到1个小时,耐心等待别让你的系统掉线。同时,系统会自动生成9999屏幕,用于凭证输入时输入自定义字段的内容。
激活完成后,需要找开发同事参照note 2242679和note 2519240激活mseg和mseg的相关视图,此步骤很重要,否则所有MM集成FICO的操作都会dump。具体操作不会,详询懂英文的开发大哥。
激活后,在科目的字段状态组中和记账码的字段状态组中可以看到自定义字段,根据需要设置字段为选输、必输还是隐藏;激活后,在移动类型的配置中可以看到自定义字段,根据需要设置字段为选输、必输还是隐藏;激活后,在科目分配类别的配置中可以看到自定义字段,根据需要设置字段为选输、必输还是隐藏。这也对应了SAP说的可用于FI总账科目、MM库存管理、MM采购。
Run in the Proc. Mode , check the log , Pay attention to the generation PRG, if any iconsistency happens , just run one of these PRG.
check in bseg and cl_cobl table for ensure the customer fields 'ZZ*'
check field status in Tcode : OB14
Check ZZ* fields are available in coding block sub-screen .They are displayed in sub-screen "9999" by default.
Expert Mode Exampe:
Enter expert mode -> Coding block sub-screen ->
sub-screen will display in fb01 as follows:
Main debug point
The main PRG: SAPLKACB , and the main FM : COBL_SEND_PBO , with this FM , the coding block is called by COBL_EX_SEND_PBO , and then check the require field and their status , get modification number of fields and priority , and so on , then at least 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 the internal table gt_coblf ( '0' = false , '1' = true ),
(3) Make the customer created screen 9999 as default one of coding block screen .
(4) Check the required fields , optional fields , and priority for sub-screen in internal table TREFFER , in this case 9997 is the default subscreen for coding block.
(5) if ZZ* field is suppressed , check the result the internal table TREFFER after sorting, the required fields lowered from 5 to 4 due to ZZ* 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 sorting