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: 

How to give Item text automatically while saving the Purchaser order in ME21N

Former Member
0 Kudos
955

Hi,

I have an issue like how to populate the ITEM TEXT when the user creates a PO using the transaction ME21N automatically.

I am looking at the FM CREATE_TEXT but it needs the PO number and i am not able to get the PO number in few exits which i checked. Do we have any other solution for this? I also checked out that there is a BADI - ME_PROCESS_PO_CUST. in this there is a method to set texts. But i am not at all sure how this can be used. I am very new to OOPS concept . Can anyone help me with some sample code?

Regards,
Venkatesh.

5 REPLIES 5

Venkat_Sesha
Advisor
Advisor
0 Kudos
258

Before you save the PO you check whether the user entered any data in the Texts from the ME_PROCESS_PO_CUST BADI.. You can do that in the below mentioned methods. I didnt gone deeply. Check which is the most feseable and correct one.

PROCESS_ITEM

PROCESS_SCHEDULE

PROCESS_ACCOUNT

CHECK

POST

CLOSE

If the User didnt entered any data here. Populate a Information Message and Donot save PO.

You dont need to call the Create_text Function module. The Message Tells that User should enter something in the Texts, else he cannot go further(because you are not allowing ).

Hope this helps.

0 Kudos
258

Hi,

I have tried using the BADi - ME_PROCESS_PO_CUST  and the method - Process_item. when i activated it with the simple code - BReak-point - it is not getting triggered. Let me tell what i did here ...

step 1 - used the tcode SE19 - create implementation - classic badi - ME_PROCESS_PO_CUST and then created implemetation with ZPO_ITEM_TEXT.

Step 2 - Now in the ZPO_ITEM_TEXT and then in the process_item - i have written - break-point as the code.

Step 3 - Activate the implemenation, method etc.

step 4 - used the tcode - ME21N  - but this part of the code did not get executed.

What should i do to get it triggred ?


Regards,

Venkatesh

0 Kudos
258

Hi Venkatsewar,

Goto SE18

Enter the BADI Name : ME_PROCESS_PO_CUST

From the Menu"Implementation"-> Click on Overview.

By Clicking this will show all the existing Implementations for that BADI.

Check how they did (Just to learn/do some kind of analysis)

Now in SE18 itself. From the Menu Implementation->Create

It will ask you a Implementation name It should start with Z/Y.

In the Interface-Method Put a Break point. Activate it. Press BACK and again Activate.

Now run ME21N it will trigger your break point.

As you said you are new to BADIs and OOPS. Here I will give simple and easy way to find a BADI.

Open SE37 and Enter SXV_GET_CLIF_BY_NAME. Put a break point at the END_FUNCTION.

Execute the ME21N in a new session. For every operation you perform the code Breaks and in the parameter CLIF and NAME you will get the correct BADI name that is used for that operation.

Hope this solves

Former Member
0 Kudos
258

HI Dear,

Use exit EXIT_SAPMM06E_013 write your code and use CREATE_TEXT ... I_EKKO-ebeln contains the PO number and XEKPO-EBELP contains the Item no concatenate these two and pass in CREATE_TEXT as FNAME.

Hope this would work,, working for me.

Thanks

Rahul

former_member199637
Participant
0 Kudos
258

Hello Venkateswararao,

1. GoTo SE18

2. Put BAdI name and click Display.

3. Go to Implementation(Menu path), and select create.

4. After the implementation is created, use method PROCESS_ITEM to put add text at line item.

To add text at PO item you can use method SET_TEXT of Interface IF_LONGTEXTS_MM.

like

   CALL METHOD im_item->if_longtexts_mm~set_text
          EXPORTING
            im_tdid      = <enter text ID>
            im_textlines = <text to be added>.

where IM_ITEM : Importing parameter of PROCESS_ITEM.

        

Regards,

Puneet Desai