cancel
Showing results for 
Search instead for 
Did you mean: 

Overwriting value of SAVE_TEXT before COMMIT WORK

former_member214626
Active Contributor
0 Kudos

Hi All ,

I am using SAVE_TEXT to create long text of equipment in IE01 ( create eqp) and IE02(Change Eqp) . Its working fine except in following cases :

1. When in create mode (IE01) long text is manually entered before saving

In this case system is not overwriting the manually entered long text with text from code .

2. When in change mode ( IE02) long text is manually edited before saving

In this case also system is not overwriting the manually edited long text .

In 2nd case , system calls SAVE_TEXT in program LSTXXFTE (line 588 ) and then SAVE_TEXT of my code which I have written in a implicit enhancement point .

After that system calls COMMIT WORK . I don't know why system is not overwriting the text from my code when SAVE_TEXT of my code is called after system calls SAVE_TEXT .

Accepted Solutions (0)

Answers (3)

Answers (3)

dibyajeeban_jena
Active Participant
0 Kudos

Hi,

Its continuing.. ok

For both the below cases, check the text name in the parameter HEADER (It should always be Permanent equipment number) , If  Permanent equipment number is not generated till your point of enhancement , then you have to change that  enhancement point . Permanent equipment number is textname  so you have to do all the activities (create/change) based on this only .

1. When in create mode (IE01) long text is manually entered before saving

In this case system is not overwriting the manually entered long text with text from code .

INSERT = 'X' and SAVEMODE_DIRECT = ' ' .

2. When in change mode ( IE02) long text is manually edited before saving

In this case also system is not overwriting the manually edited long text .

If you can share your code for the Enhancements and corresponding paramenter values in SAVE_TEXT when triggered during debugging ,, it will be easier to find the reason of ur issue .

Regards

DJ

former_member214626
Active Contributor
0 Kudos

Hi Dibya ,

Yes its continuing . In both the cases , I am passing permanent equipment number only .

Below is the code :

var_insert = ' '

var_direct = 'X'

dt_lines-tdformat = '*'.

dt_lines-tdline = 'This is long text from code' .

APPEND dt_lines.

dibyajeeban_jena
Active Participant
0 Kudos


Hi,

1. When in create mode (IE01) long text is manually entered before saving

In this case system is not overwriting the manually entered long text with text from code .

In the above case,  keep the values like beow and uncomment  the exceptions .

var_insert = 'X'

var_direct = '  '

dt_lines-tdformat = '*'.

dt_lines-tdline = 'This is long text from code' .

APPEND dt_lines.

put a break-point on SAVE_TEXT and check the value of RM63E-EQUNR if its getting populated with Permanent equipment number .

If correct Eqp number is populating as text name, then check the value of sy-subrc after executing SAVE_TEXT .

if sy-subrc  = 0 , then text created in the name of Permanent equipment number , else if it is not = 0,, check the value of sysubrc and from the exception list find out the reason .

Let me know the result .

Regards

DJ

former_member214626
Active Contributor
0 Kudos

Hi Diba ,

As written earlier also . Sy-subrc = 0 in all the cases but text is not getting generated . Also in all the cases permanent equipment no. is generated when system reaches my SAVE_TEXT.

dibyajeeban_jena
Active Participant
0 Kudos

Hi,

How did you know text is not generated ?

Call FM save_text

....

....

---> If sy-subrc = 0 .(keep the break-point here and in another session,manually execute(in SE37) function READ_TEXT  passing same parameters values i.e Text name, Text ID, Text object, Language .  Check the text lines in table parameters, see if it is changed or not .)

      else.

     endif .

If text lines are changed as per code,

then press F8 and check again in READ_TEXT passing the same parameters values.

In the later READ_TEXT,, if text lines(manually entered) are different than earlier READ_TEXT text lines(entered through code) .Then system is modifying text lines after your modification,, so enhancement point needs to be changed,,so that you can modify after system do .

In all above case, Text name should be same as equipment number generated finally .

Regards

DJ

former_member214626
Active Contributor
0 Kudos

I have tried doing so . When system reaches the breakpoint on sy-subrc  , I have  executed READ_TEXT in SE37 with same parameters . Here sy-subrc value was 0 .

But READ_TEXT is going into endless loop.

