2015 Aug 05 9:00 PM
Hi Folks,
There is a standard text like below :
APP :Line 1
Line 2
-----
REJ :Line 3
Line 4
-----
APP :Line 5
Line 6
-----
The requirement is to send just the REJ part of this text in an email and not include the APP part. So, I need to break the text on the basis of line '-----' as I am not seeing any other way to do this.
After that, I will be deleting those parts where first line start from APP and will keep those where first line start from REJ.
Am not sure if it is feasible to do but any guidance is really appreciated.
Thanks,
Richa
Hi Folks,
There is a standard text like below :
APP :Line 1
Line 2
-----
REJ :Line 3
Line 4
-----
APP :Line 5
Line 6
-----
The requirement is to send just the REJ part of this text in an email and not include the APP part. So, I need to break the text on the basis of line '-----' as I am not seeing any other way to do this.
After that, I will be deleting those parts where first line start from APP and will keep those where first line start from REJ.
Am not sure if it is feasible to do but any guidance is really appreciated.
Thanks,
Richa
2015 Aug 05 10:01 PM
Instead of using ---- as separator, I would suggest to define each of these sections as text elements using tag /E and then you can use simple loop to get the sections.
Thanks,
Juwin
2015 Aug 05 10:53 PM
Hi Juwin,
Thanks for your reply.
This text gets updated in the header text of PO from FIORI app and I need to use the same to send an email from workflow.
So, I did not get it when you said that we can use text elements. Could you please elaborate this.
Regards,
Richa
2015 Aug 06 1:40 PM
Hi Richa,
When you define the standard text, you can use /E identifier, to define text elements. Text elements are sections of the text. And you can easily use /E identifier and the text element name to split the text into different sections.
In the case below, there are 2 text elements - APPROVAL and REJECTION
Thanks,
Juwin
2015 Aug 07 12:54 AM
Hi Juwin,
I got that but as mentioned in my another reply to Anudeep as well, in my case it's not me who is creating the standard text. The standard text on purchase order header is getting updated from FIORI. So, I cannot change anything in the header text.
Regards,
Richa
2015 Aug 07 12:29 PM
Hi Richa, But, shouldn't the Fiori developer be able to make adjustments on their side to make the text as per your requirement?
Thanks
2015 Aug 07 1:59 PM
Hi Richa,
The reason why I am asking to use text elements is because, if the text which is being typed in itself has a '-----' in between, then your logic to split at '-----' will not work properly.
Thanks,
Juwin
2021 Oct 26 1:03 PM
Dear Juwin Pallipat Thomas
I have just seen your comment - and it might help in a similar issue I'm having...
So, if I have understood you fine, the steps to be performed would be:
1.- Define TEXT ELEMENTS IN THE STANDARD TEXT such like:
/E CONDITION1_IN_ENGLISH
IF &VBAK-VTWEG& = '12'
IF &NAST-SPRAS& EQ 'E'
TEXT TO BE PRINTED IN ENGLISH
ELSE
/E CONDITION1_IN_GERMAN
TEXT TO BE PRINTED IN GERMAN
ENDIF
/E CONDITION2_IN_ENGLISH
ELSEIF &VBAK-VTWEG& = '01' OR &VBAK-VTWEG& = '09' OR &VBAK-VTWEG& = '15'
IF &NAST-SPRAS& EQ 'E'
TEXT TO BE PRINTED IN ENGLISH
ELSE
/E CONDITION2_IN_GERMAN
TEXT TO BE PRINTED IN GERMAN
ENDIF2.- Define 2 internal tables ENGLISH_TEXT and GERMAN_TEXT containing the text for each language.
3.- Call Function Module READ_TABLE and store it on a TEXT_TABLE
4.- For English: Loop at TEXT_TABLE where TDFORMAT = "/E" and TDLINE = "CONDITION1_IN_ENGLISH"
Loop at TEXT_TABLE where TDFORMAT = "/E" and TDLINE = "CONDITION2_IN_ENGLISH"
Append ENGLISH_TEXT
5.- For German: Loop at TEXT_TABLE where TDFORMAT = "/E" and TDLINE = "CONDITION1_IN_GERMAN"
2015 Aug 05 11:02 PM
Hi Richa,
Create two internal tables one for Approve and other for Reject and move all approved data approved similarly rejected as well, then send. Can you please explain clearly.
2015 Aug 05 11:07 PM
Hi Anudeep,
To put data into internal tables, I will need to split this header text which is standard header text of PO. And that is what I need to know that what is the best practise to do that.
To be more clear :
-> There is a standard header text of purchase order in which rejection/approval comments get updated from FIORI.
-> We need to send an email containing rejection comments and not approval comments but problem is both these comments get updated in the same header text of PO.
->So, again question comes how to segregate the approval and rejection comments from standard text.
Regards,
Richa
2015 Aug 07 1:30 PM
Hi Richa,
So your question is how can you read the PO Header text? Right?
Not sure if this as simple but did you explore the option of FM READ_TEXT? This is the only option available in ABAP to read text like this. Then you can manipulate the data in LINES internal table and break based on your logic that you have already explained.
R
2015 Aug 07 3:42 PM
Hi Richa,
If you are sure that the PO header text would ALWAYS be updated as below, then you can use READ_TEXT.
Output from READ_TEXT would look like:
Now IF the REJ code ALWAYS appears at line#3 and line#4, you can read the internal table at line#4 and line#5 and get the required data.
Please let me know if this helps.
~Deepika
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |