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

finding exit with ME51N tcode?

Former Member
0 Likes
3,197

i have a requriement like in me51n transacton screen for a particular material the SHORT TEXT field should be editable.

pls help me out regarding this.

1 ACCEPTED SOLUTION
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Hello Chinmaya,

I don't understand why do you have such a requirement. Normally, short text (for material or other entities) is something that is automatically fetched by the system and displayed. Why would you want to make it editable? Plus, let's say it is made editable. Then, what if the short text has no connection whatsoever with the material?

If you still want to go ahead and would like to find an exit, you can set a breakpoint in method GET_INSTANCE of class CL_EXITHANDLER and then execute your transaction. The method will be called whenever there is an exit called during the transaction and it will return the name of the exit.

Regards,

KA

31 REPLIES 31
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,095

Hello Chinmaya,

I don't understand why do you have such a requirement. Normally, short text (for material or other entities) is something that is automatically fetched by the system and displayed. Why would you want to make it editable? Plus, let's say it is made editable. Then, what if the short text has no connection whatsoever with the material?

If you still want to go ahead and would like to find an exit, you can set a breakpoint in method GET_INSTANCE of class CL_EXITHANDLER and then execute your transaction. The method will be called whenever there is an exit called during the transaction and it will return the name of the exit.

Regards,

KA

Read only

Former Member
0 Likes
3,094

ya thnx akshat!! but mm consultant is saying for a particular material suppose material no-500000.

for this material in the item overview screen SHORT TEXT field should be editable.

   i tried to find the user exit but i am unable to do it.pls help me regarding dis.

Read only

Former Member
0 Likes
3,094

i had tried and find the badi ME_PROCESS_PO_CUST.NOW just let me kno how to add the coding for the above req?

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Hi Chinmaya,

I just checked the BAdI interface. In the method PROCESS_ITEM, I see the input to the method is an object of type IF_PURCHASE_ORDER_ITEM_MM. This interface has methods like GET_DATA and SET_DATA. You can check if using these you are able to set the short text at the item level.

Read only

Former Member
0 Likes
3,094

its not working out akshat.can u pls chk the badi CACL_CHARACTER_INPUT.wenever i put the break point it hits .so i hope its the perfect badi and if u find it then pls let me know the coding also for the particular material 500000 the SHORT TEXT filed should be editable since for all material this field is not editable.

Read only

Former Member
0 Likes
3,094

its not working out akshat.can u pls chk the badi CACL_CHARACTER_INPUT.wenever i put the break point it hits .so i hope its the perfect badi and if u find it then pls let me know the coding also for the particular material 500000 the SHORT TEXT filed should be editable since for all material this field is not editable.

Read only

Former Member
0 Likes
3,094

the following badi's i had found...i am not sure which badi ll work out??

ME_PROCESS_PO

ME_PROCESS_PO_CUST

MEGUI_LAYOUT

GOS_SRV_SELECT

BADI_LAYER

ME_PROCESS_REQ

ME_PROCESS_REQ_CUST

ME_MEREQ_PARKING

ME_REQ_HEADER_TEXT

BADI_MATN1

ME_CCP_ACTIVE_CHECK

ME_REQ_NEW_VERSION

ME_CHECK_SOURCES

CACL_CHARACTER_INPUT

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

I had another look at BAdI ME_PROCESS_PO_CUST. It has a method called IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM. It has a changing parameter CH_FIELDSELECTION which apparently will contain metadata for the various fields. In this table, there is a field called FIELDSTATUS. I think you can try changing the value of this field. An asterisk '*' means display. You can check the correct value for editable (maybe '+'). Have a look at the method implementation in the example class CL_EXM_IM_ME_PROCESS_PO_CUST and it should give you a good idea about what code to write.

Do let me know if it still does not work.

Read only

Former Member
0 Likes
3,094

akshat m in a great mess.in every badi under method wen i put the break point its not getting triggered.

can you please find the exact badi for me.

Read only

Former Member
0 Likes
3,094

any idea to solve this with user exit

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Hey,

You are working with purchase requisitions. BAdI ME_PROCESS_PO_CUST is meant for purchase order. I think that's why it's not triggering in your case. There is a very similar BAdI for purchase requisition. It's called ME_PROCESS_REQ_CUST. It has the same method I mentioned above - FIELDSELECTION_ITEM. I just put a breakpoint in FM MEREQBADI_FS_ITEM from which this BAdI is called and the control did stop. Try with this BAdI.

Also, for some reason, in my system, the SHORT_TEXT field remains editable even after I enter the material.

Read only

Former Member
0 Likes
3,094

