Application Development 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: 

Type Conversion Issue while firing query...

former_member213219
Participant
0 Kudos

Hi Experts,

Need your help and inputs ASAP.

We are writing a query:

select objid from hrp1010 INTO CORRESPONDING FIELDS OF TABLE lt_hrp1010

FOR ALL ENTRIES IN LT_VARYF

where objid eq LT_VARYF-SOBID.

Where LT_VARYF is internal table of type HRP1001,

and lt_hrp1010 is internal table of type HRP1010.

Now in the above query OBJID is of type NUMC but SOBID is of type CHAR and thats why it is gving us an error message related to Type Mismatch.

Is there any way in which we can manipulate the Data Type of Column(SOBID) of the Internal Table (LT_VARYF), just before we fire above query.

Or is there any other way through which I can solve my propose.

Appreciate your help.

Thanks,

Harish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You will have to create an new field in the internal table LT_VARYF of type hrp1010-objid.

TYPES: BEGIN OF t_hrp1001.
        INCLUDE STRUCTURE hrp1001.
TYPES: sobid2 TYPE  hrp1010-objid,
       END OF t_hrp1001.

DATA: lt_varyf TYPE STANDARD TABLE OF t_hrp1001.
DATA: lt_hrp1010 TYPE STANDARD TABLE OF hrp1010.
FIELD-SYMBOLS: <fs_line> LIKE LINE OF lt_varyf.

SELECT * INTO CORRESPONDING FIELDS OF TABLE  lt_varyf FROM hrp1010.

LOOP AT lt_varyf ASSIGNING <fs_line>.
  <fs_line>-sobid2 = <fs_line>-sobid.
ENDLOOP.

SELECT objid FROM hrp1010 INTO CORRESPONDING FIELDS OF TABLE lt_hrp1010
FOR ALL ENTRIES IN lt_varyf
WHERE objid EQ lt_varyf-sobid2.

1 REPLY 1

Former Member
0 Kudos

You will have to create an new field in the internal table LT_VARYF of type hrp1010-objid.

TYPES: BEGIN OF t_hrp1001.
        INCLUDE STRUCTURE hrp1001.
TYPES: sobid2 TYPE  hrp1010-objid,
       END OF t_hrp1001.

DATA: lt_varyf TYPE STANDARD TABLE OF t_hrp1001.
DATA: lt_hrp1010 TYPE STANDARD TABLE OF hrp1010.
FIELD-SYMBOLS: <fs_line> LIKE LINE OF lt_varyf.

SELECT * INTO CORRESPONDING FIELDS OF TABLE  lt_varyf FROM hrp1010.

LOOP AT lt_varyf ASSIGNING <fs_line>.
  <fs_line>-sobid2 = <fs_line>-sobid.
ENDLOOP.

SELECT objid FROM hrp1010 INTO CORRESPONDING FIELDS OF TABLE lt_hrp1010
FOR ALL ENTRIES IN lt_varyf
WHERE objid EQ lt_varyf-sobid2.