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

Script issue with multiple lines printing

Former Member
0 Likes
637

Dear All,

I'm trying to print multiple lines of my internal table in a script.

But only the last line is being printed all the time in all the lines.

Attached is my code.

...

    CLEAR GS_REGUP.
    LOOP AT GT_REGUP INTO GS_REGUP.

* Start the Form
      CALL FUNCTION 'START_FORM'
        EXPORTING
          ARCHIVE_INDEX = TOA_DARA
          FORM          =  'ZFORM'                                    "T042E-ZFORN
          LANGUAGE      = SY-LANGU                          "T001-SPRAS
          STARTPAGE     = 'FIRST'
          PROGRAM       = 'ZPROG'.

* Net Amount
      CLEAR GV_NETWR.
      GV_NETWR = ( GS_REGUP-WRBTR - GS_REGUP-PSSKT ).

* Print the Content
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          ELEMENT  = '525'      "Header
          FUNCTION = 'APPEND'
          TYPE     = 'BODY'
          WINDOW   = 'MAIN'.

* End the Form
      CALL FUNCTION 'END_FORM'
        IMPORTING
          RESULT = ITCPP.
      IF ITCPP-TDPAGES EQ 0.       "Print via RDI
        ITCPP-TDPAGES = 1.
      ENDIF.

    ENDLOOP.

Please let me know the flaw in it.

Regards,

Deepu.K

3 REPLIES 3
Read only

Former Member
0 Likes
512

Call WRITE_FORM in loop only not START_FORM and END_FORM. << Point begging and 2 points removed >>

Edited by: Rob Burbank on Oct 21, 2011 11:17 AM

Read only

0 Likes
512

Hello Kumar,

It's a strange issue.

The same code did not work in Dev System.

But, it worked in Quality system.

Regards,

Deepu.K

Read only

Former Member
0 Likes
512

Dear All,

As i Mentioned in my earlier post, the same coding working fine in Quality server --> Printing multiple lines in script output.

But now, I have the same reqt. in another window.

So, I did the same coding.

But, this time it's printing the last line of the internal table in all the lines.

This is happening in Quality Server only.

The only difference between the previous internal table and this int. table is:

1. The first int. table content is printing in MAIN Window. ---> working fine

2. The second int. table content is printing in VARIABLE window. ---> NOT WORKING.

Can any one tell me what's the issue with this ?

Regards,

Deepu.K