简体   繁体   English

自定义字段未显示在表 output 上

[英]Custom fields not showing on table output

I'm having trouble figuring out why two custom fields are not showing up in transaction VA05 (its output to be specific).我无法弄清楚为什么两个自定义字段没有出现在事务VA05 (具体为 output)中。

Before reading below: I didn't make any changes to the program because I wasn't assigned to this task.在阅读以下内容之前:我没有对程序进行任何更改,因为我没有被分配到这项任务。 One of my colleagues did this change.我的一位同事做了这个改变。

I followed this tutorial, which explains how to expand the VA05 output table with custom fields.我遵循了本教程,它解释了如何使用自定义字段扩展VA05 output 表。
I didn't actually followed this guide.我实际上并没有遵循本指南。 I followed this tutorial only to understand what my colleague might have done to achieve what we need and what might be needed to fix the issue.我遵循本教程只是为了了解我的同事可能做了什么来实现我们的需要以及解决问题可能需要什么。

So, as the tutorial suggests, this is what should be done in short:因此,正如本教程所建议的,这是应该做的简而言之:

  • Go to SE11 and search for VBEP Database table and click display. Go 到SE11并搜索VBEP数据库表并单击显示。
  • Click on Append Structure点击Append Structure
  • Click on Create Append点击Create Append
  • Insert the name of the append name, in my case it's ZZVBEP_MECC插入 append 名称,在我的例子中是ZZVBEP_MECC
  • Insert two fields: ZZDELIVERYDATE and ZZREQDELIVERYDATE插入两个字段: ZZDELIVERYDATEZZREQDELIVERYDATE
  • Save and activate保存并激活

If you go to VBEP table now, you'll see at the bottom the field .APPEND with the column Data Element set to ZZVBEP_MECC .如果您现在将 go 添加到VBEP表,您将在底部看到字段.APPEND ,其Data Element列设置为ZZVBEP_MECC

Now, following the tutorial, the include program V05TZZMO need to be changed, and here's ours:现在,按照教程,需要更改包含程序V05TZZMO ,这是我们的:

***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.

    WHEN 'VBAP'.

      CHECK LVBAP-PSTYV NE 'ZRAC'.
      CHECK LVBAP-PSTYV NE 'ZCAC'.     "Escl.acconti
      MOVE LVBAP-KDMAT TO LVBMTV-ZZKDMAT.
      PERFORM OFFENE_AUFTRAGSMENGE.

     SELECT SINGLE * FROM VBKD WHERE VBELN = LVBAP-VBELN.
      IF SUBRC = 0.
      MOVE VBKD-KDGRP TO LVBMTV-ZZKDGRP.
      ENDIF.

    WHEN 'VBEP'.
      MOVE LVBEP-ZZDELIVERYDATE    TO LVBMTV-ZZDELIVERYDATE.
      MOVE LVBEP-ZZREQDELIVERYDATE TO LVBMTV-ZZREQDELIVERYDATE.
  ENDCASE.
ENDFORM.

When I run VA05 however, these two custom fields are not there nor are in the Change Layout screen.但是,当我运行VA05时,这两个自定义字段不存在,也不在“ Change Layout屏幕中。

Is it possible that the code in V05TZZMO is not in the right place?有没有可能是V05TZZMO里的代码放错地方了? Looking at the tutorial's code I saw that they put those statements in WHEN 'VBAK' instead of WHEN 'VBEP' .查看教程的代码,我看到他们将这些语句放在WHEN 'VBAK'而不是WHEN 'VBEP'中。

Also, the ENHANCEMENT 1 ZZ_SD_VBAK_VA05 is not present in my code.此外, ENHANCEMENT 1 ZZ_SD_VBAK_VA05不存在于我的代码中。


There might be something I missed.可能有什么我错过了。 As I said above, I didn't make these changes so I cannot tell exactly what my colleague did.正如我上面所说,我没有进行这些更改,所以我无法确切地说出我的同事做了什么。

Custom fileds also must be included in the structure VBMTVZ .自定义文件也必须包含在结构VBMTVZ中。

Regards问候

Finally solved.终于解决了。

Here's the procedure step-by-step we followed in order to fix the issue:以下是我们为解决此问题而遵循的分步过程:

Create an Append Structure创建一个Append Structure

  • Go to TCode SE11 and open database table VBMTVZ Go 到 TCode SE11并打开数据库表VBMTVZ
  • Click on Append Structure... (It's in the program's toolbar) - or Goto > Append Structure单击Append Structure... (位于程序的工具栏中)- 或Goto > Append Structure
  • Create a new Append Structure (There's a button for it)创建一个新的Append Structure (有一个按钮)
  • Enter the name of the structure(in our case was ZZVBMTVZ_MECC输入结构的名称(在我们的例子中是ZZVBMTVZ_MECC
  • A new structure is then created.然后创建一个新结构。 Enter the needed components/fields输入所需的组件/字段
  • Save and activate the structure.保存并激活结构。
  • Note: To check if the structure is actually appended, go back and open table VBMTVZ again.注意:要检查结构是否实际附加,go 返回并再次打开表VBMTVZ At the end of the list of fields there must be one field called .APPEND with the type set to the name of the structure you created.在字段列表的末尾,必须有一个名为.APPEND的字段,其类型设置为您创建的结构的名称。 After this field, there's also all your fields you created on that structure.在该字段之后,还有您在该结构上创建的所有字段。 See the image below for reference.请参阅下图以供参考。

追加结构参考

Change V05T program更改V05T程序

Now you'll need to make some changes to the program linked to the TCode VA05 .现在您需要对链接到 TCode VA05的程序进行一些更改。

To do this:去做这个:

  • Go to TCode SE80 . Go 到 TCode SE80
  • Select Function Group and insert V05T as the name of the group. Select Function Group并插入V05T作为组名。
  • Open the sub-folder called Includes and look for V05TZZMO打开名为Includes的子文件夹并查找V05TZZMO
  • Open this include file in change mode.change模式打开此包含文件。
  • The file should look like this:该文件应如下所示:
***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.
*     header
*     MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBAP'.
*     item
*     MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBEP'.
*     schedule line
*     MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.

  ENDCASE.
ENDFORM.

Add the following line of code to the WHEN 'VBEP'.将以下代码行添加到WHEN 'VBEP'. code block.代码块。

MOVE LVBEP-name_of_your_field TO LVBMTV-name_of_your_field

You need to add that line for each field you appended.您需要为附加的每个字段添加该行。

In my case, the final result was the following:就我而言,最终结果如下:

***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.
*     header
*     MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBAP'.
*     item
*     MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBEP'.
*     schedule line
*     MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.

  move LVBEP-zzdeliverydate to lvbmtv-zzdeliverydate.
  move LVBEP-zzreqdeliverydate to lvbmtv-zzreqdeliverydate.

  ENDCASE.
ENDFORM.

Save the file and activate the program.保存文件并激活程序。

At this point you should be able to see your fields in the output of TCode VA05 .此时您应该能够在 TCode VA05的 output 中看到您的字段。


Notes笔记

In order to be able to change the include program V05TZZMO you need an Access Key.为了能够更改包含程序V05TZZMO ,您需要一个访问密钥。 Without that you cannot change the program.没有它你就不能改变程序。

If the fields you appended aren't showing even after activating, try:如果您添加的字段在激活后仍未显示,请尝试:

  • To logout and log back in or注销并重新登录或
  • reset the buffer with this TCode /$SYNC使用此 TCode /$SYNC重置缓冲区

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM