Application Development and Automation 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: 
Read only

User Exit probelm FB01

Former Member
0 Likes
1,988

Hi ,

I am using user exist F180A001 for T-code FB01.

I am validing field called assignment whether data enter there is correct or not.

If data is inccorect i want to give error message that enter data correctly.

I am writing code for this as "MESSAGE 'error in assigment' TYPE 'E'. "

This is working fine but it is also coming out of my existing screen.

but I dont want to come of screen i want to be in same screen where i have enter data. I should be able to correct data to proper value.

can you tell me code which i should use in order to achive this.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,839

Hi

Give the message as

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a FI document'.

ZM_MSG is the message class

it should stay in that screen.

other wise change the error message to I (information) or warning and see.

Reward points if useful

Regards

Anji

Hi ,

I am using user exist F180A001 for T-code FB01.

I am validing field called assignment whether data enter there is correct or not.

If data is inccorect i want to give error message that enter data correctly.

I am writing code for this as "MESSAGE 'error in assigment' TYPE 'E'. "

This is working fine but it is also coming out of my existing screen.

but I dont want to come of screen i want to be in same screen where i have enter data. I should be able to correct data to proper value.

can you tell me code which i should use in order to achive this.

thanks

15 REPLIES 15
Read only

Former Member
0 Likes
1,840

Hi

Give the message as

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a FI document'.

ZM_MSG is the message class

it should stay in that screen.

other wise change the error message to I (information) or warning and see.

Reward points if useful

Regards

Anji

Read only

0 Likes
1,839

Thanks for reply.

I am doing same ......

when i am using message E its coming out of screen .

if i am using W or I its is saving document.

I want to give message and also want to be in same scrren so that i can correct value in field assigment and save it.

Read only

0 Likes
1,839

Hi

U shouldn't use that exit to do a validation, but FI validations: trx OB28

Max

Read only

0 Likes
1,839

I have check whether user is entering proper asset no in this field or not.

for that i have write select query.

how can i do that in ob28

Read only

0 Likes
1,839

Hi

Run trx OB28 and do the double click on the validations for item of your company code.

Here you need to create a new step, than insert the prerequisite when the validation has to be done (for example SY-SYST-TCODE = 'FB01'), in CHECK create an EXIT where you write the code for validation and in MESSAGE insert the error message has to be shown if the validation fails.

Max

Read only

0 Likes
1,839

can you please explain in details.

I want into OB28 but i dont have any validation so i created one . and have define message class.

now how can i related FB01 assignmnet field to this. where will i write code.

should i create new z program.

please reply in details

Read only

0 Likes
1,839

After running the trx OB28 u'll see a table (just like SM30) where you have to insert

the company code and the point (Document header or Line item or Complete document) where the validation has to be done: I suppose at line Item livel.

Do a double click and then press create VALIDATION, here you need to create a new step.

In the step u should create an exit at CHECK level, after inserting the code of the exit (for example UZ01) press the icon to display the abap editor.

Here you should find the form GET_EXIT_TITLES and insert these codes:

EXITS-NAME  = 'UZ01'.
EXITS-PARAM = C_EXIT_PARAM_CLASS.
EXITS-TITLE = <title>.  
APPEND EXITS.

and then insert the FORM for your exit:

FORM UZ01  USING BOOL_DATA TYPE GB002_015
           CHANGING B_RESULT.

  IF  ......
   B_RESULT = B_FALSE.
  ELSE.
    B_RESULT = B_TRUE.
  ENDIF.
ENDFORM.

Max

Read only

0 Likes
1,839

that is what i am asking where will i write code in validation......

please reply

Read only

0 Likes
1,839

Hi

U should create a copy of std program RGGBR000 and insert it in the view V_T80D by sm30 for the hit GBLR

Max

Read only

0 Likes
1,839

Hi I have done same I have created copy of program RGGBR000 and inserted in view but still i cant see this prgram in ob28 .can you please send me screen shot or showing step how i can do this

here v_anln1 is assigment field in FB01.

SELECT SINGLE * FROM ANLA INTO ANLA WHERE ANLN1 = V_ANLN1.

IF SY-SUBRC NE '0'.

MESSAGE 'error in assigment' TYPE 'W'.

ENDIF.

thanks and waiting for your reply

Read only

0 Likes
1,839

Hi

Trx GCX2 replace RGGBR000 with your ZRGGBR000

Max

Read only

0 Likes
1,839

what will be data in bool-data.how can i match assignment field in this what is code.

and I have done same but still i cant go into z series program using OB28

Read only

0 Likes
1,839

Now i am getting program but I cant see form name in exit can you tell me how can i get it .

GB002_015 its telling not define .

what should i do .

pls reply

Read only

Former Member
0 Likes
1,839

It might be simpler to do this with a validation (transaction OB28).

Rob

Read only

Former Member
0 Likes
1,839

Hi,

I have found a way to avoid the problem. Try to use FM 'POPUP_DISPLAY_MESSAGE' and then LEAVE SCREEN after the FM. Check the sample code below.

LOOP AT doc_item_tab.

IF doc_item_tab-vname = '900000'.

CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'

EXPORTING

titel = 'Error'

msgid = '38'

msgty = 'E'

msgno = '000'

msgv1 = 'error'.

LEAVE SCREEN.

ENDIF.

ENDLOOP.