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: 

Validate item text in Me51n transaction

Former Member
0 Kudos

Hi Experts

Kindly is there badi or user exit i can use it to validate text item for each item un text tab , to make sure that the user fill it before post adocument ?

Thanks in advance

Ghadeer

9 REPLIES 9

Former Member
0 Kudos

check this exit EXIT_SAPLEINM_002  in Enhancement MM06E001.

there u need to call function and check whether internal table is empty and make your validations accordingly.

0 Kudos

Thanks alot abhishek , but one more question how can i check  text item , i didnt find the technical name for it or the name of its table ?

Thanks in advance

Ghadeer

0 Kudos

the texts  which are writteh in that type of editor...just as in case of item text:

u would not found them in any table.

Thats why i mentioned in my comment to use the function module 'Read_text'.

i hope u must be aware of how to use that function module and it will return a internal table

containing the texts written on item text.

CALL FUNCTION 'READ_TEXT'

   EXPORTING

*   CLIENT                        = SY-MANDT

     ID                            =

     LANGUAGE                      =

     NAME                          =

     OBJECT                        =

*   ARCHIVE_HANDLE                = 0

*   LOCAL_CAT                     = ' '

* IMPORTING

*   HEADER                        =

  TABLES

     LINES                         = t_lines"this internal table m toking abt.

* EXCEPTIONS

*   ID                            = 1

*   LANGUAGE                      = 2

*   NAME                          = 3

*   NOT_FOUND                     = 4

*   OBJECT                        = 5

*   REFERENCE_CHECK               = 6

*   WRONG_ACCESS_TO_ARCHIVE       = 7

*   OTHERS                        = 8

.

now after using this FM...u can validate that if the internal  table is initial...that means nothing has been written in item - Text.



0 Kudos

Dear  abhishek

I create enhacement project for MM06E001 , then i implement function exit EXIT_SAPLEINM_002

and iside the include i called read text function .

but when i run ME52n Tcode , and empty the text item then click save to post the document , the

function exit not called !!! i put breakepoint there but its not reached!!

please advice me

Thanks in advace

0 Kudos

There are many other exits available in the same enhancement...try others.

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi Ghadeer,

Check the simple way to find the relevant BADI that is explained in the below document.

This document is composed by me. It will be helpful for you to achieve your question.

http://scn.sap.com/docs/DOC-33611

Hope this helps.

0 Kudos

Dear venkat

I have followed your document for transaction ME51n , but i got list of badi , i want to know which one can i use to validate text item

Thanks in advance

Ghadeer

0 Kudos

Hi Zahaiqa,

Put a break point in the ENDFUCTION of the Function module mentioned in the Document.

Now Run Transaction ME51N, Do a manual operation of validating the Text Item. For each and every operation the code breaks and will give you the relevant BADI.

Now open SE18 and check that BADI has the Parameters that you need.

Hope this helps.

raymond_giuseppi
Active Contributor
0 Kudos

First use a now classic BAdi for check like ME_PROCESS_REQ_CUST (Many threads, use search tool)

Then, remember ME51N is creation transaction, so no text available in database, you have to look/check for the texts in memory, look for FM like GET_TEXT_MEMORY to get a list of the texts currently being created, Of course if you actually want to check the text value, no "space" values,  use READ_TEXT for each of those texts, by default those will be read from memory.

Regards,

Raymond