cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add PO line item to incomplete log procedure

Former Member
0 Kudos

Hi SD Experts,

How do I add PO line item to incomplete log procedure for VA02? Is that possible through configuration and/or code? if it is done by code, what userexit or BAdI I need to implement?

Thanks,

Duy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Duy

Do you mean customer's PO Line Item number which can be seen in the Order Data tab for the sales order item?

If so it can be done by config. T code OVA2

For the relevant Item Incompletion procedure, add new entry

Table VBAP; Field POSEX, Screen PBES, others as you like.

Hope this helps.

Former Member
0 Kudos

Hi Chandrasekhar ,

Thank you for your response!

Unfortunately my requirement is that this incomplete log is only for fixed number customers (let say 1000,1001,...) Is there anywhere I can do that. If I do it as you said it will affect all customers.

Thanks,

Duy

Former Member
0 Kudos

Now you are talking!

I wondered why anyone would ask such a simple question.

Your best bet is

USEREXIT_CHECK_VBAP or USEREXIT_CHECK_VBKD in program MV45AFZB.

Former Member
0 Kudos

Hi,

I intended to create a z table and put special type of customer there. However, what is the flag should I set to make the PO line item incomplete in the user exits you recommended?

Thanks,

Duy

Former Member
0 Kudos

Duy

It was Kris who talked about a flag as one of the alternatives. I think you can work without it. So just maintain the list in Z-table and the logic is simple:

"If the order Sold-to Partner is from the Z-table and If item PO line item # ( XVBAP-POSEX) is blank, set incompletion status (VBUP-UVALL) for the item."

Hope this works for you.

Former Member
0 Kudos

Thank you all for reply!

Two things:

- Configuration through OVA2? do I have to add POSEX to the incompletion log procedure?

- If I have to do the code in the userexit MV45AFZB, subroutine: USEREXIT_CHECK_VBAP. how the system realize that the filed POSEX is incomplete?

Can I achieve it completely through code? or by both configuration and code?

Another idea is I will add incomplete log to the sale order type, from userexit I will check the customer / sale order type in the Z* table. if it is not there I will not mark it as incompleted. If this is the case How do I do that from code?

Thanks,

Duy

Former Member
0 Kudos

Duy

You don't need config (check for POSEX) as it would affect everyone of your customers.

User exit would suffice. System realizes it because you are setting the status via the code after you checked for existence of Item PO number and if the customer is from the Z table.

You can do it via the 'other idea' which is essentially the reverse way of doing it. Same Z table and same user exits will work. Logic is just a you described. Here also I don't think you need the config.

Former Member
0 Kudos

Hi Chandrasekhar,

Did you ever try this before? I tried the following code and it didn't work



if xvbak-kunnr = '1000' " for testing
	loop at xvbap assigning <f_xvbap>.
		if <f_xvbap>-posex <> space." check PO line item #
			continue.
		endif.
	read table xvbup assigning <f_xvbup>
    with key vbeln = <f_xvbap>-vbeln
              posnr = <f_xvbap>-posnr.
    if sy-subrc = 0.
       <f_xvbup>-uvall = space. " I tried with 'A' and 'B' also
    endif.
	endloop.
endif.

Please advice!

Former Member
0 Kudos

Sorry Duy. I am not an ABAPer, may be others will comment on the code. If you have an ABAPer, work with him/her.

Former Member
0 Kudos

Thanks, worked with ABAPer to resolve the issue.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

User exit MV45AFZB will be helpful. This SDN thread may be helpful [Incompletion log not showing the pricing condition error|;

Regards

Vinod

Former Member
0 Kudos

Hi Duy,

You need to go to SD > Basic functions > log of incomplete items > define incomplete procedure > select group A (sales header) > procedures > select 11 (Sales order) > fields tab and add PO number incompletion fields as below:

table---field namedescriptionscreen--status--warning

VBKD---BSTKDPO number-KBES -


0----


X

Finally, you should assign your incompletion procedures to your sales doc. typ.

I hope these will work.

Regards,

Former Member
0 Kudos

You can use USEREXIT_CHECK_VBAP, This is called in include MV45AFZB.

I think you may need a ZTABLE with list of customer, or a flag from Customer master record which says for this material PO is reuqired.

Thank you

Kri