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

Removing line breaks

0 Likes
2,833

Hi,

How do I remove all Line breaks from a String?

For e.g... <b>Source String:</b>

The synopsis creation is done when the user clicks the ‘Synopsis’ button or when a document is, saved, approved or released. Any one of these actions creates an object of the corresponding Synopsis Class (e.g. /SAPPSSRM/CL_SYNOPSIS_CTR) and calls the methods checkStatusForSynopsis and maptoSynopsisStructures. The method checkSynopsisStatus checks whether the BO is active or not, whether the synopsis is sent or not and what is the status of the document for which the synopsis need to be sent.

The method maptoSynopsisStructures calls the function modules /SAPPSSRM/MAP_CTR _TO SYNOPSIS (for contract) or /SAPPSSRM/MAPPO _TO SYNOPSIS (for PO) or /SAPPSSRM/MAPBINV _TO SYNOPSIS (for Bid Invitation) which maps the fields of the document to the corresponding Synopsis (e.g. /SAPPSSRM/SFBSOLICIT_DETAILS) structure. After this the method createSynopsisData is called and in the method a function module SDIXML_DATA_TO_DOM is called to convert the document to XML document. Then the function module for sending the e-mail 'SO_NEW_DOCUMENT_ATT_SEND_API1' is called to send the document (if the data is send by e-mail). The pre-requisite is that the internet mail gateway of SAP is set in the SRM system.

<b>THEN RESULT STRING SHOULD BE:</b>

The synopsis creation is done when the user clicks the ‘Synopsis’ button or when a document is, saved, approved or released. Any one of these actions creates an object of the corresponding Synopsis Class (e.g. /SAPPSSRM/CL_SYNOPSIS_CTR) and calls the methods checkStatusForSynopsis and maptoSynopsisStructures. The method checkSynopsisStatus checks whether the BO is active or not, whether the synopsis is sent or not and what is the status of the document for which the synopsis need to be sent. The method maptoSynopsisStructures calls the function modules /SAPPSSRM/MAP_CTR _TO SYNOPSIS (for contract) or /SAPPSSRM/MAPPO _TO SYNOPSIS (for PO) or /SAPPSSRM/MAPBINV _TO SYNOPSIS (for Bid Invitation) which maps the fields of the document to the corresponding Synopsis (e.g. /SAPPSSRM/SFBSOLICIT_DETAILS) structure. After this the method createSynopsisData is called and in the method a function module SDIXML_DATA_TO_DOM is called to convert the document to XML document. Then the function module for sending the e-mail 'SO_NEW_DOCUMENT_ATT_SEND_API1' is called to send the document (if the data is send by e-mail). The pre-requisite is that the internet mail gateway of SAP is set in the SRM system.

1 ACCEPTED SOLUTION
Read only

Sougata
Active Contributor
0 Likes
2,105

The source string you've posted is same as result string as displayed on this web page of SDN. What exactly you mean? I could not see any difference between source and target strings!

Regards,

Sougata.

The source string you've posted is same as result string as displayed on this web page of SDN. What exactly you mean? I could not see any difference between source and target strings!

Regards,

Sougata.

5 REPLIES 5
Read only

Former Member
0 Likes
2,105

Hi Jeba

Try using the FM "<b>BM_LINE_BREAK".</b>

reward points if useful.

Thanks & regards

Ravish Garg

Read only

Sougata
Active Contributor
0 Likes
2,106

The source string you've posted is same as result string as displayed on this web page of SDN. What exactly you mean? I could not see any difference between source and target strings!

Regards,

Sougata.

Read only

0 Likes
2,105

Hi Sougata,

I guess the line breaks got deleted from the Source string:

The synopsis creation is done when the user clicks the ‘Synopsis’ button or when a document is, saved, approved or released. Any one of these actions creates an object of the corresponding Synopsis Class (e.g. /SAPPSSRM/CL_SYNOPSIS_CTR) and calls the methods checkStatusForSynopsis and maptoSynopsisStructures. The method checkSynopsisStatus checks whether the BO is active or not, whether the synopsis is sent or not and what is the status of the document for which the synopsis need to be sent.

The method maptoSynopsisStructures calls the function modules /SAPPSSRM/MAP_CTR _TO SYNOPSIS (for contract) or /SAPPSSRM/MAPPO _TO SYNOPSIS (for PO) or /SAPPSSRM/MAPBINV _TO SYNOPSIS (for Bid Invitation) which maps the fields of the document to the corresponding Synopsis (e.g. /SAPPSSRM/SFBSOLICIT_DETAILS) structure. After this the method createSynopsisData is called and in the method a function module SDIXML_DATA_TO_DOM is called to convert the document to XML document. Then the function module for sending the e-mail 'SO_NEW_DOCUMENT_ATT_SEND_API1' is called to send the document (if the data is send by e-mail). The pre-requisite is that the internet mail gateway of SAP is set in the SRM system.

Read only

athavanraja
Active Contributor
0 Likes
2,105

data: sorucestring type string .

replace all occurrences of cl_abap_char_utilities=>CR_LF in sourcestring with '' .

replace all occurrences of cl_abap_char_utilities=>NEWLINE in sourcestring with '' .

Raja

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
2,105

Hi,

Try using "condense" statement..

Cheers,

Smiha.