‎2007 Dec 05 3:14 PM
TYPES : BEGIN OF itab,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
TYPES : BEGIN OF itab2,
maktx LIKE makt-maktx,
END OF itab2.
DATA : it_eban TYPE STANDARD TABLE OF itab.
DATA : it_makt TYPE STANDARD TABLE OF itab2.
DATA : wa_eban TYPE itab.
DATA : wa_makt TYPE itab2.
START-OF-SELECTION.
SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
it_eban FROM eban.
SELECT maktx INTO CORRESPONDING FIELDS OF TABLE
it_makt from makt.
PERFORM display TABLES it_eban it_makt.
FORM display TABLES eban_tab makt_tab.
LOOP AT eban_tab INTO wa_eban.
WRITE :/ wa_eban-matnr, wa_eban-menge.
READ TABLE makt_tab with key matnr = wa_eban-matnr.
"here I'm getting error like
"the specified type has no structure and therefore no component called "MATNR"
"How can I write READ statement here to read makt_tab.
ENDLOOP.
ENDFORM.
‎2007 Dec 06 5:27 AM
Hi,
Execute the below code.I checked and it is working fine.
TYPES : BEGIN OF itab,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
TYPES : BEGIN OF itab2,
<b>matnr like mara-matnr,</b>maktx LIKE makt-maktx,
END OF itab2.
DATA : it_eban TYPE STANDARD TABLE OF itab.
DATA : it_makt TYPE STANDARD TABLE OF itab2.
DATA : wa_eban TYPE itab.
DATA : wa_makt TYPE itab2.
START-OF-SELECTION.
SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
it_eban FROM eban.
SELECT <b>matnr</b> maktx INTO CORRESPONDING FIELDS OF TABLE
it_makt from makt.
PERFORM display TABLES it_eban it_makt.
FORM display <b>TABLES eban_tab structure wa_eban
makt_tab structure wa_makt</b>.
LOOP AT eban_tab INTO wa_eban.
WRITE 😕 wa_eban-matnr, wa_eban-menge.
READ TABLE makt_tab <b>into wa_makt</b> with key matnr = wa_eban-matnr.
ENDLOOP.
ENDFORM.
Jayanthi Jayaraman
‎2007 Dec 05 3:19 PM
You need to use explicit work area for this:
READ TABLE makt_tab into WA_MAKT with key matnr = wa_eban-matnr.Regards,
Naimesh Patel
‎2007 Dec 05 3:37 PM
Hi Naimesh,
READ TABLE makt_tab INTO wa_makt WITH KEY matnr = wa_eban-matnr.
Problem is same I'm getting same error.
"The specified type has no structure and therefore no component called "MATNR"
Hi Matthew,
I'm getting error like,
"Field "ITAB2" is unknown.
and actually I wrote this simple program to illustarte my problem. In my actual program I must use global parameters..so please help me
Hi Jacek,
I've changed my code according to your suggetions.. but i'm getting same error
"The specified type has no structure and therefore no component called "MATNR"
‎2007 Dec 05 3:20 PM
FORM display TABLES eban_tab STRUCTURE itab
makt_tab STRUCTURE itab2.And DON'T use global defined variables inside forms unless you really have to. Define local variables.
matt
‎2007 Dec 05 3:20 PM
Try that
TYPES : BEGIN OF itab,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
TYPES : BEGIN OF itab2,
<b>matnr like mara-matnr,</b>
maktx LIKE makt-maktx,
END OF itab2.
DATA : it_eban TYPE STANDARD TABLE OF itab.
DATA : it_makt TYPE STANDARD TABLE OF itab2.
DATA : wa_eban TYPE itab.
DATA : wa_makt TYPE itab2.
START-OF-SELECTION.
SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
it_eban FROM eban.
SELECT <b>matnr</b> maktx INTO CORRESPONDING FIELDS OF TABLE
it_makt from makt.
PERFORM display TABLES it_eban it_makt.
FORM display TABLES eban_tab makt_tab.
LOOP AT eban_tab INTO wa_eban.
WRITE 😕 wa_eban-matnr, wa_eban-menge.
READ TABLE makt_tab into <b>wa_makt</b> with key matnr = wa_eban-matnr.
"here I'm getting error like
"the specified type has no structure and therefore no component called "MATNR"
"How can I write READ statement here to read makt_tab.
ENDLOOP.
ENDFORM.
Message was edited by:
Jacek Slowikowski
‎2007 Dec 05 3:28 PM
Hi Sudha,
This is a common problem where in the FORM routine parameters are not typed. ABAP allows declaring parameters without typing it to some datatype. Your problem is that the table you want to access is EBAN but inside the FORM routine there is no mention of the structure. So it should look like:
FORM DISPLAY
TABLES eban_tab STRUCTURE eban " the dictionary structure or table
makt_tab STRUCTURE makt. " the dictionary structure or table
* your code here accessing different components of eban and makt
ENDFORM.
Hope this helps.
<b><i>FYI, using TABLES addition in FORM routines (and elsewhere like function modules) is obsolete in ABAP Objects context. So, better try using CHANGING addition instead!</i></b>
Thanks
Sanjeev
‎2007 Dec 05 3:39 PM
‎2007 Dec 06 4:42 AM
hi,
In perform stmt u have the sequence as it_eban it_makt.
and it_makt doesn/t have field matnr.
in form the sequence is eban_tab makt_tab.
so makt_tab will be like it_makt .
hence makt_tab also lacks the field matnr.
thats why u get this error.
try changing the sequence or include the field matnr in structure itab2.
hope this helps.
‎2007 Dec 06 5:27 AM
Hi,
Execute the below code.I checked and it is working fine.
TYPES : BEGIN OF itab,
matnr LIKE eban-matnr,
menge LIKE eban-menge,
END OF itab.
TYPES : BEGIN OF itab2,
<b>matnr like mara-matnr,</b>maktx LIKE makt-maktx,
END OF itab2.
DATA : it_eban TYPE STANDARD TABLE OF itab.
DATA : it_makt TYPE STANDARD TABLE OF itab2.
DATA : wa_eban TYPE itab.
DATA : wa_makt TYPE itab2.
START-OF-SELECTION.
SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
it_eban FROM eban.
SELECT <b>matnr</b> maktx INTO CORRESPONDING FIELDS OF TABLE
it_makt from makt.
PERFORM display TABLES it_eban it_makt.
FORM display <b>TABLES eban_tab structure wa_eban
makt_tab structure wa_makt</b>.
LOOP AT eban_tab INTO wa_eban.
WRITE 😕 wa_eban-matnr, wa_eban-menge.
READ TABLE makt_tab <b>into wa_makt</b> with key matnr = wa_eban-matnr.
ENDLOOP.
ENDFORM.
Jayanthi Jayaraman
‎2007 Dec 06 9:04 AM