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: 

PO Text in MM01 transaction

rahulv6
Explorer
0 Kudos

Hello ppl

Iam writing a BDC program for Material Master loads..using MM01 trransaction. Iam stuck with the PO text field since I dont see that in the recording. Can anyone please let me know how to proceed. Its a bit urgent.

I appreciate your help.

Thanks,

~V

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try using the function module SAVE_TEXT to save the text directly. You can look up the text object and id from transaction SE75

Regards

Rich Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Looks like you may want to use object = MATERIAL and id = BEST

REgards,

Rich Heilman

0 Kudos

thanks Rich, where am I using this object ID and name? are you talking about Read_text?

if Iam using save_text how do I pass the text into this FM?

0 Kudos

You use the SAVE_TEXT function to update the database with text and of course you can then use the READ_TEXT function module to read it back, but it will also be visible in MM03 when your done. You pass the text the same way you retrieve it when using READ_TEXT, simply pass the text to the TABLES parameter.

REgards,

Rich Heilman

0 Kudos

You know, I could get the SAVE_TEXT to work for me, but it does in a lot of cases, there may be something in the material master preventing it from showing. Anyway, lets go a different route. Lets use the BAPI instead. I have done this example and it works good.



report zrich_0001.

data: headdata type bapimathead.

data: iltxt type table of bapi_mltx with header line.
data: return type  bapiret2 .
data: returnm type table of bapi_matreturn2 with header line.
data: xmara type mara.

parameters: p_matnr type mara-matnr.

select single * from mara into xmara
          where matnr = p_matnr.

headdata-material        = xmara-matnr.
headdata-ind_sector      = xmara-mbrsh.
headdata-matl_type       = xmara-mtart.
headdata-basic_view = 'X'.
headdata-purchase_view = 'X'.

iltxt-applobject = 'MATERIAL'.
iltxt-text_name  = p_matnr.
iltxt-text_id    = 'BEST'.
iltxt-langu      = sy-langu.
iltxt-langu_iso  = 'EN'.
iltxt-format_col = space.
iltxt-text_line  = 'This is line 1'.
append iltxt.
iltxt-text_line  = 'This is line 2'.
append iltxt.

call function 'BAPI_MATERIAL_SAVEDATA'
     exporting
          headdata         = headdata
     importing
          return           = return
     tables
          materiallongtext = iltxt
          returnmessages   = returnm.

check sy-subrc  = 0.

Regards,

Rich Heilman

0 Kudos

Thanks very much Rich..it is working but I have a question here..since am loading master data, I dont think this is going to work there..I proposed a sugestion to my functional guy that we can run a seperate program to load the PO text once the material is created..do you think this is a good idea??

0 Kudos

Sure, but you can also use this BAPI to create your material as well, and at the same time, assign the long text. But you can do it in two separate pieces as well.

Regards,

Rich Heilman

0 Kudos

After you call the BDC, you will get the material number in the messages, you can send that to NAME parameter to create the text using SAVE_TEXT. But for that you have to do it as call transaction not batch input session.

0 Kudos

Thanks Srinivas for the reply.

Rich..I see that the length of the tline is 132 characters..but I have a couple of records in my excel sheet where the length is more than 132..can you please suggest some solution for this?

0 Kudos

You can split it into next line but leave the FORMAT_COL as blank. That way they will be saved as continuous line.

Message was edited by:

Srinivas Adavi