cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in raising error message during posting accounting document

Former Member
0 Kudos

Hi All,

I had a scenario where when user is posted with line items

whose bussiness area with 3 series  along with any other series it had to display an error message during saving the document.i.e through FB01 or some other transaction.

if line items with bussiness area contains only 3 series it had to allow the posting and line items with bussiness area without 3 series also will allow for posting.

for eg line items having bussiness are like this: 4010

                                                                    1010

                                                                    3010

                                                                    5010

here the line item contains bussiness area 3010 so it wont allow for posting the document.

I tried from GGB0 validation but my problem is i need to raise an error message .

As per note 842318 we should not raise an error messages.

and also i tried the user exit EXIT_SAPLF048_001 also.

But the problem is when i write the error message it is coming out of the transaction.

I need to be stay in the same transaction with the error message dislpayed so that user can correct the data.

Any clues help me...

Regards

Ram

Accepted Solutions (0)

Answers (1)

Answers (1)

raymond_giuseppi
Active Contributor
0 Kudos

I tried from GGB0 validation but my problem is i need to raise an error message .

As per note 842318 we should not raise an error messages.

Of course validation can raise error, but you must not use a MESSAGE TYPE 'E' in the user exit forms, but fill the return parameter that will indicate that the check failed, and then the error/warning message defined in the validation will be raised by the SAP generated report.

form uXXX using b_result.

  if <error>.

    b_result = b_false.

  else.

    b_result = b_true.

  endif.

endform.

Regards,

Raymond

Former Member
0 Kudos

Hi Raymond,

Thanks for the reply..

where we can raise error messages like ' Please check business area'

Can you please eloborate.

And also for your information i am writing code in the standard program by taking access key.

i.e by writing the form U900.

Any thing i need to do after this ?

Regards

Ram

Former Member
0 Kudos

Any clues...

raymond_giuseppi
Active Contributor
0 Kudos

- You will create your FORM (e.g. U900 in a Z-copy of the standard sample program RGGBR000) and declare the name of this program via transaction GCX2, key GBLR

- In GGB0 when you create a step, the third node is related to error message (first is when execute the check, second is execute the check)

- Read Note 842318 - Frequently asked questions about validations + substitutions

Regards,

Raymond

Former Member
0 Kudos

Thanks Raymond...for ur help.

I am closing this thread.

Regards

Ram