on 04-17-2018 1:38 PM
Hi All,
I have a requirement whereby I need to extract specific text/words within long text.
I have a PM Task List and within the header and operation there are specific instructions that the artisan needs to complete. However I only want certain sections/sentences to be printed i.e. there are sections that contain a NOTE, CAUTION and WARNING.. I only want those to print.. I was thinking of creating a custom paragraph format and assigning those instructions to the custom format and then trying to extract those.. This text will be printed on a job card for the artisan
As Hedvig mentions, you can achieve this with SAPScript Functions.
See FM "READ_MULTIPLE_TEXTS" (Cfr. SAP-KBA 2261311) that is able to use Ranges and Wildcards. I suggest you can test if you can use Wildcards OR get As much Content as you would possibly want, and then use A RegEx to search for Specific Words ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ameet,
I hope I understand your task.
1. Via help of function READ_TEXT you can get the text in an internal table. Here you can extract the specific text ( using custom paragraph format is a good idea).
2. If you use .g. Smartforms to display the job card you can use e.g. dynamic text type to display the text
or in case Sapscript you can modify your print program and call the textelement.
Best regards, Hedvig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for the feedback..
I have long text maintained in the header and operations of a PM task list and I need to display specific sentences/words/phrases on the job card at time of printing.
I have used READ_TEXT, I will have to explore the dynamic text option..
I am not sure if I should go the custom paragraph format route or find the text enclosed with special characters #NOTE#
#text under note xxxxxxxxx#
#xxxxxxxxxxxxxxxxxxxxxxx#
$CAUTION$
$text under caution$
$xxxxxxxxxxxxxxxxxxxxxxxx$
Hi Ameet,
You mentioned that maybe you can use the dynamic text type so I suppose you use Smartform:
1. You can create an Abap node on your smartform to call the READ_TEXT.
CALL FUNCTION 'READ_TEXT'
EXPORTING ID LANGUAGE
NAME OBJECT
...
TABLES LINES Type TLINE (TDFORMAT, TDLINE)
To find the object and ID: please go into the text editor and here via Goto - Header. Now you can see, which is the text object of the text. 2.
2.To find the text enclosed with special characters #NOTE# you have a lot of possibilty:
Searching using Abap command "FIND IN TABLE" or
running a LOOP and using "FIND" to search the individual rows LINES-TDLINE), ....
But your idea was also good via paragraph, which is stored in LINES-TDFORMAT.
3. Then you can create a text element with type dynamic text (means SAPscript texts that are saved in an internal table with the line type TLINE)
https://help.sap.com/doc/saphelp_ewm94/9.4/en-US/4a/a668944a3b007fe10000000a42189c/frameset.htm
Best regards,
Hedvig
If this has been resolved then kindly close the question (see this blog).
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.