Skip to Content

Add long-text in BOM item screen exit.(tcode - CS01,CS02,CS03,CS61 etc.)

May 17, 2017 at 01:35 PM


avatar image
Former Member

My requirement is to add certain custom fields at BOM item level, along with long text.

i have managed to add custom fields(by extending STPO) but stuck on long-text addition.

i am using FM- TEXT_FOR_OPERAION by mimicking the standard long text available in tab 'Status/Lng Text' . I understand the logic of passing old and new keys to said FM in case of edit and display mode. my problem is in create mode i am making long text key by combining (STLTY + STLNR + IDENT) but in insert mode we do not have IDENT available in screen exit. IDENT is only available after we save the transaction.

SAP in this case is using a logic that creates long-text in edit mode with some dummy key (like textname = PO 1) and later while saving it renames the long-text name to key combination (STLTY + STLNR + IDENT).

I am thinking of appending structure STPOB to get one more field so that i can save dummy key and map it with actual key (STLTY + STLNR + IDENT) while saving.

Has anyone used such approch?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raymond Giuseppi
May 17, 2017 at 02:07 PM

Perform some debug or any search, to identify where the standard transaction perform some code like PERFORM TEXT_UPDATExxx ON COMMIT, which will execute some call of RENAME_TEXT (*) followed by COMMIT_TEXT. Once found, find some enhancement to add your own texts in the same logic.

(*) you can try break-point on those FM, also active update debug

10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 17, 2017 at 03:30 PM

Hi Raymond,

Thanks for quick reply,

i have done initial analysis on this topic and as you mentioned i had kept my break-point in 'SAVE_TEXT' as system has to save text when renaming. and i got the include LCSBTF54 where system loops on every component at BOM item level and here it checks structure STPOB

to decide if standard long-text exist at particular item.

Here as we are dealing with item level so there is possibility that multiple items may have been inserted /changed with long text. SAP is making use of field STPOB-LTXSP to associate particular line item with dummy long text key (concatenate 'PO' with STPOB-LTXSP to get dummy key) and then replaces it with (STLTY + STLNR + IDENT) when IDENT is available.

My problem here is that i can not alter STPOB-LTXSP to distinguish custom long-text dummy key (as it will affect standard text processing).

I need suggestion that if I append custom field to STPOB structure to store 'counter' for my custom long text dummy key, is it acceptable?

10 |10000 characters needed characters left characters exceeded