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

SAP SCRIPT - Repearting values

Former Member
0 Likes
1,175

Hello,

I have a problem when I run my sapscrip, this repeating the values from the text elemets, pleas see image below.

Do u know why?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,142

Hi Luis,

Please activate the debugger in SE71 and debug to see why it is repeating. Maybe you would have called WRITE_FORM twice or something. Please see and revert.

BR.

7 REPLIES 7
Read only

Former Member
0 Likes
1,143

Hi Luis,

Please activate the debugger in SE71 and debug to see why it is repeating. Maybe you would have called WRITE_FORM twice or something. Please see and revert.

BR.

Read only

former_member209120
Active Contributor
0 Likes
1,142

Hi,

Maintain Text Element in main window

/E  TE

call function 'WRITE_FORM'

        exporting

  ELEMENT                        =  ' TE'

*   FUNCTION                       = 'SET'

*   TYPE                           = 'BODY'

          window                         = 'MAIN'

* IMPORTING

*   PENDING_LINES                  =

* 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.

or

clear work area.

Read only

arindam_m
Active Contributor
0 Likes
1,142

Hi,

May be not clearing the variables that are passed to these text elements after they are written into the script.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,142

Hi,

Please check the item internal program values from where it is filling in driver program if it is correct please check WRITE_FORM is called for 2 times,In script please check printing values variables used for two times? These all are the possible reasons.

Regards,

Ravi Shankar L

Read only

Former Member
0 Likes
1,142

clear that variable

Read only

former_member209120
Active Contributor
0 Likes
1,142

As per Ravi check are you written write_Form two time.

call function 'WRITE_FORM'

        exporting

  ELEMENT                        =  ' TE'

*   FUNCTION                       = 'SET'

*   TYPE                           = 'BODY'

          window                         = 'MAIN'

* IMPORTING

*   PENDING_LINES                  =

* 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.

call function 'WRITE_FORM'

        exporting

  ELEMENT                        =  ' TE'

*   FUNCTION                       = 'SET'

*   TYPE                           = 'BODY'

          window                         = 'MAIN'

* IMPORTING

*   PENDING_LINES                  =

* 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.

Read only

Former Member
0 Likes
1,142

Hi,

Check your Loop internal table.. it may contain duplicate records..

Regards

Tejas