Skip to Content
0
Jun 08, 2022 at 09:35 AM

Getting dump when Trying to Sum quantity fields Stock in the ALV Report.

100 Views Last edit Jun 08, 2022 at 11:44 AM 6 rev

abapruntimejpg.png

Hi Experts,

I have developed an ALV Report and it working fine but its showing a dump when I am trying to sum the stock quantity fileds .

N.B : I have total 3 quantity fields in my report.

unrestricted ( clabs + kalab) , quality ( cinsm + kains ), blocked ( cspem + kaspe).

I am giving the fieldcat code here .. Please suggest.

DATA : it_fcat TYPE slis_t_fieldcat_alv,
wa_fact TYPE slis_fieldcat_alv,
gt_layout TYPE slis_layout_alv,
ls_variant TYPE disvariant.

FORM display_alv .



wa_fact-col_pos = '1'.
wa_fact-fieldname = 'WERKS'.
wa_fact-seltext_l = 'Plant'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '2'.
wa_fact-fieldname = 'LGORT'.
wa_fact-seltext_l = 'Storage Location'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '3'.
wa_fact-fieldname = 'MATNR'.
wa_fact-seltext_l = 'Material'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '4'.
wa_fact-fieldname = 'MAKTX'.
wa_fact-seltext_l = 'Material Description'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '5'.
wa_fact-fieldname = 'SOBKZ'.
wa_fact-seltext_l = 'Special Stock'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '6'.
wa_fact-fieldname = 'VBELN'.
wa_fact-seltext_l = 'Sales Order'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '7'.
wa_fact-fieldname = 'POSNR'.
wa_fact-seltext_l = 'Sales item'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '8'.
wa_fact-fieldname = 'MEINS'.
wa_fact-seltext_l = 'UNIT'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '9'.
wa_fact-fieldname = 'CHARG'.
wa_fact-seltext_l = 'Batch'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '10'.
wa_fact-fieldname = 'ERSDA'.
wa_fact-seltext_l = 'Created On'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '11'.
wa_fact-fieldname = 'AGE'.
wa_fact-seltext_l = 'Age'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '12'.
wa_fact-fieldname = 'CLABS'.
wa_fact-seltext_l = 'Unrestricted Stock'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '13'.
wa_fact-fieldname = 'CINSM'.
wa_fact-seltext_l = 'Quality Ins. Stock'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '14'.
wa_fact-fieldname = 'CSPEM'.
wa_fact-seltext_l = 'Restricted Stock'.
APPEND wa_fact TO it_fcat.

* wa_fact-col_pos = '15'.
* wa_fact-fieldname = 'MEINH'.
* wa_fact-seltext_l = 'ALT Unit'.
* APPEND wa_fact TO it_fcat.

* wa_fact-col_pos = '16'.
** wa_fact-fieldname = 'CSPEM'.
* wa_fact-seltext_l = 'Stock AUOM'.
* APPEND wa_fact TO it_fcat.

* wa_fact-col_pos = '17'.
** wa_fact-fieldname = 'CRETM'.
* wa_fact-seltext_l = 'Return Stock'.
* APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '18'.
wa_fact-fieldname = 'ARTICALE_NO'.
wa_fact-seltext_l = 'ARTICALE NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '19'.
wa_fact-fieldname = 'ASSET_CODE'.
wa_fact-seltext_l = 'ASSET CODE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '20'.
wa_fact-fieldname = 'BILL_OF_ENTRY'.
wa_fact-seltext_l = 'Bill Of Entry'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '21'.
wa_fact-fieldname = 'BRAND'.
wa_fact-seltext_l = 'BRAND'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '22'.
wa_fact-fieldname = 'BUDGET_NAME'.
wa_fact-seltext_l = 'BUDGET NAME'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '23'.
wa_fact-fieldname = 'BUYER'.
wa_fact-seltext_l = 'BUYER'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '24'.
wa_fact-fieldname = 'CATALOG_NO'.
wa_fact-seltext_l = 'CATALOG NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '25'.
wa_fact-fieldname = 'COLOR'.
wa_fact-seltext_l = 'COLOR'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '26'.
wa_fact-fieldname = 'COLOR_CODE'.
wa_fact-seltext_l = 'COLOR CODE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '27'.
wa_fact-fieldname = 'COLOR_NAME'.
wa_fact-seltext_l = 'COLOR NAME'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '28'.
wa_fact-fieldname = 'COUNT'.
wa_fact-seltext_l = 'COUNT'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '29'.
wa_fact-fieldname = 'EXPIRATION_DATE'.
wa_fact-seltext_l = 'EXPIRATION DATE'.
APPEND wa_fact TO it_fcat.


