‎2007 May 02 10:17 AM
this is manjunatha.
My requirement is to save the partner function address into the text tab in the sales order creation.
object id is Z005 : object : VBBP.
Please can anyone look into the issue.
this is my code.
I have called the function module INIT_TEXT before this code.
li_ithead-tdobject = 'VBBP'.
li_ithead-tdid = 'Z005'.
li_ithead-tdspras = sy-langu.
CONCATENATE lw_adrc-name1 lw_adrc-street INTO li_tline-tdline SEPARATED BY space.
li_tline-tdformat = '*'.
APPEND li_tline .
CONCATENATE lw_adrc-str_supply1 lw_adrc-city1 INTO li_tline-tdline
SEPARATED BY space.
APPEND li_tline .
CONCATENATE lw_adrc-post_code1 lw_adrc-tel_number INTO li_tline-tdline
SEPARATED BY space.
APPEND li_tline .
describe table li_tline lines lv_lines.
li_ithead-tdtxtlines = lv_lines.
/* here i am geeting lv_lines =3.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = li_ithead
insert = 'X'
savemode_direct = 'X'
TABLES
lines = li_tline
EXCEPTIONS
OTHERS = 1.
if sy-subrc ne 0.
exit. */ program is exiting here......
endif.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
object = 'VBBP'
id = 'Z005'
language = sy-langu.
if sy-subrc ne 0.
exit.
endif.
‎2007 May 02 10:20 AM
Hi,
Instead of SAVE_TEXT use the CREATE_TEXT function module
Regards
Sudheer
‎2007 May 02 10:49 AM
Hi ,
I tried with create text the function module is executing without any errors .
but i am not getting the text ( 3 lines) in the object id Z005 of text VBBP.
Please do the needful
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = 'Z005'
flanguage = 'E'
fname = 'Manju'
fobject = 'VBBP'
SAVE_DIRECT = 'X'
FFORMAT = '*'
tables
flines = li_tline.
EXCEPTIONS
NO_INIT = 1
NO_SAVE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
Exit.
ENDIF.
regards
manju
‎2007 May 02 10:20 AM
HI Manjunath,
INstead of exiting the program when the subrc fails for the save_text fm, retain the message that you get when you use the pattern button to call a FM.UNcomment the message and run your program.
YOu can know what the problem was, seeing the message.
Regards,
Ravi
‎2007 May 02 11:00 AM
Hi ravi,
i tried with ur solution:
it is giving i/o error with object VBBP Z005 EN
Please do the needful
regards
manju
‎2007 May 02 11:31 AM
Hi ,
I am using the userexit : USEREXIT_SAVE_DOCUMENT _PREPARE to implement this object..
is it the correct user exit?.
Please can anyone suggest me the correct user exit.
‎2007 May 09 10:44 AM
Hi mnajunath,
i think you should use USEREXIT_SAVE_DOCUMENT.
regards,
sap fan
‎2007 May 09 11:19 AM
Hi,
I am executing the program in the exit : userexit_save_document.
I am getting the error :
I/O error for text VBBP manju Z005 EN.
can u please explain me why i am getting this error .
is there any need for authorization to write the text objects?
Advance Thanks
regards
‎2007 May 09 12:12 PM
hi,
what value are u passing for 'name' or theader in the function module.
‎2007 May 09 12:15 PM
hi,
u should concatenate sales order no and item no into 'name'
‎2007 May 25 11:23 AM
Hi sap fan,
I need ur help.
as per ur suggestion i concatenated sales order number and posnr into tdname.
it is working fine.
But i have one question
is sales order number is a mandatory field to pass into the tdname.is there any other go....
Regards
paveee
‎2007 May 28 7:55 AM
hi,
you can use the FM 'MESSAGE_TEXT_BUILD'.
Regards