Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

need help

laxman_sankhla3
Participant
0 Likes
639

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.

4 REPLIES 4
Read only

Former Member
0 Likes
614

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

Read only

0 Likes
614

hi i need to take internal doc no( cuobf )from mara

and i need to put that numbet in ausp-objek.

thanks.

Read only

Former Member
0 Likes
614

> 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

Read only

Former Member
0 Likes
614

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