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

Long Text problem in a BADI

Former Member
0 Likes
1,530

Hi Everyone,

I am implementing BADI "WORKORDER_UPDATE". The requirement is there should be no changes made on the IW32 transaction. I have successfully implemented the BADI and it is now giving an error when we try to change anything on the order in IW32.

The problem is with the longtext. There is a field TXCHG which I used to see if there are any changes being made to the long text. When someone changes the lontext and tries to save it, it gives an error but still retains the changed longtext. The code works fine with all other changes(I mean it gives an error when they try to change anything in IW32 and will not retain the changes). But this does not happen in the case of long text. It gives an error but still has the changed long text as part of the order.

Any suggestions on how to proceeed? I am using instance Before_Update in this BADI.

Thanks

Kumar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,213

Do u mean after giving the Error message, even if u come out without saving it is keeping the changes?

If the answer to the above question is no then try the following procedure:

Read the long text using READ_TEXT (function module) by passing the TDID, TDOBJECT, TDSPRAS, TDNAME (u can get these details by going through the menu edit-> go to header).

Store that in an internal table and then append all the lines of this internal table into a string Variable and assign this variable's text to the field in which long text is being displayed.

This should work bcoz , in the database only the original Long text is stored and we are retrieving it and displaying back in the relevant field.

Please reply if it works.....

4 REPLIES 4
Read only

Former Member
0 Likes
1,214

Do u mean after giving the Error message, even if u come out without saving it is keeping the changes?

If the answer to the above question is no then try the following procedure:

Read the long text using READ_TEXT (function module) by passing the TDID, TDOBJECT, TDSPRAS, TDNAME (u can get these details by going through the menu edit-> go to header).

Store that in an internal table and then append all the lines of this internal table into a string Variable and assign this variable's text to the field in which long text is being displayed.

This should work bcoz , in the database only the original Long text is stored and we are retrieving it and displaying back in the relevant field.

Please reply if it works.....

Read only

0 Likes
1,213

Harshu,

It is retaining the text even after giving the error message and getting out of the transaction. Thats the whole problem.

Kumar.

Read only

0 Likes
1,213

Also the order retains long text only if it has long text before. I mean if there is no long text for a particular operation it gives me an error and will not retain the new long text. But if the operation already has old long text, it retains it.

Kumar.

Read only

0 Likes
1,213

Any ideas anyone?