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

Upload Task List Operation long Text using SAVE_TEXT-Urgent

Former Member
0 Likes
7,997

Hi ,

I am trying to create Task List Operation Long text using the function module ..

SAVE_TEXT .I am passing the following keys

Text Name 300ATEST057 0000000900000009

Language EN

Text ID PLPO Long Text

Text Object ROUTING Texts for task list types

But the long texts are not getting updated in the Task lists operations .

Can anyone please suggest whether SAVE_TEXT will work for Operation long Texts or not Are we missing something

.This is pretty urgent requirement .Award points are assured.

Regards

Sam

Hi ,

I am trying to create Task List Operation Long text using the function module ..

SAVE_TEXT .I am passing the following keys

Text Name 300ATEST057 0000000900000009

Language EN

Text ID PLPO Long Text

Text Object ROUTING Texts for task list types

But the long texts are not getting updated in the Task lists operations .

Can anyone please suggest whether SAVE_TEXT will work for Operation long Texts or not Are we missing something

.This is pretty urgent requirement .Award points are assured.

Regards

Sam

17 REPLIES 17
Read only

Former Member
0 Likes
4,629

hi,

use function module create text

check the sample code

DATA: BEGIN OF itab OCCURS 0,

asnum LIKE asmd-asnum, " Service No

text(5000) TYPE c, " Long Text

END OF itab.

*DATA: itab1 LIKE itab OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF itab1 OCCURS 0,

asnum LIKE asmd-asnum, " Service No

sequ type i, " Text Sequence

text(5000) TYPE c, " Long Text

END OF itab1.

  • To create Long Text lines for CREATE_TEXT function module

DATA:BEGIN OF dt_lines OCCURS 0.

INCLUDE STRUCTURE tline. " Long Text

DATA:END OF dt_lines.

  • Variable declarations for CREATE_TEXT function module

DATA : dl_name TYPE thead-tdname, " Object Name

dl_lan TYPE thead-tdspras. " Language

  • Constants

  • Object ID for Long Text of Service Master

CONSTANTS:c_best TYPE thead-tdid VALUE 'LTXT',

c_material TYPE thead-tdobject VALUE 'ASMD'. " Object

  • for file splitting.

DATA: start TYPE i,

len TYPE i VALUE 92,

totlen TYPE i,

n TYPE i.

PARAMETERS p_file LIKE rlgrap-filename."input file

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start Of Selection

START-OF-SELECTION.

*To Upload Flat file

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = itab

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

LOOP AT itab.

itab1-asnum = itab-asnum.

CLEAR: totlen,n, start.

totlen = STRLEN( itab-text ).

n = totlen / len.

n = n + 1.

DO n TIMES.

itab1-text = itab-text+start(len).

itab1-sequ = sy-index.

start = start + len.

APPEND itab1.

ENDDO.

ENDLOOP.

delete itab1 where text is initial.

SORT itab1 BY asnum sequ.

LOOP AT itab1.

dt_lines-tdformat = '*'.

dt_lines-tdline = itab1-text.

APPEND dt_lines.

  • Call the Function Module to Create Text

AT END OF asnum.

dl_lan = sy-langu.

WRITE : / itab-asnum.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = itab1-asnum

IMPORTING

output = itab1-asnum.

MOVE itab1-asnum TO dl_name.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_best

flanguage = dl_lan

fname = dl_name

fobject = c_material

save_direct = 'X'

fformat = '*'

TABLES

flines = dt_lines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Long Text Creation failed for Service No'(001),

itab1-asnum.

ELSE.

WRITE:/ 'Long Text Created Successfully for Service No'(002),

itab1-asnum.

ENDIF.

REFRESH dt_lines.

ENDAT.

ENDLOOP.

in text file give first field records in capitals

regards

siva

Read only

Former Member
0 Likes
4,629

Hi,

I checked with the object ROUTING in table TTXOB.I found that for object ROUTING ,TDSAVEMODE is V.If it is V,u have to use the FMs.

INTTAB_SAVE_TEXT and

INTTAB_COMMIT_TEXT ,then it will get updated correctly.Only if TDSAVEMODE is D , u can use SAVE_TEXT and COMMIT_TEXT.

Dont forget to use INTTAB_COMMIT_TEXT,only then the saved text will get updated in the table.

Regards,

Read only

0 Likes
4,629

Hi,

Thanks for the reply ...

I checked in the table TTXOB for TDSAVEMODE. It is V.

so I tried using FM's INTTAB_SAVE_TEXT and

INTTAB_COMMIT_TEXT.

But still the Operation Long text is getting saved ...

Can you please suggest the solution ..

Regards,

Sam

Read only

0 Likes
4,629

But still the Operation Long text is getting saved ???

what does it mean? you want to save or not?

In the FM u need to pass the table LINES.

which is of type standard table of tline.

In this internal table u will store the long text u have entered and is passed to the save _text FM.

Plz check whether u r passing that also to the FM.

and plz clarify ur qn.

Read only

0 Likes
4,629

Hi ..

I am sorry I meant to say,

Operation Long Text is still not getting saved ...

