cancel
Showing results for 
Search instead for 
Did you mean: 

'TAX Code is NOt Applicable For Two Group Items

former_member188586
Active Contributor
0 Kudos

Hi

Every One

Bellow Sp is Not Working ,,Any One help to Correct it

if @object_type='18' and @transaction_type='A'

Begin

if exists(SELECT DISTINCT 'TRUE' FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] IN ('117','110') AND T1.[TaxCode] IS NULL AND T0.[DocType] ='I' AND T1.DocEntry= @list_of_cols_val_tab_del)

Begin

      set @error = '-2'

      set @error_message = 'TAX Code is NOt Applicable For METAL AND SAND....  '

end

End






----RAMUDU

Accepted Solutions (1)

Accepted Solutions (1)

former_member212181
Active Contributor
0 Kudos

Hi Ramdu,

Please check this area.

"AND T1.[TaxCode] IS NULL "


Please give specific tax codes which is/ are not applicable.


SAP B1 won't allow to add AP Invoice without tax code.


Thanks

Unnikrishnan

former_member188586
Active Contributor
0 Kudos

HI

Thanks for your replay ...

yes But We created one Code like "ZERO" that want to apply that's it

former_member212181
Active Contributor
0 Kudos

Hi,

then try like this

AND T1.[TaxCode] <> 'ZERO'


Error Message: TAX Code should be "Zero" For METAL AND SAND...



Thanks

Unnikrishnan

former_member188586
Active Contributor
0 Kudos

OK , I'LL CHECK AND UPDATE YOU THE STATUS

former_member188586
Active Contributor
0 Kudos

hi

it not working sp

if @object_type='18' and @transaction_type='A'

Begin

if exists(SELECT DISTINCT 'TRUE' FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] IN ('117','110') AND T1.[TaxCode] <>'ZERO'AND T0.[DocType] ='I' AND T1.DocEntry= @list_of_cols_val_tab_del)

Begin

      set @error = '-2'

      set @error_message = 'TAX Code should be "Zero" For METAL AND SAND...  '

end

End

The Document is Directly Added , if i took other Tax code ...

former_member212181
Active Contributor
0 Kudos

Please try below TN

if @object_type='18' and @transaction_type='A'

Begin

if exists(SELECT T0.DocEntry

  FROM OPCH T0 

  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry

  INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode

  WHERE T2.[ItmsGrpCod] IN ('117','110')

  AND T1.[TaxCode] <>'ZERO'

  AND T0.[DocType] ='I' AND T0.DocEntry= @list_of_cols_val_tab_del)

Begin

      set @error = '-2'

      set @error_message = 'TAX Code should be "Zero" For METAL AND SAND...  '

end

End

Thanks

Unnikrishnan

Former Member
0 Kudos

Hi Ramdu,

Try this...

Begin IF Exists(SELECT DISTINCT 'ERROR' FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] IN ('117','110') AND T1.[TaxCode] <>'ZERO'AND T0.[DocType] ='I' AND T0.DocEntry= @list_of_cols_val_tab_del) Begin       set @error = '-2'       set @error_message = 'TAX Code should be "Zero" For METAL AND SAND...  ' END End

Regards,

SP Samy

former_member188586
Active Contributor
0 Kudos

Hi swamy

Thanks for the replay ....I got the Solution

Answers (1)

Answers (1)

isaac_kalii
Active Participant
0 Kudos

Hi,

Please try the below:

if @object_type='18' and @transaction_type='A'

Begin

if exists(SELECT T0.DocEntry

  FROM OPCH T0 

  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry

  INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode

  WHERE T2.[ItmsGrpCod] IN ('117','110')

  AND T1.[VatGroup] <>'ZERO'

  AND T0.[DocType] ='I' AND T0.DocEntry= @list_of_cols_val_tab_del)

Begin

      set @error = '-2'

      set @error_message = 'TAX Code should be "Zero" For METAL AND SAND...  '

end

End

Regards,

Isaac.

former_member188586
Active Contributor
0 Kudos

Hi Isaac Kalli

Thanks for the replay ....I got the Solution