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

Hi.Problem with SAVE_TEXT Function Module.

Former Member
0 Likes
1,678

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.

11 REPLIES 11
Read only

Former Member
0 Likes
1,289

Hi,

Instead of SAVE_TEXT use the CREATE_TEXT function module

Regards

Sudheer

Read only

0 Likes
1,289

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

Read only

Former Member
0 Likes
1,289

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

Read only

0 Likes
1,289

Hi ravi,

i tried with ur solution:

it is giving i/o error with object VBBP Z005 EN

Please do the needful

regards

manju

Read only

0 Likes
1,289

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.

Read only

0 Likes
1,289

Hi mnajunath,

i think you should use USEREXIT_SAVE_DOCUMENT.

regards,

sap fan

Read only

0 Likes
1,289

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

Read only

0 Likes
1,289

hi,

what value are u passing for 'name' or theader in the function module.

Read only

0 Likes
1,289

hi,

u should concatenate sales order no and item no into 'name'

Read only

0 Likes
1,289

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

Read only

Former Member
0 Likes
1,289

hi,

you can use the FM 'MESSAGE_TEXT_BUILD'.

Regards