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

SAPScript(ABAP)

Former Member
0 Likes
768

Hi,

hope u r doing well .i have small doubt i.e i have 3 text messages in a internal table(in print program),i want to show all these messages in my form output ,but it is showing only last message .pls give ur suggestion with an example.i m waiting for ur reply....

thx in adv.

Regds,

Prabhas

5 REPLIES 5
Read only

Former Member
0 Likes
747

Hi,

Use the below Function module,

CALL FUNCTION 'WRITE_FORM_LINES'

EXPORTING HEADER = HEADER

TABLES LINES = LINES1

EXCEPTIONS UNSTARTED = 1

UNOPENED = 1

OTHERS = 9.

hope, it will solve your problem.

cheers.

santosh.

Read only

Former Member
0 Likes
747

HI,

i think in write_form function module.. for FUNCTION u have given DELETE.. give as SET...

<b>CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'UR TEXT MESSAGE'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

.</b>

hope this helps..

if not post ur code.. so we can check more

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
747

In your sapcript, put the lines of the internal table in the MAIN window and put them under an element.

/E   TEXT_LINES
PF   &iTextLines&

Now in your print program, loop the internal table and write each line one by one.




    loop at itextlines.
      call function 'WRITE_FORM'
           exporting
                element = 'TEXTLINES'
                window  = 'MAIN'.
    endloop.


Regards,

Rich Heilman

Read only

Former Member
0 Likes
747

Your printer program have to look like this


LOOP AT itab INTO wa.
  CALL FUNCTION 'WRITE_FORM'
    ELEMENT 'MESSAGE'
ENDLOOP.

And the SAPScript:

/E MESSAGE

ZZ wa-message

Regards

Tamá

Read only

0 Likes
747

Hi,

I am facing the same problem with internal table. All records are not getting printed on sapscript.Last record of internal table is getting printed.

I am using following code in print program

loop at t_bset1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = '252'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'SUB_TOTL'.

endloop.

W1 <B>VAT &t_bset1-wrbtr_pers(C)&%</>,,&t_bset1-fwste&

Please help me solve the problem.

Message was edited by:

Sid Kumar