cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent Posting AP Invoices without P.O & GRPO

Former Member
0 Kudos

Hi ,

How to set authorization for the following scenario .

Some of the users put AP Invoice without P.O & GRPO.How can i prevent it ? A users shouldn't directly post AP Invoices without P.O & GRPO.

former_member185682
Active Contributor
0 Kudos

Hi Nabil,

If you choose to use approval procedure to achieve your goal, you can look this blog:

https://blogs.sap.com/2016/09/17/approval-template-at-the-line-level-on-marketing-documents/

To do your approval procedure based on document line. Approval procedures are able to validate all lines of your document.

Hope it helps.

Kind Regards,

Diego Lother

Former Member
0 Kudos

Please add one more END to close outer IF.

Thanks

Engr. Taseeb Saeed

Former Member
0 Kudos

Taseeb ,

Not working.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member859135
Discoverer
0 Kudos

Hello,

This is the code for Stand Alone GRPO Not Allowed Copy from PO is Required With Line Total Allow Rs.3000 Limit Only.

IF EXISTS (
SELECT OPDN.DocEntry FROM OPDN inner join PDN1 on OPDN.DocEntry=PDN1.DocEntry  WHERE  OPDN.DocEntry=@list_of_cols_val_tab_del and PDn1.BaseType='-1'

--and  (select isnull(U_pendingpay_opn_dp,'N') from ocrd where cardcode=(SELECT CardCode FROM OPDN C WHERE C.DocEntry=@list_of_cols_val_tab_del))='N' 
group by opdn.docentry having sum(PDN1.LineTotal)>3000

)
BEGIN
 Set @error =1
 set @error_message = 'Stand Alone GRPO is not Allowed..Copy from PO required'
END<br>
Former Member
0 Kudos

Hello,

This is the code for you



If @object_type = '18' And @transaction_type in ('A','U')
BEGIN


DECLARE @intError INT


SELECT @intError =   COUNT(*) FROM dbo.PCH1 T0
WHERE T0.DocEntry = @list_of_cols_val_tab_del
AND t0.BaseType NOT IN (22,20)




 IF @intError > 0
  BEGIN
  SET @error = 1004
  SET @error_message = 'A/P Invoice -- You can not make A/P Invoice without base document PO or GRPO'
  select @error, @error_message
  END
  
  




END

Thanks

Engr. Taseeb Saeed

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

No authorization setting for AP invoice without base document. If you have only one line in AP Invoice, then you can use approval procedure.

If multiple lines, you can use Transaction notification.

Regards,

Nagarajan

Former Member
0 Kudos

can u share me the code ?

Former Member
0 Kudos

Hello,

You can achieve it by writing a SQL code in Transaction Notification which will block the user when he will enter AP Invoice without a base entry. You need to just check BaseType for PCH1 table. BaseType should be either 22 (PO) or 20 (GRPO)

Regards,

Engr. Taseeb Saeed