cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Validation Coding issue

Former Member
0 Likes
1,542

Hello Friends,

I have written the below Validation for make a require entry for "Bank Partner Type" but I think there is some problem due to it is not working properly.

( Transaction code = 'MIR4' OR Transaction code = 'MIR7' OR

Transaction code = 'MIRO' OR Transaction code = 'FB60' OR

Transaction code = 'F-43' OR Transaction code = 'FBA6' OR

Transaction code = 'FBA7' OR Transaction code = 'FB01' OR

Transaction Code = 'FB65' OR Transaction code = 'FBCJ' ) AND

Account Type = 'K' AND Vendor < '80000000' AND

Vendor > '81999999' AND ( Pmt Method = 'E' OR

Pmt Method = 'R'

OR Pmt Method = 'N' OR Pmt Method = 'T' )

I have doubt on above highlighted coding is not correct. Can any one please help me to understand this coding.

Regards,

Rajesh. K

Accepted Solutions (1)

Accepted Solutions (1)

former_member182098
Active Contributor
0 Likes

There are two bits in validation.

1. Writing validation in GGB0

2. Assigning it in OB28. (If you miss this step, then your validation will not be triggered for checks).

Ensure you have assigned in OB28, otherwise, it will not work.

Former Member
0 Likes

Hello Ravi,

Yes, I am able to see my validation in OB28 with all the changes I have did recently in GGB0.

Regards,

Rajesh. K

former_member198650
Active Contributor
0 Likes

Hi Rajesh,

Instead of maintaining vendor numbers in validation.You can also create a set in GS01 for vendors list for whom you want to apply validation as mentioned below.

( SYST-TCODE = 'MIR4' OR SYST-TCODE = 'MIR7' OR

SYST-TCODE = 'MIRO' OR SYST-TCODE = 'FB60' OR

SYST-TCODE = 'F - 43' OR SYST-TCODE = 'FBA6' OR

SYST-TCODE = 'FBA7' OR SYST-TCODE = 'FB01' OR

BKPF-TCODE = 'FB65' OR SYST-TCODE = 'FBCJ' ) AND

BSEG-KOART = 'K' AND ( BSEG-ZLSCH = 'C' OR

BSEG-ZLSCH = 'R' OR BSEG-ZLSCH = 'N' OR

BSEG-ZLSCH = 'T' ) AND BSEG-LIFNR IN ZVND (Set name)

Regards,

Mukthar

former_member182098
Active Contributor
0 Likes

Try using BKPF-TCODE instead of SYST-TCODE

Former Member
0 Likes

Hello Ravi,

Thanks for your inputs, but still it is not working after changing from SYST to KBPF.

Hello Mukthar,

Sorry, my scenior dont want to update the table.

Regards,

Rajesh. K

Former Member
0 Likes

Hello Ravi and all the frnds,

Finally it works, the issue with Coding in condition.

(SYST-TCODE = 'MIR4' OR SYST-TCODE = 'MIR7' OR

SYST-TCODE = 'MIRO' OR SYST-TCODE = 'FB60' OR

SYST-TCODE = 'F - 43' OR SYST-TCODE = 'FBA6' OR

SYST-TCODE = 'FBA7' OR SYST-TCODE = 'FB01' OR

BKPF-TCODE = 'FB65' OR SYST-TCODE = 'FBCJ' ) AND

BSEG-KOART = 'K' AND ( BSEG-LIFNR < '80000000' AND

BSEG-LIFNR > '81999999' ) AND ( BSEG-ZLSCH = 'E' OR

BSEG-ZLSCH = 'R' OR BSEG-ZLSCH = 'N' OR

  BSEG-ZLSCH = 'T' )


In the above coding the "AND" should be replaced with "OR" and the Validation is now working.


Once again thanks for all your efforts.



Regards,

Rajesh. K.


sanilbhandari
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi

Please close the thread if your issue has been resolved

Regards

Sanil

Answers (1)

Answers (1)

former_member198650
Active Contributor
0 Likes

Hi Rajesh,

You can also make field status as required by field status variant OB14 or posting key OB41 for the GL  account.

Regards,

Mukthar

Former Member
0 Likes

Hello Mukthar,

This is required for specific Vendor, it should not apply for all the Vendors.

But because of some error on above coding it is creating a problem for me. It didnt work.

Can you please help me to update this one.

Regards,

Rajesh. K

former_member198650
Active Contributor
0 Likes

Hi Rajesh,

What is the vendor code range for the validation? You can also activate trace for the validation and try to post.

Regards,

Mukthar

Former Member
0 Likes

Hello Mukthar,

Can any one pls.. let us know how to change the validation because it gives me in gray color option for insert formula text.

Regards,

Rajesh. K

sanilbhandari
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Rajesh

I tested this and it worked perfectly triggering an error at the time of FB60.

Regards

Sanil

Former Member
0 Likes

Hello Sunil,

I did the changes again and tested too, but still documents are posted with Vendor No. which are starts less then 8 series  and more then 819... series without asking the Business Part Type.

I have created this validation at LIne item level not at Document Header Level, Sunil can you please tell me were to maintain this code ? Document Header or Line item?

( SYST-TCODE = 'MIR4' OR SYST-TCODE = 'MIR7' OR

SYST-TCODE = 'MIRO' OR SYST-TCODE = 'FB60' OR

SYST-TCODE = 'F - 43' OR SYST-TCODE = 'FBA6' OR

SYST-TCODE = 'FBA7' OR SYST-TCODE = 'FB01' OR

BKPF-TCODE = 'FB65' OR SYST-TCODE = 'FBCJ' ) AND

BSEG-KOART = 'K' AND ( BSEG-LIFNR < '80000000' AND

BSEG-LIFNR > '81999999' ) AND ( BSEG-ZLSCH = 'E' OR

BSEG-ZLSCH = 'R' OR BSEG-ZLSCH = 'N' OR

BSEG-ZLSCH = 'T' )

Is any possibilities of overwrite the validation.

Regards,

Rajesh. K

Message was edited by: Rajesh Kasargoda

former_member182098
Active Contributor
0 Likes

You are intending to enter the Bank Partner Type on line items based on the transaction code available on the header.

Then how would it work if you are only writing your validation at header or line item level.

You should write it at complete document level.

Where is BSEG-BVTYP in your validation for check? Otherwise, how would it check the validation?

Former Member
0 Likes

Hello Ravi,

Thanks for your inputs,

This what I have updated in validation at line item level, is the same need to update at Complete document level ?

I didn't create a single validation at complete document level, can you please guide which table I have to prefer?

Thanks in advance.

Regards,

Rajesh. K

former_member182098
Active Contributor
0 Likes

You need to write the validation under "Complete Document" (Not under Document Header, not under line item level)

You need to check if you are not writing other way around of with your vendor numbers. Please change your < to > and > to < and try for vendors. It looks your vendor number ranges, it is reading other way around, so change the sign and give a try.

The validation check in this way:

If the pre-requisites are met, check the validation, otherwise, give me an error / warning.