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

help i copying internal table

Former Member
0 Likes
726

Grateful if anyone could help

TYPES declaration: T_ITAB

bukrs TYPE /bev2/edmse-bukrs,

matnr TYPE /bev2/edmse-matnr,

posnr TYPE /bev2/edmse-posnr,

lfsnr TYPE lips-vbeln, (This is char 10)

TABLE DECLARATION

it_edmse TYPE STANDARD TABLE OF /BEV2/EDMSE,

it_ITAB_tmpc TYPE STANDARD TABLE OF t_itab,

it_ITAB_tmpc2 TYPE STANDARD TABLE OF t_itab,

LOOP AT it_edmse INTO wa_edmse.

MOVE: wa_edmse-bukrs TO wa_ITAB_tmpc-bukrs,

wa_edmse-matnr to wa_ITAB_tmpc-matnr,

wa_edmse-posnr to wa_ITAB_tmpc-posnr.

  • convert char 16 to char 10

WRITE wa_edmse-lfsnr TO wa_ITAB_tmpc-lfsnr.

APPEND wa_ITAB_tmpc TO it_ITAB_tmpc .

CLEAR wa_ITAB_tmpc.

ENDLOOP.

it_edmse_tmpc2[] = it_edmse_tmpc[] ( SYNTAX ERROR BELOW )

SYNTAX ERROR

Arithmetic operations are only intended for operands that can be converted to numbers (numeric operands). operands). - - - - - - - - - -

Can anyone advise what does this mean and how can i correct it??

Grateful if anyone could help

TYPES declaration: T_ITAB

bukrs TYPE /bev2/edmse-bukrs,

matnr TYPE /bev2/edmse-matnr,

posnr TYPE /bev2/edmse-posnr,

lfsnr TYPE lips-vbeln, (This is char 10)

TABLE DECLARATION

it_edmse TYPE STANDARD TABLE OF /BEV2/EDMSE,

it_ITAB_tmpc TYPE STANDARD TABLE OF t_itab,

it_ITAB_tmpc2 TYPE STANDARD TABLE OF t_itab,

LOOP AT it_edmse INTO wa_edmse.

MOVE: wa_edmse-bukrs TO wa_ITAB_tmpc-bukrs,

wa_edmse-matnr to wa_ITAB_tmpc-matnr,

wa_edmse-posnr to wa_ITAB_tmpc-posnr.

  • convert char 16 to char 10

WRITE wa_edmse-lfsnr TO wa_ITAB_tmpc-lfsnr.

APPEND wa_ITAB_tmpc TO it_ITAB_tmpc .

CLEAR wa_ITAB_tmpc.

ENDLOOP.

it_edmse_tmpc2[] = it_edmse_tmpc[] ( SYNTAX ERROR BELOW )

SYNTAX ERROR

Arithmetic operations are only intended for operands that can be converted to numbers (numeric operands). operands). - - - - - - - - - -

Can anyone advise what does this mean and how can i correct it??

6 REPLIES 6
Read only

Former Member
0 Likes
696

Hi,

I think the error message is very clear, you are trying arthmetic opetrations in a non-number field. But looking at the code you have pasted i cant makeout anything.

Paste the complete code.

Regards,

Pankaj

Read only

0 Likes
696

FUNCTION /BEV2/ED_EDDOC_UPD.

*"----


""Verbuchungsfunktionsbaustein:

*"

""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(I_TABNAM) LIKE DD02D-TABNAME

*" TABLES

*" I_YHMSE STRUCTURE /BEV2/EDMSE

*" EXCEPTIONS

*" NOT_EXISTS

*"----


DATA: LV_LINES LIKE SY-TABIX.

DESCRIBE TABLE I_YHMSE LINES LV_LINES.

IF NOT LV_LINES > 0.

MESSAGE ID '/BEV2/EDMESS1' TYPE 'E' NUMBER '010' WITH I_TABNAM

RAISING NOT_EXISTS.

ENDIF.

LOOP AT I_YHMSE.

MOVE-CORRESPONDING I_YHMSE TO /BEV2/EDMSE.

MODIFY /BEV2/EDMSE.

ENDLOOP.

ENDFUNCTION.

