2020 Feb 05 10:15 AM
looking for a way to parse an ABAP program code to remove unnecessary new lines or spaces
looking for a way to parse an ABAP program code to remove unnecessary new lines or spaces
2020 Feb 05 10:35 AM
Is the question about reading and updating ABAP "source code units" (whatever is to be changed), or, if you know how to read and update, about a standard algorithm to "remove unnecessary new lines or spaces"?
2020 Feb 05 10:45 AM
I have few custom program and function module from where i need to remove unnecessary new lines or spaces. if there is any program or standard algorithm, will work for me. Just need to remove unnecessary lines and space from my program
2020 Feb 05 4:36 PM
Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area. At the same time, the person will be informed of your comment (currently not).
2020 Feb 05 5:11 PM
>> Just need to remove unnecessary lines and space from my program
My above answer solves that problem!
>> I have few custom program and function module from where i need to remove unnecessary new lines or spaces.
What is a few? Ten or hundreds? If it is around 10, above solution should still work fine. If it is 100s, yeah, I see why you are trying to automate tidying it up 😉
>> if there is any program or standard algorithm, will work for me.
Program as in SAP program or functionality as in "Pretty Printer"? No, not that I know of.
Standard algorithm? What is that? Do you write standard or non-standard algorithms?
I am curious, why do you need this so bad? The editor doesnt mind a few lines and spaces and sometimes those couple extra lines can even make it more readable and the compiler doesnt get to see those at all 😉
2020 Feb 05 2:51 PM
You could first use the pretty printer (gets rid of spaces in empty lines and spaces after coding).
Then you copy and paste it to a text editor, search and replace " \n\r\n\r" with "\n\r". And then copy and paste it back to your SAP editor.
2020 Feb 05 5:18 PM
there is no standard way to it..You have to do manually.
If there is standard way then we don't need ABAP consultants to write the programs in first place 🙂
2020 May 13 12:34 PM
anuragkathal, please follow up on your open question.