on 06-04-2010 9:30 AM
I programed a simple driver program for a form to show the item info a Sales order, but on the output of the form, only the last item's information will be printed for line count's time. Who knows the reason?
SELECT *
INTO TABLE it_VBAP
FROM VBAP
WHERE VBELN = I_VBELN.
CLEAR VBAP.
FILL ITCPO
CLEAR itcpo.
itcpo-tdpageslct = space. "all pages
itcpo-tdnewid = 'X'. "create new spool dataset
itcpo-tdcopies = 1. "one copy
itcpo-tddest = NAST-LDEST. "name of printer
itcpo-tdpreview = space. "no preview
itcpo-tdcover = space. "no cover page
itcpo-tddataset = p_tddataset. "dataset name
itcpo-tdsuffix1 = NAST-LDEST. "name or printer
itcpo-tdsuffix2 = par_vari. "name of report variant
itcpo-tdimmed = ''. "print immediately?
itcpo-tddelete = space. "do not delete after print
itcpo-tdtitle = t042z-text1. "title of pop-up-window
itcpo-tdcovtitle = t042z-text1. "title of print-cover
itcpo-tdautority = ''. "print authority
itcpo-tdarmod = ''. "print only
CALL FUNCTION 'OPEN_FORM'
EXPORTING
archive_index = toa_dara
archive_params = arc_params
form = 'ZTEST'
device = 'PRINTER'
language = NAST-SPRAS
OPTIONS = itcpo
dialog = 'X'
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
OTHERS = 8.
IF sy-subrc EQ 1. "abend:
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'ZTEST2'
EXCEPTIONS
window = 1
element = 2.
loop at it_vbap into VBAP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = '525'
FUNCTION = 'APPEND'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
window = 1
element = 2.
endloop.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
OTHERS = 1.
I'd try putting a breakpoint inside the "loop at it_vbap into VBAP" to see that VBAP is being populated correctly.
How did you define VBAP in the program? It should be a line, not a table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm not entirely sure what you mean by "only the last item's information will be printed for line count's time" but if you mean it's printing the same information multiple times I'd look at the SAPScript element 525 and make sure you're using VBAP and not IT_VBAP.
Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
did u debug the program & checked how many records u get in it_vbap ?
chk wat the height of the main window, if less increase
Edited by: Madhukar Shetty on Jun 4, 2010 2:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is only a test program.
there is nothing but the following in the main window.
/E 525
T1 &VBAP-POSNR&,,&VBAP-MATNR&
I've debuged the driver proram, there are for records, it supposed to print like:
000010 ISU_TEST
000020 ISU_FLOWER
000030 ISU_TEST
000040 ISU_FLOWER
But now, it always print like:
000040 ISU_FLOWER
000040 ISU_FLOWER
000040 ISU_FLOWER
000040 ISU_FLOWER
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.