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

Inner Join Error

Former Member
0 Likes
1,294

Please People help

Error:- You cannot use an internal table as a work area.

PERFORM de top

TABLES: EKKO, EKPO

Data: BEGIN OF es_tabla_inner,

a_EBELN TYPE EKKO-EBELN,

b_EBELP TYPE EKPO-EBELP,

b_MATNR TYPE EKPO-MATNR,

b_WERKS TYPE EKPO-WERKS,

b_MENGE TYPE EKPO-MENGE,

b_MEINS TYPE EKPO-MEINS,

b_LOEKZ TYPE EKPO-LOEKZ,

END OF es_tabla_inner.

DATA: ti_tabla_inner LIKE TABLE OF es_tabla_inner.

Perform de rutina

FORM obtener_datos_alv TABLES p_it_zsdtt_alv.

SELECT a~EBELN b~EBELP b~MATNR b~MENGE b~WERKS b~MEINS b~LOEKZ

FROM EKKO AS a INNER JOIN ekpo as b ON a~ebeln = b~ebeln INTO ti_tabla_inner.

SKIP.

IF sy-subrc EQ 0.

WRITE: 'Tabla del Inner Join'.

uline.

LOOP AT ti_tabla_inner INTO es_tabla_inner.

write:/'|',es_tabla_inner-a_EBELN,'|',es_tabla_inner-b_EBELP,'|', es_tabla_inner-b_MATNR,'|',es_tabla_inner-b_WERKS,'|',

es_tabla_inner-b_MENGE,'|',es_tabla_inner-b_MATNR,'|' ,es_tabla_inner-b_MEINS,'|',es_tabla_inner-b_LOEKZ,'|'.

uline.

ENDLOOP.

ENDIF.

ENDFORM.

4 REPLIES 4
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,173

More than trivial!

Use SELECT ... INTO TABLE ...

And what the heck are the TABLES statements for? Seems that they are superfluous.

Read only

matt
Active Contributor
0 Likes
1,173

And FORMs as well. *shudder*. 😉

Read only

pokrakam
Active Contributor
0 Likes
1,173

Please use code formatting when posting code, it makes it much easier to read.

Read only

matt
Active Contributor
0 Likes
1,173

I.e. use the button marked "code" in the editor.