I have kept the breakpoint on COMMIT WORK ( in std code) which comes after my code . After executing this statement READ_TEXT shows the long text ( not same as that of my code) .

dibyajeeban_jena
Active Participant
0 Kudos

Keep below parameters as shown

var_insert = 'X' .

var_direct = 'X' .

if error is trigering .. then let me the value of sy-subrc and error .

if sy-subrc = 0 .

use READ_TEXT to read as above and check .

former_member214626
Active Contributor
0 Kudos

With both insert and direct as X , sy-subrc remains 0 and READ_TEXT went into endless loop.

dibyajeeban_jena
Active Participant
0 Kudos

Ok ...

lets do it in other way...

In include - LSTXXFTE ,FM  'SAVE_TEXT' will get triggered , whenever user add any text in the PC Editor .

In both of your cases, some texts are manually entered in the PC editor(for both Tcodes-IE01/2,, that means 'SAVE_TEXT' will be triggered every time .

So in form TE_SAVE_TEXT , create a implicit enhancement in the starting line . Change the content of the variable- ED_TEXT (which contains the text entered manually) according to your requirement . These text lines will reflect in the final text of the equipment .

Regards

DJ

former_member214626
Active Contributor
0 Kudos

I have done using GET_TEXT_MEMORY FM . Using this FM I will get the id in table catalog .

Using this id I read the text from memory

Former Member
0 Kudos

What value you are passing in  SAVEMODE_DIRECT field when you call your own SAVE_TEXT?

former_member214626
Active Contributor
0 Kudos

Hi Rudra ,

SAVEMODE_DIRECT = X and INSERT = ' '

in both the cases .

Former Member
0 Kudos

The standard code does not use SAVEMODE_DIRECT = 'X'. The reason is simple.

it waits for the first commit to happen. But your case you are saving the text immediately and then the commit happens that kicks in the SAVE_TEXT by standard and it is overwriting your text.

Check this in debug mode.

So as per me, the solution would be to call your FM also as SAVEMODE_DIRECT = Blank.

R

former_member214626
Active Contributor
0 Kudos

If both insert and save_direct are  blank then system gives error " I/O error for text 00000000EquipmentNo"  as till this point system has generated the equipment no.

Former Member
0 Kudos

What happens when you pass INSERT = 'X'.

former_member214626
Active Contributor
0 Kudos

It give you same error as it gives with INSERT = X and DIRECT_SAVE = X .

Former Member
0 Kudos

What is DIRECT_SAVE? I meant INSERT = 'X' and SAVEMODE_DIRECT = space.

You somehow have tro make it work using SAVMODE_DIRECT = space as I explained aleady.

former_member214626
Active Contributor
0 Kudos

Sorry it was typo . I have tested with

INSERT = 'X' and SAVEMODE_DIRECT = ' ' .

But its not working giving same error as mentioned above

Former Member
0 Kudos

Then only option I could think of try calling your code(changing SAVEMODE_DIRECT = space) in a wrapper FM and call that in UPDATE TASK. But make sure you are not already in UPDATE TASK.

former_member214626
Active Contributor
0 Kudos

Hi Rudra ,

One more thing I have checked , for CASE 1 (  i.e in create mode - IE01 if the long text manually entered before save) system calls :

SET_TEXT_OBJECT in program MIEQ0F90 before my SAVE_TEXT .

I am using implicit enhancement in program MIEQ0F90 .

Former Member
0 Kudos

Did you try doing the same thing for IE02?

former_member214626
Active Contributor
0 Kudos

I had already tried that in IE02 . In IE02 it works if I pass INSERT = 'X' and SAVEMODE_DIRECT = ' '.

But in this case , if the long text is not edited in IE02 then system will not overwrite it with text from code. Its not known to me that long text is edited or not , so I can not decide value of INSERT and SAVEMODE_DIRECT at run time .

That is why I am alsways passing INSERT = ''  and SAVEMODE_DIRECT = 'X'.

former_member205488
Active Participant
0 Kudos

Hello!

You could try to place your statement which saves the text into PERFORM ON COMMIT. Then it will be processed just before commit work.

*But if your enhancement is already placed in perform on commit you will get a short dump. Try this approach in development or QAS system first.

former_member214626
Active Contributor
0 Kudos

Doesn't work .