ALV Toolbar Runtime error
Hi
i am enhancing one report.i just added some fields like standard price,special procurement,safety stock.i'm displaying the
report in ALV.my problem is report displaying is fine.but when i click any ALV toolbar buttons like export to local file,print preview.before enhancement,ALV tool bar is working fine.it is showing the runtime error like "The statement strlen(obj) the argument 'obj' can only take a character type data obj.in this case,the operand 'ob' has the non character type".i am unabale to find where exactly error is occuring.. when i start debugger in runtime error 'the cursor going to 'gs_out-hlplen = strlen( <field> ).when i click this one is is showing my standard price value of the first material in ALV like '3367.44'.can anyone suggest on this issue.
Thanks
Arjun
Hi PranavJeeth,
this is my field catalog.i'm just showing one field.
PERFORM set_field USING:
FIELD SHORT TEXT LONG TEXT OUTLEN TYP FMT SUM HID
'STPRS' 'STD.PRICE ' 'STANDARD PRICE ' '00011' 'P' ' ' ' ' ' ',
FORM set_field USING pv_fieldname TYPE c
pv_descr_s TYPE c
pv_descr_m TYPE c
pv_length TYPE c
pv_inttype TYPE c
pv_format TYPE c
pv_sum TYPE c
pv_hide TYPE c.
CLEAR gw_fieldcat.
gw_fieldcat-fieldname = pv_fieldname.
gw_fieldcat-seltext_s = pv_descr_s.
gw_fieldcat-seltext_m = pv_descr_m.
gw_fieldcat-outputlen = pv_length.
gw_fieldcat-inttype = pv_inttype.
gw_fieldcat-no_out = pv_hide.
CASE pv_format.
*-- Prices must have corresponding currency for format purposes
If no currency field is needed (fixed currency), use
GW_FIELDCAT-CURRENCY instead of GW_FIELDCAT-CFIELDNAME
WHEN 'P'. " prices
gw_fieldcat-currency = 'MYR'.
gw_fieldcat-do_sum = pv_sum.
when i excute report is ok.but when we clcik on alv toolbar runtime error occuring.when i run debugger,the code like this
if gs_fc-tech_form ne 99.
gs_out-hlplen = strlen( <field> ).
endif.
when i click on field the values like this
<field> = 100
gs_fc-tech_form = 90.
please suggest on this issue.
Similar Messages
-
ALV list -Runtime error using the Spreadsheet button(CTRL+SHIFT+F7)
Hi,
We are on ECC6.0.When ever I try to use the button 'Spreadsheet' (CTRLSHIFTF7) it gives me the following runtime error.It works fine if I use the export button.Also it works for ALV grid.Issue is only with ALV list.
Can you pelase advise waht could be the issue.
Thanks
Venkat
Runtime Errors GETWA_NOT_ASSIGNED
Date and Time 08.06.2009 16:02:22
Short text
Field symbol has not yet been assigned.
What happened?
Error in the ABAP Application Program
The current ABAP program "CL_SALV_BS_TT_RESULT_TABLE====CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
You attempted to access an unassigned field symbol
(data segment 32781).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
Trigger Location of Runtime Error
Program CL_SALV_BS_TT_RESULT_TABLE====CP
Include CL_SALV_BS_TT_RESULT_TABLE====CM00L
Row 165
Module type (METHOD)
Module Name GET_CELL_VALUE
Source Code Extract
Line
SourceCde
135
call method cl_alv_xslt_transform=>get_days_since_1900
136
exporting
137
i_date = l_date
138
receiving
139
e_num = attribute01.
140
141
elseif ls_attribute-s_dfies-inttype eq cl_abap_typedescr=>typekind_time. "Time
142
data:
143
l_time type t.
144
145
l_time = <l_data>.
146
147
call method cl_alv_xslt_transform=>get_isotime_from_inttime
148
exporting
149
i_value = l_time
150
receiving
151
e_value = value.
152
153
*... fill attribute01 with percent value of actual day
154
call method cl_alv_xslt_transform=>get_percent_of_act_day
155
exporting
156
i_time = l_time
157
receiving
158
e_num = attribute01.
159
160
elseif ls_attribute-s_dfies-inttype ca if_salv_bs_log_exp_operand=>c_numeric and
161
ls_attribute-s_dfies-convexit is initial.
162
case ls_attribute-s_dfies-reference_field_type.
163
when if_salv_bs_c_data=>reffieldtype_curr.
164
*... get iso value for currency value
>>>>>
call method cl_alv_xslt_transform=>get_isonum_from_intnum
166
exporting
167
i_value = <l_data>
168
i_currency = <l_reference>
169
i_decimals = ls_attribute-s_dfies-decimals
170
importing
171
e_value = l_isovalue.
172
173
when if_salv_bs_c_data=>reffieldtype_quan.
174
*... get iso value for quantity value
175
call method cl_alv_xslt_transform=>get_isonum_from_intnum
176
exporting
177
i_value = <l_data>
178
i_unit = <l_reference>
179
i_decimals = ls_attribute-s_dfies-decimals
180
importing
181
e_value = l_isovalue.
182
183
when others.
184
*... get iso value for valueHi Pinaki,
Thanks for your reply.
below is my code.
data: t_fieldcat type slis_t_fieldcat_alv,
w_fieldcat like line of t_fieldcat,
w_layout type slis_layout_alv,
t_sort type slis_t_sortinfo_alv,
w_sort like line of t_sort,
t_events type slis_t_event,
w_events like line of t_events.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZSD_ORDERS'
i_bypassing_buffer = 'X'
changing
ct_fieldcat = t_fieldcat.
data: l_lines_fieldcat type i.
describe table t_fieldcat lines l_lines_fieldcat.
clear: w_fieldcat.:
w_fieldcat-col_pos = l_lines_fieldcat + 1.
w_fieldcat-datatype = 'QUAN'.
w_fieldcat-just = ' '.
w_fieldcat-do_sum = ' '.
w_fieldcat-fieldname = 'ZZSCLQTY'.
w_fieldcat-tabname = 'T_DATA'.
w_fieldcat-qfieldname = 'VRKME'.
w_fieldcat-seltext_s = text-a01.
w_fieldcat-seltext_m = text-a01.
w_fieldcat-seltext_l = text-a01.
append w_fieldcat to t_fieldcat.
Modify column headings
loop at t_fieldcat into w_fieldcat.
case w_fieldcat-fieldname.
when 'MATNR'.
w_fieldcat-no_zero = 'X'.
when 'ZZPRICECHECK'.
w_fieldcat-reptext_ddic = text-l01.
when 'KZWI5'.
w_fieldcat-reptext_ddic = text-l02.
when 'VBELN'.
w_fieldcat-hotspot = 'X'.
when 'BMENG'.
w_fieldcat-do_sum = 'X'.
when 'COUNTER'.
w_fieldcat-do_sum = 'X'.
w_fieldcat-reptext_ddic = text-l03.
when 'OBJDE'.
w_fieldcat-reptext_ddic = 'Obj ID'.
endcase.
modify t_fieldcat from w_fieldcat.
endloop.
Format output options
clear w_layout.
w_layout-colwidth_optimize = 'X'.
w_layout-zebra = 'X'.
w_layout-get_selinfos = 'X'.
w_layout-detail_initial_lines = 'X'.
w_layout-group_change_edit = 'X'.
Specify list processing events
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
Fit Add List Variant from Selection Screen "003
clear: w_variant.
w_variant-report = sy-repid.
w_variant-variant = sp_vari.
end Fit02
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = w_repid
is_layout = w_layout
it_sort = t_sort
i_callback_user_command = 'USER_COMMAND'
is_variant = w_variant
i_save = 'A'
it_fieldcat = t_fieldcat[]
it_events = t_events[]
tables
t_outtab = t_data.
endform. -
Getting runtime Error 'UC_OBJECTS_NOT_CHARLIKE' for ALV grid
Hi,
When I call method SET_TABLE_FOR_FIRST_DISPLAY of ALV I get runtime error 'UC_OBJECTS_NOT_CHARLIKE'.
Actually i have set in the fieldcatalog the field 'CHK' of internal table as checkbox.
wa_fcat-fieldname = 'CHK' .
wa_fcat-coltext = 'Clear' .
wa_fcat-seltext = 'Clear' .
wa_fcat-checkbox = 'X' .
wa_fcat-edit = 'X' .
APPEND wa_fcat to p_lt_fieldcatalog .
Field CHK is of type c.
when i dont set the field as checkbox, I stop getting the error.
Please find a solution.
regards,
auroRelevant parts of code are:
Data Declaration:
types: begin of tt_revenue_det,
chk type c,
budat like zefit0006-zefibudat,
racct_txt like skat-txt50,
amount like zefit0006-zefihsl,
pbar_txt like tgsbt-gtext,
sgtxt like zefit0006-zefisgtxt,
costcentertxt like cskt-ktext,
bar_txt like skat-txt50,
doctype like zefit0006-zefiblart,
ch_flag type c,
end of tt_revenue_det,
data: gt_revenue_det type table of tt_revenue_det.
FIELD CATALOG
*& Form set_fieldcatalog_rev_det
text
-->P_LT_FIELDCATALOG text
form set_fieldcatalog_rev_det using p_lt_fieldcatalog type lvc_t_fcat.
data:wa_fcat type lvc_s_fcat.
wa_fcat-fieldname = 'P_GT_REVENUE_DET-CHK' .
wa_fcat-coltext = 'Clear' .
wa_fcat-seltext = 'Clear' .
wa_fcat-checkbox = 'X' .
wa_fcat-edit = 'X' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'BUDAT' .
wa_fcat-coltext = 'Posting Date' .
wa_fcat-seltext = 'Posting Date' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'RACCT_TXT' .
wa_fcat-coltext = 'Account Item Text' .
wa_fcat-seltext = 'Account Item Text' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'AMOUNT' .
wa_fcat-coltext = 'Amount' .
wa_fcat-seltext = 'Amount' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'PBAR_TXT' .
wa_fcat-coltext = 'Partner Business Area' .
wa_fcat-seltext = 'Partner Business Area' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'SGTXT' .
wa_fcat-coltext = 'Item Text' .
wa_fcat-seltext = 'Item Text' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'COSTCENTERTXT' .
wa_fcat-coltext = 'Cost Center' .
wa_fcat-seltext = 'Cost Center' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'BAR_TXT' .
wa_fcat-coltext = 'Business Area' .
wa_fcat-seltext = 'Business Area' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'DOCTYPE' .
wa_fcat-coltext = 'Type' .
wa_fcat-seltext = 'Type' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'CH_FLAG' .
wa_fcat-coltext = 'Split' .
wa_fcat-seltext = 'Split' .
APPEND wa_fcat to p_lt_fieldcatalog .
endform. " set_fieldcatalog_rev_det
CREATE ALV
*& Form create_alv_revenue_det
text
-->P_GT_REVENUE_DET text
form create_alv_revenue_det using p_gt_revenue_det.
ALV related data declaration
DATA: lf_layout TYPE lvc_s_layo, "alv layout
lt_fieldcatalog type table of lvc_s_fcat, "field catalog internal table
wa_fieldcatalog type lvc_s_fcat. "work area for field catalog
create alv only if container is initial
IF G_CUSTOM_CONTAINER_REV_DET IS INITIAL.
lf_layout-no_toolbar = 'X'. " no toolbar
lf_layout-sel_mode = 'B'.
populate field catalog
perform set_fieldcatalog_rev_det using lt_fieldcatalog.
create instance of container class
CREATE OBJECT G_CUSTOM_CONTAINER_REV_DET
EXPORTING CONTAINER_NAME = G_CONTAINER_REV2.
create instance of alv grid class
CREATE OBJECT GR_ALVGRID_REV_DET
EXPORTING I_PARENT = G_CUSTOM_CONTAINER_REV_DET.
call method to display table in alv grid by passing layout and fieldcatalog
CALL METHOD GR_ALVGRID_REV_DET->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
is_layout = lf_layout
CHANGING
IT_OUTTAB = p_gt_revenue_det
IT_FIELDCATALOG = lt_fieldcatalog.
ENDIF.
endform. " create_alv_revenue_det -
Runtime Error in ALV Tree Output
Dear All, I am trying to create a ALV Tree using Class cl_gui_alv_tree. The Report Shows the Output with the first Node but when i try to expand it is dumping with a runtime error GETWA_NOT_ASSIGNED in class CL_ALV_TREE_BASE and method SET_ITEMS_FOR_COLUMN. The Reason being the data which was copied in the initial node display to mt_outtab is getting refreshed.
Can any one of you help me the reason for the table getting refreshed. Do i need to pass any data.
I am doing the following steps.
1. Create Container,
2. Create Tree Class object
3. Generate the Field Catalog.
4. Set table for first display " With empty internal table
5. Generate the Hierarchy
6. Call the Method Frontend Update.
Let me know if i had missed any steps in the process.
Thank you,
Regards,
Swaroop PatriOne reason for getting this error is using local defined tables for it_outtab parameter in the below code:
To get rid of the dump, define two distinct output tables globally: one is an empty table which you will pass to the below method, other one is your real output table whose size increases dependently.
CALL METHOD go_tree->set_table_for_first_display
EXPORTING
is_hierarchy_header = ls_hier_header
CHANGING
it_outtab = gt_data_e "Empty table
it_fieldcatalog = gt_fcat_tree. -
Regarding Runtime error in ALV List Display.
am using following to display data in ALV List.
but after executing of program am getting runtime error called 'Field Symbol has Not been assigned' .
please tell me how to correct the error.
Very urgent
Suitable answers rewarded with Maximum Ponits...
REPORT zmatrix.
TYPE-POOLS: slis.
TABLES: agr_define, sza5_d0700.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.
SELECT-OPTIONS: s_role FOR agr_define-agr_name OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
D A T A *
TYPES: BEGIN OF ty_agr_1251_inf,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_agr_1251_inf.
TYPES: BEGIN OF ty_agr_1251_tcode,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
tcode TYPE tstct-tcode,
ttext TYPE tstct-ttext,
END OF ty_agr_1251_tcode.
TYPES: BEGIN OF ty_t582s,
infty TYPE agval,
itext TYPE t582s-itext,
END OF ty_t582s.
TYPES: BEGIN OF ty_code,
tcode TYPE tstct-tcode,
ttext TYPE ttext_stct,
END OF ty_code.
TYPES: BEGIN OF ty_inf,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_inf.
TYPES: BEGIN OF ty_role,
agr_name TYPE agr_1251-agr_name,
END OF ty_role.
TYPES: BEGIN OF tys_role_dtls,
agr_name TYPE agr_name,
value TYPE c,
property TYPE c,
END OF tys_role_dtls.
TYPES: BEGIN OF tys_infotype_final,
text(60),
text1(60),
value(4),
END OF tys_infotype_final.
I N T E R N A L T A B L E S *
DATA: wa_infotyp_final TYPE tys_infotype_final.
DATA: t_infotyp_final TYPE TABLE OF tys_infotype_final.
DATA: BEGIN OF wa_infotyp_dtls,
infty TYPE infty,
itext TYPE intxt,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_infotyp_dtls.
DATA: BEGIN OF wa_tcode_dtls,
tcode TYPE tcode,
ttext TYPE ttext_stct,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_tcode_dtls.
DATA: t_infotyp_dtls LIKE TABLE OF wa_infotyp_dtls,
t_tcode_dtls LIKE TABLE OF wa_tcode_dtls,
t_role_dtls TYPE TABLE OF tys_role_dtls,
wa_role_dtls TYPE tys_role_dtls.
DATA: wa_inf TYPE ty_inf,
t_inf TYPE STANDARD TABLE OF ty_inf.
DATA: wa_role TYPE ty_role,
t_role TYPE STANDARD TABLE OF ty_role.
DATA: wa_tcode TYPE ty_code,
t_tcode TYPE TABLE OF ty_code.
DATA: wa_agr_1251_inf TYPE ty_agr_1251_inf.
DATA: wa_agr_1251_tcode TYPE ty_agr_1251_tcode.
DATA: t_agr_1251_inf TYPE STANDARD TABLE OF ty_agr_1251_inf.
DATA: t_agr_1251_tc TYPE STANDARD TABLE OF ty_agr_1251_tcode.
DATA: wa_582s TYPE ty_t582s.
DATA: t_582s TYPE STANDARD TABLE OF ty_t582s.
DATA: t_range_tcode TYPE RANGE OF tcode.
DATA: t_range_inf TYPE RANGE OF infotyp.
DATA: wa_range_inf LIKE LINE OF t_range_inf.
DATA: wa_range_tcode LIKE LINE OF t_range_tcode.
DATA: wa_field TYPE slis_fieldcat_alv.
DATA: t_field TYPE slis_t_fieldcat_alv.
VARIABLES FOR OLE *
DATA: text(20),
count(20).
DATA: text1(30).
DATA: agr_name TYPE agr_1251-agr_name.
DATA: flag TYPE i VALUE '0'.
DATA: string1 TYPE string.
DATA: str TYPE string VALUE 'SAP%'.
DATA: count1 TYPE i VALUE '0'.
*& Event START-OF-SELECTION
START-OF-SELECTION.
PERFORM f100_get_inf_data.
PERFORM f200_process_inf_data.
count1 = 1.
PERFORM f300_prepare_field_catalog.
PERFORM f110_main_data.
PERFORM f400_display_data.
PERFORM f100_get_trans_data.
*& Form f110_main_data
text
FORM f110_main_data.
wa_infotyp_final-text = 'Access to Infotypes'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = 'Infotype'.
wa_infotyp_final-text1 = 'Description'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = '*'.
wa_infotyp_final-text1 = 'Acess to all Infotypes'.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'INFTY' low = '*'.
IF syst-subrc = 0.
wa_infotyp_final-value = 'X'.
ENDIF.
ENDLOOP.
APPEND wa_infotyp_final TO t_infotyp_final.
LOOP AT t_inf INTO wa_inf WHERE infty <> ' '.
wa_infotyp_final-text = wa_inf-infty.
wa_infotyp_final-text1 = wa_inf-itext.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
Role Name
CLEAR wa_role_dtls.
flag = 1.
wa_role_dtls-agr_name = wa_role-agr_name.
For Value D & F
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'AUTHC'..
IF syst-subrc EQ 0.
IF wa_agr_1251_inf-low = 'R'.
wa_infotyp_final-value = 'D'.
ELSE.
wa_infotyp_final-value = 'F'.
ENDIF.
ENDIF.
APPEND wa_role_dtls TO t_role_dtls.
APPEND wa_infotyp_final TO t_infotyp_final.
ENDLOOP.
ENDLOOP.
ENDFORM. "f110_main_data
*& Form f100_get_inf_data
text
FORM f100_get_inf_data.
Logic for Infotypes *
SELECT aagr_name aobject
afield alow a~high
INTO TABLE t_agr_1251_inf
FROM agr_1251 AS a INNER JOIN agr_define AS b
ON aagr_name EQ bagr_name
WHERE ( ( aobject EQ 'P_ORGIN' OR aobject EQ 'P_PERNR' )
AND ( aagr_name IN s_role ) AND ( bagr_name NOT LIKE str ) ).
ENDFORM. "f100_get_inf_data
*& Form f200_get_inf_process_data
text
FORM f200_process_inf_data.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'EQ'.
wa_range_inf-low = wa_agr_1251_inf-low.
APPEND wa_range_inf TO t_range_inf.
ELSE.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'BT'.
wa_range_inf-low = wa_agr_1251_inf-low.
wa_range_inf-high = wa_agr_1251_inf-high.
APPEND wa_range_inf TO t_range_inf.
ENDIF.
ENDLOOP.
SORT t_range_inf.
DELETE ADJACENT DUPLICATES FROM t_range_inf.
IF t_range_inf IS NOT INITIAL.
SELECT infty itext FROM t582s
INTO TABLE t_582s
WHERE sprsl = 'EN' AND infty IN t_range_inf.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
READ TABLE t_582s INTO wa_582s
WITH KEY infty = wa_agr_1251_inf-low.
IF syst-subrc EQ 0.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_582s INTO wa_582s
WHERE infty GE wa_agr_1251_inf-low
AND infty LE wa_agr_1251_inf-high.
IF count LE 1.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
CLEAR wa_582s.
ENDIF.
ELSE.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
APPEND wa_agr_1251_inf TO t_agr_1251_inf.
ENDIF.
CLEAR wa_agr_1251_inf.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf IS NOT INITIAL.
wa_role-agr_name = wa_agr_1251_inf-agr_name.
wa_inf-infty = wa_agr_1251_inf-infty.
wa_inf-itext = wa_agr_1251_inf-itext.
APPEND wa_role TO t_role.
APPEND wa_inf TO t_inf.
ENDIF.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_inf BY infty.
DELETE ADJACENT DUPLICATES FROM t_inf.
ENDFORM. "f200_get_process_inf_data
*& Form f100_get_trans_data
text
FORM f100_get_trans_data.
Logic for Transaction Codes *
SELECT aagr_name aobject
afield alow a~high
INTO CORRESPONDING FIELDS OF TABLE t_agr_1251_tc
FROM agr_1251 AS a
INNER JOIN agr_define AS b ON aagr_name EQ bagr_name
WHERE a~agr_name IN s_role
AND a~object EQ 'S_TCODE'.
ENDFORM. "f100_get_trans_data
*& Form f200_process_trans_data
text
FORM f200_process_trans_data.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'EQ'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
APPEND wa_range_tcode TO t_range_tcode.
ELSE.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'BT'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
wa_range_tcode-high = wa_agr_1251_tcode-high.
APPEND wa_range_tcode TO t_range_tcode.
ENDIF.
ENDLOOP.
SORT t_range_tcode.
DELETE ADJACENT DUPLICATES FROM t_range_tcode.
IF t_range_tcode IS NOT INITIAL.
SELECT tcode
ttext
FROM tstct
INTO TABLE t_tcode
WHERE sprsl EQ 'E'
AND tcode IN t_range_tcode.
IF sy-subrc EQ 0.
ENDIF.
ENDIF.
SORT t_agr_1251_tc BY agr_name.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
READ TABLE t_tcode INTO wa_tcode
WITH KEY tcode = wa_agr_1251_tcode-low.
IF syst-subrc EQ 0.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_tcode INTO wa_tcode
WHERE tcode GE wa_agr_1251_tcode-low
AND tcode LE wa_agr_1251_tcode-high.
IF count LE 1.
agr_name = wa_agr_1251_tcode-agr_name.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext high.
IF syst-subrc EQ 0.
CLEAR wa_tcode.
ENDIF.
count = 1.
ELSE.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-agr_name = agr_name.
wa_agr_1251_tcode-low = wa_tcode-tcode.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
APPEND wa_agr_1251_tcode TO t_agr_1251_tc.
ENDIF.
CLEAR wa_agr_1251_tcode.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
wa_role-agr_name = wa_agr_1251_tcode-agr_name.
APPEND wa_role TO t_role.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_tcode BY tcode.
DELETE ADJACENT DUPLICATES FROM t_tcode.
ENDFORM. "f200_process_trans_data
*& Form f100_prepare_field_catalog
text
FORM f300_prepare_field_catalog.
LOOP AT t_role INTO wa_role.
wa_field-col_pos = count1.
wa_field-fieldname = wa_role-agr_name.
APPEND wa_field TO t_field.
count1 = count1 + 1.
ENDLOOP.
ENDFORM. "f100_prepare_field_catalog
*& Form f100_display_data
text
FORM f400_display_data.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
it_fieldcat = t_field[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_infotyp_final[]
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. "f100_display_datathis are the wasy u can build a field catalog...
1.----
FORM fill_fieldcat .
DATA: fld(30),
idx(2) TYPE n.
DEFINE no_output.
fieldcatalog-fieldname = &1.
fieldcatalog-no_out = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
DEFINE catalog.
fieldcatalog-fieldname = &1.
fieldcatalog-seltext_s = &2.
if not &3 is initial.
fieldcatalog-seltext_m = &3.
else.
fieldcatalog-seltext_m = fieldcatalog-seltext_s.
endif.
if not &4 is initial.
fieldcatalog-seltext_l = &4.
else.
fieldcatalog-seltext_l = fieldcatalog-seltext_m.
endif.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
catalog 'AVAIL_BASE'
'Base Qty.'
'Base Qty. Available'
'Base Quantity Available'.
catalog 'AVAIL_SALES'
'Sales Qty.'
'Sales Qty. Available'
'Sales Quantity Available'.
LOOP AT t_char_data.
idx = sy-tabix.
CONCATENATE 'CHR' idx INTO fld.
catalog fld
t_char_data-atbez
t_char_data-atbez
t_char_data-atbez.
ENDLOOP.
ADD 1 TO idx.
WHILE idx LE 15.
CONCATENATE 'CHR' idx INTO fld.
no_output fld.
ADD 1 TO idx.
ENDWHILE..
fieldcatalog-fieldname = 'EXACT'.
fieldcatalog-checkbox = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
2.----
FORM fieldcatalog.
REFRESH fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'KUNNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'NAME1_K'.
fc-ref_tabname = 'KNA1'.
fc-ref_fieldname = 'NAME1'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'TOTAL'.
fc-ref_tabname = 'MBEW'.
fc-ref_fieldname = 'SALK3'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MATNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MAKTX'.
fc-ref_tabname = 'MAKT'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'CHARG'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'WERKS'.
fc-ref_tabname = 'MSKU'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'NAME1_W'.
fc-ref_tabname = 'T001W'.
fc-ref_fieldname = 'NAME1'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc. -
Runtime Error while summing a column in ALV output
Dear All,
I have developed an ALV Report and the report is giving output without any flaws.
I have defined proper field catalog and displaying the results using REUSE_ALV_GRID function module.
Now the report is generating Runtime Error while the user selects a column and click the SUM icon.
The fields like Qty, or amounts are also theowing runtime error while summing up their column in the ALV output.
What might be the reason and how to resolve this issu?
Regards
PavanHi ,
I don't know how you have write down the code but follow the below coding example:
FOR TOTAL:
there is a property of fieldcatalog, that is do_sum.
USE COED LIKE:
PERFORM fieldcat USING:
'1' 'MATNR' 'I_MARD' 'MATERIAL NO' 'MARD' 'MATNR ' ' ',
'2' 'NETWR' 'I_MARD' 'PLANT' 'MARD' 'WERKS' ' ',
FORM fieldcat USING value(p_0029)
value(p_0030)
value(p_0031)
value(p_0032)
wa_fieldcat-col_pos = p_0029.
wa_fieldcat-fieldname = p_0030.
wa_fieldcat-tabname = p_0031.
wa_fieldcat-reptext = p_0032.
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " FIELDCAT
in final output you will get the total of currency field.
FOR SUB TOTAL:
decleare: i_sort type standard table of slis_sortinfo_alv,
wa_sort type slis_t_sortinfo_alv.
wa_sort-spos = '1'.
wa_sort-fieldname = 'field1'.
wa_sort-subtot = 'X'.
append wa_tab to i_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = i_sort
Hope this can solve your pbs.
If you need more inputs let me know.
Regards,
Tutun -
Runtime error while trying to execute custom F4 help in OOP ALV grid.
Dear All,
I am trying to add custom search help for one of my column in ALV grid. I'm using OOP ALV, when i click for search help for that column, the system shows runtime error like below.
I am new to OOP concept and tried to follow program BCALV_EDIT_03. But not getting this error occur. Please help me.
With regards.Hi,
In order to be able to provide a search help for a field in an ALV you must do the following things.
1) The field where F4 help need to be attached needs to be made editable.
2) Create an event handler class to handle the ONF4 event. You can refer the following code:
CLASS lcl_alv1_handler DEFINITION.
PUBLIC SECTION.
"Tohandle F4 helps
METHODS handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid
IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data
et_bad_cells e_display.
ENDCLASS.
CLASS lcl_alv1_handler IMPLEMENTATION.
METHOD handle_f4.
CASE e_fieldname.
WHEN 'LIFNR'. "Set F4 for courier vendor
SELECT lifnr name1 FROM lfa1 INTO TABLE lt_lifnr.
IF lt_lifnr IS NOT INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LIFNR'
window_title = 'Vendors'
value_org = 'S'
TABLES
value_tab = lt_lifnr
return_tab = lt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE gt_final INTO wa_final_t INDEX es_row_no-row_id.
IF sy-subrc = 0.
READ TABLE lt_return INTO wa_return INDEX 1.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_return-fieldval
IMPORTING
output = lv_lifnr.
wa_final_t-lifnr = lv_lifnr.
MODIFY gt_final FROM wa_final_t INDEX es_row_no-row_id.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
CALL METHOD o_alv->refresh_table_display.
ENDMETHOD.
ENDCLASS.
In the above method, GT_FINAL-LIFNR is being overwritten by the LIFNR you had selected from F4 help. So we will call the refresh_table_display after it to see the result in the ALV.
3) After creating the ALV object, add the fields to which the F4 has to be added. For this you
need to declare an internal table based on lvc_t_f4. Use the following code. Here O_ALV is my ALV object.:
CREATE OBJECT o_container
EXPORTING
container_name = 'CUSTCON'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT o_alv
EXPORTING
i_parent = o_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR : gt_f4, wa_f4.
wa_f4-fieldname = 'LIFNR'.
wa_f4-register = 'X'.
wa_f4-getbefore = space.
wa_f4-chngeafter = space.
APPEND wa_f4 TO gt_f4.
Here I am assigning F4 to LIFNR field in the final internal table that is displayed using ALV.
After this register this field for F4.
CALL METHOD o_alv->register_f4_for_fields
EXPORTING
it_f4 = gt_f4.
CREATE OBJECT o_alv_handler.
SET HANDLER : o_alv_handler->handle_f4 FOR o_alv1.
The object o_alv_handler is created based on the event handler class.
I hope that this will solve your issue. Revert if this is solved.
Rgards,
Abijith -
Runtime error while executing ALV
Hi all,
I have implemented an ALV in OOPS concept and whenevr I am executing it I am getting a runtime error as GET WA NOT ASSIGNED
Error analysis:
You attempted to access an unassigned field symbol
(data segment 32821).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
Trigger Location of Runtime Error
Program SAPLSLVC
Include LSLVCF36
Row 3.231
Module type (FORM)
Module Name FILL_DATA_TABLE
3201 alv_style_align_center_top.
3202 endif.
3203
3204 append ls_lvc_data to ct_lvc_data.
3205 endif.
3206
3207 ************************************
3208 * Column per Fieldcat Entry
3209 ************************************
3210 loop at it_fcat_local assigning <ls_fcat>.
3211 clear: ls_lvc_data-href_hndl,
3212 ls_lvc_data-drdn_hndl,
3213 ls_lvc_data-style,
3214 ls_lvc_data-style2,
3215 ls_lvc_data-style3,
3216 ls_lvc_data-style4,
3217 ls_lvc_data-maxlen.
3218
3219 clear: lt_color_lvc, lt_color_slis.
3220
3221 add 1 to ls_lvc_data-col_pos.
3222
3223 if not <ls_fcat>-indx_field is initial.
3224 assign component <ls_fcat>-indx_field
3225 of structure <ls_data> to <l_field_value>.
3226 else.
3227 assign component <ls_fcat>-fieldname
3228 of structure <ls_data> to <l_field_value>.
3229 endif.
3230
>>>> macro_cell_data_get
3232 <ls_fcat>
3233 <ls_data>
3234 <l_field_value>
3235 ls_lvc_data-value.
3236
3237 *>>> new API
3238 if ir_salv_adapter is bound.
3239 clear ls_lvc_data-style.
3240
3241 * color
3242 if g_gui_type ne 1.
3243 if <ls_fcat>-key eq abap_true.
3244 ls_lvc_data-style = alv_style_color_int_key.
3245 elseif l_style_color is initial
3246 and ( <ls_fcat>-emphasize is initial or
3247 <ls_fcat>-emphasize = '$' ).
3248 if <ls_stin>-counter is initial.
3249 ls_lvc_data-style = alv_style_color_normal.
3250 else.
Please help me to sort out this issueFORM s_build_fldctlg .
v_repid = sy-repid.
DATA lw_fldctlg TYPE lvc_s_fcat.
REFRESH i_fldctlg[].
v_cpos = 0.
* Column 1
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_unlpt.
lw_fldctlg-coltext = 'Unloading Point'. "Unloading Point
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
* Column 2
v_cpos = v_cpos + 1.
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_vdrloc. "Vendor Location
lw_fldctlg-coltext = text-003.
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
* Column 3
v_cpos = v_cpos + 1.
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_nopkgs. "No of packages
lw_fldctlg-coltext = text-004.
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
* Column 4
v_cpos = v_cpos + 1.
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_delnote. "Delivery Note
lw_fldctlg-coltext = text-005.
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
* Column 5
v_cpos = v_cpos + 1.
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_reason. "Reason
lw_fldctlg-coltext = text-006.
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
* Column 6
v_cpos = v_cpos + 1.
lw_fldctlg-col_pos = v_cpos.
lw_fldctlg-row_pos = c_1.
lw_fldctlg-ref_table = 'I_OUTPUT'.
lw_fldctlg-fieldname = c_status.
lw_fldctlg-coltext = text-007.
APPEND lw_fldctlg TO i_fldctlg.
CLEAR lw_fldctlg.
ENDFORM. " S_BUILD_FLDCTLG
This is my code.
When i execute it without any values in my final table the ALV is getting displayed.
But when I put some data in the final table I am getting this error -
Runtime error in Downloading and printing ALV
Hi Gurus,
I have created a ALV with subtotal text and hotspot click event using OO ABAP.
When ever I am trying to download the ALV to Excel it's generating a runtime error, same is happening when
I am pressing the Print button in the ALV.
Please Help !!!!Hi avik2005uitbu,
in debugger, before or just when ALV display is called, check the internal tables for field catalog and the date to be displayed. From debugger, you can save the internal tables contents as local files (rigth-click mouse, save as local file or CTRL->F11 in classical debugger, Save as local file with rogth-click on internal table name in variables or table display, no shortcut ). After saving both as excel, have a look at the fieldnames in the internal table and in the field catalog. Additionally, you should check all other parameters as layout and sort for fieldnames not present in field catalog and display table.
After having done these steps, you will definitely know what is wrong.
Also, when in GRID display, point the mouse outside (right of or below) the table display area, SHIFT-DOUBLE-RIGTH-CLICK invokes the ALV consistency check.
Please just do it.
Regards,
Clemens -
Getting runtime error in ALV ...
Hi,
I am calling function REUSE_ALV_GRID_DISPLAY to display my data in an ALV grid... this code was working fine and so I used it for a different set of data but now it is throwing a runtime error saying ..
GETWA_NOT_ASSIGNED
Field symbol has not yet been assigned.
I dont understand why I am getting this and how to resolve this...my sample code is pasted below..
REPORT ZFB12TEST.
TABLES: BKPF.
TYPE-POOLS: slis.
DATA: BEGIN OF bkpf_rec OCCURS 0,
bukrs LIKE BKPF-BUKRS,
blart LIKE BKPF-BLART,
cpudt LIKE BKPF-CPUDT,
budat LIKE BKPF-budat,
belnr LIKE BKPF-BELNR,
gjahr LIKE BKPF-GJAHR,
END OF bkpf_rec.
DATA migo_data LIKE bkpf_rec occurs 0 with header line.
DATA: it_cat TYPE slis_t_fieldcat_alv,
wa_lay TYPE slis_layout_alv.
FIELD-SYMBOLS: <fs_cat> LIKE LINE OF it_cat.
SELECT-OPTIONS: so_bukrs FOR BKPF-BUKRS,
so_blart FOR BKPF-BLART,
so_cpudt FOR BKPF-CPUDT,
so_budat FOR BKPF-budat,
so_belnr FOR BKPF-BELNR,
so_gjahr FOR BKPF-GJAHR.
*include bdcrecx1.
start-of-selection.
SELECT bukrs blart cpudt budat belnr gjahr into table bkpf_rec from bkpf
where bukrs IN
so_bukrs and blart in so_blart and cpudt in so_cpudt and budat in
so_budat and belnr in so_belnr and gjahr in so_gjahr.
loop at bkpf_rec.
move-corresponding bkpf_rec to migo_data.
append migo_data.
endloop.
DATA: it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
wa_sort-spos = 1.
wa_sort-fieldname = 'bukrs'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'belnr'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sortcat.
wa_lay-zebra = 'X'.
data: tmp_fc type slis_fieldcat_alv .
tmp_fc-reptext_ddic = 'CC'.
tmp_fc-fieldname = 'bukrs'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 10.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
tmp_fc-reptext_ddic = 'Document number'.
tmp_fc-fieldname = 'belnr'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 20.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
tmp_fc-reptext_ddic = 'Entry date'.
tmp_fc-fieldname = 'cpudt'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 20.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
tmp_fc-reptext_ddic = 'Posting date'.
tmp_fc-fieldname = 'budat'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 20.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
tmp_fc-reptext_ddic = 'Doc type'.
tmp_fc-fieldname = 'blart'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 10.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
tmp_fc-reptext_ddic = 'Fiscal year'.
tmp_fc-fieldname = 'gjahr'.
tmp_fc-tabname = 'migo_data'.
tmp_fc-outputlen = 10.
tmp_fc-do_sum = space.
append tmp_fc to it_cat.
LOOP AT it_cat ASSIGNING <fs_cat>.
CLEAR <fs_cat>-key.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_title = 'Invoice selected'
is_layout = wa_lay
it_fieldcat = it_cat
it_sort = it_sortcat
TABLES
t_outtab = MIGO_DATA
EXCEPTIONS
program_error = 1
OTHERS = 2.When building your sort catalog, make sure to include the tabname.
wa_sort-spos = 1.
wa_sort-fieldname = 'BUKRS'.
<b> wa_sort-tabname = 'MIGO_DATA'.</b>
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
append wa_sort to it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'BELNR'.
<b> wa_sort-tabname = 'MIGO_DATA'.</b>
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
append wa_sort to it_sortcat.
Please make sure to award points and mark your post as solved. Thanks.
REgards,
Rich HEilman
Message was edited by: Rich Heilman
Message was edited by: Rich Heilman -
Hi,
I have a report to display in ALV list display, It give a runtime error when i run the report ,
error message : in INCLUDE LKKBLF99 - Field symbol not assigned.
I am not usning any field symbols in my report, can anyone suggest what could be the problem.Hi,
While creating fieldcatalog table you should give the fieldname and the tabname in capital letters.
for eg.
fcat-fieldname = 'MATNR'.
regards,
Santosh Thorat. -
Runtime Error : MOVE_TO_LIT_NOTALLOWED_NODATA after ALV execution
Hi experts
I'm facing this runtime error after execute an interface and show an ALV grid for data processed.
ShrtText
Assignment error: Overwriting a protected field.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLKKBL" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
The program tried to assign a new value to the field "<L_UNIT>" even though
it is protected against changes.
The following objects are protected:
- Character or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions
and methods
- Untyped field symbols to which a field has not yet been assigned
using ASSIGN
- TABLES parameters if the corresponding actual parameter is protected
against changes
- USING reference parameters and CHANGING parameters for FORMs if
the actual parameter for this is protected against changes
- Field symbols if the field assigned using ASSIGN or ASSIGNING
is protected against changes
- External write accesses to READ-ONLY attributes
- Key components of lines in internal tables of the type HASHED or
SORTED TABLE
SORTED TABLE.
What I must check on ABAP code for fix it. When I debug I found that the totals(in Yellow) are of two lines. The first line displays with the total values of the respective columns, but the second line is blank. So During the debug it clears the value "lflg_show" which causes the short dump.
Pleaase help me with this.
Thanks in advance.Hi experts
I'm facing this runtime error after execute an interface and show an ALV grid for data processed.
ShrtText
Assignment error: Overwriting a protected field.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLKKBL" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
The program tried to assign a new value to the field "<L_UNIT>" even though
it is protected against changes.
The following objects are protected:
- Character or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions
and methods
- Untyped field symbols to which a field has not yet been assigned
using ASSIGN
- TABLES parameters if the corresponding actual parameter is protected
against changes
- USING reference parameters and CHANGING parameters for FORMs if
the actual parameter for this is protected against changes
- Field symbols if the field assigned using ASSIGN or ASSIGNING
is protected against changes
- External write accesses to READ-ONLY attributes
- Key components of lines in internal tables of the type HASHED or
SORTED TABLE
SORTED TABLE.
What I must check on ABAP code for fix it. When I debug I found that the totals(in Yellow) are of two lines. The first line displays with the total values of the respective columns, but the second line is blank. So During the debug it clears the value "lflg_show" which causes the short dump.
Pleaase help me with this.
Thanks in advance. -
ALV: Runtime error when calling only few columns of tables in ALV rpt
Dear ABAP Gurus N Experts,
I am new for ABAP.
I am creating an ALV for fetching the data from ztable. It works fine, If I select all column than .
SELECT * FROM zshipment01 INTO TABLE gi_zshipment01.
But when I try to select only few column it gives an error. Runtime errors: DBIF_RSQL_INVALID_RSQL, Exception: CX_SY_OPEN_SQL_DB
SELECT container shipment_no bill_of_lad bl_date DATE_OF_PORT ARRIVAL_NO1 ED_TRUCKING
FROM zshipment01 INTO TABLE gi_zshipment01.
I am using following function:, which is called in program as PERFORM load_data_into_grid.
FORM load_data_into_grid.
SELECT * FROM zshipment01 INTO TABLE gi_zshipment01.
Load data into the grid and display them
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'zshipment01'
CHANGING it_outtab = gi_zshipment01.
ENDFORM. " load_data_into_grid
Early response will be highly appreciated.
With thanks,
DSC
Moderator Messge: Basic questions are not allowed. Search before you post.
Edited by: kishan P on Feb 29, 2012 2:22 PMHi Devendra,
Try to use "corresponding" statement.
SELECT field1 field1 etc FROM zshipment01 *INTO CORRESPONDING FIELD OF TABLE* gi_zshipment01.
Regards,
Dondi.
Points unassigned
Edited by: kishan P on Feb 29, 2012 2:22 PM -
Runtime Error - TABLE_FREE_IN_LOOP in editable ALV GRID
While modifying editable ALV Grid, (CL_GUI_ALV_GRID) I am getting an unexpected dump as follows -
"Runtime Error TABLE_FREE_IN_LOOP".
In a Editable ALV grid whenever new row is added using standard append row button, And while saving, i check for any initial values, in that case iam displaying a warning message. So after that when i try to modify the row, and press enter key, Iam getting this dump "TABLE_FREE_IN_LOOP".
Can you please help on this regard.
Thanks in advance..
Best regards,
Prasad.Hello Krishna
take a additional internal table which is exactly of same type of the internal table which you want to modify . try modifying the second internal table. and then proceed for db update(if required).
Regards,
Suvendu -
Runtime Error during export ALV Grid to Local File and Print Priview
Hi all,
While Exporting ALV grid to local file using menu List->export->local file , I m getting following runtime error,
Field Symbol has not yet been assigned.
Details of Errors:
Program : SAPLKKBL
Include : LKKBLF99
Module Type : (FORM)
module name : GEN_FIELD_OUT2
So. pls Suggest any good solution.
Thanks & Regards,
Sandip Sonar.hi
this is happening just because you might have declared that your ALV list should have a checkbox, but defined no field as "checkbox" into your internal table.
and one more thing to check up is that before you call the REUSE_ALV_GRID_DISPLAY, you need to fill a few parameters for instance is_layout. This one has a field box_fieldname, in which you have to enter the name of the field of the internal table that will store the 'X' as and when the checkbox is checked.
hope this helps
regards
Aakash Banga
Maybe you are looking for
-
How do you change the color of events on ICal.
How do you changed the color of events on ICal? I was able to do this when I utilized ICal on the Snow Leopard system but can no longer do this with Lion. I know that I can select the Calanders list, but when I create a new "Calander" it doesn't allo
-
Do I have to use cloud for photoshop
I thought that I could buy photoshop as a stand alone product for editing - now it just seems to come in packages with 'cloud'. I do not want to use it on a machine connected to the internet is there an alternative to monthly subscription?
-
Adobe Technical Communication Suite Classroom in a Book?
Does anyone know when the Adobe Technical Communication Suite Classroom in a Book is scheduled to be published?
-
Need adobe Illistrator CS5 not CS6
For my college class i need the 30 day trial for the CS5 due to no income to afford it yet. I cant get the college Citrix to work for me and my computer and i am 2 weeks behind due to it.
-
Crystal Report Runtime start splwow64.exe on windows 64 OS
Hi, We are using the Crystal Reports runtime in our application. We are utilizing the runtime through the COM interface. Recently a client of us installed our application on windows 2003 64-bit. Now whenever a report is created windows starts splwow6