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

general

Former Member
0 Likes
661

Hi,

I have dec a variable and incr its value in loop then prn it.

data: no type i.

loop at itab.

no = no +1.

call fn write_form.

endloop.

here am getting the number 1 twice.

1

1

2

3

4

and so on.

How to ignore the first number from printing.

Regards,

Siri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
633

hi Siri,

If you change your table type, the problem will get solved.

data: T_TEMP type table of ......

currently you are using an internal table with header line; I guess, Somewhere in

your code, you are calling WRITE_FORM before the loop statement, and it is

printing the record in the header line (though the body part of the internal table

is looped, the header will contain the data if you have not cleared the header

using <b>clear t_temp</b> statement).

alternatively, you can use CLEAR T_TEMP statement to clear the header,

after the internal table is manipulated in the code.

Hope this helps,

Sajan Joseph.

5 REPLIES 5
Read only

Former Member
0 Likes
633

what is the code inside the WRITE_FORM.

just check that.

Thanks & Regards

Santhosh

Read only

Former Member
0 Likes
633

problem in you subroutine. can u send that

Read only

Former Member
0 Likes
633

Hi,

Unable to conclude from the peice of code which you have sent can you send your code so that it would be helpful.

Regards,

Varun.

Read only

0 Likes
633

> Hi,

>

> Unable to conclude from the peice of code which you

> have sent can you send your code so that it would be

> helpful.

>

> Regards,

>

> Varun.

THIS IS MY CODE AND BELOW OUTPUT

LOOP AT T_EMP.

W_SNO = W_SNO + 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

1 00003 09.09.19890 4345

1 00003 09.09.19890 4345

2 0004 8.09.98 3423

3 00005 8.08.98 234234

Regards,

Siri

Read only

Former Member
0 Likes
634

hi Siri,

If you change your table type, the problem will get solved.

data: T_TEMP type table of ......

currently you are using an internal table with header line; I guess, Somewhere in

your code, you are calling WRITE_FORM before the loop statement, and it is

printing the record in the header line (though the body part of the internal table

is looped, the header will contain the data if you have not cleared the header

using <b>clear t_temp</b> statement).

alternatively, you can use CLEAR T_TEMP statement to clear the header,

after the internal table is manipulated in the code.

Hope this helps,

Sajan Joseph.