Skip to Content
0
Former Member
Jul 03, 2007 at 01:50 PM

help me in my code

17 Views

hello friends,

i am not getting the output for my program. my task is :

1.to display selected data by joining 6 tables. qmfe, qmsm, vbap, makt, ekpo and eket.

2. Conditions : in mncod if for same material there are both 3050 and 3100 exist then we should not display it and if there is only 3050 then it should be displayed in the output.

im pasting my code below. i hope ther is a problem in my select statement

REPORT Z_SPRING_DELIVERY .

tables : qmfe, makt, qmsm, vbap, vbup, ekpo, eket.

select-options : plant for qmfe-werks,

baugroup for qmfe-bautl,

material for qmfe-matnr.

data : begin of itab occurs 0,

mngrp like qmsm-mngrp,

bautl like qmfe-bautl,

maktx like makt-maktx,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

ebeln like eket-ebeln,

ebelp like eket-ebelp,

menge like eket-menge,

wemng like eket-wemng,

eindt like eket-eindt,

end of itab.

data : stab like table of itab.

DATA : CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

GRID TYPE REF TO CL_GUI_ALV_GRID,

GT_FIELDCAT TYPE LVC_T_FCAT.

select amngrp bbautl cmaktx dvbeln dposnr eebeln eebelp emenge ewemng eeindt

into corresponding fields of table stab from

( qmsm as a inner join qmfe as b on aqmnum = bqmnum

inner join makt as c on bmatnr = cmatnr

inner join vbap as d on cmatnr = dmatnr

inner join ekpo as f on cmatnr = fmatnr

inner join eket as e on febeln = eebeln )

where a~mncod eq '3050'

and a~mncod ne '3100'

and c~spras eq 'D'

and b~werks in plant

and b~bautl in baugroup.

call screen 0001.

&----


*& Module STATUS_0001 OUTPUT

&----


  • text

----


module STATUS_0001 output.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'MENU'.

CREATE OBJECT container

EXPORTING

container_name = 'CONT'. "Layout Grid name as CONT"

CREATE OBJECT grid

EXPORTING

i_parent = container.

PERFORM prepare_field_catalog CHANGING gt_fieldcat .

CALL METHOD grid->set_table_for_first_display

  • EXPORTING

  • i_structure_name = 'ZSC_ALVSTUC' “ Structure of Itab created in Data Dictionary"

CHANGING

it_outtab = stab

IT_FIELDCATALOG = gt_fieldcat.

endmodule. " STATUS_0001 OUTPUT

FORM prepare_field_catalog CHANGING pt_fieldcat type lvc_t_fcat.

DATA ls_fcat type lvc_s_fcat .

ls_fcat-fieldname = 'MNGRP' .

ls_fcat-tabname = 'QMSM'.

ls_fcat-inttype = 'C' .

ls_fcat-outputlen = '8' .

ls_fcat-coltext = 'Codegroup' .

ls_fcat-seltext = 'CODEGRUPPE' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'BAUTL' .

ls_fcat-tabname = 'qmfe'.

ls_fcat-inttype = 'C' .

ls_fcat-outputlen = '18' .

ls_fcat-coltext = 'Baugruppe' .

ls_fcat-seltext = 'BAUGRUPPE' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'MAKTX' .

ls_fcat-tabname = 'MAKT'.

ls_fcat-inttype = 'C' .

ls_fcat-outputlen = '40' .

ls_fcat-coltext = 'Material Description' .

ls_fcat-seltext = 'MATERIAL DESCRIPTION' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'VBELN' .

ls_fcat-tabname = 'VBAP'.

ls_fcat-inttype = 'C' .

ls_fcat-outputlen = '10' .

ls_fcat-coltext = 'Sales Document' .

ls_fcat-seltext = 'SALES DOCUMENT' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'POSNR' .

ls_fcat-tabname = 'VBAP'.

ls_fcat-inttype = 'N' .

ls_fcat-outputlen = '6' .

ls_fcat-coltext = 'Position' .

ls_fcat-seltext = 'POSITION' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'EBELN' .

ls_fcat-tabname = 'EKET'.

ls_fcat-inttype = 'C' .

ls_fcat-outputlen = '10' .

ls_fcat-coltext = 'Purchase Document' .

ls_fcat-seltext = 'PURCHASE DOCUMENT' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'EBELP' .

ls_fcat-tabname = 'EKET'.

ls_fcat-inttype = 'N' .

ls_fcat-outputlen = '5' .

ls_fcat-coltext = 'Psoition' .

ls_fcat-seltext = 'POSITION' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'MENGE' .

ls_fcat-tabname = 'EKET'.

ls_fcat-inttype = 'Q' .

ls_fcat-outputlen = '13' .

ls_fcat-coltext = 'Schudeld Quantity' .

ls_fcat-seltext = 'SCHUDELED QUANTITY' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'WEMNG' .

ls_fcat-tabname = 'EKET'.

ls_fcat-inttype = 'Q' .

ls_fcat-outputlen = '13' .

ls_fcat-coltext = 'Quantity Issued' .

ls_fcat-seltext = 'QUANTITY ISSUED' .

APPEND ls_fcat to pt_fieldcat .

ls_fcat-fieldname = 'EINDT' .

ls_fcat-tabname = 'EKET'.

ls_fcat-inttype = 'D' .

ls_fcat-outputlen = '8' .

ls_fcat-coltext = 'Delivery Date' .

ls_fcat-seltext = 'DELIVERY DATE' .

APPEND ls_fcat to pt_fieldcat .

ENDFORM.

thanx in advance

abhilash