ABAP顾问
分类:
2007-12-15 22:21:34
转载自:http://jgtang82.javaeye.com/blog/139818
正常情况下通过FM Exits来enhancement a screen, 我们会
1. Find relevant enhancement thru program name.
2. T-code: CMOD, create an enhancement project, then assign the enhancement to the enhancement project
3. Create a subscreen in corresponding X function group
4. Implement the FM exits for transporting data to subscreen and retrieving data from subscreen.
5. Active the enhancement project.
在main screen的flow logic中
PBO
CALL CUSTOMER-SUBSCREEN 〈area〉 INCLUDING 〈x-function-pool〉〈screen_number〉.
" Transporting data to subscreen
MODULE ...
CALL CUSTOMER-FUNCTION 'xxx'
EXPORTING
i_vars = gl_field.
PAI
CALL CUSTOMER-SUBSCREEN 〈area〉 .
" Transporting data from subscreen
MODULE...
CALL CUSTOMER-FUNCTION 'xxx'
IMPORTING
o_vars = gl_field.
这里的FM exits的parameter interface是不能改变的,且一个screen enhancemnet都要对应一个确定的X Function Group但screen number是可以变化的。
不过在enhance MM01 screen时,情况就有些变化了,我们会
1. T-code: OMT3C, create a function group
2. Create/copy a subscreen to the function group
3. Build subscreen layout
4. Add some necessary code to PBO and PAI event block
5. T-code: OMT3B, create/copy a screen sequence, make sure that the program name = "SAPL"+created function group name, and the subscreen number = created subscreen number
6. T-code: OMT3E, change the screen sequence.
至于为什么要这么做,是因为MM01的Screen组成特点造成的。MM01中的Screen完全是通过一个个的subscreen像一个个的component组合而成的。在原有的subscreen不在customer namespace的情况下,如果不想做Modification,只能通过这种办法去做,即创建一个自己的subscreen和screen sequence,并把这个sequence放到screen的determination procedure中去。
如果是要把数据放到Add-on的表中,可以是呀MGA00001的EXIT_SAPLMGMU_001
如:
TABLES zmm01addon.
IF sy-ucomm = 'BU' OR sy-ucomm = 'YES'.
IMPORT a = zmm01addon FROM MEMORY ID 'MM01ADDON'.
IF sy-subrc = 0.
MODIFY zmm01addon FROM zmm01addon.
ENDIF.
ENDIF.
SAP的帮助:
chinaunix网友2008-08-25 15:10:40
关于Screen增强,在main screen的flow logic中,是不是不光只在出口中写代码,还得在系统代码中添加啊!我不太懂这个,我做了一个,我在main screen中也加代码了,感觉不知道对不,我理解的出口是不用在系统代码中加的,就在出口中编辑就行!还有如果不在系统代码中添加代码,我要怎么做呢,谢谢!