on 2005 May 19 2:13 PM
hi all ,
Am getting syntax error for the code below. Am using
4.7 .its says "p0041-dar01" and "date" are type-incompatible.
however when i compile the same code in 4.6 its workin fine. here is the code..
&----
*& Report ZTEST_REP *
*& *
&----
*& *
*& *
&----
REPORT ZTEST_REP .
INFOTYPES 0041.
NODES : PERNR.
data : begin of date,
dar like pa0041-dar01 ,
dat like pa0041-dat01.
data : end of date.
START-OF-SELECTION.
GET PERNR.
DO 12 TIMES VARYING DATE
FROM P0041-DAR01
NEXT p0041-DAR02.
write : / date-dar ,
date-dat.
write : / date.
ENDDO.
END-OF-SELECTION.
can i know what is the exact problem ...
Thanks
senthil
You should do like this:
DO 12 TIMES
VARYING DATE-DAR FROM P0041-DAR01
NEXT p0041-DAR02
VARYING DATE-DAT FROM P0041-DAT01
NEXT p0041-DAT02.
write : / date-dar ,
date-dat.
write : / date.
ENDDO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil,
The date is a structure containing two date fields. The following piece of code expects the field DATE to be of type d.
DO 12 TIMES VARYING DATE
FROM P0041-DAR01
NEXT p0041-DAR02.
Try replacing->
ata : begin of date,
dar like pa0041-dar01 ,
dat like pa0041-dat01.
data : end of date.
with->
data: date type d.
and->
write date.
instead of->
write : / date-dar ,
date-dat.
write : / date.
Good luck!
Marcel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vijay ,
This program will work since its using single field , if we use structure as a variable it won't . Let me know if there is an alternative and simple solution.
Thanks
Senthil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil ,
Try ...this way...
DATA: BEGIN OF WORD,
ONE VALUE 'E',
TWO VALUE 'x',
THREE VALUE 'a',
FOUR VALUE 'm',
FIVE VALUE 'p',
SIX VALUE 'l',
SEVEN VALUE 'e',
EIGHT VALUE '!',
END OF WORD,
LETTER1, LETTER2.
DO VARYING LETTER1 FROM WORD-ONE NEXT WORD-THREE
VARYING LETTER2 FROM WORD-TWO NEXT WORD-FOUR.
WRITE: LETTER1, LETTER2.
IF LETTER2 = '!'.
EXIT.
ENDIF.
ENDDO.
The resulting output is the character string
"E x a m p l e !".
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil
4.7 may apply a more strict check on the DO...VARYING statement.
i. Does the repeating block only contains darXX and datXX fields? If not, you should include all the fields.
ii. There should be at least 12 blocks.
Regards
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.