Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

validation in ob28

Former Member
0 Kudos

Hi,

i have created a validation in ob28 for f-47. first i have created a form in zggbr000 and write code in it. after that i create a validation in ob28 and use this exit which i have created in zggbr000 in the check and prerequisite is sy-tcode = f-47.But when i give a break pont on that code and use t-code f-47 the debugger doesn't go to that code. plz any one help.

1. define form

exits-name = 'U403'.

exits-param = c_exit_param_none.

exits-title = 'AMOUNT VALIDATION'. " check order value

APPEND exits

2.FORM U403 USING b_result

end form.

3.use ob28 and create validation

prerequsite = (sy-tcode = f-47)

check = u403

message

12 REPLIES 12

brad_bohn
Active Contributor
0 Kudos

Check the transaction code value. F-47 is just a variant of FB01. You need to use document level values in your check.

Former Member
0 Kudos

Thanks for the reply, but how i use document level value in my check.plz suggest.

0 Kudos

Hi,

Try to use the condition SY-TCODE = 'FBA6' . or BKPF-TODE = 'FBA6'.

0 Kudos

- Use sy-tcode = 'FBA6' (as SAP do in [Note 792736 - Extension to Note# 763934 to cater FBA7.|https://service.sap.com/sap/support/notes/792736])

- F-47 is only a variant of FBA6 with BKPF-BLART = ''KA', so you can also check this second condition.

Proposal:

- Prerequisite = (sy-tcode = 'FBA6' AND bkpf-blart = 'KA')

Regards,

Raymond

brad_bohn
Active Contributor
0 Kudos

Sorry, Raymond is correct about the FBA6 value; I misread the trans code you specified - just keep in mind that many FI tcodes are variants of other 'base' transactions and that's why your pre-requisite didn't work. However, I don't think you should use ANY checks on SY-TCODE (and certainly not BKPF-TCODE) in your validation, so that the validation is not transaction code dependent (and it fires in a BAPI call as well). A header validation should generally be document specific and not dependent on how/where the document was entered. So, for an FI validation, you would use fields from BKPF for your pre-requisitie logic such as document type (BLART).

Former Member
0 Kudos

Thanks Raymond my problem has solved with your suggestion.

raymond_giuseppi
Active Contributor
0 Kudos

Read OSS [Note 842318 - Frequently asked questions about validations + substitutions|https://service.sap.com/sap/support/notes/842318] look for "debug" to find the actual include to use foir debug.

Regards,

Raymond

Former Member
0 Kudos

Hello ,

you need to create these steps in GGB0(tcode) then on u need to do it in tcode OB28.

let me know if you need any more info on it.

regards

Prabhu

Former Member
0 Kudos

@prbhat..

Please check if you hav maintained the correct validation against the company code u are checking.

Former Member
0 Kudos

@prbhat..

Please check if you hav maintained the correct validation against the company code u are checking in ob28 transaction.

Former Member
0 Kudos

Hi Prabhat,

Make sure you have run the regeneration part of code, if not then obviously the control will not go to your part of the code because whenever we add any step through GGB0, We have to run the regeneration program RGUGBR00. As soon as you run this program your changes will take effect.

Caution wile running the program. On Selection screen, you need to check all checkbox except Generate sets, Gen. substn routns in all clnts & Trace Prog. generate calls

I am sure control will go to your part of the code in Debug mode.

Regards

Abhinandan

0 Kudos

No, I don't think you last two gentlemen understand - his breakpoint is in the validation exit code. It will NEVER hit because the pre-requisite fails for the simple fact that the SY-TCODE value in the check is wrong. Though good suggestions, the issue has nothing to do with assignments in GGB4 or boolean code re-generation. Transaction code checks are not a good idea in validations...