‎2006 Aug 23 11:42 AM
HI friends,
Please help me wiht this coding..I am getting the error as p0041-dar01 and mydates are type incompatible. please solve it...i have spend my whole day but i am not getting where i am wrong... The coding is below
REPORT ZDATES1 .
TABLES: PERNR.
DATA: BEGIN OF MYDATES,
DAR LIKE P0041-DAR01,
DAT LIKE P0041-DAT01,
END OF MYDATES.
INFOTYPES 0041.
GET PERNR.
WRITE: PERNR-PERNR, PERNR-ENAME. "show employee number and name
RP-PROVIDE-FROM-LAST P0041 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
DO 12 TIMES VARYING mydates
FROM p0041-dar01
NEXT p0041-dar02.
IF mydates-dar NE space.
WRITE: /,MYDATES-DAR, MYDATES-DAT.
ENDIF.
ENDDO.
ENDIF.
‎2006 Aug 23 11:45 AM
HI,
you are comparing field with internal table .
try this now.
DO 12 TIMES VARYING <b>mydates-dar01</b>
FROM p0041-dar01
NEXT p0041-dar02.
Regards,
‎2006 Aug 23 11:45 AM
HI,
you are comparing field with internal table .
try this now.
DO 12 TIMES VARYING <b>mydates-dar01</b>
FROM p0041-dar01
NEXT p0041-dar02.
Regards,
‎2006 Aug 23 11:46 AM
hi Specify the field name instead of internal table
<b>DO 12 TIMES VARYING mydates-dar01
FROM p0041-dar01
NEXT p0041-dar02.</b>
‎2006 Aug 23 11:51 AM
I tried that, but I am facing anotehr problem.
When I am comparing field, my 1 field is getting populated bt the 2nd field is left empty.
please can anybody solve it for me.
‎2006 Aug 23 11:57 AM
HI abhay,
I think you need both fields of internal table to get populated for that try this.
DO 12 TIMES VARYING mydates-dar01
FROM p0041-dar01
NEXT p0041-dar02
<b>VARYING mydates-dat01
FROM p0041-dat01
NEXT p0041-dat02.</b>
Regards,
HRA
‎2006 Aug 23 11:52 AM
hi,
I think you are working on Unicode Check Active system. So, you are getting incompatibility error. While working on Non-unicode system, we wont get any error of incompatibility.
So, while doing assignment from one field to other field, comparisions of fields, both the fields should be type compatible.
Regards,
Sailaja.
‎2006 Aug 23 11:54 AM
Wht doesd the unicode active system and non-unicode system mean.
cant I corredt this error anyhow?
‎2006 Aug 23 11:59 AM
Try using the below
DO 12 TIMES VARYING mydates-dar
FROM p0041-dar01 NEXT p0041-dar02
varying my-dates-dat
FROM p0041-dat01 NEXT p0041-dat02.
IF mydates-dar NE space and my-dates-dat ne space.
WRITE: /,MYDATES-DAR, MYDATES-DAT.
ENDIF.
ENDDO.
‎2006 Aug 23 12:00 PM
hi,
In Unicode programs , dobj, dobj1 and dobj2 have to be compatible . Moreover, in unicode programs, dobj1 and dobj2 have to be either structure components that belong to the same structure, or, part areas of the same data object specified through offset/length.
Here is the example from help.
DATA: BEGIN OF text,
word1(4) TYPE c VALUE 'AAAA',
word2(4) TYPE c VALUE 'BBBB',
word3(4) TYPE c VALUE 'CCCC',
word4(4) TYPE c VALUE 'DDDD',
END OF text.
DATA: word(4) TYPE c,
char1(1) TYPE c,
char2(1) TYPE c,
leng TYPE i.
DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.
leng = leng / 2.
<b>DO leng TIMES VARYING char1 FROM text(1)
NEXT text+2(1) RANGE text
VARYING char2 FROM text+1(1)
NEXT text+3(1) RANGE text. </b>
WRITE: char1, char2.
char1 = 'x'.
char2 = 'y'.
ENDDO.
DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.
WRITE / word.
ENDDO. Regards,
Sailaja.