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

Skip Specific Lines with Codes in a Program

Former Member
0 Likes
1,567

Hi,

I hope everyone is doing great today.

I have a program that requires to ignore or skip or just retain lines of codes that are commented out. Does anyone know the syntax to retain the codes.

Sample:

*Case 1: This is to change all c to mara (--->this is just a Comment)

Data: lv_matnr(18) type c.

The result should be that only the 'c' inside the Data Declaration will be changed. The syntax shouldn't change the 'c' in

*Case 1: This is to change all c to mara (--->this is just a Comment) .

Thanks.

3 REPLIES 3
Read only

GK817
Active Contributor
0 Likes
1,178

Hi,

Are you trying to do 'Find and replace' and there want to ignore some lines?

If yes, you can find 'Type c' and then replace with 'Type Matnr'. There are no rules that you can set in 'find and replace' to ignore commented lines.

Regards

GK

Read only

dev_parbutteea
Active Contributor
0 Likes
1,178

hi,

I do not understand what is your exact requirement. I am assuming that you are scanning codes of a program lines in another program. If you are storing all lines in a table, you just have to ignore lines starting with '*'.

Read only

Former Member
0 Likes
1,178

Hi,

Could you please rephrase your requirement,we're having trouble understanding it.

For retaining lines of code (if this is the requirement) but skipping them without commenting it I always use:

If 1 = 2.
<code>
endif. "if 1 = 2

Kind regards, Rob Dielemans