‎2007 Sep 18 10:26 AM
hi
i m getting type mismatch error.
SELECT OBJEK
ATWRT
FROM AUSP
INTO TABLE INT_AUSP
FOR ALL ENTRIES IN INT_MARA
WHERE OBJEK = INT_MARA-CUOBF.
i want to check conditon objek = cuobf .
but getting error type mismatch so what i need to do
thanks.
‎2007 Sep 18 10:31 AM
OBJEK in AUSP and CUOBF in MARA are of different datatypes.
One is char(50) and other is NUMC(18)
How can you compare different data types?
<b>WHERE OBJEK = INT_MARA-CUOBF.</b>
is wrong condition.
Please check right where condition required.
Regards
Vasu
‎2007 Sep 18 10:34 AM
hi i need to take internal doc no( cuobf )from mara
and i need to put that numbet in ausp-objek.
thanks.
‎2007 Sep 18 10:46 AM
> hi
>
> i m getting type mismatch error.
>
> SELECT OBJEK
> ATWRT
> FROM AUSP
> INTO TABLE INT_AUSP
> FOR ALL ENTRIES IN INT_MARA
> WHERE OBJEK = INT_MARA-CUOBF.
> nt to check conditon objek = cuobf .
> but getting error type mismatch so what i need to do
>
> thanks.
In such cases u've copy the values of CUOBJ in the internal table INT_MARA into a temporary internal table INT_MARA_TEMP declaring CUOBJ w.r.t AUSP-CUOBJ
data:
begin of int_mara_temp occurs 0,
cuobj TYPE ausp-cuobj,
end of int_mara_temp.
loop at int_mara.
int_mara_temp-cuobj = int_mara-cuobj
endloop.
sort int_mara_temp cuobj.
delete adjacent duplicates from int_mara_temp comparing cuobj.
if int_mara_temp[] is not initial.
SELECT OBJEK
ATWRT
FROM AUSP
INTO TABLE INT_AUSP
FOR ALL ENTRIES IN INT_MARA_TEMP
WHERE OBJEK = INT_MARA_TEMP-CUOBF
endif.
Also see that there is no data loss when moving int_mara-cuobj to int_mara_temp-cuobj
‎2007 Sep 18 10:58 AM
Hi
i had same problem when i am doing one report
at that time i had done like this
if helpful reward me
TYPES : BEGIN OF ST_HRP1001,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RELAT type hrp1001-RELAT,
BEGDA TYPE HRP1001-BEGDA,
ENDDA TYPE HRP1001-ENDDA,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-SOBID,
END OF ST_HRP1001.
TYPES : BEGIN OF ST_SOBID,
OTYPE TYPE HRP1001-OTYPE,
OBJID TYPE HRP1001-OBJID,
RELAT type hrp1001-OBJID,
BEGDA TYPE HRP1001-BEGDA,
ENDDA TYPE HRP1001-ENDDA,
SCLAS TYPE HRP1001-SCLAS,
SOBID TYPE HRP1001-OBJID,
END OF ST_SOBID.
START-OF-SELECTION.
SELECT OTYPE
OBJID
RELAT
BEGDA
ENDDA
SCLAS
SOBID FROM HRP1001 INTO TABLE IT_HRP1001
WHERE OTYPE = 'D'
AND OBJID IN S_OBJID
AND BEGDA GE DATE-LOW
AND ENDDA LE DATE-HIGH
AND ( SCLAS = 'E' OR SCLAS = 'ET' ).
IF SY-SUBRC NE 0.
MESSAGE 'NO RECORD FOUND FOR THE GIVEN SELECTION CRITERIA ' TYPE 'E'.
ENDIF.
LOOP AT IT_HRP1001 INTO WA_HRP1001.
WA_SOBID-OTYPE = WA_HRP1001-OTYPE.
WA_SOBID-OBJID = WA_HRP1001-OBJID.
WA_SOBID-RELAT = WA_HRP1001-RELAT.
WA_SOBID-BEGDA = WA_HRP1001-BEGDA.
WA_SOBID-ENDDA = WA_HRP1001-ENDDA.
WA_SOBID-SCLAS = WA_HRP1001-SCLAS.
WA_SOBID-SOBID = WA_HRP1001-SOBID.
APPEND WA_SOBID TO IT_SOBID.
ENDLOOP.
SELECT OTYPE
OBJID
AEDTM
UNAME
DELET
CANCR
NCONT
FROM HRP1026
INTO TABLE IT_HRP1026
FOR ALL ENTRIES IN IT_SOBID
WHERE OBJID = IT_SOBID-SOBID
AND ( OTYPE = 'E' OR OTYPE = 'ET' )
AND DELET = 'X' AND
BEGDA GE DATE-LOW AND
ENDDA LE DATE-HIGH.
in the above declaration i had declared 2 structures of same type
in that OBJID field has to taken and check with SOBID of other table at that OBJID is 8 charctes SOBID is 45 char
then in the 2nd structure i had declared SOBID as the OBJID then that program executed as per the requirement
see this if u understand ok other wise ask me where u did't get understand
reward if usefull