Skip to Content
0
Former Member
Apr 29, 2015 at 07:08 AM

Unable to fill data in Structure

275 Views

Hello,

i am new to ABAP, started learning a week ago. i am trying to create a structure with 3 fields from two sap tables. Later, i need to fetch data from sap table to populate the structure and display. i am getting an error like "workarea does not contain corresponding components" and when i execute data will be populated in structure but the number of rows is shown (number of rows is 20 but all blank values) i write my code as follows.

TABLES vbak.

TABLES vbap.

SELECT-OPTIONS: so_vbeln FOR vbap-vbeln.

TYPES: BEGIN OF ty_item,

salesdoch TYPE vbak-vbeln,

salesdoci TYPE vbap-vbeln,

materno TYPE vbap-matnr,

END OF ty_item.

DATA: gt_vbak TYPE STANDARD TABLE OF vbak,

gs_vbak TYPE vbak,

gt_vbap TYPE STANDARD TABLE OF vbap,

gs_vbap TYPE vbap,

gt_item TYPE STANDARD TABLE OF ty_item,

gs_item TYPE ty_item.

SELECT vbeln FROM vbak INTO CORRESPONDING FIELDS OF TABLE gt_vbak

WHERE vbeln IN so_vbeln.

IF gt_vbak IS NOT INITIAL.

SELECT vbeln matnr FROM vbap INTO CORRESPONDING FIELDS OF TABLE gt_item

FOR ALL ENTRIES IN gt_vbak

WHERE vbeln EQ gt_vbak-vbeln.

ENDIF.

LOOP AT gt_item INTO gs_item.

WRITE: gs_item-salesdoci.

ENDLOOP.



can you please help me how can i fix this issue.