Adding Incompletion log entries to Incompletion Log Internal Table XVBUV

作者:郑德鼎 约 5 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, 开发

https://blogs.sap.com/2016/09/13/adding-incompletion-log-entries-to-incompletion-log-internal-table-xvbuv/

kishore babu

September 13, 2016 8 minute read

Adding Incompletion log entries to Incompletion Log Internal Table XVBUV

41229,885

The in-completion log reminds you when data important for further processing is missing from the sales document.

When you enter a sales document, the system usually proposes much of the necessary data from customer and material master records, and you can also enter additional data or change proposed data manually. The sales document then forms the basis for various subsequent functions, such as delivery processing and billing.

However, subsequent functions can often only be carried out if the data in the original sales document is complete. To guarantee completeness, the system logs all missing data in an in-completion log. The data needed to process subsequent functions is defined by your system administrator for each sales document type.

Path for finding Incomplete Procedures

IMG -> Sales and Distribution -> Basic Functions -> Log of Incomplete Items or Go to T-code OVA2

1. The incompletion log have block at following in-completion groups

Sales – Header

Sales – Item

Sales – Sched. Line

Partner

Sales Activity

Delivery header

Delivery item

Screen Shot – 1

2. Each in-completion group may have set of incomplete procedures/Error procedures.

Screen Shot – 2

3. Consider Incomplete Procedure ‘Z1’ and go to ‘Fields’

Screen Shot – 3

‘Fields’ of the Procedure contains following fields

1. Table: – Specifies the table in which the field exists.

2. Field name: – Specifies the Field name in the table.

3. Description: – Description of the field (The error log message that displays during the Incompletion Log)

4. Screen: – The function code displays the screen on which we can enter the incomplete data.

5. Status Group: – Specify the corresponding status group.

6. Warning: – Checking this field the system gives a warning when the user does not make an entry in the required field.

7. Sequence: – Determines the sequence in which the system checks for the incomplete fields.

‘Status Group Controls’ which subsequent documents can be blocked for processing, if the data in the mandatory field is missing.

Screen Shot – 4

Here if we check delivery we cannot create the delivery document if the data in the mandatory field is missing to which this status group is       assigned.

Consider an example how to add In-completion Log entries to the In-completion Log Internal Table

Based on a business logic/requirement user wants to display an in-completion message avoiding the order to be deliverable.

Consider field ZZBUYGRP which is not a screen field and appended to table VBAK. Whole idea of in-completion log is if certain field is blank system prompts us to fill that field before saving an order.

From Screen Shot – 3 the field ZZBUYGRP is defined with description ‘Buying Group Approval’ under Sales Header Group. An in-completion log message ‘Buying Group Approval’ should trigger for missing Buying Group approval and when the document is saved with in-completion status then in general fields VBUK-UVVLK and VBUK-UVALL is set to ‘A’.

Screen Shot – 5

And if the certain field is not blank then in-completion log message should not trigger setting fields VBUK-UVVLK & VBUK-UVALL to ‘C’ and SAP thinks the order is deliverable as the field VBAK-ZZBUYGRP assigned to Status Group 02 as per the Screen Shot – 4.

As a standard convention VBAK-ZZBUYGRP = ‘X’ when certain field is not blank which means there exists no In-completion log and VBAK-ZZBUYGRP = space when certain field is blank.

Since the In-completion log has to be triggered at Sales Header level, add the below code under all valid USER Exit inside MV45AFZZ.

• Set initial Values

vbak–zzbuygrp    = ‘X’.

• For Create and Change

IF t180–trtyp = ‘H’ OR t180–trtyp = ‘V’

OR t180–trtyp = ‘A’.

• Only for Sales Document

IF vbak–vbtyp = ‘C’.

IF (certain field) is not blank.

CLEAR vbak–zzbuygrp.

ELSE.

vbak–zzbuygrp = ‘X’.

• Clear from incompletion log if exits.

READ TABLE xvbuv ASSIGNING <ls_xvbuv> WITH KEY vbeln = vbak–vbeln

tbnam = ‘VBAK’

fdnam = ‘ZZBUYGRP’.

IF sy–subrc = 0.

• Delete the Entry from standard Incompletion table

DELETE xvbuv INDEX sy–tabix.

ENDIF.
ENDIF.
ENDIF.
ENDIF.

Even if the certain field is not having value and the In-completion log is not triggering & this is due to record with respect to the ‘ZZBUYGRP’ doesn’t exist in the In-completion Log internal table, XVBUV.

Check all other possible User Exit available in MV45AFZZ. If still the In-completion log is not triggering even the certain field is blank, add the below code adding in-completion log entry to the In-completion Log internal table XVBUV.

