cancel
Showing results for 
Search instead for 
Did you mean: 

Text Copy from Sales Order Header to Item

Former Member
0 Kudos

Hello Experts

Is there a way to copy a text that is manually entered in the Sales Oder header to be copied to a corresponding text-ID in all line items. We have a specific business reqmt in our project that requires this functionality. The issue is that the no of items is usually high and hence, automation is required. I did consult a few blogs where a solution to this requirement was discussed; however, it didn't work for me when I did the same settings in the system. For one, VBBK refers to the previous document. In our case, the reference document is the current doc (this can be in create or change mode).

All changes done in the SO text must also be reflected in the item texts.

Any ideas through configuration or through exits is welcome.

Thanks

Arijit

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor
0 Kudos

I kind of doubt configuration will copy header text to all the items in the same document but hey, what do I know - I'm just an ABAPer.

We have a user exit that does something similar. The routine is called in USEREXIT_SAVE_DOCUMENT. The important part is that it's called using ...ON COMMIT. I suspect this was chosen because the texts need to be updated already by that time (this was developed by a consultant long time ago). Then further down in the routine the regular text functions (READ_TEXT, SAVE_TEXT, etc.) are called.

You'll need to also think about a scenario when users (hypothetically) enter some text in the line items manually. This will need to be handled somehow.

Another option would be instead of copying text (this is not good for your database, by the way) read the text when creating subsequent documents and add it at that time. Or, even better, if this is just needed for some form then just add some code there and read the text directly from the order header or wherever and avoid this whole hassle altogether. Many choices here.

Former Member
0 Kudos

Hi

This should work with just configuration in VOTXN. An SO header text type (eg: Z001), and an SO item text type (eg: Z002, but both can also be Z001 if you wish). In the config for Z002, specify a new access sequence that uses Object VBBK and Text ID Z001 as the references.

Then, assuming the right Text Procedure is being called, when you add text to the SO header text Z001 it is automatically copied to the SO items under text Z002. Works in create and change mode for both existing and new items. No need for ABAP.

Not sure what you mean by your statement that "VBBK refers to the previous document". In the context of Text management, it is simply the SO Header Text object, and is exactly where you want to copy from, if the text is to appear in SO line items, for object VBBP.

Regards

Former Member
0 Kudos

Hello

I did try this approach but it doesn't seem to work. By "previous document", I meant the preceding document during sales document copy. I observed that this setup works only if there is a document copy scenario and the preceding document has the header text, not the current document.

Regards

Arijit

jobis
Contributor
0 Kudos

Hi Arijit,

The suggestion given by Richard should work for this requirement.

Can you paste the screenshot of your configurations.

THanks

Jobi

Former Member
0 Kudos

Hello Jobi

I did all the relevant settings. I observed that the text comes into the item level during creation of the SO (when I physically navigate to the item text, I see it's there), but disappears when I save the order. Thereafter the item text is blank and further changes to the SO header text also do not flow into the items anymore.

Regards

Arijit

0 Kudos

Hi Arijit,

Can you explain what you are trying to do with having all these texts copied into the item?

If it is the same text and you want to copy them over to all the item for the purpose of printing on an output or transmitting over as an XML (or something else) then I would recommend that you write a simple custom logic to fetch this information for each line from the header text object. Example, create a custom text object ZTXT and add it to the header text procedure in T-Code  VOTXN. Then you can write a logic inside your program to read this text object for every line in the sales order.

The reason I suggest this is to avoid replication of the same data on your tables. Think about how many table entries and text data will be stored over a period of time for all the sales orders and the line items that will be created.. And more over, if you change the header, you might also want to keep the item data consistent. And for this reason, it is always better to reference the source.

Regards,

Navin

Former Member
0 Kudos

Hello Navin,

Thanks for the input. We're doing an SO => PR -=> PO text copy at item level (third-party scenario). The number of items is huge and hence the need for automation. The user will enter the text only at the header and it will percolate to the items. Standard SAP does the rest of the copy to PR and PO.

I did try looking for enhancement but was unable to find a suitable spot. Any ideas?

The other option would be to take the SO header text and pump it into the PR item text. bUT, delta changes also need to be reflected into the PR => PO.

Regards

Arijit