can you help me coding also??

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

You can refer the following code and do something similar...



   FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.


     READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_01.
     IF sy-subrc IS INITIAL.
       <fs>-fieldstatus = '*'. " Display
     ENDIF.

Basically, look for the short text field in CH_FIELDSELECTION and set the value of FIELDSTATUS to editable for it. * is for display, you will need to find out the value for editable. Maybe it's + as I mentioned earlier.


Read only

Former Member
0 Likes
3,094

i got it but when i put the break point in fm its trggered but if i put brek point inside badi its nt triggered.should i add any im enhancement to the fm or i can directly add the code in badi?

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Where exactly are you setting a breakpoint in the BAdI? First, you need to create a BAdI implementation which would lead to the creation of an implementation class. Once you activate the BAdI implementation, you can put a breakpoint in the class.

By the way, have you checked with any functional colleagues why the short text field is not editable in your system? As I had written before, in my system, it remains editable. You should make sure that it's not a configuration issue.

Read only

Former Member
0 Likes
3,094

for testing purpose i had gone to se19 den to classic badi.i had put me_process_req_cust.and under that i had dn an implementation zmm15. and then i had gone to method filedselection_item.and by clicking that inside the class zcl_im_mm15 i put the break point or else code.but its not triggered.

i asked the functional guy that smart fellow in spro he made short text field non editable for all the material.but nw he wants for a particular material like 500000 the short text field should be editable.

Read only

Former Member
0 Likes
3,094

but if i put the break point inside the fm as u had told its exactly triggered in short text field.

Read only

0 Likes
3,094

Hi Kumar,

He is playing with sap or what.Through configuration we can filter like not applicable for few materials.

Regards,

Madhu.

Read only

Former Member
0 Likes
3,094

..i already had fight with that guy but he is eating my mind.i told him to make it editable for all material.but he is not listening.

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Hi Madhu,

Do you know how to resolve this problem through configuration? If yes, please share.

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Why do you to put a breakpoint in the FM?

Read only

Former Member
0 Likes
3,094

akshat i think as per my knowledge you can do it for all material editable or non editable but in spro you can't do it for a particular material.

Read only

0 Likes
3,094

Hi Akshat,

Looks i may type wrongly.I want to tell you like it is not possible to filter through config.If get any idea let see.

Regards,

Madhu.

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Ohk..did you make sure that the BAdI implementation is active? If yes, then maybe what you can do is debug the FM and see why it's not calling the BAdI.

Read only

Former Member
0 Likes
3,094

m totally gone now.i dnt know what to do now.pls help me gurus!!

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Did you check my last reply?

Read only

Former Member
0 Likes
3,094

i cnt find.

Read only

Former Member
0 Likes
3,094

ya actually m nt that exp in badi..so i cnt find out after debugging also.

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

I tried to understand the logic in FM MEREQBADI_FS_ITEM. I think it is not calling the BAdI because it looks for particular customer fields in ch_fieldselection and only on finding them does it call the BAdI. Since your field is not among those customer fields, the BAdI is not called.

An alternative would be to do an implicit enhancement at the end of the above FM. Again, the logic would essentially be to look for the short text field in ch_fieldselection and change fieldstatus. You will need to find out the metafield value for short text.

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,094

Another user had a similar problem as yours. He adopted the implicit enhancement approach. He was kind to share his code. If you are still having problems with the code, you can refer the extract below. Note that his requirement was to grey-out a field while yours was to make a field editable.

Code to be copied is

DATA: WA_ITEM TYPE MEREQ_ITEM,

        WA_header TYPE MEREQ_header.

*

  FIELD-SYMBOLS: <fs_sakto> like line of CH_FIELDSELECTION.

*

  CLEAR: WA_ITEM.

  CALL METHOD IM_ITEM->GET_DATA  " Get PR items
    RECEIVING
        RE_DATA = WA_ITEM.
  CALL METHOD IM_header->GET_DATA  " Get PR items
    RECEIVING
        RE_DATA = WA_header.

  IF NOT wa_item-MATNR IS INITIAL .

    READ TABLE CH_FIELDSELECTION ASSIGNING <fs_sakto> WITH TABLE KEY METAFIELD = 551.

    IF SY-SUBRC IS INITIAL.
      <fs_sakto>-fieldstatus = '*'.  "Field is purely a display field
    ENDIF.

  ENDIF.

Read only

madhu_vadlamani
Active Contributor
0 Likes
3,094

Hi,

Go to me52n and change.Check this link.it may be useful.

http://scn.sap.com/thread/1684026

Regards,

Madhu.