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

Block the abap instruction : write

Former Member
0 Likes
2,048

Hi,

Is it possible to block the abap instruction : write.

Example :

write 'My name is Marc Frenay'.

if xxx = 1.

set log off (this is a example)

else.

set log on (this is a example)

endif.

I need an other instruction that set log on/off.

Thanks

Hi,

Is it possible to block the abap instruction : write.

Example :

write 'My name is Marc Frenay'.

if xxx = 1.

set log off (this is a example)

else.

set log on (this is a example)

endif.

I need an other instruction that set log on/off.

Thanks

16 REPLIES 16
Read only

former_member194669
Active Contributor
0 Likes
1,935

Your questions not clear. Pl. give more specific

Read only

0 Likes
1,935

You know that when you but a 'write' a line is displayed in the ouput. ok?

I want nothing in my output whithout erase the "write" instruction.

Is it clear?

Thanks

Read only

0 Likes
1,935

Try


END-OF-SELECTION.
  LEAVE LIST-PROCESSING.

Regards

Markus

Edited by: Markus Stange on Nov 25, 2009 9:38 AM

Read only

Former Member
0 Likes
1,935

Hi Marc,

your question is not quite clear. What do you realy want to do?

What kind of log do you mean?

Regards

Markus

Read only

Former Member
0 Likes
1,935

Hi Marc,

Could you explaing with respect to the functionality probabaly with a piece of code what is the output you want?

For writing to the spool execute the program in background or pass it to an FM that writes in spool.

Regards,

Anand.

Read only

0 Likes
1,935

Sorry my english is not perfect but i already put a piece of code.

All i need if is exists is a instruction whitch remplace my fake instruction set log for the "write" does nothing.

Sorry but i can't be more clear.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,934

Hello,

Is this what you are looking for:

DATA:
v_log TYPE flag.

if xxx = 1.
CLEAR v_log .
else.
v_log = 'X'.
endif.

IF v_log = 'X'.
write 'My name is Marc Frenay'.
ENDIF.

or

IF xxx NE 1.
write 'My name is Marc Frenay'.
ENDIF.

BR,

Suhas

Read only

Former Member
0 Likes
1,934

It's a good solution but i have a lot of "write" and i posted this thread to avoid put a test in front of each "write"

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,934

Hello Marc,

I am confused like others are. What exactly do you want to achieve?

May be you can try this way:

IF xxx = 1.
LEAVE LIST-PROCESSING.
ENDIF.

BR,

Suhas

Read only

Former Member
0 Likes
1,934

Hello Marc,

What I understood from the discussions and the comments above is you do not wish to erase the write statements and at the same time you do not want to have the statements that get written in the output using the WRITE statement.

If I have understood the requirement correctly then probably you can simply comment all the WRITE statements that are used.

Example :

if the write statement you are using is

WRITE  'My name is Marc Frenay'.

Then you can comment it by simply putting a '*' at the begining.

* WRITE 'My name is Marc Frenay'.

Try this. You will not have to erase the write statements and also the output of the write statement will not appear in the output.

Regards,

Bhanu

Read only

0 Likes
1,934

it's exactly this but for me put on commentary or erase the instruction is the same but you have understood my problem

Read only

0 Likes
1,934

Then you may have to clone the program and comment.

Read only

0 Likes
1,934

new-page print on no dialog .

write : / 'text'.

new-page print off

Just put new-page print on in the beginning of ur code , and page off at the end . Itwill send output to spool . Get spool number and using FM delete that spool.

But why bother doing all this . some1 has alread suggested to use Leave list processing after end-of-selection. did you try that?

Read only

0 Likes
1,934

Thanks Rajesh!

I'm getting a little bit confused of this thread...

Regards

Markus

Read only

matt
Active Contributor
0 Likes
1,934

>

> But why bother doing all this . some1 has alread suggested to use Leave list processing after end-of-selection. did you try that?

I'd imagine the code he's working on hasn't separated out data selection/processing from data display. You know:

WRITE: / 'This is my header'.
SELECT ...
  WRITE: / 'Some more data'...
ENDSELECT

Read only

0 Likes
1,934

I put a test in front of each "write" its was the simplest solution in a court term

Thanks for your help.