You can use the sample source code attached here to recognize the basic functions of the exit. This example is, however, only one of many options that are offered by the customer enhancement.
The sample source code includes the following functions:
- Supply of an additional field on header level
- Supply of an additional field on item level
- Derivation of a field on item level from the copied reference document
Now, in order to be able to use the sample source code, you must create field ZZFLAG on the header level of the document and field ZZFIELD on the item level.
Double-click on Include table CI_EKKODB
Enter the following values:
- NameComponent type DType Length DecPlace Short text
- ZZFLAGCHAR1CHAR101-digit indicator
Save and activate the include table.
Double-click on Include table CI_EKPODB
Enter the following values:
- NameComponent type DType Length DecPlace Short Text
- ZZFIELD CHAR1CHAR101-digit indicator
Save and activate the include table.
In order to activate the sample source code, you additionally have to carry out the following changes on screens 0101 and 0111.
1. Screen 0101: Create the following fields:
"Checkbox"Name: EKKO_CI-ZZFLAG
2. Screen 0111: Create the following fields:
"Input/output field"Name: EKPO_CI-ZZFIELD
"Pushbutton"Name: BUTTON
FctCode: ZZDETERMINE
The following assignments apply to the sample source code:
EXIT_SAPMM06E_006-->ZXM06F36
EXIT_SAPMM06E_007-->ZXM06F38
EXIT_SAPMM06E_008-->ZXM06F37
EXIT_SAPMM06E_009-->ZXM06F39
EXIT_SAPMM06E_016-->ZXM06F41
EXIT_SAPMM06E_017-->ZXM06F42
EXIT_SAPMM06E_018-->ZXM06F40
Copy the source code from the attachment and insert it into the corresponding function modules. Save and activate the function modules.
Create the following variables in the corresponding TOP include in order not to get any syntax errors:
*
* INCLUDE ZXM06TOP
*
data: gl_aktyp type c,
gl_no_screen type c,
gl_rekko like ekko,
gl_ekko_ci like ekko_ci,
gl_ekpo_ci like ekpo_ci,
gl_ekpo like ekpo,
gl_ucomm like sy-ucomm.
types: begin of ekpo_tab,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
ekpo like ekpo,
end of ekpo_tab.
data:gt_ref_ekpo_tab type table of ekpo_tab.
Save and activate the TOP include.
On header level, you can now store a character, X or space, via field ZZFLAG on the database with the document and read it also again.
On item level, you can fill field ZZFIELD with a one-digit value and save it with the document. If you copy this document, the system displays an additional function button on tab page "Customer data". If you press this button, the value of the reference document is copied to field ZZFIELD.
If you want to store the source code as sample source code in your system, start Transaction SMOD. Enter MM06E005 as an enhancement. Select "Components". Press "Change". Position the cursor on the corresponding module and choose "Sample code". Create the corresponding include and copy the source code from the note. Save the include. Note that, of course, syntax errors may occur when you check components. This is because the includes of the sample code are not integrated into a program but rather are completely independent and, therefore, do not have any relationship to each other either. For this reason, only save the include and do not activate or check it. The sample code has to be copied into the corresponding function modules in order to become active.
If you use the user exit in the new purchase order, it is not guaranteed that the customer screen is always processed. To make sure that possible required fields are checked, include a corresponding message into the EXIT_SAPMM06E_012. This screen is always processed.
相关代码:
*----------------------------------------------------------------------*<script><!--mce:0--></script>
* INCLUDE ZXM06F36 *<script><!--mce:1--></script>
*----------------------------------------------------------------------*<script><!--mce:2--></script><script><!--mce:3--></script>*<script><!--mce:4--></script>
* store transaction type for later modification of screen attributes<script><!--mce:5--></script>
*<script><!--mce:6--></script>
gl_aktyp = i_trtyp.<script><!--mce:7--></script><script><!--mce:8--></script>gl_no_screen = i_no_screen.<script><!--mce:9--></script><script><!--mce:10--></script><script><!--mce:11--></script>*<script><!--mce:12--></script>
* store current state of customer data in ekko_ci (structure for screen)<script><!--mce:13--></script>
*<script><!--mce:14--></script>
ekko_ci = i_ci_ekko.<script><!--mce:15--></script><script><!--mce:16--></script>*<script><!--mce:17--></script>
* store reference document<script><!--mce:18--></script>
*<script><!--mce:19--></script>
if i_rekko-ebeln ne gl_rekko-ebeln and<script><!--mce:20--></script>
not i_rekko-ebeln is initial and<script><!--mce:21--></script>
gl_rekko-ebeln is initial.<script><!--mce:22--></script><script><!--mce:23--></script> ekko_ci-zzflag = i_rekko-zzflag.<script><!--mce:24--></script><script><!--mce:25--></script> gl_rekko = i_rekko.<script><!--mce:26--></script><script><!--mce:27--></script>endif.<script><!--mce:28--></script>*----------------------------------------------------------------------*<script><!--mce:29--></script>
* INCLUDE ZXM06F37 *<script><!--mce:30--></script>
*----------------------------------------------------------------------*<script><!--mce:31--></script><script><!--mce:32--></script>*<script><!--mce:33--></script>
* e_ci_ekko is the returning parameter<script><!--mce:34--></script>
* gl_ekko_ci : values stored at PBO<script><!--mce:35--></script>
*<script><!--mce:36--></script><script><!--mce:37--></script>e_ci_ekko = gl_ekko_ci.<script><!--mce:38--></script><script><!--mce:39--></script>*<script><!--mce:40--></script>
* ekko_ci contains the actual values of the Dynpro fields<script><!--mce:41--></script>
* e_ci_update is only set if you really want the fields<script><!--mce:42--></script>
* on the Dynpro to be saved. You must set it then to 'X'<script><!--mce:43--></script>
* the field ekko_ci-zzflag will here only be saved if there<script><!--mce:44--></script>
* was a change and the transaction is not in display mode<script><!--mce:45--></script>
*<script><!--mce:46--></script><script><!--mce:47--></script>if gl_ekko_ci-zzflag ne ekko_ci-zzflag.<script><!--mce:48--></script>
e_ci_ekko-zzflag = ekko_ci-zzflag.<script><!--mce:49--></script>
if gl_aktyp ne 'A'.<script><!--mce:50--></script>
e_ci_update = 'X'.<script><!--mce:51--></script>
endif.<script><!--mce:52--></script>
endif.<script><!--mce:53--></script>*----------------------------------------------------------------------*<script><!--mce:54--></script>
* INCLUDE ZXM06F38 *<script><!--mce:55--></script>
*----------------------------------------------------------------------*<script><!--mce:56--></script><script><!--mce:57--></script>*<script><!--mce:58--></script>
* store ekko to gl_ekko<script><!--mce:59--></script>
*<script><!--mce:60--></script>
move-corresponding i_ekko to gl_ekko_ci.<script><!--mce:61--></script>
*----------------------------------------------------------------------*<script><!--mce:62--></script>
* INCLUDE LXM06F39 *<script><!--mce:63--></script>
*----------------------------------------------------------------------*<script><!--mce:64--></script><script><!--mce:65--></script>clear: ekko_ci,<script><!--mce:66--></script>
ekpo_ci,<script><!--mce:67--></script>
gl_no_screen,<script><!--mce:68--></script>
gl_aktyp,<script><!--mce:69--></script>
gl_ekko_ci,<script><!--mce:70--></script>
gl_rekko,<script><!--mce:71--></script>
gl_ekpo,<script><!--mce:72--></script>
gl_ucomm.<script><!--mce:73--></script><script><!--mce:74--></script>refresh: gt_ref_ekpo_tab.<script><!--mce:75--></script>
*----------------------------------------------------------------------*<script><!--mce:76--></script>
* INCLUDE ZXM06F40 *<script><!--mce:77--></script>
*----------------------------------------------------------------------*<script><!--mce:78--></script>
*<script><!--mce:79--></script>
* move stored global values back to the returning structure<script><!--mce:80--></script>
*<script><!--mce:81--></script><script><!--mce:82--></script>e_ci_ekpo = gl_ekpo_ci.<script><!--mce:83--></script><script><!--mce:84--></script>*<script><!--mce:85--></script>
* in case the Button was clicked the value of ekpo_ci-zzfield<script><!--mce:86--></script>
* will be taken from the copied PO<script><!--mce:87--></script>
*<script><!--mce:88--></script><script><!--mce:89--></script>if i_ucomm = 'ZZDETERMINE'.<script><!--mce:90--></script><script><!--mce:91--></script> data: ls_ref_ekpo like line of gt_ref_ekpo_tab.<script><!--mce:92--></script><script><!--mce:93--></script>*<script><!--mce:94--></script>
* gt_ref_ekpo_tab contains all positions of the copied PO<script><!--mce:95--></script>
*<script><!--mce:96--></script><script><!--mce:97--></script> read table gt_ref_ekpo_tab into ls_ref_ekpo<script><!--mce:98--></script>
with key ebelp = gl_ekpo-ebelp.<script><!--mce:99--></script><script><!--mce:100--></script> if sy-subrc is initial.<script><!--mce:101--></script><script><!--mce:102--></script> ekpo_ci-zzfield = ls_ref_ekpo-ekpo-zzfield.<script><!--mce:103--></script><script><!--mce:104--></script> endif.<script><!--mce:105--></script><script><!--mce:106--></script>else.<script><!--mce:107--></script><script><!--mce:108--></script>*<script><!--mce:109--></script>
* return the function code of the Screen. This code will be handled<script><!--mce:110--></script>
* in the SAP program. It can only be handled if you use SAP function<script><!--mce:111--></script>
* codes<script><!--mce:112--></script>
*<script><!--mce:113--></script><script><!--mce:114--></script> e_ucomm = i_ucomm.<script><!--mce:115--></script>
endif.<script><!--mce:116--></script><script><!--mce:117--></script>*<script><!--mce:118--></script>
* ekko_ci contains the actual values of the Dynpro fields<script><!--mce:119--></script>
* e_ci_update is only set if you really want the fields<script><!--mce:120--></script>
* on the Dynpro to be saved. You must set it then to 'X'<script><!--mce:121--></script>
* the field ekko_ci-zzfield will here only be saved if there<script><!--mce:122--></script>
* was a change and the transaction is not in display mode<script><!--mce:123--></script>
*<script><!--mce:124--></script><script><!--mce:125--></script>if gl_ekpo_ci-zzfield ne ekpo_ci-zzfield.<script><!--mce:126--></script>
e_ci_ekpo-zzfield = ekpo_ci-zzfield.<script><!--mce:127--></script>
if gl_aktyp ne 'A'.<script><!--mce:128--></script>
e_ci_update = 'X'.<script><!--mce:129--></script>
endif.<script><!--mce:130--></script>
endif.<script><!--mce:131--></script>
*----------------------------------------------------------------------*<script><!--mce:132--></script>
* INCLUDE ZXM06F41 *<script><!--mce:133--></script>
*----------------------------------------------------------------------*<script><!--mce:134--></script><script><!--mce:135--></script>
data: ls_ref_ekpo like line of gt_ref_ekpo_tab.<script><!--mce:136--></script><script><!--mce:137--></script>
*<script><!--mce:138--></script>
* store transaction type for later modification of screen attributes<script><!--mce:139--></script>
*<script><!--mce:140--></script>
gl_aktyp = i_aktyp.<script><!--mce:141--></script><script><!--mce:142--></script>
gl_no_screen = i_no_screen.<script><!--mce:143--></script><script><!--mce:144--></script><script><!--mce:145--></script>
*<script><!--mce:146--></script>
* store current state of customer data in ekko_ci (structure for screen)<script><!--mce:147--></script>
*<script><!--mce:148--></script>
ekpo_ci = i_ci_ekpo.<script><!--mce:149--></script><script><!--mce:150--></script>
gl_ekpo = i_ekpo.<script><!--mce:151--></script><script><!--mce:152--></script>
if not i_rekpo-ebeln is initial and<script><!--mce:153--></script>
not i_ekpo-ebelp is initial.<script><!--mce:154--></script><script><!--mce:155--></script>
clear ls_ref_ekpo.<script><!--mce:156--></script><script><!--mce:157--></script>
read table gt_ref_ekpo_tab into ls_ref_ekpo<script><!--mce:158--></script>
with key ebelp = i_ekpo-ebelp.<script><!--mce:159--></script><script><!--mce:160--></script>
if ls_ref_ekpo-ekpo-ebeln ne i_rekpo-ebeln and<script><!--mce:161--></script>
ls_ref_ekpo-ekpo-ebelp ne i_rekpo-ebelp.<script><!--mce:162--></script><script><!--mce:163--></script>
ls_ref_ekpo-ebelp = i_ekpo-ebelp.<script><!--mce:164--></script>
ls_ref_ekpo-ekpo = i_rekpo.<script><!--mce:165--></script><script><!--mce:166--></script>
if sy-subrc is initial.<script><!--mce:167--></script>
modify gt_ref_ekpo_tab from ls_ref_ekpo index sy-tabix.<script><!--mce:168--></script>
else.<script><!--mce:169--></script>
append ls_ref_ekpo to gt_ref_ekpo_tab.<script><!--mce:170--></script>
endif.<script><!--mce:171--></script><script><!--mce:172--></script>
endif.<script><!--mce:173--></script><script><!--mce:174--></script>
endif.<script><!--mce:175--></script>
*----------------------------------------------------------------------*<script><!--mce:176--></script>
* INCLUDE ZXM06F42 *<script><!--mce:177--></script>
*----------------------------------------------------------------------*<script><!--mce:178--></script><script><!--mce:179--></script>
move-corresponding i_ekpo to gl_ekpo_ci.<script><!--mce:180--></script>
gl_ekpo = i_ekpo.<script><!--mce:181--></script>
note number:407975
分享到:
相关推荐
最近做毕业设计把资料共享一下吧-基于MATLAB的状态观测器设计方法.pdf 如题:开始发了20多篇但不知怎么提示不成功,...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-LQR系统最优控制器设计的MATLAB实现及应用.pdf 如题:开始发了20多篇但不知怎么提示...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
SECS GEM 标准通讯协议
最近做毕业设计把资料共享一下吧-LQR控制与PID控制在单级倒立摆中的对比研究.pdf 如题:开始发了20多篇但不知怎么...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
本文详细描述CSR8635/8645在调试通话音质时的详细操作,为初入门者提供详细的参考
最近做毕业设计把资料共享一下吧-基于LQR指标的鲁棒PID整定方法及鲁棒稳定性裕度评估.pdf 如题:开始发了20多篇但...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-极点配置和状态观测器辅助设计工具开发.pdf 如题:开始发了20多篇但不知怎么提示不...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于LQR的直升机最优控制系统的设计.pdf 如题:开始发了20多篇但不知怎么提示不成功...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-大机动飞机的非线性鲁棒控制律设计.pdf 如题:开始发了20多篇但不知怎么提示不成功...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于鲁棒观测器结构的直升机飞控系统设计.pdf 如题:开始发了20多篇但不知怎么提示...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-H_回路成形法设计直升机飞控系统.pdf 如题:开始发了20多篇但不知怎么提示不成功...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于LQR方法的航空发动机最优PID控制系统设计.pdf 如题:开始发了20多篇但不知怎么...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于状态观测器的球形机器人状态反馈控制系统设计.pdf 如题:开始发了20多篇但不知...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于LMIs的不确定线性切换系统H_鲁棒控制.pdf 如题:开始发了20多篇但不知怎么提示...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-基于状态观测和反馈的伺服系统位置控制器.pdf 如题:开始发了20多篇但不知怎么提示...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-H_理论在直升机飞行控制系统设计中的应用.pdf 如题:开始发了20多篇但不知怎么提示...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
最近做毕业设计把资料共享一下吧-一种从LQR理论设计容错MIMO系统方法的非普适性.pdf 如题:开始发了20多篇但不知怎么...s^4 2.403e005 s^3 1.926e010 s^2 4.92e012 s 7.58e015 做了好些试验都不理想,可以用PID和LQR
E005-渗透测试常用工具-使用XSSer进行自动化渗透测试