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

Append Text during an Order Copy

Former Member
0 Likes
1,498

Hi all,

What is the best way to append a line of text to an existing text when doing an order copy?

Here is the scenario: Say we have an existing order and there is a customized text type that contains text. We would like to copy this order but also append the date to the text. We've explored numerous options but working with texts and new orders has proven difficult. Any ideas?

Thanks!

1 ACCEPTED SOLUTION
Read only

venkata_ramisetti
Active Contributor
0 Likes
1,448

Hi,

1. Just copy the order and it will also automatically copies the order.

2. Now read the texts using READ_TEXT function module. It returns a table with texts

3. Add your texts to the above internal table and then use SAVE_TEXT MODULE to pas the updated texts internal table.

Thanks,

Ramakrishna

Hi all,

What is the best way to append a line of text to an existing text when doing an order copy?

Here is the scenario: Say we have an existing order and there is a customized text type that contains text. We would like to copy this order but also append the date to the text. We've explored numerous options but working with texts and new orders has proven difficult. Any ideas?

Thanks!

10 REPLIES 10
Read only

Former Member
0 Likes
1,448

Perhaps a more detailed example would be more helpful:

We have order 1, with a custom header text type called "Details". In it we have text "Sample".

Now when we do a copy order 2, we would like everything of the order to be the same. Except now in the "Details" text type, we have "Sample, Last Changed: 10/27/2006" or whatever the date is.

Now we would like to copy order 2 to copy 3. We would like everything in copy 2 to copy over but now in "Details" text, we have "Sample, Last Changed: 10/27/2006, Last Changed: 11/01/2006". Every subsequent document should have an appended date.

Thanks in advance!

Read only

venkata_ramisetti
Active Contributor
0 Likes
1,449

Hi,

1. Just copy the order and it will also automatically copies the order.

2. Now read the texts using READ_TEXT function module. It returns a table with texts

3. Add your texts to the above internal table and then use SAVE_TEXT MODULE to pas the updated texts internal table.

Thanks,

Ramakrishna

Read only

0 Likes
1,448

Thanks, Ramakrishna.

This is what we planned to do but how can we do this automatically?

Using the first example, if we copy order 1 using a copy routine for order 2, how do we initiate the SAVE_TEXT when order 2 has not yet been created?

For example, if we use VA41 to copy order 1 to a new order, how can we have everything copied but also append a line to the text?

Thanks!

Read only

0 Likes
1,448

Hi John,

How you are copying one order to another order? I mean are you doing this manually or through program?

1. If you are doing manually, then you have to write user-exit to update the texts. In this case, you should not use SAVE_TEXT function module. You have to update the exists texts internal table.

Please give the transaction name and what type of texts you want to update?

2. If you are doing programmatically, them just commit the copied order, the use READ_TEXT & SAVE_TEXT function modules to update texts later.

Thanks,

Ramakrishna

Read only

0 Likes
1,448

We are using transaction VA41 and have set up a contract type that copies an existing contract. What is the internal table for texts?

Read only

0 Likes
1,448

Hi,

Can you tell me what Text, you want to update? I mean is it header text or item text?

YOu need to write code in the user-exit to get the saved text using READ_TEX. This function module returns an internal table with texts. Now you have to update the internal table with your texts. Then finally you have to call SAVE_TEXT function module.

If that doesn't work, then you have to read data from the stack and need to save it.

THanks

Ramakrishna

Read only

0 Likes
1,448

We have a custom header text for a contract with an ID of ZDET for details. I know how to use the READ_TEXT fm but that is for an existing contract. How do I use SAVE_TEXT for a new contract that hasn't been created yet? I previously tried this approach but couldn't get it to work.

We want contract 1 to be copied. Using VA41, we create a copy of the contract. VA41 will open up the new contract and copy all of the data we need but we want to automatically append a new line to the already existing header text ZDET. Then we save the new contract.

Read only

0 Likes
1,448

Does anyone have a possible solution to this? Any help would be greatly appreciated. Again, the scenario is as follows:

We have created a contract that we would like copied to another contract. However, either during the copy transfer routine or when the new contract is saved, we would like to append a time stamp to whatever might already be in the contract header level texts.

This needs to be done automatically and as far as I can tell, we cannot use the SAVE_TEXT fm on a contract that does not yet exist.

Read only

0 Likes
1,448

Hi John

Just a thought, Please check if this can help you.

Text determination procedure is assigned to order type for header texts. This can be checked via table TVAK. Field: TXTGR. For Items this will be at Item Categories. We can check the same from table TVAP.

1. Now after extracting the text determination procedure. Use transaction VOTXN.

2. Select option Sales Document Header and click on change from application toolbar.

3. Select the Procedure which is assigned to the order type.

4. Now Double click on Text Id's in Text Procedure. This will give the list of Text Id's available in the procedure. Check the access sequence Number assigned for the Text-Id.

5. Double click on access sequence.

6. Select the access sequence and double click on access sequences for Text Id's.

7. In the screen displayed on the right side, if we scroll to the right we can find a column for adding custom routine. Column name "Requirement".

Maybe adding the custome code here can help to suit your requirement. Please explore on the same and let us know if this works.

Kind Regards

Eswar

Read only

Former Member
0 Likes
1,448

Thanks for all the help. I was unable to implement the suggestions but the requirement to provide this was removed so development wasn't needed.