07-10-2007 8:09 PM
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
07-10-2007 8:13 PM
07-10-2007 8:16 PM
07-10-2007 8:20 PM
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?
07-10-2007 8:23 PM
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
07-10-2007 8:45 PM
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
07-10-2007 9:32 PM
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??
07-10-2007 9:50 PM
07-10-2007 9:57 PM
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.
07-10-2007 10:23 PM
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?
07-10-2007 10:26 PM
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