Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

match on numc and char

I have an ecc extractor I am modifying that is not making a match.

The tknum is a char 10.

The tanum is a numc 10.

So with my select statement:

select single ERDAT ERZET into

(ST_ZOXDE20037-DALEN, ST_ZOXDE20037-UALEN )

FROM VTTK where TKNUM = ST_ZOXDE20037-TANUM.

Since I don't get a match I assume I have to convert the VTTP-tknum into a numc.

I was trying something like:

DATA ST_ZOXDE20037 like ZOXDE20037.

DATA: TBL_ZI_T_DATA TYPE sorted TABLE OF ZOXDE20037 with

NON-unique key SONUM.

TYPES: BEGIN OF TY_VTTK,

TKNUM LIKE VTTK-TKNUM,

DALEN LIKE VTTK-ERDAT,

UALEN LIKE VTTK-ERZET,

END OF TY_VTTK.

  • define temp table for vttk ...

  • because the tknum and tanum are differenct data types char / numc

DATA: TBL_VTTK TYPE SORTED TABLE OF TY_VTTK with unique key tknum.

    • define temp table for vttk

DATA: ST_VTTK LIKE LINE OF TBL_VTTK.

FIELD-SYMBOLS: <fs_VTTK> LIKE LINE OF TBL_VTTK.

*do the select of the char into the numc

select TKNUM ERDAT ERZET

into TABLE TBL_VTTK

from VTTK.

LOOP AT TBL_VTTK ASSIGNING <fs_VTTK>.

SHIFT <fs_VTTK>-tknum LEFT DELETING LEADING '0'.

ENDLOOP.

TBL_ZI_T_DATA[] = C_T_DATA[].

LOOP AT TBL_ZI_T_DATA INTO ST_ZOXDE20037.

Read table TBL_VTTK

with table key

TKNUM = ST_ZOXDE20037-TANUM.

if sy-subrc = 0.

ST_ZOXDE20037-DALEN = ST_VTTK-DALEN.

ST_ZOXDE20037-UALEN = ST_VTTK-UALEN.

endif.

MODIFY TBL_ZI_T_DATA FROM ST_ZOXDE20037.

ENDLOOP.

C_T_DATA[] = TBL_ZI_T_DATA[].

i'm getting a short dump because I'm trying to change the "KEY". So, how should I be processing this without a key?

Any thoughts appreciated.

Mike

Former Member
Not what you were looking for? View more on this topic or Ask a question