-


TYPES:

  • copy of edmse for the conversion of LFSNR (CHAR 16) to VBELN (CHAR 10)

BEGIN OF t_edmse_tmpc,

bukrs TYPE /bev2/edmse-bukrs, "Company code

matnr TYPE /bev2/edmse-matnr, " material "20

posnr TYPE /bev2/edmse-posnr, "Item num in SD "45

lfsnr TYPE lips-vbeln, "Delivery "char 10

END OF t_edmse_tmpc.

DATA:

wa_edmse TYPE /BEV2/EDMSE,

wa_edmse_tmpc TYPE t_edmse_tmpc.

DATA:

i_edmse TYPE STANDARD TABLE OF /BEV2/EDMSE,

i_edmse_tmp TYPE STANDARD TABLE OF /BEV2/EDMSE,

  • Internal table for char conversiton

i_edmse_tmpc TYPE STANDARD TABLE OF t_edmse_tmpc,

  • Internal table to keep a copy for char conversion

i_edmse_tmpc2 TYPE STANDARD TABLE OF t_edmse_tmpc.

SELECT *

FROM /bev2/edmse

INTO TABLE i_edmse

WHERE bukrs EQ p_bukrs

AND werks IN s_werks

AND yhlbgrp IN s_yhlbgp

AND lfsnr IN s_lfsnr

AND mblnr IN s_mblnr

AND matnr IN s_matnr

AND zzvaad_proc_flag EQ v_proc_flag.

LOOP AT i_edmse INTO wa_edmse.

MOVE: wa_edmse-bukrs TO wa_edmse_tmpc-bukrs,

wa_edmse-matnr to wa_edmse_tmpc-matnr,

wa_edmse-posnr to wa_edmse_tmpc-posnr.

  • convert char 16 to char 10

WRITE wa_edmse-lfsnr TO wa_edmse_tmpc-lfsnr.

APPEND wa_edmse_tmpc TO i_edmse_tmpc.

CLEAR wa_edmse_tmpc.

ENDLOOP.

IF NOT i_edmse_tmpc[] IS INITIAL.

  • retriving data for field STO/PO, delivered qty, base unit for inbound

REFRESH i_edmse_tmpc2.

  • i_edmse_tmpc2[] = i_edmse_tmpc[]

move i_edmse_tmpc[] to i_edmse_tmpc2[].

SORT i_edmse_tmpc2 BY lfsnr matnr.

DELETE ADJACENT DUPLICATES FROM i_edmse_tmpc2

COMPARING lfsnr matnr.

SELECT vbeln posnr matnr lfimg meins

FROM lips

INTO TABLE i_lips

FOR ALL ENTRIES IN i_edmse_tmpc2

WHERE vbeln = i_edmse_tmpc2-lfsnr

AND matnr = i_edmse_tmpc2-matnr.

IF sy-subrc EQ 0.

SORT i_lips BY vbeln posnr.

ENDIF.

Read only

0 Likes
696

move i_edmse_tmpc] to i_edmse_tmpc2[.

the abv statement is incorrect..

if both the table holds the same structure then use.

i_edmse_tmpc2[] = i_edmse_tmpc[].

or

append lines of i_edmse_tmpc2 to i_edmse_tmpc

Read only

0 Likes
696

hey the format is changing when the post happens...

try using

append lines of i_edmse_tmpc2 to i_edmse_tmpc

if it throws error again check whethre all the fields in both the tables r comparitively matching...

if its not matching.

loop at i_edmse_tmpc2.

move-corresponding i_edmse_tmpc2 to i_edmse_tmpc.

append i_edmse_tmpc.

endloop.

Read only

Former Member
0 Likes
696

"it_edmse_tmpc2] = it_edmse_tmpc[" ??

I can't see any declaration of both it_edmse_tmpc2 and it_edmse_tmpc (only of it_edmse, it_itab_tmpc and it_itab_tmpc2).

Furtheremore the use of "]" and "[" is not correct.

Regards,

John.

Read only

0 Likes
696

ok i forgot to put "." after my statement copying an internal table to another an internal table. how stupid of me

i_edmse_tmpc2[] = i_edmse_tmpc[].