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: 

Make PR header text mandatory in ME51N or atleast error message if initial

former_member16044
Active Participant
0 Kudos

HI all,

I need to make PR PR header text mandatory in ME51N or atleast error message I have to display in case PR header text is not entered. I tried with SHD0 and tried to chek the BADI's and user-exits,I didn't find any answer. Please tell me if I have followed the incorrect step or solution

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check BADI "ME_PROCESS_REQ_CUST", method "CHECK".

Edit : Call the method IM_HEADER->IF_LONGTEXTS_MM~GET_TEXT with parameter IM_TDID = 'B01' to get the header text in the above mentioned BADI method. If the internal table structure for EX_TEXTLINES is initial, raise an error message.

Edited by: Vinod Kumar on Dec 1, 2010 5:27 PM

6 REPLIES 6

Former Member
0 Kudos

Check BADI "ME_PROCESS_REQ_CUST", method "CHECK".

Edit : Call the method IM_HEADER->IF_LONGTEXTS_MM~GET_TEXT with parameter IM_TDID = 'B01' to get the header text in the above mentioned BADI method. If the internal table structure for EX_TEXTLINES is initial, raise an error message.

Edited by: Vinod Kumar on Dec 1, 2010 5:27 PM

0 Kudos

Thanks alot. But I am not able to create IM_HEADER object of type IF_LONGTEXTS_MM, as IM_HEADER is the parameter of main CHECK method of ME_PROCESS_REQ_CUST BAdi. if I try to make some other object of type IF_LONGTEXTS_MM in get_text method, the ME51N is giving dump while saving a PR. Please elaborate your answer.

0 Kudos

I don't think there is any problem in implementing the validation in CHECK method. See the sample code below

DATA : lt_textlines TYPE mmpur_t_textlines.
REFRESH : lt_textlines.
CALL METHOD im_header->if_longtexts_mm~get_text(
  EXPORTING
    im_tdid      = 'B01'
  IMPORTING
    ex_textlines = lt_textlines ) .
IF lt_textlines[] IS INITIAL.
   MESSAGE 'Header text not available' TYPE 'E'.
ENDIF.

0 Kudos

Thanks Vinod, I was wrongly using the object class definition syntax, as this is the first time I am working with BAdi

0 Kudos

Hi Vinod

What about if i have the same requirement but for item text instead ?

please advise me

Regards

Ghadeer

0 Kudos

Kindly Share the screenshot , method is not exist message display in se18 , kindly share the screenshot step by step on urgent need ?