‎2005 Oct 28 11:55 PM
Hi
I have a Z program working fine, it is a SAPM07DR copy and i aggregated some fields to WASCHEIN form.
But i see when the program (standard or copy) calls the write form, the field values in program have other values (just the previous values) than the values wich appears in the printed form.
For example:
WASCHEIN KOPF Window has the WERKS value:
Plant: &*T001W-WERKS&
But when the write form is called
CALL FUNCTION 'WRITE_FORM'
EXPORTING ELEMENT = 'KOPF'
WINDOW = 'KOPF'.
In the program the *T001W-WERKS field has a different value that the value wich appears in the spool, debugging i see that the field has the prevoius value in the program:
Program
*T001W-WERKS
(when Write Form).............Spool
-
.................----
' '...................................Plant: 0900
'0900'.............................Plant: 0901
I had to do the same logic in my new aggregated fields, but i realy don't know why does the program works in this way.
Why the print program and sapscript function works in this way ?
How does WRITE-FORM works, that is where the function take from the values to print ?
Thanks
Frank
‎2005 Oct 31 4:42 PM
Does nobody can help me to solve my doubt, please ?
Thanks
Frank
‎2005 Oct 31 4:42 PM
Does nobody can help me to solve my doubt, please ?
Thanks
Frank
‎2005 Oct 31 4:58 PM
Hi
It generally depends on when the fm WRITE_FORM is called:
*T001W-WERS = '9000'.
CALL FUNCTION 'WRITE_FORM'
....
*T001W-WERS = '9001'.
CALL FUNCTION 'WRITE_FORM'
....
Here the sapscript should print 9000 and after 9001.
Max
‎2005 Oct 31 5:52 PM
Hi Max
I hope the program works like you said, but it works:
old_werks = ' '
T001W-WERKS = '0900'.
*T001W-WERKS = T001W-WERKS .
*T001W-WERKS = old_werks. <-- ' '
CALL FUNCTION 'WRITE_FORM'
(form KOPF with *T001W-WERKS)
....
old_werks = '0900'
T001W-WERKS = '0901'.
*T001W-WERKS = T001W-WERKS .
*T001W-WERKS = old_werks. <-- '0900'
CALL FUNCTION 'WRITE_FORM'
(form with *T001W-WERKS)
But the FM prints 0900 and after 0901, when the *T001W-WERKS values were ' ' and '0900' !!!
(and with the *T001W-NAME1 field occurs in the same way)
Why does the FM prints that values ??
Thanks
Frank