Field TVAK-FEHGR will carry the Error Procedure (Z1) inside MV45AFZZ and using Error procedure, Z1 get all the records defined inside the ‘Fields’ as shown in Screen Shot – 3 using Table TVUVF.

DATA: ls_tvuvf TYPE tvuvf.

• Set initial Values

vbak–zzbuygrp    = ‘X’.

• For Create and Change

IF t180–trtyp = ‘H’ OR t180–trtyp = ‘V’

OR t180–trtyp = ‘A’.

• Only for Sales Document

IF vbak–vbtyp = ‘C’.

IF (certain field) is not blank.

CLEAR vbak–zzbuygrp.

READ TABLE xvbuv TRANSPORTING NO FIELDS WITH KEY vbeln = vbak–vbeln

tbnam = ‘VBAK’

fdnam = ‘ZZBUYGRP’.

IF sy–subrc <> 0.

SELECT SINGLE *

FROM tvuvf

INTO ls_tvuvf

WHERE fehgr = tvak–fehgr

AND   tbnam = ‘VBAK’

AND   fdnam = ‘ZZBUYGRP’.

IF sy–subrc = 0.

xvbuv–mandt = sy–mandt.

xvbuv–vbeln = vbak–vbeln.

xvbuv–tbnam = ls_tvuvf–tbnam. xvbuv–fdnam = ls_tvuvf–fdnam.

xvbuv–fehgr = tvak–fehgr.

xvbuv–statg = ls_tvuvf–statg. xvbuv–msgkz = ls_tvuvf–msgkz. xvbuv–sortf = ls_tvuvf–sortf.
APPEND xvbuv.
ENDIF.
ENDIF.

ELSE.

vbak–zzbuygrp = ‘X’.

• Clear from incompletion log if exits.

READ TABLE xvbuv ASSIGNING <ls_xvbuv> WITH KEY vbeln = vbak–vbeln

tbnam = ‘VBAK’

fdnam = ‘ZZBUYGRP’.

IF sy–subrc = 0.

• Delete the Entry from standard Incompletion table

DELETE xvbuv INDEX sy–tabix.

ENDIF.
ENDIF.
ENDIF.
ENDIF.

Tcode’s related to In-completion Log

FollowLikeRSS Feed

4 Comments

You must be Logged on to comment or reply to a post.

Praveen Dasari

January 16, 2018 at 6:05 pm

Hi Kishore,

That's a really good article that you have written. Keep it up. Just a question. Is there a similar table like VBUV for delivery as well which when I update appears in incompletion log.

Regards,

Praveen

Like 0

Share

Bansidhara Padhy

March 4, 2020 at 9:18 pm

Hi,

I am working on the similar issue on Incompletion Log.

But how to update the short description against the field in Incompletion log entries ?

Thanks

Like 0

Share

Mitrajit Debroy

August 7, 2021 at 8:49 am

I am facing same issue. Did you find a solution on how to update the short description?

Like 0

Share

Glauco Ernesto Soares Silva

February 22, 2023 at 9:12 pm

Hi kishore babu,

Great post!

I am working on a custom fields in the "Additional data B tab" and I needed to checked the custom field as well.

The code below was implemented in the subroutine USEREXIT_CHECK_VBAP (include MV45AFZB)

I just needed to adapt the code and the navigation to the "Additional data B" tab worked.

REMARK

In the "Screen Shot – 3" step, we needed to indicate the custom screen: PZKU - Sales: Item - Additional data B

At.te/Best regards,

Glauco Silva

SAP Developer

Like 0

Share

Tcode | Description

OVA2 | To define incompletion procedure

VUA4 | To assign incompletion procedure to delivery type

VUPA | To assign incompletion procedure to Partner functions

VUC2 | To assign incompletion procedure to Sales Activities

OVA0 | To define Status groups

VUA2 | To assign incompletion procedure to Sales Document Header

V.02 | Execute to get a checklist of incomplete sales orders

VUA2 | To set a warning or error message on document save

VUP2 | To assign incompletion procedure to Sales item category

VUE2 | To assign incompletion procedure to Schedule line category

Key tables to check Incompletion Logs | Key tables to check Incompletion Logs

Tables | Description

VBUV | Incompletion log – Sales documents

VBUK | Header incompletion

VBUP | Item incompletion

TVUVG | Groups

V50UC | Incompletion log − Deliveries

V50UC_USER | Incompletion log − Deliveries − Enhancements

TVUV | Procedures

TVUVF | Fields

TVUVS | Status groups

TVUVFC | Fcodes

FMII1 | Funds Management Account Assignment Data

郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「Adding Incompletion log entries to Incompletion Log Internal Table XVBUV.docx」整理生成,仅用于内部技术分享与学习交流。