‎2006 Sep 05 5:30 AM
hai friends,
how to print multiple line item in SAPSCRIPT main window i am new in script
thanks & good regards
vallamuthu
‎2006 Sep 05 5:31 AM
Create your text element and call it from the print program in a loop.
Plz reward if its helpful
thnx
‎2006 Sep 05 5:33 AM
Loop through your internal table and use 'WRITE_FORM' to print the data. mention the window name and
'Text Element' to be used.
Example:
loop at itab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = line_item
window = main
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
IF sy-subrc <> 0.
PERFORM protocol_update.
ENDIF.
endloop.
‎2006 Sep 05 5:33 AM
within loop call write_Form by passing MAIN window to that.
and place all your fields(item level) in the MAIN window of that layout.
LOOP AT IT_ITEMS.
CALL FUNCTION 'WRITE_FORM'
EXPORTING..
WINDOW = 'MAIN' ..and so onn
ENDLOOP.
regards
srikanth
‎2006 Sep 05 5:40 AM
hi,
LOOP AT IT_VBAK.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DETAILS'
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.
endloop.
regards,
priya.
‎2006 Sep 05 5:42 AM
Hello,
1.In ur program Pass all the line items into internal table,example itab.So itab consists of different fields.
2.In ur form in the main window,place a text element and under that line item details.
Example:
/E Line_items
p1 itab-no,itab-matnr----
3.Now in ur print program.
loop at itab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = line_items
window = main
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
endloop.
Hope this helps.
Regards
‎2006 Sep 05 6:27 AM
I HAVE TWO INCLUDE PROGRM ie 1)YRFFORI01
2)YRFFORI09
IN WHICH INCLUDE PROGRAM I WRITE THE FUNCTION "WRITE_FORM"
TO GET A MULTIPLE LINE ITEM IN MAIN WINDOW