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

Validation with sets

Former Member
0 Kudos
2,186

Dear Friends I have a requirement from our client is when T-codes: FB60, FB01, F-43 and MIRO when ever FI invoice is getting created if listed Company code and GL accounts in SETS and the partner ID (Field : VPTNR) is empty then an error message should be triggered.

Prerequisite :

SYST-TCODE = 'FB60' OR SYST-TCODE = 'FB01' OR SYST-TCODE = 'MIRO' OR SYST-TCODE = 'F-43'

Check :

BKPF-BUKRS IN ZFDC_BUKRS_HCP_ONLY AND BSEG-HKONT IN ZFDC_RDC1_GL_HCP_ONLY AND BSEG-VPTNR = ' '

I have created 2 sets

"ZFDC_BUKRS_HCP_ONLY" for company code restriction and "ZFDC_RDC1_GL_HCP_ONLY" GL account restriction. I have duly maintained few company codes and GL accounts in the respective sets.

Now the validation is triggering when conditioning is satisfied when I am trying to post an invoice using the T-codes that I listed above. On the other hand validation is also triggering for those company codes which are not listed in the set "ZFDC_BUKRS_HCP_ONLY". So please help me to get rid of this issue. I don't want the validation to be triggered when creating an invoice for the company codes that are not maintained in the set.

Thanks in Advance,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All thanks for your response,

Finally it is working with below logic

Prerequisite

( SYST-TCODE = 'FB60' OR SYST-TCODE = 'FB01' OR SYST-TCODE = 'MIRO' OR SYST-TCODE = 'F-43' OR SYST-TCODE = 'FV60' ) AND ( BKPF-BUKRS IN Z_BUKRS_HAP_ONLY AND BSEG-HKONT IN Z_RRC1_GL_HCP_ONLY )

Check

BSEG-VPTNR <> ''

Thanks for your support

former_member198650
Active Contributor
0 Kudos

Hi Tajuddin,

Activate the validate for concern co.code in OB28. I think you have activated it for all co.codes.

Regards,

Mukthar

christian_e8m2
Explorer
0 Kudos

Hello Tajdeen,

Before creating your validation, how the field Partner ID is populated? Is it derived or it’s a manual task? Or, did you refer to trading partner (VBUND)?

For your validation rule, this is my suggestion. First, create another SET for your T-code because one day, someone else will ask you to add another transaction. So, you will have 3 SET to manage into your validation rule.

Secondly, validate with the simulation mode into OB28. This can help to find the issue. Sometime, I try with another field (ex: cost center). This way, you will validate your rule and clarify that your problem is with the field Partner.

Regards

Christian

iklovski
Active Contributor
0 Kudos

Hi,

You should put BUKRS in 'pre-requisite' and not into 'Check'.

Regards,

Eli

Former Member
0 Kudos

I agree on this solution