By using the FM inttab_save_text and inttab_commit_text

I have passed the LINES.

which is of type standard table of tline.

Read only

0 Likes
4,629

Hi,

r u using this in ur custom program?

where r u checking for whether it is saved or not?

check in table STXH(header) and STXL(line) whether an entry is made for corresponding object and tdname.if so it is saved properly.

then while reading u have to use the FM READ_TEXT to display the updated text in the editor.

Read only

0 Likes
4,629

Hi ...

Yes as you said we are able to read the text using the FM READ_TEXT ...

But the same text is not displaying in the long text window of operations of IA05 ...

why is it not displaying ... not getting reflected in the screen ... can you please tell me what problem is it ..

Thanks,

Sam

Read only

Former Member
0 Likes
4,629

Hi Sam,

I am working on a similar requirement like this. Can you please let me know how you uploaded the the long text for operation. It is bit urgent. kindly reply.

Regards,

Prabaharan.G

Read only

0 Likes
4,629

Hi Prabaharan,

I have tried uploading the long text using SAVE_TEXT and COMMIT_TEXT .. but this dint work for transaction IA05 ..

I am not sure on which transaction you are working ... but the same function modules are working for any other transaction to upload the long text ..except for IA05 ..

If you are working on the same transaction i.e., IA05 .. then there is a standard object and Method in LSMW to upload task list, operations and Long Text ...

Details are as below;

Object: 0490

Method: 0000

Program Name: IBIP

Program Type B.

Hope this will be helpful ... need anymore info on the same .. do send me ur queries..

Thanks,

Sam

Read only

0 Likes
4,629

Hi Sam and Other Experts,

As in this posting as suggested by Murugesh, to make a BDC recording first to make the Long Text Check Box checked and then actually uploading the text using FMs Create_Text, Commit_text.

My problem is that I need to upload the long text for Tcode IA06 ( General Task List ) instaed of CA02 ( Change Routing). As mentioned above we can select the operation for which we want to upload the long text in case of CA02 and go further but in case of IA06 I am not getting the option of selecting the operation any where which I can pass while calling BDC.

Is there any other way to upload General Task List Long Text. Your expert comments would be of great help to me.

Regards,

Lalit Kabra

Read only

0 Likes
4,629

Hi,

May be this would help you:

For the step 1 ( to register the LT ) you could accomplish from a BDC. You read the plan by FM: CP_EX_PLAN_READ to determine the number of operations in the plan(Pass:PLNTY,PLNNR,PLNAL,STTAG & WERKS). Develop a BDC program to register the LTs as expalined in my earlier post. Important point here is to note the number of times you loop based on the number of operations available in the plan, ( you can also skip if a LT is already existing as you are reading the plan ).

Push the 'Select all' button and then push "LT" button to go to the text editor operation by operation. if you have a LT for a particular operation where you need to skip, you can do so in your BDC.

After the above step is complete, we now will have all the operations registered for LT where PLPO-TXTSP = 'E'.

Now you can proceed with the next step to load the actual LT by FM: SAVE_TEXT.

Another approch is to read the plan operations by FM: CP_EX_PLAN_READ and with the PLPO records, make a DB direct update to the field TXTSP. However i do not recommend the direct table update until we do not have any other way.

Best Regards, Murugesh

Read only

0 Likes
4,629

Hi.

OSS note 138012 [https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/sapnotes/index2.htm?numm=138012] gives you the reason.

Regards.

Rafael Rojas.

Read only

Former Member
0 Likes
4,629

Try calling the function module COMMIT_TEXT after SAVE_TEXT.

Read only

Former Member
4,629

Hi,

this updation is little tricky. The LT with the transaction CS01/CS02 would also update the field PLPO-TXTSP with the language of the LT. This would enable the transaction to determine whether a LT exists for the operation ( I believe the same logic is followed in MIC level. So I suggest the following:

1 Step 1: make a BDC Recording as explained: In CA02, in the operation overview screen, choose menu options Edit -> Find, mention the operation number and position the specfic operation in first line of table control. Mark the first line in the table control ( the Specific operation which you have positioned earlier ), and push "Long Text" button to get the Text editor for the operation. Now you see the short text in the first line of the long text. Technically the LT starts from the second line of the editor. Now fill a "*'" in the tag column of the editor - second line and save. This process would fill the language parameter in field PLPO-TXTSP.

2. In the next step, save the actual LT by FM: SAVE_TEXT.

By this way I have successfully added & changed the Routing LT.

Hope this helps.

Best Regards, Murugesh AS

Read only

Former Member
0 Likes
4,629

Hi

Im unable to update Operation text description of IA06 through save_text FM, but didnt work.

Read only

aromalr
Active Participant
0 Likes
4,629

Hi,

try this.

1. When you call the funtion module save_text , pass SAVEMODE_DIRECT eq 'X' too .

2. call COMMIT_TEXT funtion module after SAVE_TEXT.

3. In the table there will be long text indicator filed , Please use UPDATE statement for the Long text indicator in you program after you call COMMIT_TEXT.

Regards

Aromal R