Select statement dump
Hi,
Am getting dump with the below select statement in ECC 6.0,
where as the same select works fine in 4.7C.
SELECT distinct aebeln abukrs absart alifnr azterm aekorg aekgrp awaers awkurs akdatb akdate aunsez bebelp btxz01 bwerks blgort bbednr bmatkl bidnlf bmeins bbprme bnetpr bpeinh bknttp badrn2 csakto canln1 caufnr cgsber cps_psp_pnr detenr dlpein deindt dwemng dslfdt dmenge
INTO CORRESPONDING FIELDS OF TABLE it_output FROM
( ( ( ekko AS a INNER JOIN ekpo AS b ON aebeln = bebeln )
INNER JOIN ekkn AS c ON bebeln = cebeln and bebelp = cebelp )
INNER JOIN eket AS d ON cebeln = debeln and cebelp = debelp )
WHERE aebeln IN s_ebeln AND alifnr IN s_lifnr AND a~bukrs IN s_bukrs.
Whether I've to add anything addition for select distinct statement in ecc 6.0 or is it obsolette?
can oneone help in this regards?
Thanks,
Ponraj.s.
Hi,
This is only dev.server and it consists only few records.
TYPES: BEGIN OF ty_output,
*********Header data*****************************
rectype_line1(1) TYPE c,
rectype_line2(1) TYPE c,
rectype_line3(1) TYPE c,
rectype_line4(1) TYPE c,
ebeln TYPE ebeln,
bukrs TYPE bukrs, "Company Code
bsart TYPE bsart, "Documnet Type
lifnr TYPE lifnr,
zterm TYPE dzterm,
ekorg TYPE ekorg, "Purchase Org
ekgrp TYPE ekgrp, "Purchase grp
waers TYPE waers, "Currency
wkurs TYPE wkurs, "Exchange rate
wkurs1(9) TYPE c,
kdatb TYPE kdatb,
kdate TYPE kdate, "Validity end date
unsez TYPE unsez, "Our Reference
********Line item data***************************
ebelp TYPE ebelp, "po item
txz01 TYPE txz01, "Item Text
werks TYPE werks, "Plant
lgort TYPE lgort_d, "Storage Location
bednr TYPE bednr, "Tracking No
matkl TYPE matkl, "Material group
idnlf TYPE idnlf, "Vendor Material No
meins TYPE meins, "Order unit
bprme TYPE bprme, "Order price unit
netpr TYPE netpr, "Net price
netpr1(11) TYPE c,
peinh TYPE peinh, "Price unit
peinh1(5) TYPE c,
knttp TYPE knttp, "Acc Assgnment
adrn2 TYPE adrn2,
**************G/L Account data***********************
menge2(13) TYPE c, "PO Quantity
sakto TYPE sakto, "GL Acc No
anln1 TYPE anln1, "Main Asset number
aufnr TYPE aufnr, "Order Number
gsber TYPE gsber, "Business Area
ps_psp_pnr(8) TYPE c,
**********Item schedule data*******************************
etenr TYPE etenr,
lpein TYPE lpein, "Delivery date category
eindt TYPE eindt, "Delivery date
menge TYPE menge, "Schedule Quantity
menge1(13) TYPE c,
wemng TYPE wemng,
wemng1(13) TYPE c,
slfdt TYPE slfdt, "Start of Delivery date
END OF ty_output.
DATA : it_output TYPE STANDARD TABLE OF ty_output.
This is my table declaration,pls help me in resolving this issue.
Similar Messages
-
Hi Experts,
I am facing the problem in the select statement where it giving the short dump
DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_S.
i have searched many forms, but i found that the select option s_matnr have the limitaion 2000 entreis, but i am passing same s_matnr to other select statement with more than 2000 entries but it is not giving me any short dump.
but i am facing problem with only one select statement where if i pass select option s_matnr more than 1500 entris also giving short dump.
my select statement is
SELECT * FROM bsim
INTO CORRESPONDING FIELDS OF TABLE g_t_bsim_lean
FOR ALL ENTRIES IN t_bwkey WHERE bwkey = t_bwkey-bwkey
AND matnr IN matnr
AND bwtar IN bwtar
AND budat >= datum-low.
in the internal table g_t_bsim_lean internal table contain all the fields of the table bsim with 2 fields from other table.
Please let me know whether i need to change the select statement or any other solution for this.
Regards,
udupimy select query is like this:
DATA: BEGIN OF t_bwkey OCCURS 0, "184465
bwkey LIKE bsim-bwkey, "184465
END OF t_bwkey. "184465
LOOP AT g_t_organ WHERE keytype = c_bwkey.
MOVE g_t_organ-bwkey TO t_bwkey-bwkey.
COLLECT t_bwkey. "184465
ENDLOOP. "184465
READ TABLE t_bwkey INDEX 1. "184465
CHECK sy-subrc = 0. "184465
SELECT * FROM bsim "n443935
INTO CORRESPONDING FIELDS OF TABLE g_t_bsim_lean "n443935
FOR ALL ENTRIES IN t_bwkey WHERE bwkey = t_bwkey-bwkey
AND matnr IN matnr
AND bwtar IN bwtar
AND budat >= datum-low. -
Short dump with a select statement
I have the following select statement (I have also inluded my data statement(s)) and I get a short dump. The error is as follows:
<b>What happened?
Error in ABAP application program.
The current ABAP program "ZPARTNER" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Following a SELECT statement, the data read could not be placed in AN
the output area.
A conversion may have been intended that is not supported by the
system, or the output area may be too small.
Error analysis
An exception occurred. This exception will be dealt with in more detail
below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not
caught, which
led to a runtime error. The reason for this exception is:
The data read during a SELECT access could not be inserted into the
target field.
Either conversion is not supported for the target field's type or the
target field is too short to accept the value or the data are not in a
form that the target field can accept </b>
it_adrc TYPE TABLE OF adrc,
wa_adrc LIKE LINE OF it_adrc,
SELECT addrnumber name1 street city1 region post_code1 tel_number
FROM adrc INTO TABLE it_adrc
FOR ALL ENTRIES IN it_detail
WHERE addrnumber = it_detail-adrnr.
Regards,
DavisIf you only need the fields mentioned in the select query, then follow this:
TYPES: BEGIN OF ADRC_TYPE,
ADDRNUMBER LIKE ADRC-ADDRNUMBER,
NAME1 LIKE ADRC-NAME1,
STREET LIKE ADRC-STREET,
CITY LIKE ADRC-CITY,
REGION LIKE ADRC-REGION,
POST_CODE1 LIKE ADRC-POST_CODE1,
TEL_NUMBER LIKE ADRC-TEL_NUMBER,
END OF ADRC_TYPE,
ADRC_T_TYPE TYPE TABLE OF ADRC_TYPE.
DATA: IT_ADRC TYPE ADRC_T_TYPE WITH HEADER LINE.
IF NOT IT_DETAIL[] IS INITIAL.
SELECT addrnumber name1 street city1 region post_code1 tel_number
FROM adrc INTO TABLE it_adrc
FOR ALL ENTRIES IN it_detail
WHERE addrnumber = it_detail-adrnr.
ENDIF.
Thanks,
SKJ -
Adding one more table to the select statement joining 4 tables gives dump
Hi All,
There is a select statement using which four tables namely VBAK,VBAP,LIPS and LIKPUK(view) are joined(inner join).Here, date and time fields are selected from LIPS and used.
My requirement is to consider the Date (LIKP - WADAT_IST) instead of LIPS-ERDAT and time(LIKP-SPE_WAUHR_IST) is to be used instead of LIPS-erzet.
Neither LIPS nor LIKPUK contains time(SPE_WAUHR_IST) field. And, I cannot remove LIPS table or LIKPUK view as each contains a unique field which is used in the report.
When I tried to join LIPS in the select query, it is going to dump.
Can someone suggest a good approach ?
Thanks,
PavanThank you for the detailed explanation of the dump.
The dump details together with your code lead to the answer: 42.
Regards,
Clemens -
Short dump during select statement
hi,
i have to display 1 alv list output using REUSE_ALV_HIERSEQ_LIST_DISPLAY function module...so i have populated the data using select statement
select EXIDV
brgew meabm
vegr1 erlkz vhilm erdat aenam
ernam from vekp
into corresponding fields of table gt_master
up to gs_test-select_amount rows.
so the data is also getting populated to gt_master table before the function module...but after executing the function module..it is giving short dump...due to some standard program....any ideahi,
my coding is
Report : ZBCALV *
Author : *
SAP-User : *
Requester : *
Date : *
Specification: *
Description : *
Changes : *
Change No : *
Author : *
SAP-User : *
Date : *
Reason / Desc: *
REPORT ZBCALV.
**& Report BCALV_TEST_HIERSEQ_LIST_EVENTS *
*report bcalv_test_hierseq_list_events.
types: g_ty_t_exidv type standard table of vekp,
g_ty_t_brgew type standard table of vekp,
g_ty_t_vegr1 type standard table of vekp,
g_ty_t_vekp type standard table of vekp,
g_ty_t_curr type standard table of alv_cur,
g_ty_s_vekp type alv_t_t2,
g_ty_s_exidv type alv_tab,
g_ty_s_brgew type alv_tab,
g_ty_s_vegr1 type alv_chck,
g_ty_s_vekp type vekp,
g_ty_s_curr type alv_cur.
constants:
*con_vekp type lvc_fname value 'ALV_T_T2',
con_scarr type lvc_fname value 'ALV_TAB', "#EC *
con_spfli type lvc_fname value 'ALV_CHCK', "#EC *
con_vekp type lvc_fname value 'VEKP',
con_scurx type lvc_fname value 'ALV_CUR'. "#EC *
DATA *
tables: sscrfields. " for processing the FCODEs in Selektion screens
type-pools: slis, kkblo.
class lcl_events_d1001 definition deferred.
types: begin of g_ty_s_test,
select_amount type i,
selected_recs_m type i,
selected_recs_s type i,
no_info_popup type char1,
info_popup_once type char1,
events type lvc_fname occurs 0,
events_exit type slis_t_event_exit,
events_info_popup type lvc_fname occurs 0,
list_append type char1,
list_amount type i,
list_append_status type i,
layo_expand_field type char1,
layo_expand_all type char1,
vari_default type char1,
vari_save type char1,
bypassing_buffer type char1,
buffer_active type char1,
end of g_ty_s_test,
begin of g_ty_s_evt_exit.
include type slis_event_exit.
types: text type string,
end of g_ty_s_evt_exit,
g_ty_t_evt_exit type standard table of g_ty_s_evt_exit.
constants: con_true type char1 value 'X',
con_ok type sy-ucomm value 'OK',
con_exit type sy-ucomm value 'EXIT',
con_canc type sy-ucomm value 'CANC',
con_back type sy-ucomm value 'BACK',
con_event_01 type lvc_fname value 'PF_STATUS_SET',
con_event_02 type lvc_fname value 'USER_COMMAND',
con_event_03 type lvc_fname value 'CALLER_EXIT',
con_event_04 type lvc_fname value 'LIST_MODIFY',
con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',
con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',
con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',
con_event_08 type lvc_fname value 'REPREP_MODIFY',
con_event_09 type lvc_fname value 'TOP_OF_PAGE',
con_event_10 type lvc_fname value 'END_OF_PAGE',
con_event_11 type lvc_fname value 'TOP_OF_LIST',
con_event_12 type lvc_fname value 'END_OF_LIST',
con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',
con_event_14 type lvc_fname value 'END_OF_COVERPAGE',
con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',
con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',
con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE',
con_event_18 type lvc_fname value 'ITEM_DATA_EXPAND'.
data: gs_test type g_ty_s_test.
data: g_okcode type sy-ucomm.
data: g_repid type sy-repid.
data: gt_evt_exit type g_ty_t_evt_exit.
data: gr_container_d1001 type ref to cl_gui_custom_container,
gr_grid_d1001 type ref to cl_gui_alv_grid,
gr_events_d1001 type ref to lcl_events_d1001.
data: g_start_listinfo type slis_lineinfo.
*addition for extra
DATA: fieldcatalog TYPE slis_t_fieldcat_alv with header line.
types : BEGIN OF gt_output ,
EXIDV TYPE VEKP-EXIDV,
VGBEL TYPE LIPS-VGBEL,
BRGEW TYPE VEKP-BRGEW,
VEGR1 TYPE VEKP-VEGR1,
MEABM TYPE VEKP-MEABM,
ERLKZ TYPE VEKP-ERLKZ,
VSTAT TYPE NAST-VSTAT,
VHILM TYPE VEKP-VHILM,
ERDAT TYPE VEKP-ERDAT,
AENAM TYPE VEKP-AENAM,
VBELN TYPE VBELN_GEN,
ERNAM TYPE VEKP-ERNAM,
END OF gt_output.
data: ls_output type gt_output,
lt_output type gt_output occurs 0 WITH HEADER LINE .
types : BEGIN OF gt_item_output ,
EXIDV TYPE VEKP-EXIDV,
BRGEW TYPE VEKP-BRGEW,
vEGR1 TYPE VEKP-VEGR1,
TARAG TYPE VEKP-TARAG,
NTGEW TYPE VEKP-NTGEW,
MEABM TYPE VEKP-MEABM,
BREIT TYPE VEKP-BREIT,
HOEHE TYPE VEKP-HOEHE,
ANW_STATUS TYPE VEKP-ANW_STATUS,
MATNR TYPE VEPO-MATNR,
VEGR2 TYPE VEKP-VEGR2,
VSTEL TYPE VEKP-VSTEL,
WERKS TYPE VEKP-WERKS,
END OF gt_item_output.
data: ls_ITEM_output type gt_ITEM_output,
lt_ITEM_output type gt_ITEM_output occurs 0 with header line.
types: begin of g_ty_s_master.
include type gt_output.
types: box type char1,
lights type char1,
checkbox type char1,
expand type char1,
help type i,
end of g_ty_s_master,
g_ty_t_master type standard table of g_ty_s_master,
begin of g_ty_s_slave.
include type gt_item_output.
types: box type char1,
lights type char1,
checkbox type char1,
expand type char1,
help type i,
end of g_ty_s_slave,
g_ty_t_slave type standard table of g_ty_s_slave.
data: gt_master type g_ty_t_master with header line,
gt_slave type g_ty_t_slave with header line,
gs_master type g_ty_s_master.
CLASS lcl_events_d1001 DEFINITION
class lcl_events_d1001 definition.
public section.
methods:
data_changed for event data_changed
of cl_gui_alv_grid
importing er_data_changed
e_onf4
e_onf4_before
e_onf4_after,
data_changed_finished
for event data_changed_finished
of cl_gui_alv_grid.
endclass. "lcl_events_d1001 DEFINITION
CLASS lcl_events_d1001 IMPLEMENTATION
class lcl_events_d1001 implementation.
method data_changed.
endmethod. "data_changed
method data_changed_finished.
endmethod. "data_changed_finished
endclass. "lcl_events_d1001 IMPLEMENTATION
SELECTION-SCREEN *
selection-screen begin of block gen with frame.
parameters:
p_amount type i default 30.
selection-screen end of block gen.
at selection-screen.
AT SELECTION-SCREEN *
case sscrfields-ucomm.
when 'PB01'.
call screen 1001 starting at 1 1 ending at 80 20.
endcase.
START-OF-SELECTION *
start-of-selection.
g_repid = sy-repid.
gs_test-select_amount = p_amount.
END-OF-SELECTION *
end-of-selection.
perform f01_call_list.
*& Form f01_call_list
text
form f01_call_list.
data: l_callback_program type sy-cprog, "#EC NEEDED
ls_layo type slis_layout_alv,
lt_fcat type slis_t_fieldcat_alv,
ls_keyinfo type slis_keyinfo_alv.
data: ls_master type g_ty_s_master,
ls_slave type g_ty_s_slave.
l_callback_program = sy-repid.
perform f01_alv_get_outtab.
perform f01_alv_set_layout changing ls_layo.
perform f01_alv_set_fcat changing lt_fcat.
perform f01_alv_set_keyinfo changing ls_keyinfo.
if gs_test-list_append_status ne 0.
ls_layo-list_append = gs_test-list_append.
endif.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = g_repid
is_layout = ls_layo
it_fieldcat = lt_fcat
i_tabname_header = 'GT_MASTER'
i_tabname_item = 'GT_SLAVE'
is_keyinfo = ls_keyinfo
tables
t_outtab_header = gt_master
t_outtab_item = gt_slave
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " f01_call_list
FORM f01_alv_set_fcat
form f01_alv_set_fcat changing ct_fcat type slis_t_fieldcat_alv.
data: lt_fcat_master type slis_t_fieldcat_alv,
lt_fcat_slave type slis_t_fieldcat_alv.
clear ct_fcat[].
perform f01_alv_set_fcat_master changing lt_fcat_master.
perform f01_alv_set_fcat_slave changing lt_fcat_slave.
append lines of lt_fcat_master to ct_fcat.
append lines of lt_fcat_slave to ct_fcat.
endform. " F01_ALV_SET_FCAT
*& Form f01_alv_set_fcat_master
text
form f01_alv_set_fcat_master changing ct_fcat type slis_t_fieldcat_alv.
data: ls_fcat type slis_fieldcat_alv,
l_char(3) type c.
get fieldcatalog
fieldcatalog-fieldname = 'EXIDV'. "Field name in itab
fieldcatalog-seltext_l = 'HU-NR'. "Column text
FIELDCATALOG-KEY = 'X'.
FIELDCATALOG-TECH = 'X'.
fieldcatalog-col_pos = 1. "Column position
fieldcatalog-ref_tabname = 'VEKP'.
fieldcatalog-outputlen = 05. "Column width
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VGBEL'.
fieldcatalog-seltext_L = 'SALES ORDER'.
fieldcatalog-outputlen = 15.
fieldcatalog-ref_tabname = 'LIPS'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BRGEW'.
fieldcatalog-seltext_l = 'WEIGHT'.
FIELDCATALOG-KEY = 'X'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 3.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEABM'.
fieldcatalog-seltext_l = 'DIMENSION'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 4.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VEGR1'.
fieldcatalog-seltext_l = 'IPPC NR'.
fieldcatalog-outputlen = 15.
FIELDCATALOG-KEY = 'X'.
fieldcatalog-col_pos = 5.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ERLKZ'.
fieldcatalog-seltext_l = 'STATUS'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 6.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VSTAT'.
fieldcatalog-seltext_l = 'PRINT STATUS'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 7.
fieldcatalog-ref_tabname = 'VSTAT'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VHILM'.
fieldcatalog-seltext_l = 'PACKING MATERIAL'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 8.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ERDAT'.
fieldcatalog-seltext_l = 'CREATED FROM'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 9.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AENAM'.
fieldcatalog-seltext_l = 'LAST CHANGE'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 10.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VBELN'.
fieldcatalog-seltext_l = 'DELIVERY'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 11.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ERNAM'.
fieldcatalog-seltext_l = 'CREATED BY'.
fieldcatalog-outputlen = 12.
fieldcatalog-col_pos = 8.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
ls_fcat-tabname = 'GT_MASTER'.
modify ct_fcat from ls_fcat transporting tabname
where tabname ne ls_fcat-tabname.
loop at ct_fcat into ls_fcat.
if ls_fcat-fieldname eq 'BRGEW'.
or ls_fcat-fieldname eq ''.
*§1.Set status of columns PLANETYPE and SEATSOCC to editable.
ls_fcat-edit = 'X'.
modify ct_fcat from ls_fcat.
endif.
endloop.
endform. " f01_alv_set_fcat_master
*& Form f01_alv_set_fcat_slave
text
form f01_alv_set_fcat_slave changing ct_fcat type slis_t_fieldcat_alv.
data: ls_fcat type slis_fieldcat_alv,
l_char(3) type c.
fieldcatalog-fieldname = 'EXIDV'. "Field name in itab
fieldcatalog-seltext_l = 'HU-NR'. "Column text
FIELDCATALOG-KEY = 'X'.
FIELDCATALOG-TECH = 'X'.
fieldcatalog-col_pos = 1. "Column position
fieldcatalog-ref_tabname = 'VEKP'.
fieldcatalog-outputlen = 05. "Column width
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'TARAG'. "Field name in itab
fieldcatalog-seltext_l = 'HU-NR'. "Column text
fieldcatalog-col_pos = 1. "Column position
fieldcatalog-ref_tabname = 'VEKP'.
fieldcatalog-outputlen = 05. "Column width
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NTGEW'.
fieldcatalog-seltext_L = 'WEIGHT HU'.
fieldcatalog-outputlen = 15.
fieldcatalog-ref_tabname = 'VEKP'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BRGEW'.
fieldcatalog-seltext_l = 'WEIGHT'.
FIELDCATALOG-KEY = 'X'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 3.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'LAENG'.
fieldcatalog-seltext_l = 'LENGTH'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 4.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'BREIT'.
fieldcatalog-seltext_l = 'WIDTH'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 5.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'HOEHE'.
fieldcatalog-seltext_l = 'HEIGHT'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 6.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VEGR1'.
fieldcatalog-seltext_l = 'HU GR1'.
FIELDCATALOG-KEY = 'X'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 7.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VEGR2'.
fieldcatalog-seltext_l = 'HU GR2'.
FIELDCATALOG-KEY = 'X'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 8.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_l = 'MAT NO'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 9.
fieldcatalog-ref_tabname = 'VEPO'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'VSTEL'.
fieldcatalog-seltext_l = 'SHIPPING'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 10.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'WERKS'.
fieldcatalog-seltext_l = 'PLANT'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 11.
fieldcatalog-ref_tabname = 'VEKP'.
APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.
ls_fcat-tabname = 'GT_SLAVE'.
modify ct_fcat from ls_fcat transporting tabname
where tabname ne ls_fcat-tabname.
endform. " f01_alv_set_fcat_slave
FORM f01_alv_set_layout
form f01_alv_set_layout changing cs_layout type slis_layout_alv.
*... Display options
cs_layout-colwidth_optimize = con_true.
cs_layout-no_colhead = space.
cs_layout-no_hotspot = space.
cs_layout-zebra = space.
cs_layout-no_vline = space.
cs_layout-cell_merge = space.
cs_layout-no_min_linesize = space.
cs_layout-min_linesize = space.
cs_layout-max_linesize = space.
cs_layout-window_titlebar = space.
cs_layout-no_uline_hs = space.
cs_layout-no_sumchoice = space.
cs_layout-no_totalline = space.
cs_layout-totals_before_items = space.
cs_layout-totals_only = space.
cs_layout-totals_text = space.
cs_layout-no_subchoice = space.
cs_layout-no_subtotals = space.
cs_layout-subtotals_text = space.
cs_layout-numc_sum = space.
cs_layout-no_unit_splitting = space.
*... Interaction
cs_layout-box_fieldname = 'BOX'.
cs_layout-box_tabname = space.
cs_layout-box_rollname = space.
if gs_test-layo_expand_field eq con_true.
cs_layout-expand_fieldname = 'EXPAND'.
endif.
cs_layout-hotspot_fieldname = space.
cs_layout-f2code = space.
cs_layout-key_hotspot = space.
cs_layout-flexible_key = space.
cs_layout-reprep = space.
cs_layout-group_buttons = space.
cs_layout-no_keyfix = space.
cs_layout-get_selinfos = con_true.
cs_layout-group_change_edit = con_true.
cs_layout-no_scrolling = space.
cs_layout-expand_all = gs_test-layo_expand_all.
*... Detailed screen
cs_layout-detail_popup = space.
cs_layout-detail_initial_lines = space.
cs_layout-detail_titlebar = space.
*... PF-status
cs_layout-def_status = space.
*... Display variants
cs_layout-header_text = space.
cs_layout-item_text = space.
cs_layout-default_item = space.
*... colour
cs_layout-info_fieldname = space.
cs_layout-coltab_fieldname = space.
*... others
cs_layout-list_append = space.
endform. " F01_ALV_SET_LAYOUT
*& Form f01_alv_set_keyinfo
text
form f01_alv_set_keyinfo changing cs_keyinfo type slis_keyinfo_alv.
cs_keyinfo-header01 = 'EXIDV'.
cs_keyinfo-item01 = 'EXIDV'.
cs_keyinfo-header02 = 'BRGEW'."'CARRID'.
cs_keyinfo-item02 = 'BRGEW'."."'CARRID'.
cs_keyinfo-header03 = 'VEGR1'."'CONNID'.
cs_keyinfo-item03 = 'VEGR1'."'CONNID'.
cs_keyinfo-header04 = space.
cs_keyinfo-item04 = 'VEGR2'."'FLDATE'.
cs_keyinfo-header05 = space.
cs_keyinfo-item05 = space.
endform. " f01_alv_set_keyinfo
FORM f01_alv_event_pf_status_set
form f01_alv_event_pf_status_set using rt_extab type slis_t_extab.
"#EC *
data: l_event type lvc_fname. "#EC NEEDED
if gs_test-info_popup_once eq con_true.
read table gs_test-events_info_popup into l_event
with key table_line = 'PF_STATUS_SET'.
if sy-subrc ne 0.
insert 'PF_STATUS_SET' into gs_test-events_info_popup index 1.
message i000(0k) with text-t01.
endif.
elseif gs_test-no_info_popup eq space.
message i000(0k) with text-t01.
endif.
set pf-status 'STANDARD' excluding rt_extab.
set titlebar 'STANDARD'.
endform. " F01_ALV_EVENT_PF_STATUS_SET
*& Form F01_ALV_EVENT_BEFORE_LINE_OUTP
text
form f01_alv_event_before_line_outp
using rs_lineinfo type slis_lineinfo. "#EC *
data: l_event type lvc_fname. "#EC NEEDED
if gs_test-info_popup_once eq con_true.
read table gs_test-events_info_popup into l_event
with key table_line = 'BEFORE_LINE_OUTPUT'.
if sy-subrc ne 0.
insert 'BEFORE_LINE_OUTPUT' into gs_test-events_info_popup
index 1.
message i000(0k) with text-t05.
endif.
elseif gs_test-no_info_popup eq space.
message i000(0k) with text-t05.
endif.
format color off
intensified off
inverse off
hotspot off
input off.
if rs_lineinfo-tabname eq 'GT_MASTER'.
if
gs_master-exidv ne gt_master-exidv or
gs_master-brgew ne gt_master-brgew.
write: / text-t05.
write: /
gt_master-exidv,
gt_master-brgew.
gs_master = gt_master.
endif.
if gs_test-selected_recs_m eq rs_lineinfo-tabindex.
clear gs_master.
endif.
endif.
endform. " F01_ALV_EVENT_BEFORE_LINE_OUTP
*& Form f01_alv_get_outtab
text
form f01_alv_get_outtab .
field-symbols: .
select
exidv BRGEW VEGR1
TARAG NTgew meabm BREIT HOEHE VEGR2 VSTEL weRKS
from
(con_vekp) into corresponding fields of table
lt_slave up to gs_test-select_amount rows
where
exidv eq <ls_master>-exidv and
brgew eq -vegr1.
append lines of lt_slave to gt_slave.
endloop.
sort gt_slave by exidv brgew vegr1.
endif.
describe table gt_master lines gs_test-selected_recs_m.
describe table gt_slave lines gs_test-selected_recs_s.
clear gt_master.
clear gt_slave.
endform. " f01_alv_get_outtab
*& Module d1001_pbo OUTPUT
text
module d1001_pbo output.
perform d1001_pbo.
endmodule. " d1001_pbo OUTPUT
*& Module d1001_pai INPUT
text
module d1001_pai input.
perform d1001_pai.
endmodule. " d1001_pai INPUT -
Hello Experts,
I am working on PM module where I am preparing a report for ATPCHECK.
My select statement is not working.
I have to select all the active status from jest table.
select STAT from JEST into itab-STAT where objnr = ITAB-objnr
AND INACT eq 'X'.
But than I need to apply a check where I just need 2 active status 'I0002' and 'I0340'.
Is there a way to select all active status fields and than just these 2 active fields.
Thanks and Regrds,
Nikhil.SELECT pobjnr ppspnr pvbukr ppost1 pzzmattermanager pzzclient qstat qinact
INTO TABLE gt_proj_temp
FROM ( proj AS p INNER JOIN jest AS q ON pobjnr = qobjnr )
WHERE zzmattermanager IN so_pernr AND
( qstat = 'E0010' OR qstat = 'E0015') AND q~inact = ' '.
IF sy-subrc = 0.
SELECT kunnr name1
INTO TABLE gt_kna1
FROM kna1
FOR ALL ENTRIES IN gt_proj_temp
WHERE kunnr = gt_proj_temp-zzclient.
LOOP AT gt_proj_temp INTO gs_proj_temp.
READ TABLE gt_kna1 INTO gs_kna1 WITH KEY kunnr = gs_proj_temp-zzclient.
IF sy-subrc = 0.
gs_proj-objnr = gs_proj_temp-objnr.
gs_proj-pspnr = gs_proj_temp-pspnr.
gs_proj-vbukr = gs_proj_temp-vbukr.
gs_proj-post1 = gs_proj_temp-post1.
gs_proj-zzmattermanager = gs_proj_temp-zzmattermanager.
gs_proj-kunnr = gs_kna1-kunnr.
gs_proj-name1 = gs_kna1-name1.
APPEND gs_proj TO gt_proj.
CLEAR gs_proj.
ENDIF.
ENDLOOP.
ENDIF.
IF gv_lines = 0.
MESSAGE e003(z01).
ENDIF.
IF NOT gt_proj[] IS INITIAL.
SELECT pernr ename FROM pa0001 INTO TABLE gt_pa0001
FOR ALL ENTRIES IN gt_proj
WHERE pernr = gt_proj-zzmattermanager.
ENDIF.
ENDIF.
IF NOT gt_proj[] IS INITIAL.
SELECT objnr stat INTO TABLE gt_jest FROM jest
FOR ALL ENTRIES IN gt_proj
WHERE objnr = gt_proj-objnr AND stat = 'I0046' AND inact = ' '.
ENDIF. -
Performance issue - Select statement
Hi I am having the 10 lack records in the KONP table . If i am trying to see all the records in SE11 , it is giving the short dump TSV_TNEW_PAGE_ALLOC_FAILED . I know this is because of less memory in the Server . Is there any other way to get the data ? How to optimise the below SELECT statement if i have large data in the table .
i_condn_data - is having 8 lack records .
SELECT knumh kznep valtg valdt zterm
FROM konp
INTO TABLE i_condn_data_b
FOR ALL ENTRIES IN i_condn_data
WHERE knumh = i_condn_data-knumh
AND kschl = p_kschl.
Please suggest .Hi,
try to use "UP TO n ROWS" to control the quantity of selected data in each Loop step.
Something like this:
sort itab by itab-knumh.
flag = 'X'.
while flag = 'X'.
SELECT knumh kznep valtg valdt zterm
FROM konp
INTO TABLE i_condn_data_b UP TO one_million ROWS
WHERE knumh > new_value_for_selection
AND kschl = p_kschl.
describe table i_condn_data_b lines i.
read table i_condn_data_b index i.
new_value_for_selection = i_condn_data_b-knumh.
*....your logic for table i_condn_data_b
if one_million > i.
clear flag.
endif.
endwhile.
Regards -
Urgent, SELECT statement results in error
hi all, this is very urgent, could you guys have a look at my SELECT statement?
SELECT vk~kunnr "customer no
vk~vbeln "sales order no
vk~audat "date
vk~vbtyp "SD DOCUMENT CATEGORY
vk~knumv "lwk
vp~kwmeng "qty
vp~matnr "material no
vp~posnr "LINE ITEM
vd~bstkd "PURCHASE ORDER NO
* kv~kwert "lwk
FROM vbak AS vk
INNER JOIN vbap AS vp
ON vk~vbeln = vp~vbeln
INNER JOIN vbkd AS vd
ON vk~vbeln = vd~vbeln
* INNER JOIN konv AS kv
* ON kv~knumv = vk~knumv
INTO CORRESPONDING FIELDS OF TABLE it_so
WHERE vk~vkorg IN s_vkorg
AND vk~audat IN s_date
AND vk~kunnr IN s_kunnr
AND vp~matnr IN s_matnr
AND vd~bstkd IN s_bstkd
AND vk~vbeln IN s_vbeln
* AND kv~kschl = 'ZP00'
AND vk~vbtyp = 'C'.
The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:
For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".
Is there a way i can go around it?Hi,
look at this SAP note : 550043
Symptom
KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.
Other terms
KEPM MESSAGE_TYPE_X transform characteristic value
Reason and Prerequisites
This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising
during execution of planning method, for which is possible to define
transformation of characteristics values i.e. Copy, Forecast, Top-Down
distribution, Ratios and Customer Enhancement.
Dump is raising in case, if there was defined transformation of char.
values in parameter set definition for some characteristic. Later on,
this characteristic was removed from planning level definition but
characteristic wasn't removed from relevant customizing of transform
characteristic values before.
Solution
Please apply attached program correction.
Regards,
GSR. -
WD -Select options - DUMP -Practicing Rich heilman's app
Hi,
I am practising the tutorial created by Rich heilman /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
I am getting following dump while running i browser.
Error when processing your request
What has happened?
The URL http://ssss.com/sap/bc/webdynpro/sap/ytest/ was not called due to an error.
Note
The following error text was processed in the system DV1 : Exception condition "TYPE_NOT_FOUND" raised.
The error occurred on the application server sape-dev_DV1_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: DESCRIBE_BY_NAME of program CL_ABAP_TYPEDESCR=============CP
What can I do?
If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system DV1 in transaction ST22.
If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server sape-dev_DV1_00 in transaction SM21.
If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server sape-dev_DV1_00 . In some situations, you may also need to analyze the trace files of other work processes.
If you do not yet have a user ID, contact your system administrator.
Error code: ICF-IE-http -c: 180 -u: XXXXX -l: E -s: DV1 -i: sape-dev_DV1_00 -w: 0 -d: 20090112 -t: 162129 -v: RABAX_STATE -e: RAISE_EXCEPTION
All I did is i used a different table and follwed all steps.
Rich,
Thank you for the wonderful blog.
Any idea?
rgds
Vara
Edited by: Vara K on Jan 12, 2009 11:26 PM
Edited by: Vara K on Jan 12, 2009 11:34 PMRich,
Here is what I did.
I changed SFLIGHT TABLE to PROJ and tried to put only one select-options for field PSPNR.
Node name = PROJ.
I kept a break-point in these methods but it got dumped before that only.
method WDDOINIT .
data:
lt_range_table type ref to data,
rt_range_table type ref to data,
read_only type abap_bool,
typename type string.
data:
lr_componentcontroller type ref to ig_componentcontroller,
l_ref_cmp_usage type ref to if_wd_component_usage.
* create the used component
l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
* get a pointer to the interface controller of the select options
*component
wd_this->m_wd_select_options =
wd_this->wd_cpifc_select_options( ).
* init the select screen
wd_this->m_handler =
wd_this->m_wd_select_options->init_selection_screen( ).
* create a range table that consists of this new data element
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'S_PSPNR_ID' ).
*add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = 'S_PSPNR_ID'
it_result = lt_range_table
i_read_only = read_only ).
endmethod.
method ONACTIONCONTINUE .
data: node_proj type ref to if_wd_context_node.
data: rt_pspnr type ref to data.
data: iproj type table of proj.
data: wproj type proj.
field-symbols: <fs_pspnr> type table.
* Retrieve the data from the select option
rt_pspnr = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_PSPNR_ID' ).
* Assign it to a field symbol
assign rt_pspnr->* to <fs_pspnr>.
* Retrieve that data from the database. Normally it is suggested to
* encapsulate the data retrieval in a separate class.
* For simplicity, the SELECT statement has been implemented here.
clear iproj. refresh iproj.
select * into corresponding fields of table iproj from proj
where pspnr in <fs_pspnr>.
* Bind the data to the context
node_proj = wd_context->get_child_node( name = `PROJ` ).
node_proj->bind_elements( iproj ).
endmethod.
rgds
vara
Edited by: Vara K on Jan 13, 2009 12:10 AM -
Hi,
I have recently been asked to generate a program that reports of payroll postings to FI. This involves creating a giant select statement from the ppoix table to gather all the postings. My select statement is as follows:
SELECT pernr "EE Number
seqno "Sequential number
actsign "Indicator: Status of record
runid "Number of posting run
postnum "Number
tslin "Line number of data transfer
lgart "Wage Type
betrg "Amount
waers "Currency
anzhl "Number
meins "Base unit of measure
spprc "Special processing of posting items
momag "Transfer to FI/CO:EE grouping for acct determi
komok "Transfer to FI/CO: Symbolic account
mcode "Matchcode search term
koart "Account assignment type
auart "Expenditure type
nofin "Indicator: Expenditure type is not funded
INTO CORRESPONDING FIELDS OF TABLE i_ppoix
FROM ppoix
FOR ALL ENTRIES IN run_doc_xref
WHERE runid = run_doc_xref-runid
AND tslin = run_doc_xref-linum
AND spprc <> 'A'
AND lgart IN s_lgart
AND pernr in s_pernr.
where s_pernr is a select option that holds personnel nummbers and s_lgart is a select option that holds wagetypes. This statement works fine for a certain amount of personnel numbers and a certain amount of wagetypes, but once you exceed a certain limit the Database does not allow you to perform a select statement this large. Is there a better way to perform such a large select such as this one) ie: FM, or some other method I am not aware of. This select statement comes from the standard SAP delivered cost center admin report and this report dumps as well when too much data is passed to it.
any ideas would be much appreciated.
thanks.The problem here is with the select-options.
For a select statement, you cannot have more that certain amount of data.
The problem with your select becomes complex because of the FOR ALL ENTRIES in and the huge s_pernr and the 40 million records :(.
I am guessing that the s_lgart will be small.
How many entries do you have in internal table "run_doc_xref"?
If there are not that many, then I would suggest this:
TYPES:
BEGIN OF ty_temp_ppoix,
pernr TYPE ppoix-pernr,
lgart TYPE ppoix-lgart,
seqno TYPE ppoix-seqno,
actsign TYPE ppoix-actsign,
runid TYPE ppoix-runid,
postnum TYPE ppoix-postnum,
tslin TYPE ppoix-tslin,
betrg TYPE ppoix-betrg,
spprc TYPE ppoix-spprc,
END OF ty_temp_ppoix.
DATA:
i_temp_ppoix TYPE SORTED TABLE OF ty_temp_ppoix
WITH NON-UNIQUE KEY pernr lgart
INITIAL SIZE 0
WITH HEADER LINE.
DATA:
v_pernr_lines TYPE sy-tabix,
v_lgart_lines TYPE sy-tabix.
IF NOT run_doc_xref[] IS INITIAL.
DESCRIBE TABLE s_pernr LINES v_pernr_lines.
DESCRIBE TABLE s_lgart LINES v_lgart_lines.
IF v_pernr_lines GT 800 OR
v_lgart_lines GT 800.
* There is an index on runid and tslin. This should be ok
* ( still bad because of the huge table :( )
SELECT pernr lgart seqno actsign runid postnum tslin betrg spprc
* Selecting into sorted TEMP table here
INTO TABLE i_temp_ppoix
FROM ppoix
FOR ALL ENTRIES IN run_doc_xref
WHERE runid = run_doc_xref-runid
AND tslin = run_doc_xref-linum
AND spprc <> 'A'.
* The sorted table should make the delete faster
DELETE i_temp_ppoix WHERE NOT pernr IN s_pernr
AND NOT lgart IN s_lgart.
* Now populate the actual target
LOOP AT i_temp_ppoix.
MOVE: i_temp_ppoix-pernr TO i_ppoix-pernr.
* and the rest of the fields
APPEND i_ppoix.
DELETE i_temp_ppoix.
ENDLOOP.
ELSE.
SELECT pernr seqno actsign runid postnum tslin lgart betrg spprc
* Selecting into your ACTUAL target here
INTO TABLE i_ppoix
FROM ppoix
FOR ALL ENTRIES IN run_doc_xref
WHERE runid = run_doc_xref-runid
AND tslin = run_doc_xref-linum
AND spprc <> 'A'
AND pernr IN s_pernr
AND lgart IN s_lgart.
ENDIF.
ELSE.
* Error message because of no entries in run_doc_xref?
* Please answer this so a new solution can be implemented here
* if it is NOT an error
ENDIF.
Hope this helps.
Regards,
-Ramesh -
hi
We are getting the following sql statement dump, and i am not able to understand what should be done here, would anyone please advise
Registered qb: SEL$1 0xc4c8a150 (PARSER)
QUERY BLOCK SIGNATURE
signature (): qb_name=SEL$1 nbfros=1 flg=0
fro(0): flg=4 objn=272221 hint_alias="BSAD"@"SEL$1"
SPM: statement not found in SMB
SPM: statement not a candidate for auto-capture
Automatic degree of parallelism (ADOP)
Automatic degree of parallelism is disabled: Parameter.
PM: Considering predicate move-around in query block SEL$1 (#0)
Predicate Move-Around (PM)
PM: PM bypassed: disabled due to star transformation.
OPTIMIZER INFORMATION
----- Current SQL Statement for this session (sql_id=82mdu08rbcnyy) -----
EXPLAIN PLAN SET STATEMENT_ID='SAP_STMT' FOR /*+ 142235 */ SELECT "MANDT" , "BUKRS" , "KUNNR" , "UMSKS" , "UMSKZ" , "AUGDT" , "AUGBL" , "ZUONR"
, "GJAHR" , "BELNR" , "BUZEI" , "BUDAT" , "BLDAT" , "CPUDT" , "WAERS" , "XBLNR" , "BLART" , "MONAT" , "BSCHL" , "ZUMSK" , "SHKZG" , "GSBER" ,
"MWSKZ" , "DMBTR" , "WRBTR" , "MWSTS" , "WMWST" , "BDIFF" , "BDIF2" , "SGTXT" , "PROJN" , "AUFNR" , "ANLN1" , "ANLN2" , "SAKNR" , "HKONT" , "FK
ONT" , "FILKD" , "ZFBDT" , "ZTERM" , "ZBD1T" , "ZBD2T" , "ZBD3T" , "ZBD1P" , "ZBD2P" , "SKFBT" , "SKNTO" , "WSKTO" , "ZLSCH" , "ZLSPR" , "ZBFIX
" , "HBKID" , "BVTYP" , "REBZG" , "REBZJ" , "REBZZ" , "SAMNR" , "ANFBN" , "ANFBJ" , "ANFBU" , "ANFAE" , "MANSP" , "MSCHL" , "MADAT" , "MANST" ,
"MABER" , "XNETB" , "XANET" , "XCPDD" , "XINVE" , "XZAHL" , "MWSK1" , "DMBT1" , "WRBT1" , "MWSK2" , "DMBT2" , "WRBT2" , "MWSK3" , "DMBT3" , "W
RBT3" , "BSTAT" , "VBUND" , "VBELN" , "REBZT" , "INFAE" , "STCEG" , "EGBLD" , "EGLLD" , "RSTGR" , "XNOZA" , "VERTT" , "VERTN" , "VBEWA" , "WVER
W" , "PROJK" , "FIPOS" , "NPLNR" , "AUFPL" , "APLZL" , "XEGDR" , "DMBE2" , "DMBE3" , "DMB21" , "DMB22" , "DMB23" , "DMB31" , "DMB32" , "DMB33"
, "BDIF3" , "XRAGL" , "UZAWE" , "XSTOV" , "MWST2" , "MWST3" , "SKNT2" , "SKNT3" , "XREF1" , "XREF2" , "XARCH" , "PSWSL" , "PSWBT" , "LZBKZ" , "
LANDL" , "IMKEY" , "VBEL2" , "VPOS2" , "POSN2" , "ETEN2" , "FISTL" , "GEBER" , "DABRZ" , "XNEGP" , "KOSTL" , "RFZEI" , "KKBER" , "EMPFB" , "PRC
TR" , "XREF3" , "QSSKZ" , "ZINKZ" , "DTWS1" , "DTWS2" , "DTWS3" , "DTWS4" , "XPYPR" , "KIDNO" , "ABSBT" , "CCBTC" , "PYCUR" , "PYAMT" , "BUPLA"
, "SECCO" , "CESSION_KZ" , "PPDIFF" , "PPDIF2" , "PPDIF3" , "KBLNR" , "KBLPOS" , "GRANT_NBR" , "GMVKZ" , "SRTYPE" , "LOTKZ" , "FKBER" , "INTRE
NO" , "PPRCT" , "BUZID" , "AUGGJ" , "HKTID" , "BUDGET_PD" , "KONTT" , "KONTL" , "UEBGDAT" , "VNAME" , "EGRUP" , "BTYPE" , "PROPMANO" , "YYSTORE
" , "YYDELGRP" , "YYBOLNR" FROM "BSAD" WHERE "MANDT" = :A0 AND "KUNNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 ) AND "BUKRS" = :A6 AND "AUGDT" = :A7
user_id=27 user_name=SAPSR3 module=RSXPLORA action=7093
sql_id=82mdu08rbcnyy plan_hash_value=1162638466 problem_type=3
----- Current SQL Statement for this session (sql_id=82mdu08rbcnyy) -----
EXPLAIN PLAN SET STATEMENT_ID='SAP_STMT' FOR /*+ 142235 */ SELECT "MANDT" , "BUKRS" , "KUNNR" , "UMSKS" , "UMSKZ" , "AUGDT" , "AUGBL" , "ZUONR"
, "GJAHR" , "BELNR" , "BUZEI" , "BUDAT" , "BLDAT" , "CPUDT" , "WAERS" , "XBLNR" , "BLART" , "MONAT" , "BSCHL" , "ZUMSK" , "SHKZG" , "GSBER" ,
"MWSKZ" , "DMBTR" , "WRBTR" , "MWSTS" , "WMWST" , "BDIFF" , "BDIF2" , "SGTXT" , "PROJN" , "AUFNR" , "ANLN1" , "ANLN2" , "SAKNR" , "HKONT" , "FK
ONT" , "FILKD" , "ZFBDT" , "ZTERM" , "ZBD1T" , "ZBD2T" , "ZBD3T" , "ZBD1P" , "ZBD2P" , "SKFBT" , "SKNTO" , "WSKTO" , "ZLSCH" , "ZLSPR" , "ZBFIX
" , "HBKID" , "BVTYP" , "REBZG" , "REBZJ" , "REBZZ" , "SAMNR" , "ANFBN" , "ANFBJ" , "ANFBU" , "ANFAE" , "MANSP" , "MSCHL" , "MADAT" , "MANST" ,
"MABER" , "XNETB" , "XANET" , "XCPDD" , "XINVE" , "XZAHL" , "MWSK1" , "DMBT1" , "WRBT1" , "MWSK2" , "DMBT2" , "WRBT2" , "MWSK3" , "DMBT3" , "W
RBT3" , "BSTAT" , "VBUND" , "VBELN" , "REBZT" , "INFAE" , "STCEG" , "EGBLD" , "EGLLD" , "RSTGR" , "XNOZA" , "VERTT" , "VERTN" , "VBEWA" , "WVER
W" , "PROJK" , "FIPOS" , "NPLNR" , "AUFPL" , "APLZL" , "XEGDR" , "DMBE2" , "DMBE3" , "DMB21" , "DMB22" , "DMB23" , "DMB31" , "DMB32" , "DMB33"
, "BDIF3" , "XRAGL" , "UZAWE" , "XSTOV" , "MWST2" , "MWST3" , "SKNT2" , "SKNT3" , "XREF1" , "XREF2" , "XARCH" , "PSWSL" , "PSWBT" , "LZBKZ" , "
LANDL" , "IMKEY" , "VBEL2" , "VPOS2" , "POSN2" , "ETEN2" , "FISTL" , "GEBER" , "DABRZ" , "XNEGP" , "KOSTL" , "RFZEI" , "KKBER" , "EMPFB" , "PRC
TR" , "XREF3" , "QSSKZ" , "ZINKZ" , "DTWS1" , "DTWS2" , "DTWS3" , "DTWS4" , "XPYPR" , "KIDNO" , "ABSBT" , "CCBTC" , "PYCUR" , "PYAMT" , "BUPLA"
, "SECCO" , "CESSION_KZ" , "PPDIFF" , "PPDIF2" , "PPDIF3" , "KBLNR" , "KBLPOS" , "GRANT_NBR" , "GMVKZ" , "SRTYPE" , "LOTKZ" , "FKBER" , "INTRE
NO" , "PPRCT" , "BUZID" , "AUGGJ" , "HKTID" , "BUDGET_PD" , "KONTT" , "KONTL" , "UEBGDAT" , "VNAME" , "EGRUP" , "BTYPE" , "PROPMANO" , "YYSTORE
" , "YYDELGRP" , "YYBOLNR" FROM "BSAD" WHERE "MANDT" = :A0 AND "KUNNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 ) AND "BUKRS" = :A6 AND "AUGDT" = :A7
sql_text_length=2001
----- Explain Plan Dump -----
----- Plan Table -----
============
Plan Table
============
| Id | Operation | Name | Rows | Bytes | Cost | Time |
| 0 | SELECT STATEMENT | | | | 2 | |
| 1 | INLIST ITERATOR | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID | BSAD | 1 | 601 | 2 | 00:00:01 |
| 3 | INDEX RANGE SCAN | BSAD~1 | 1 | | 1 | 00:00:01 |
Predicate Information:
3 - access("MANDT"=:A0 AND (("KUNNR"=:A1 OR "KUNNR"=:A2 OR "KUNNR"=:A3 OR "KUNNR"=:A4 OR "KUNNR"=:A5)) AND "BUKRS"=:A6 AND "AUGDT"=:A7)
Content of other_xml column
===========================
db_version : 11.2.0.1
parse_schema : SAPSR3
plan_hash : 1162638466
plan_hash_2 : 3684135643
Outline Data:
/*+
BEGIN_OUTLINE_DATA
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('11.2.0.1')
DB_VERSION('11.2.0.1')
OPT_PARAM('query_rewrite_enabled' 'false')
OPT_PARAM('_optim_peek_user_binds' 'false')
OPT_PARAM('_optimizer_extended_cursor_sharing_rel' 'none')
OPT_PARAM('_optimizer_adaptive_cursor_sharing' 'false')
OPT_PARAM('_optimizer_use_feedback' 'false')
OPT_PARAM('star_transformation_enabled' 'true')
OPT_PARAM('optimizer_index_cost_adj' 20)
OPT_PARAM('_fix_control' '4728348:0 5483301:0 5705630:1 6626018:1 6440977:1 6972291:1 6399597:1 6430500:1 5099019:1 9196440:1 9495669:1 8
937971:1')
ALL_ROWS
OUTLINE_LEAF(@"SEL$1")
INDEX_RS_ASC(@"SEL$1" "BSAD"@"SEL$1" ("BSAD"."MANDT" "BSAD"."KUNNR" "BSAD"."BUKRS" "BSAD"."AUGDT" "BSAD"."AUGBL" "BSAD"."GJAHR" "BSAD"."B
ELNR" "BSAD"."BUZEI" "BSAD"."BUDAT"))
END_OUTLINE_DATA
Query Block Registry:
SEL$1 0xc4c8a150 (PARSER) [FINAL]
call(in-use=194136, alloc=229336), compile(in-use=233336, alloc=338904), execution(in-use=540368, alloc=544176)
End of Optimizer State Dump
Dumping Hints
=============
====================== END SQL Statement Dump ======================
thx
Jonu Joywould anyone please advise It looks OK to me.
-
Database hints in select statement
Hi all,
i need to apply the databaser hints for my select statement where i am using for all entries clause .But the issue is that i am getting the dump when i am tring with the same .
If i use the hint without all entries clause ,it runs fine.
The query where i need to apply the hint is :
SELECT * FROM bsim "n443935
INTO CORRESPONDING FIELDS OF TABLE g_t_bsim_lean "n443935
FOR ALL ENTRIES IN t_bwkey WHERE bwkey = t_bwkey-bwkey
AND matnr IN matnr
AND bwtar IN bwtar
AND budat >= datum-low.
and the DB hint is:
Addition of database hints for DB6 as per OSS message 649621
%_HINTS
DB6 'USE_OPTLEVEL 7' " Insert CR-1000000473 Tr-D11K934315
DB6 '&SUBSTITUTE VALUES&'.
Let me know whats the issue for the dump in for all entries in clause.Did you check if [https://service.sap.com/sap/support/notes/1520152|https://service.sap.com/sap/support/notes/1520152] applies?
-
Clarification on Select statement
Hello all,
can u please any one tell me the solution.
In one condition.
i am getting the data from marc mkpf and mseg
my requirement is
get the material number from marc based on plant on selection screen
get some data from mkpf table based on posting date(budat) on selection screen entered .
then
get the material data from mseg table based on matnr = equal to point1
mblnr = equal to point2
mjahr = equal to point2.
here some fields is there that equal to selection screen fields.
for that i have written the code like this
one way:
select matnr
werks
from marc
into table out_it_marc
where werks in s_werks.
sort out_it_marc by matnr werks.
delete adjacent duplicates from out_it_marc
comparing matnr werks.
loop at out_it_marc into lfl_marc.
vr_matnr-low = lfl_marc-matnr.
vr_matnr-sign = c_in.
vr_matnr-option = c_eq.
append vr_matnr.
clear : lfl_marc.
endloop.
FORM get_mseg_data
tables i_r_matnr structure vr_matnr
USING in_it_mkpf type t_it_mkpf
changing out_it_mseg type t_it_mseg.
if not in_it_mkpf[] is initial.
select
MBLNR "Number of Material Document
MJAHR "Material Document Year
BWART "Movement Type (Inventory Management)
MATNR "Material Number
WERKS "Plant
LGORT "Storage location
SOBKZ "Special Stock Indicator
LIFNR "Vendor's account number
KUNNR "Account number of customer
DMBTR "Amount in local currency
MENGE "Quantity
MEINS "Base Unit of Measure
EBELN "Purchase order number
KOSTL "Cost Center
AUFNR "Order Number
BUKRS "company code
PS_PSP_PNR "Work Breakdown Structure Element (WBS Element)
SAKTO "G/L account number
from mseg
into table out_it_mseg
for all entries in in_it_mkpf
where mblnr eq in_it_mkpf-mblnr
and mjahr eq in_it_mkpf-mjahr
and bwart in s_bwart
and matnr in vr_matnr
and werks in s_werks
and kostl in s_kostl
and ps_psp_pnr in s_pspnr.
endif.
but its getting dump because of so many records
so that i have written again like this.
FORM get_mkpf_mseg_data USING in_it_marc type t_it_marc
changing out_it_mkpf_mseg type t_it_mkpf_mseg.
if not in_it_marc[] is not initial.
select A~mblnr
A~mjahr
A~budat
A~cpudt
A~cputm
A~usnam
A~xblnr
B~BWART "Movement Type (Inventory Management)
B~MATNR "Material Number
B~WERKS "Plant
B~LGORT "Storage location
B~SOBKZ "Special Stock Indicator
B~LIFNR "Vendor's account number
B~KUNNR "Account number of customer
B~DMBTR "Amount in local currency
B~MENGE "Quantity
B~MEINS "Base Unit of Measure
B~EBELN "Purchase order number
B~KOSTL "Cost Center
B~AUFNR "Order Number
B~BUKRS "company code
B~PS_PSP_PNR "Work Breakdown Structure Element (WBS Element)
B~SAKTO "G/L account number
INTO TABLE out_it_mkpf_mseg
from mkpf AS A INNER JOIN MSEG AS B
ON AMBLNR = BMBLNR
AND AMJAHR = BMJAHR
FOR ALL ENTRIES IN IN_IT_MARC
WHERE B~MATNR = IN_IT_MARC-MATNR
AND B~WERKS = IN_IT_MARC-WERKS
AND A~BUDAT IN S_BUDAT
AND B~BWART IN S_BWART
AND MATNR = IN_IT_MSEG-MATNR
AND WERKS = IN_IT_MSEG-WERKS
AND B~KOSTL IN S_KOSTL
AND B~PS_PSP_PNR IN S_PSPNR.
ENDIF.
BREAK-POINT.
ENDFORM. " get_mkpf_mseg_data
but this select statement is not working properly
is there anyway to solve it.
please give me the solution ASAP, its urgent.
Thanks in advance....Hi bs,
you dont\'t have to build a range table vr_matnr for the selection, you just can use for all entries. See help on WHERE-clause:
Suppose FTAB is filled as follows:
CARRID CONNID
LH 2415
SQ 0026
LH 0400
SELECT * FROM sflight INTO wa_sflight
FOR ALL ENTRIES IN ftab
WHERE CARRID = ftab-carrid AND
CONNID = ftab-connid AND
fldate = '20010228'.
free = wa_sflight-seatsocc - wa_sflight-seatsmax.
WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
ENDSELECT.
Cheers,
Stefan -
Performance Tuning 'Runtime Error' on Select statement
Hi Experts,
Good Day!
I would like to ask some help regarding a custom program that will encounter 'Runtime Error' on the below codes on how to perform performance tunning especially number 1.
1.
SELECT A~VBELN A~ERDAT A~AUART A~VKORG A~VTWEG A~SPART A~VDATU
A~KUNNR B~POSNR B~MATNR B~ARKTX B~ABGRU B~KWMENG B~VRKME
B~WERKS B~VSTEL B~ROUTE
FROM VBAK AS A INNER JOIN VBAP AS B ON A~VBELN EQ B~VBELN
INNER JOIN VBEP AS C ON A~VBELN EQ C~VBELN
AND B~POSNR EQ C~POSNR
INTO CORRESPONDING FIELDS OF TABLE I_DATA_TAB
WHERE A~VBELN IN S_VBELN
AND A~VKORG IN S_VKORG
AND A~AUART IN S_AUART
AND A~VTWEG IN S_VTWEG
AND A~SPART IN S_SPART
AND A~VDATU IN S_VDATU
AND A~KUNNR IN S_KUNNRD
AND B~MATNR IN S_MATNR
AND B~KWMENG IN S_KWMENG
AND B~VRKME IN S_VRKME
AND B~WERKS IN S_WERKS
AND C~EDATU IN S_VDATU.
2.
SELECT VBELN FROM LIKP INTO LIKP-VBELN
WHERE LFDAT IN S_VDATU
AND VKORG IN S_VKORG
AND LFART EQ 'YSTD'
AND KUNNR IN S_KUNNRP
AND KUNAG IN S_KUNNRD
SELECT VBELN POSNR LFIMG MATNR WERKS
FROM LIPS INTO (LIPS-VBELN, LIPS-POSNR, DISPLAY_TAB-DEL_QTY,
LIPS-MATNR, LIPS-WERKS)
WHERE VBELN EQ LIKP-VBELN
AND MATNR IN S_MATNR
AND VTWEG IN S_VTWEG
AND SPART IN S_SPART
AND WERKS IN S_WERKS.
ENDSELECT.
ENDSELECT.
4.
SELECT DELIVERY POSNR MATNR PODLFIMG FROM T9YPODI INTO
(T9YPODI-DELIVERY, T9YPODI-POSNR, T9YPODI-MATNR, T9YPODI-PODLFIMG)
WHERE MATNR IN S_MATNR
AND PODDATE IN S_VDATU.
Answer's will be a great help.
~Thank You,
Lourd
Edited by: Lourd06 on Oct 23, 2009 10:32 AM
Moderator message - Welcome to SCN.
Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting. You're in the driver's seat here. It's up to you to do some analysis before expecting that people can halp you. - post locked
And please use code tags.
Edited by: Rob Burbank on Oct 23, 2009 9:13 AMHi All,
We've checked the transaction ST22 it is TIME OUT. I really need your help on this the program will dump in number 1 Select statement. Can you help me perform a performance tunning.
In transaction ST22
Runtime Errors TIME_OUT
Date and Time 21.10.2009 08:51:33
Short text
Time limit exceeded.
What happened?
The program "ZV0PSR10" has exceeded the maximum permitted runtime without
interruption and has therefore been terminated.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
After a specific time, the program is terminated to make the work area
available to other users who may be waiting.
This is to prevent a work area being blocked unnecessarily long by, for
example:
- Endless loops (DO, WHILE, ...),
- Database accesses with a large result set
- Database accesses without a suitable index (full table scan)
The maximum runtime of a program is limited by the system profile
parameter "rdisp/max_wprun_time". The current setting is 1200 seconds. If this
time limit is
exceeded, the system attempts to cancel any running SQL statement or
signals the ABAP processor to stop the running program. Then the system
waits another 60 seconds maximum. If the program is then still active,
the work process is restarted.
~Thank you
Lourd
Edited by: Lourd06 on Oct 23, 2009 11:22 AM
Edited by: Lourd06 on Oct 23, 2009 11:33 AM -
I can't use my field-symbols in my select statement...
Hello experts,
I am have been having problems with my report for the past days. My problem is,
I declared a dynamic field symbol so that I can use it in my select statement
instead of the standard internal table. But it is giving me a dump. Below is my code:
REPORT zfr_forex_rev_acctg
NO STANDARD PAGE HEADING
LINE-COUNT 0
LINE-SIZE 100.
Data dictionary tables *
TABLES: bsis,
bsas,
tcurr,
t001.
FIELD-SYMBOLS: <fs_dyntable> TYPE STANDARD TABLE,
<fs_dynline> TYPE ANY,
<fs_fld> TYPE ANY,
<fs_data> TYPE REF TO data,
<fs_1> TYPE ANY,
<fs_2> TYPE ANY TABLE.
CLASS lcl_main DEFINITION.
PUBLIC SECTION.
METHODS: build_table,
get_data,
combine_data,
display_header,
display_results.
PRIVATE SECTION.
TYPES: BEGIN OF t_bsis_bsas,
zuonr TYPE bsis-zuonr,
gjahr TYPE bsis-gjahr,
belnr TYPE bsis-belnr,
bldat TYPE bsis-bldat,
waers TYPE bsis-waers,
blart TYPE bsis-blart,
dmbtr TYPE bsis-dmbtr,
wrbtr TYPE bsis-wrbtr,
hkont TYPE bsis-hkont,
amount TYPE bsis-wrbtr,
END OF t_bsis_bsas.
DATA: it_bsis_bsas TYPE STANDARD TABLE OF t_bsis_bsas,
v_counter TYPE i.
data declarations for internal table
DATA: lt TYPE lvc_t_fcat,
ls TYPE lvc_s_fcat,
fldname(50) TYPE c,
it_ddfields TYPE TABLE OF ddfield,
wa_ddfields LIKE LINE OF it_ddfields.
ENDCLASS.
CLASS lcl_main IMPLEMENTATION.
METHOD build_table
METHOD build_table.
DATA: lv_from TYPE bsis-gjahr,
lv_asof TYPE bsis-gjahr,
lv_check TYPE i,
lt_data TYPE REF TO data,
lt TYPE lvc_t_fcat.
FIELD-SYMBOLS: <fs_year> TYPE gjahr.
ASSIGN lv_asof TO <fs_year>.
lv_from = p_year.
lv_asof = p_asof+0(4).
v_counter = lv_asof - lv_from.
wa_ddfields-fieldname = 'ZUONR'.
wa_ddfields-position = '0001'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000018'.
wa_ddfields-decimals = '00000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'GJAHR'.
wa_ddfields-position = '0002'.
wa_ddfields-datatype = 'NUMC'.
wa_ddfields-leng = '000004'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'BELNR'.
wa_ddfields-position = '0003'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'BLDAT'.
wa_ddfields-position = '0004'.
wa_ddfields-datatype = 'DATS'.
wa_ddfields-leng = '000008'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'WAERS'.
wa_ddfields-position = '0005'.
wa_ddfields-datatype = 'CUKY'.
wa_ddfields-leng = '000005'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'BLART'.
wa_ddfields-position = '0006'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000002'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'DMBTR'.
wa_ddfields-position = '0007'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000013'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'WRBTR'.
wa_ddfields-position = '0008'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000013'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'HKONT'.
wa_ddfields-position = '0009'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
wa_ddfields-fieldname = 'AMOUNT'.
wa_ddfields-position = '0010'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
DATA: lv_position TYPE i.
lv_position = 0011.
WHILE lv_check < v_counter.
<fs_year> = lv_asof.
wa_ddfields-fieldname = <fs_year>.
wa_ddfields-position = lv_position.
wa_ddfields-datatype = 'NUMC'.
wa_ddfields-leng = '000004'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
lv_asof = lv_asof - 1.
ADD 1 TO: lv_check, lv_position.
ENDWHILE.
CLEAR lv_position.
lv_position = 1.
LOOP AT it_ddfields INTO wa_ddfields.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
APPEND ls TO lt.
ADD 1 TO lv_position.
ENDLOOP.
CLEAR lv_position.
ASSIGN lt_data TO <fs_data>.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ASSIGN <fs_data>->* TO <fs_1>.
ASSIGN <fs_1> TO <fs_2>.
ASSIGN <fs_1> TO <fs_dyntable>.
ENDMETHOD.
METHOD get_data
METHOD get_data.
*get records from BSIS
SELECT zuonr gjahr belnr bldat waers blart dmbtr wrbtr hkont
FROM bsis
INTO CORRESPONDING FIELDS OF TABLE <fs_dyntable>
WHERE bukrs = p_bukrs
AND hkont IN s_hkont
AND budat <= p_asof.
*get records from BSAS
SELECT zuonr gjahr belnr bldat waers blart dmbtr wrbtr hkont
FROM bsas
APPENDING CORRESPONDING FIELDS OF TABLE <fs_dyntable>
WHERE bukrs = p_bukrs
AND hkont IN s_hkont
AND budat <= p_asof
AND augdt > p_asof.
ENDMETHOD.
START-OF-SELECTION.
DATA: main TYPE REF TO lcl_main.
CREATE OBJECT main.
CALL METHOD main->build_table.
CALL METHOD main->get_data.
Need help on this problem. Thanks a lot guys and take care!Hi guys,
I found out the problem and Andreas is right. Now, I am having problems when including DMBTR, WRBTR in my select statement. All the others are ok. Here is my modified code. Please suggest what I need to add/modify. Thanks a lot!
CLASS lcl_main IMPLEMENTATION.
METHOD build_table
METHOD build_table.
DATA: lv_from TYPE bsis-gjahr,
lv_asof TYPE bsis-gjahr,
lv_check TYPE i,
lt_data TYPE REF TO data,
lt TYPE lvc_t_fcat.
FIELD-SYMBOLS: <fs_year> TYPE gjahr.
ASSIGN lv_asof TO <fs_year>.
lv_from = p_year.
lv_asof = p_asof+0(4).
v_counter = lv_asof - lv_from.
ZUONR
wa_ddfields-fieldname = 'ZUONR'.
wa_ddfields-position = '0001'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000018'.
wa_ddfields-decimals = '00000'.
APPEND wa_ddfields TO it_ddfields.
GJAHR
wa_ddfields-fieldname = 'GJAHR'.
wa_ddfields-position = '0002'.
wa_ddfields-datatype = 'NUMC'.
wa_ddfields-leng = '000004'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
BELNR
wa_ddfields-fieldname = 'BELNR'.
wa_ddfields-position = '0003'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
BLDAT
wa_ddfields-fieldname = 'BLDAT'.
wa_ddfields-position = '0004'.
wa_ddfields-datatype = 'DATS'.
wa_ddfields-leng = '00008'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
WAERS
wa_ddfields-fieldname = 'WAERS'.
wa_ddfields-position = '0005'.
wa_ddfields-datatype = 'CUKY'.
wa_ddfields-leng = '000005'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
BLART
wa_ddfields-fieldname = 'BLART'.
wa_ddfields-position = '0006'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000002'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
DMBTR
wa_ddfields-fieldname = 'DMBTR'.
wa_ddfields-position = '0007'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000013'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
WRBTR
wa_ddfields-fieldname = 'WRBTR'.
wa_ddfields-position = '0008'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000013'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
HKONT
wa_ddfields-fieldname = 'HKONT'.
wa_ddfields-position = '0009'.
wa_ddfields-datatype = 'CHAR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
AMOUNT
wa_ddfields-fieldname = 'AMOUNT'.
wa_ddfields-position = '0010'.
wa_ddfields-datatype = 'CURR'.
wa_ddfields-leng = '000010'.
wa_ddfields-decimals = '000002'.
APPEND wa_ddfields TO it_ddfields.
DATA: lv_position TYPE i.
lv_position = 0011.
Additional fields for the years
WHILE lv_check < v_counter.
wa_ddfields-fieldname = <fs_year>.
wa_ddfields-position = lv_position.
wa_ddfields-datatype = 'NUMC'.
wa_ddfields-leng = '000004'.
wa_ddfields-decimals = '000000'.
APPEND wa_ddfields TO it_ddfields.
lv_asof = lv_asof - 1.
ADD 1 TO: lv_check, lv_position.
ENDWHILE.
CLEAR lv_position.
lv_position = 1.
LOOP AT it_ddfields INTO wa_ddfields.
CASE wa_ddfields-fieldname.
WHEN 'BLDAT'.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
ls-inttype = 'D'.
ls-ref_table = 'BSIS'.
ls-ref_field = 'BLDAT'.
WHEN 'WAERS'.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
ls-ref_table = 'BSIS'.
ls-ref_field = 'WAERS'.
when 'DMBTR'.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
ls-ref_table = 'BSIS'.
ls-ref_field = 'DMBTR'.
when 'WRBTR'.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
ls-ref_table = 'BSIS'.
ls-ref_field = 'WRBTR'.
WHEN OTHERS.
ls-col_pos = lv_position.
ls-row_pos = lv_position.
ls-fieldname = wa_ddfields-fieldname.
ENDCASE.
APPEND ls TO lt.
ADD 1 TO lv_position.
ENDLOOP.
CLEAR lv_position.
ASSIGN lt_data TO <fs_data>.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ASSIGN <fs_data>->* TO <fs_1>.
ASSIGN <fs_1> TO <fs_2>.
ASSIGN <fs_1> TO <fs_dyntable>.
ENDMETHOD.
Maybe you are looking for
-
Problem importing ics files into iCal
Importing ics files into iCal is the problem, but first here is the background on why I'm trying to import. I have an iMac and iPad, and recently changed my iPhone 3G for an iPhone 4S. Having got the iPhone 4S I have now set up all my devices to use
-
My iPad Air will suddenly quit in the middle of an application and return to home screen.
Can anyone tell me why my iPad Air will suddenly stop in the middle of an application, (usually a game), and return to my home screen? Thanks
-
(PDF) Acrobat X's "Save Optimized" Option
Hi, When using the "Save Optimized" dialog in Adobe Acrobat X, we can see that Acrobat strips out a LOT of stuff from the document to make the size as manageable as possible. But I can't for the life of me find the checkbox corresponding to whatever
-
Worksheet 1 uses a parameter for "Plant" to produce a report of all of the engineers for the selected Plant(s). We would like to use the list of engineers from worksheet 1 as the LOV for an "Engineer" parameter in worksheet 2 in order to produce a re
-
How do you access SENS in JAVA
Hi, I would like to know how to access SENS (System Event Notification Service) in JAVA, any hints?