wa_fact-col_pos = '30'.
wa_fact-fieldname = 'VALIDITY DATE'.
wa_fact-seltext_l = 'VALIDITY DATE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '31'.
wa_fact-fieldname = 'JOB_NUMBER'.
wa_fact-seltext_l = 'JOB NUMBER'.
APPEND wa_fact TO it_fcat.


wa_fact-col_pos = '32'.
wa_fact-fieldname = 'KPM'.
wa_fact-seltext_l = 'KPM( MOISTURE RELATED)'.
APPEND wa_fact TO it_fcat.


wa_fact-col_pos = '33'.
wa_fact-fieldname = 'LC_NUMBER'.
wa_fact-seltext_l = 'LC NUMBER'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '34'.
wa_fact-fieldname = 'LOCATION1'.
wa_fact-seltext_l = 'LOACTION'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '35'.
wa_fact-fieldname = 'LOCATION2'.
wa_fact-seltext_l = 'LOCATION EXT1'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '36'.
wa_fact-fieldname = 'LOCATION3'.
wa_fact-seltext_l = 'LOCATION EXT2'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '37'.
wa_fact-fieldname = 'LOT'.
wa_fact-seltext_l = 'LOT'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '38'.
wa_fact-fieldname = 'MACHINE_NAME'.
wa_fact-seltext_l = 'MACHINE NAME'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '39'.
wa_fact-fieldname = 'MODEL'.
wa_fact-seltext_l = 'MODEL'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '40'.
wa_fact-fieldname = 'NWT'.
wa_fact-seltext_l = 'N.WT.(KG)'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '41'.
wa_fact-fieldname = 'ORIGIN'.
wa_fact-seltext_l = 'ORIGIN'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '42'.
wa_fact-fieldname = 'PACKAGE_LENGTH'.
wa_fact-seltext_l = 'Package Length'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '43'.
wa_fact-fieldname = 'PACKAGE_WEIGHT'.
wa_fact-seltext_l = 'Package Weight'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '44'.
wa_fact-fieldname = 'PO_NO'.
wa_fact-seltext_l = 'PO NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '45'.
wa_fact-fieldname = 'PROG_NUM'.
wa_fact-seltext_l = 'PROGRAM NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '46'.
wa_fact-fieldname = 'RACK_NUM'.
wa_fact-seltext_l = 'RACK NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '47'.
wa_fact-fieldname = 'RCV_DATE'.
wa_fact-seltext_l = 'Received Date'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '48'.
wa_fact-fieldname = 'SO_NUM'.
wa_fact-seltext_l = 'Sales Order No'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '49'.
wa_fact-fieldname = 'SFL2_LOCATION'.
wa_fact-seltext_l = 'SFL2 LOCATION'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '50'.
wa_fact-fieldname = 'SHADE_TYPE'.
wa_fact-seltext_l = 'SHADE TYPE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '51'.
wa_fact-fieldname = 'SHADE'.
wa_fact-seltext_l = 'SHADE/COLOR CODE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '52'.
wa_fact-fieldname = 'LOCATION EXT2'.
wa_fact-seltext_l = 'SHADE NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '53'.
wa_fact-fieldname = 'SIZE'.
wa_fact-seltext_l = 'SIZE'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '54'.
wa_fact-fieldname = 'CONSTRUCTION'.
wa_fact-seltext_l = 'CONSTRUCTION'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '55'.
wa_fact-fieldname = 'SIZE_NO'.
wa_fact-seltext_l = 'SIZE NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '56'.
wa_fact-fieldname = 'SPECIFICATION'.
wa_fact-seltext_l = 'SPECIFICATION'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '57'.
wa_fact-fieldname = 'STYLE_NO'.
wa_fact-seltext_l = 'STYLE NO'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '58'.
wa_fact-fieldname = 'SUPPLIER'.
wa_fact-seltext_l = 'SUPPLIER'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '59'.
wa_fact-fieldname = 'VEHICLE_NAME'.
wa_fact-seltext_l = 'VEHICLE NAME'.
APPEND wa_fact TO it_fcat.

wa_fact-col_pos = '60'.
wa_fact-fieldname = 'YARN_COUNT'.
wa_fact-seltext_l = 'YARN COUNT'.
APPEND wa_fact TO it_fcat.


wa_fact-col_pos = '61'.
wa_fact-fieldname = 'SOURCE'.
wa_fact-seltext_l = 'SOURCE'.
APPEND wa_fact TO it_fcat.





gt_layout-zebra = 'X'.
gt_layout-colwidth_optimize = 'X'.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = it_fcat
is_layout = gt_layout
i_save = 'U'
is_variant = ls_variant
TABLES
t_outtab = it_tabf
EXCEPTIONS
program_error = 1
OTHERS = 2.






ENDFORM.

Attachments

abapruntimejpg.png (33.7 kB)