Getting Dump GETWA_NOT_ASSIGNED, In ALV
Hi Experts,
Once ALV report is generated then when I am downloaing to xls, I am getting dump
GETWA_NOT_ASSIGNED.
Please advice.
Regards,
IFF
Possibly the field catalog and output table is not synch.
Try to create the field catalog automatically (LVC_FIELDCATALOG_MERGE). and not by mannual ( hardcoded)
If you mentioned any coloring in alv , for testing purpose (just comment the coloring part) and try
a®
Similar Messages
-
Dump GETWA_NOT_ASSIGNED in ALV OO
Hi experts, i have a problem ... i created an ALV OO but when i wanna dowload the ALV's lines the program trigger a DUMP: GETWA_NOT_ASSIGNED in program SAPLKKBL ... i know that it's a clasic DUMP about ALV's ... please i need your help.
Thanks.
David CarballidoHi Uwe ... i created a structure and called to FM LVC_FIELDCATALOG_MERGE to create my fieldcat and the program trigger the same DUMP.
Errores tiempo ejecucióGETWA_NOT_ASSIGNED
ocurrido el 23.09.2008 a 17:10:54
>> Dump breve ABAP no almacenado completamente (muy grande)
Field symbol has not yet been assigned.
¿Qué ha sucedido?
The current ABAP/4 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/4 program.
¿Qué puede hacer?
Note the actions and input that caused the error.
Inform your SAP system administrator.
You can print out this message by choosing "Print". Transaction ST22
allows you to display and manage termination messages, including keeping
them beyond their normal deletion date.
Análisis error
You attempted to access an unassigned field symbol
(data segment 1069).
This error occurs:
- if you address a typed field symbol before it has been set with
ASSIGN or
- if you address a field symbol that has been reset with UNASSIGN
or pointed to a local field that no longer exists, or
- if you address a field symbol that pointed to a line of an internal
table that has now been deleted, or
- if you address a global function interface partameter, even
though the relevant function module is not active,
i.e. it is not in the list of active calls. You can get the list
of active calls from the this short dump.
Notas para corregir errores
If the error occurred in a non-modified SAP program, you may be
able to find a solution in the SAP note system.
If you have access to the note system yourself, use the following
search criteria:
"GETWA_NOT_ASSIGNED"
"SAPLKKBL " or "LKKBLF99 "
"GEN_FIELD_OUT2"
If you cannot solve the problem yourself, please send the
following documents to SAP:
1. A hard copy print describing the problem.
To obtain this, select the "Print" function on the current screen.
2. A suitable hardcopy prinout of the system log.
To obtain this, call the system log with Transaction SM21
and select the "Print" function to print out the relevant
part.
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, you can either use the "PRINT" command in the editor or
print the programs using the report RSINCL00.
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
Usuario, transacción....
Client.............. 200
User................ "BCDCARBALLID"
Language key........ "S"
Transaction......... "SEU_INT "
Program............. "SAPLKKBL "
Screen.............. "SAPLKKBL 0500"
Screen line......... 3
Info posición de cancelación
The termination occurred in the ABAP/4 program "SAPLKKBL " in
"GEN_FIELD_OUT2".
The main program was "ZFI_RPT_PDB_005 ".
The termination occurred in line 3824
of the source code of program "LKKBLF99 " (when calling the editor 38240).
Detalle código fuente
037940 * Color settings "K_COLCOLOR
037950 if gs_out_flags-sum is initial.
037960 if gs_fc-hotspot = 'X' and gs_out_flags-hotline is initial
037970 and gt_stack-is_layout-no_hotspot is initial.
037980 format hotspot on.
037990 elseif gs_fc-hotspot = 'V'
038000 and gs_out_flags-hotline is initial and not <field> is initial
038010 and gt_stack-is_layout-no_hotspot is initial.
038020 format hotspot on.
038030 endif.
038040 if gs_fc-input = 'X' and
038050 gt_stack-is_layout-no_input is initial and
038060 gs_fc-checkbox is initial.
038070 format input on.
038080 format intensified off.
038090 endif.
038100 if not gs_fc-emphasize is initial and gs_out-info is initial.
038110 perform field_color_normal using gs_fc
038120 * gt_stack-is_layout
038130 gs_out-info.
038140 endif.
038150
038160 * complex logic with internal table for color description
038170 if gs_out_flags-mcoltab = 'X' and gs_out_flags-slave ne 'X' and
038180 gs_out_flags-sum ne 'X'.
038190
038200 perform field_color_complex using <coltab>
038210 gs_fc
038220 gs_out_flags-inverse.
038230 elseif gs_out_flags-scoltab = 'X' and gs_out_flags-slave = 'X' and
-----> gs_out_flags-sum ne 'X'.
038250
038260 * perform field_color_complex using <coltab> " DEL FGS_COLOR
038270 perform field_color_complex using <coltab_slave> " INS FGS_COLOR
038280 gs_fc
038290 gs_out_flags-inverse.
038300 endif.
038310 endif.
038320
038330 *--- Prüfung Ausgabelänge
038340 clear gs_out-hlplen.
038350 * Edit-Mask
038360 if gs_fc-tech_form = 7.
038370 write <field> to gs_out-hlpchar
038380 using edit mask gs_fc-edit_mask.
038390 gs_out-hlplen = strlen( gs_out-hlpchar ).
038400 * Bei NUMC führende '0' und ' ' nicht berücksichtigen
038410 elseif gs_fc-tech_form = 6.
038420 write <field> to gs_out-hlpchar no-zero left-justified.
038430 if gs_fc-just = 'R'. -
Dump GETWA_NOT_ASSIGNED in ALV
Hi,
i created a new ALV and when i want to export the data to Word document or local file, every format except Excel format (it's work !) i have a dump with GETWA_NOT_ASSIGNED error.
I looked this error on SDN and people talk about field catalogue i check it and it's ok, all fields are uppercase.
Thanks for help.
Cheers.Thanks for your answer, it exists an SAP Note : 915887 but my customer is in 4.6 version (sic). I'm going to try FM REUSE_ALV_FIELDCATALOG_MERGE.
Other possibility, can i delete the export option, in fact the users need only Excel export and it's work.
Cheers. -
OO ALV dump - GETWA_NOT_ASSIGNED
Hello Friends,
I have implemented OO ALV to display data. Two of the fields are WERKS and MATNR. These fields are input enabled. I have not coded any F4 routine, the standard search helps work. I have SAP GUI 720 installed on my laptop and the program runs just fine. But when I try to run it on another machine with GUI 710 the search help function does not work and I get the dump GETWA_NOT_ASSIGNED. I may be wrong but it seems like there is a problem with the GUI version. Where should I check?
Thanks in advance,
AliHi,
This is a field catalog issue. check whether you populated field catalog correctly. check the field names and internal table field names and also check the col_pos is correct or not.
ls_fieldcat-col_pos = '1'.
u might be assigned the col_pos same for some fields,
hope this helps u.,
Thanks & Regards,
Kiran -
Getting dump when using do_sum in alv field cat in the output of the report
Dear Freinds,
Iam getting the alv report when i click on the segma field (Sum) on my salary
field iam getting dump. and also if i try to print my alv output iam getting dump , only
happening to my custom report.
i have used the following code pleae correct me .
This perform is used for Layout settings
perform st_layout_build using gs_layout.
form st_layout_build using st_ls_layout type slis_layout_alv.
st_ls_layout-no_input = 'X'.
st_ls_layout-colwidth_optimize = 'X'.
st_ls_layout-zebra = 'X'.
st_ls_layout-detail_popup = 'X'.
endform. " st_layout_build
Field Catalog details
perform st_fieldcat_init changing gt_fieldcat.
form st_fieldcat_init changing fp_i_fieldcat type slis_t_fieldcat_alv.
clear ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'ORGUNIT'.
ls_fieldcat-seltext_l = 'Orgunit'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'ORGTEXT'.
ls_fieldcat-seltext_l = 'Orgdesc'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'SALARY'.
ls_fieldcat-seltext_l = 'Salary'.
ls_fieldcat-col_pos = 3.
ls_fieldcat-outputlen = 15.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'CURR'. "CURR
append ls_fieldcat to fp_i_fieldcat.
endform.
Variant
perform st_variant_init using gs_variant g_repid.
form st_variant_init using st_gs_variant type disvariant
st_repid like sy-repid.
clear st_gs_variant.
st_gs_variant-report = st_repid.
endform. " st_variant_init
g_repid = sy-repid.
perform st_comment_build using gt_list_top_of_page[].
form st_comment_build using st_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
Listenüberschrift: Typ H
clear ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = text-000.
append ls_line to st_lt_top_of_page.
endform. " st_comment_build
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = 'X'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_structure_name = 'i_final' "c_i_final "'objec'
i_save = g_save
is_variant = gs_variant
tables
t_outtab = fp_i_pyrol_final
exceptions
program_error = 1
others = 2.
if sy-subrc ne 0.
message e018. " Displaying the ALV GRID has failed
endif.
Please could any one let me know why iam getting dump when iam clicking for total
on my salary field.
Regards
lathaDear Chandu,
my code iam giving in details
types : begin of ty_output_data,
staffno type pernr_d,
staffname type emnam,
grade type stell,
orgunit type orgeh,
orgtext type hr_mcstext,
psgroup type trfgr, " Pay Scale Group
salary type maxbt, "PAD_AMT7S,
rrefunded type pad_amt7s,
leavepay type pad_amt7s,
mshortfal type pad_amt7s, " Medical Shortfall
echkshfal type pad_amt7s, " Execute checkup shortfall
ofindeduc type pad_amt7s, " Other Finance Deduction
mtyprem type pad_amt7s, " maternity premium
vpbonus type pad_amt7s, " VP/Bonus
gratuity type pad_amt7s, " Gratuity
vpay type pad_amt7s, " Variable pay
mallowance type pad_amt7s, " Meal Allowance
overtime type pad_amt7s, " overtime
other type pad_amt7s, " OTHER
pfundeecon type pad_amt7s, " PFund Employee's Contribution
banktrnsfer type pad_amt7s, " Bank Transfer
count type i,
end of ty_output_data.
data : i_final type standard table of ty_output_data.
iam getting all my data in the internal table I_FINAL.
perform get_final_alv using i_final.
form get_final_alv using fp_i_pyrol_final type ty_t_output_data.
*local variable declarations
data : l_v_idx type sy-tabix.
*local work areas
data : l_wa_final type ty_output_data.
g_save = 'A'.
This perform is used for Layout settings
perform st_layout_build using gs_layout.
Field Catalog details
perform st_fieldcat_init changing gt_fieldcat.
Variant
perform st_variant_init using gs_variant g_repid.
g_repid = sy-repid.
perform st_comment_build using gt_list_top_of_page[].
if not fp_i_pyrol_final is initial.
delete adjacent duplicates from fp_i_pyrol_final comparing all fields.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = 'X'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_structure_name = 'i_final' "c_i_final "'objec'
i_save = g_save
is_variant = gs_variant
tables
t_outtab = fp_i_pyrol_final
exceptions
program_error = 1
others = 2.
if sy-subrc ne 0.
message e018. " Displaying the ALV GRID has failed
endif.
endif.
endform. " get_final_alv
form st_layout_build using st_ls_layout type slis_layout_alv.
st_ls_layout-no_input = 'X'.
st_ls_layout-colwidth_optimize = 'X'.
st_ls_layout-zebra = 'X'.
st_ls_layout-detail_popup = 'X'.
endform. " st_layout_build
form st_fieldcat_init changing fp_i_fieldcat type slis_t_fieldcat_alv.
data: ls_fieldcat type slis_fieldcat_alv.
clear ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'ORGUNIT'.
ls_fieldcat-seltext_l = 'Orgunit'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'ORGTEXT'.
ls_fieldcat-seltext_l = 'Orgdesc'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 5.
ls_fieldcat-fieldname = 'STAFFNAME'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-seltext_l = 'StaffName'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 4.
ls_fieldcat-fieldname = 'STAFFNO'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-seltext_l = 'StaffNo.'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 6.
ls_fieldcat-fieldname = 'GRADE'.
ls_fieldcat-seltext_l = 'Grade'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 3.
ls_fieldcat-fieldname = 'COUNT'.
ls_fieldcat-seltext_l = 'Headcount'.
append ls_fieldcat to fp_i_fieldcat.
if the field name is 'Salary' then do a sum on this field.
IF fp_fname = c_betrg.
l_wa_fieldcat-do_sum = c_x.
ENDIF.
NOTE : IAM GETTING PROBLEM IN THE BELOW SALARY.
IAM JUST CHECKING ITSELF NOT ALLOWING ME TO EXECUTE
clear ls_fieldcat.
ls_fieldcat-fieldname = 'SALARY'.
ls_fieldcat-seltext_l = 'Salary'.
ls_fieldcat-col_pos = 7.
ls_fieldcat-outputlen = 20.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'CURR'. "CURR
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 9.
ls_fieldcat-fieldname = 'LEAVEPAY'.
ls_fieldcat-seltext_l = 'Leave Pay'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 10.
ls_fieldcat-fieldname = 'MSHORTFAL'.
ls_fieldcat-seltext_l = 'Med.Sfall'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 11.
ls_fieldcat-fieldname = 'ECHKSHFAL'.
ls_fieldcat-seltext_l = 'EX.Chckup.Sfall'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 12.
ls_fieldcat-fieldname = 'OFINDEDUC'.
ls_fieldcat-seltext_l = 'Oth.Fin.Deduction'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 13.
ls_fieldcat-fieldname = 'MTYPREM'.
ls_fieldcat-seltext_l = 'Mat.Premium'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 14.
ls_fieldcat-fieldname = 'VPBONUS'.
ls_fieldcat-seltext_l = 'VP/Bonus'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 15.
ls_fieldcat-fieldname = 'GRATUITY'.
ls_fieldcat-seltext_l = 'Gratuity'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 16.
ls_fieldcat-fieldname = 'VPAY'.
ls_fieldcat-seltext_l = 'Variable Pay'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 17.
ls_fieldcat-fieldname = 'MALLOWANCE'.
ls_fieldcat-seltext_l = 'Meal.Allowance'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 18.
ls_fieldcat-fieldname = 'OVERTIME'.
ls_fieldcat-seltext_l = 'Overtime'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 19.
ls_fieldcat-fieldname = 'OTHER'.
ls_fieldcat-seltext_l = 'Other'.
append ls_fieldcat to fp_i_fieldcat.
pfundeecon
clear ls_fieldcat.
ls_fieldcat-col_pos = 20.
ls_fieldcat-fieldname = 'P FUND EMPLOYEES CONTRIBUTION'.
ls_fieldcat-seltext_l = 'P.Fund.Emp.Contrib'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 21.
ls_fieldcat-fieldname = 'BANKTRNSFER'.
ls_fieldcat-seltext_l = 'Payment'.
append ls_fieldcat to fp_i_fieldcat.
endform. " st_fieldcat_init
form st_variant_init using st_gs_variant type disvariant
st_repid like sy-repid.
clear st_gs_variant.
st_gs_variant-report = st_repid.
endform. " st_variant_init
form st_comment_build using st_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
Listenüberschrift: Typ H
clear ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = text-000.
append ls_line to st_lt_top_of_page.
endform. " st_comment_build
FORM TOP_OF_PAGE *
form top_of_page.
data: l_i_detailheader type slis_t_listheader.
To get the header for ALV
perform detail_header changing l_i_detailheader.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = l_i_detailheader.
endform. "top_of_page
form detail_header changing fp_i_detailheader type slis_t_listheader.
data: l_wa_header type slis_listheader,
l_v_time type slis_edit_mask,
l_v_date type slis_edit_mask,
l_v_abkrs type char5,
l_v_pabrj type char8,
l_v_pagno type char10.
Local Constants
constants: l_c_h type char1 value 'H',
l_c_1 type i value '1',
l_c_edit type char10 value '__.__.____',
l_c_slash type c value '/'. " constant for slash
To display the report Header
l_wa_header-typ = l_c_h.
WRITE sy-repid TO l_wa_header-info LEFT-JUSTIFIED.
write text-014 to l_wa_header-info left-justified.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To display the Page no
l_v_pagno = sy-pagno + l_c_1.
l_wa_header-typ = c_s.
l_wa_header-key = text-008. " Page No:
l_wa_header-info = l_v_pagno.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To Display the User ID
l_wa_header-typ = c_s.
l_wa_header-key = text-009. " User ID
l_wa_header-info = sy-uname.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To Display the Date/Time
l_wa_header-typ = c_s.
l_wa_header-key = text-010. " Date/Time:
l_v_time = sy-uzeit.
l_v_date = sy-datum.
write: sy-uzeit to l_v_time.
write sy-datum to l_v_date using edit mask l_c_edit.
concatenate l_v_date
l_c_slash
l_v_time into l_wa_header-info+0(25) separated by space.
append l_wa_header to fp_i_detailheader.
clear: l_wa_header, l_v_date.
To Display the Report Description
l_wa_header-typ = c_s.
l_wa_header-key = text-011. " Report Description
l_wa_header-info = text-012.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
append l_wa_header to fp_i_detailheader.
endform. " detail_header
I will be greatful if any one can please help me in removing me the dump.
REGARDS
LATHA. -
Hi all,
I want to display output using ALV tree. I havent worked on this before, So kindly provide me useful sample programs to display output using ALV tree.
Also i am creating field catalog using following code:
data : gt_fieldcatalog type lvc_t_fcat. "Fieldcatalog
get fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'TP_OUTTAB'
CHANGING
ct_fieldcat = gt_fieldcatalog.
But its getting dumped and "NO_FIELDCATALOG_AVAILABLE" exception is raised.
Also strucure TP_OUTTAB is as:
TYPES: BEGIN OF tp_outtab,
aufnr TYPE aufk-aufnr,
txt TYPE t003p-txt,
maktx TYPE makt-maktx,
charg TYPE afpo-charg,
icon TYPE char4,
prueflos TYPE afko-prueflos, prueflos _ r TYPE icon-id,
ext_roses(5),
expt_roses TYPE icon-id,
zurl(8), "
zurl_r TYPE icon-id,
crstat_t TYPE icon-id,
crstat TYPE icon-id,
adres TYPE cochp-adres,
END OF tp_outtab.
Kindly tell me why the code is getting dumped. Seems there is some problem with structure.
Regards,
SachinHi,
try the following example.
TYPE-POOLS: SLIS.
DATA: BEGIN OF I_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERNAM LIKE VBAK-ERNAM,
ERDAT LIKE VBAK-ERDAT,
AUDAT LIKE VBAK-AUDAT,
VAR1,
END OF I_VBAK.
DATA: BEGIN OF I_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
CHARG LIKE VBAP-CHARG,
END OF I_VBAP.
DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
LAYOUT TYPE SLIS_LAYOUT_ALV,
KEY TYPE SLIS_KEYINFO_ALV.
DATA: IT_HEADER1 TYPE SLIS_T_LISTHEADER.
DATA: WA_HEADER1 TYPE SLIS_LISTHEADER.
DATA: IT_EVE1 TYPE SLIS_T_EVENT,
WA_EVE1 TYPE SLIS_ALV_EVENT.
SELECT VBELN ERNAM ERDAT AUDAT FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE I_VBAK
UP TO 20 ROWS.
SELECT VBELN POSNR MATNR CHARG FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE I_VBAP
UP TO 20 ROWS.
FLDCAT-FIELDNAME = 'VBELN'.
FLDCAT-TABNAME = 'I_VBAK'.
FLDCAT-REF_FIELDNAME = 'VBELN'.
FLDCAT-REF_TABNAME = 'VBAK'.
FLDCAT-SELTEXT_M = 'SALES DOC.'.
FLDCAT-COL_POS = 0.
FLDCAT-KEY = 'X'.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERNAM'.
FLDCAT-TABNAME = 'I_VBAK'.
FLDCAT-REF_FIELDNAME = 'ERNAM'.
FLDCAT-REF_TABNAME = 'VBAK'.
FLDCAT-SELTEXT_M = 'NAME OF PERSON'.
FLDCAT-COL_POS = 1.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERDAT'.
FLDCAT-TABNAME = 'I_VBAK'.
FLDCAT-REF_FIELDNAME = 'ERDAT'.
FLDCAT-REF_TABNAME = 'VBAK'.
FLDCAT-SELTEXT_M = 'RECORD DATE'.
FLDCAT-COL_POS = 2.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'AUDAT'.
FLDCAT-TABNAME = 'I_VBAK'.
FLDCAT-REF_FIELDNAME = 'AUDAT'.
FLDCAT-REF_TABNAME = 'VBAK'.
FLDCAT-SELTEXT_M = 'DOCUMENT DATE'.
FLDCAT-COL_POS = 3.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'POSNR'.
FLDCAT-TABNAME = 'I_VBAP'.
FLDCAT-REF_FIELDNAME = 'POSNR'.
FLDCAT-REF_TABNAME = 'VBAP'.
FLDCAT-SELTEXT_M = 'SALES DOC ITEM'.
FLDCAT-COL_POS = 4.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'MATNR'.
FLDCAT-TABNAME = 'I_VBAP'.
FLDCAT-REF_FIELDNAME = 'MATNR'.
FLDCAT-REF_TABNAME = 'VBAP'.
FLDCAT-SELTEXT_M = 'MATERIAL NO'.
FLDCAT-COL_POS = 5.
APPEND FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'CHARG'.
FLDCAT-TABNAME = 'I_VBAP'.
FLDCAT-REF_FIELDNAME = 'CHARG'.
FLDCAT-REF_TABNAME = 'VBAP'.
FLDCAT-SELTEXT_M = 'BATCH NUMBER'.
FLDCAT-COL_POS = 6.
APPEND FLDCAT.
CLEAR FLDCAT.
LAYOUT-EXPAND_FIELDNAME = 'VAR1'.
KEY-HEADER01 = 'VBELN'.
KEY-ITEM01 = 'VBELN'.
CLEAR WA_EVE1.
WA_EVE1-NAME = 'TOP_OF_PAGE'.
WA_EVE1-FORM = 'TOP-OF-PAGE1'.
APPEND WA_EVE1 TO IT_EVE1.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FLDCAT[]
IT_EVENTS = IT_EVE1[]
I_TABNAME_HEADER = 'I_VBAK'
I_TABNAME_ITEM = 'I_VBAP'
IS_KEYINFO = KEY
TABLES
T_OUTTAB_HEADER = I_VBAK
T_OUTTAB_ITEM = I_VBAP
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.
FORM TOP-OF-PAGE1. WA_HEADER1-TYP = 'H'.
WA_HEADER1-INFO = 'Hierarchical Display'.
APPEND WA_HEADER1 TO IT_HEADER1.
CLEAR WA_HEADER1.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_HEADER1[].
REFRESH IT_HEADER1.
ENDFORM. "TOP-OF-PAGE1
Reward points,if it is useful.
Thanks,
chandu. -
Hi Experts,
In the report I am using LDB pnp and outputting results with ALV,
I am using the FM REUSE_ALV_GRID_DISPLAY,
And I am getting the dump GETWA_NOT_ASSIGNED.
The dump I am getting when the FM is executed.
Thanks in Advance.
Regards,
IFFHi,
i faced the same problem some days ago.
jst cleck your fieldcat.
check fields names passed to fieldcat and should be in ' ' and in capital.
This shd solve your problem
Thanks & regards -
Dump GETWA_NOT_ASSIGNED with REUSE_ALV_GRID_DISPLAY
Hi All,
Today I observed that REUSE_ALV_GRID_DISPLAY gives dump GETWA_NOT_ASSIGNED if we pass a blank table for output. These days I am working with ECC6. Earlier when I use to work with ECC5 such thing never happened and ALV get displayed without any row.
Does anyone know is that correct that in ECC6 blank table in REUSE_ALV_GRID_DISPLAY gives dump. If so, any reason why in ECC6 and not in ECC5?
Regards,
BhaskarHi Bhaskar Tripathi ,
I have an example that works in ECC 6 if you want you can compare it with your code.
types: slis_formname(30) type c.
data: i_repid type sy-repid,
I_CALLBACK_PF_STATUS_SET type slis_formname,
I_CALLBACK_USER_COMMAND type slis_formname,
I_CALLBACK_TOP_OF_PAGE type slis_formname,
lt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
lt_sort TYPE slis_sortinfo_alv OCCURS 1,
gt_events TYPE slis_t_event WITH HEADER LINE,
lt_out "your table with information",
ls_layout TYPE slis_layout_alv.
ls_layout-no_input = 'X'.
ls_layout-colwidth_optimize = 'X'.
ls_layout-totals_text = 'Totals'(201).
ls_layout-info_fieldname = 'LINE_COLOR'.
ls_fieldcat-fieldname = 'MANDT'.
ls_fieldcat-seltext_m = 'Mandante'.
ls_fieldcat-col_pos = 0.
ls_fieldcatj-outputlen = 10.
ls_fieldcat-emphasize = 'X'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PSPID'.
ls_fieldcat-seltext_m = 'Def. de Proyecto'.
ls_fieldcat-col_pos = 1.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'POST1'.
ls_fieldcat-seltext_m = 'Descrip. breve'.
ls_fieldcat-col_pos = 2.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'OBJNR'.
ls_fieldcat-seltext_m = 'Número de objeto'.
ls_fieldcat-col_pos = 3.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
**Event
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events[].
* EXCEPTIONS
* LIST_TYPE_WRONG = 1
* OTHERS = 2
READ TABLE gt_events WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
MOVE 'END_OF_PAGE' TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
READ TABLE gt_events WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
MOVE 'END_OF_LIST' TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_callback_pf_status_set = i_callback_pf_status_set
i_callback_user_command = i_callback_user_command
i_grid_title = i_title
is_layout = lt_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
* IS_VARIANT =
it_events = lt_events
TABLES
t_outtab = lt_out
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.
Best regards. -
Total is not getting displayed in the ALV output.
Hi,
Total is not getting displayed in the ALV output.
I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
Are there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
source code:
DATA: layout TYPE slis_layout_alv,
IT_eventS TYPE slis_t_event,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
TYPES: BEGIN OF ty_tab,
belnr TYPE dberchz-belnr,
belzart TYPE dberchz-belzart,
net TYPE dberchz-nettobtr,
END OF ty_tab.
DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
SELECT belnr belzart nettobtr
FROM dberchz
INTO TABLE lt_tab[]
WHERE belnr eq '000000000001'.
if sy-subrc ne 0.
ENDIF.
* defining layout
layout-colwidth_optimize = 'X'.
layout-def_status = 'X'.
*defning event
*event
*defining field catalog
fcat-col_pos = 1.
fcat-fieldname = 'BELNR'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 2.
fcat-fieldname = 'BELZART'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 3.
fcat-fieldname = 'NET'.
fcat-tabname = 'LT_TAB'.
fcat-do_sum = 'X'.
APPEND fcat.
*calling alv
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'YZ_PLR'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = layout
it_fieldcat = fcat[]
i_tabname = 'LT_TAB'
it_events = IT_EVENTS[]
* IT_SORT =
* I_TEXT = ' '
tables
t_outtab = lt_tab[]
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 2
* OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
Thanks,
GauravHi
No I don't think, this is my code (based on your code) and it works fine:
TYPE-POOLS SLIS.
DATA: BEGIN OF LT_TAB OCCURS 0,
BELNR LIKE BSEG-BELNR,
GJAHR LIKE BSEG-GJAHR,
WRBTR LIKE BSEG-WRBTR,
WAERS LIKE BKPF-WAERS,
END OF LT_TAB.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
REC_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
START-OF-SELECTION.
FCAT-COL_POS = 1.
FCAT-FIELDNAME = 'BELNR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'BELNR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 2.
FCAT-FIELDNAME = 'GJAHR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'GJAHR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 3.
FCAT-FIELDNAME = 'WRBTR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-CFIELDNAME = 'WAERS'.
FCAT-REF_FIELDNAME = 'WRBTR'.
FCAT-REF_TABNAME = 'BSEG'.
FCAT-DO_SUM = 'X'.
APPEND FCAT.
FCAT-COL_POS = 4.
FCAT-FIELDNAME = 'WAERS'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'WAERS'.
FCAT-REF_TABNAME = 'BKPF'.
FCAT-DO_SUM = SPACE.
APPEND FCAT.
SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
WHERE BUKRS = 'MAAB'
AND BELNR = '0000000001'.
LT_TAB-WAERS = 'EUR'.
MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
*CALLING ALV
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT[]
I_TABNAME = 'LT_TAB'
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = LT_TAB[].
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
I've also inserted a currency field
Max -
Getting dump with message CALL_FUNCTION_GET_NAME_FAILED
Hi,
My requirement is to write a report which will be run in background every Monday and the result will be sent to a user as email with excel as attachment.
I tried it by giving the email in 'Spool list recipient' in SM36. ut since the length of the output is more than 255 chars, so i thought of writing the email code as shown below.
DATA: l_message_content LIKE soli OCCURS 10 WITH HEADER LINE,
l_receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
l_packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
l_listobject LIKE abaplist OCCURS 10,
l_compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
lw_object_hd_change LIKE sood1,
l_compressed_size LIKE sy-index.
l_receiver_list-recnam = sy-uname .
l_receiver_list-esc_des = 'B'.
APPEND l_receiver_list.
lw_object_hd_change-objla = sy-langu.
lw_object_hd_change-objnam = 'Selection'.
lw_object_hd_change-objsns = 'P'.
Mail subject
lw_object_hd_change-objdes = 'KRB SAP Inconsistency Report'.
Mail body
APPEND 'Consisteny report between KRB and SAP' TO l_message_content.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = l_compressed_size
TABLES
in = <fs_table>
out = l_compressed_attachment.
DESCRIBE TABLE l_compressed_attachment.
CLEAR l_packing_list.
l_packing_list-transf_bin = 'X'.
l_packing_list-head_start = 0.
l_packing_list-head_num = 0.
l_packing_list-body_start = 1.
l_packing_list-body_num = sy-tfill.
l_packing_list-objtp = 'ALI'.
l_packing_list-objnam = 'Selection'.
l_packing_list-objdes = 'SAP KRB Consistency Report'.
l_packing_list-objlen = l_compressed_size.
APPEND l_packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = lw_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = l_message_content
receivers = l_receiver_list
packing_list = l_packing_list
att_cont = l_compressed_attachment.
I am getting the mail which i checked in SBWP but when i clicked on the attachment i am getting dump with message CALL_FUNCTION_GET_NAME_FAILED.
Short text
Error when starting a Remote Function Call.
What happened?
"CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=223#CPIC program connection ended (read
error) "
An error occurred when executing a Remote Function Call.
Error analysis
An error occurred when executing a Remote Function Call.
"CPIC-CALL: 'ThSAPCMRCV' : cmRc=20 thRc=223#CPIC program connection ended (read
error) "
Status of connection.... "RFC DRV=??? ???"
Internal error code.... "RFC_IO4"
Internal error: Invalid RFC handle.
Trigger Location of Runtime Error
Program SAPMSSY1
Include SAPMSSY1
Row 266
Module type (FORM)
Module Name XAB_RUN_DRIVER
Please help in this.
<removed by moderator>
Edited by: Thomas Zloch on Sep 14, 2011 11:57 AMHi,
Check your RFC Connection Configuration. Also, check the used username & password.
Reward points if the asnwer is helpful.
Regards, -
How to get check box in alv output
hi gurus
can anyone explian me how to get check box in alv output
it should not be a pop up window
i want to get in output itself
tahnk you
regards
kals.Hi
by using rs_selfield
ty to call dynamic subroutine..
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
read table rs-selfield with key cond = 'X'
endform.
see the below example
REPORT Z_GET_REFRESH no standard page heading.
type-pools : slis.
tables : makt,
mara.
data : i_fieldcat type slis_t_fieldcat_alv.
CONSTANTS :
gc_refresh TYPE syucomm VALUE '&REFRESH'.
data : begin of i_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of i_makt.
data : v_repid like sy-repid,
g_user_command type slis_formname value 'USER_COMMAND',
g_status_set type slis_formname value 'SET_PF_STATUS',
lt_event_exit TYPE slis_t_event_exit,
ls_event_exit TYPE slis_event_exit.
DATA:LC_GLAY TYPE LVC_S_GLAY.
select-options s_matnr for mara-matnr .
start-of-selection.
select matnr maktx from makt into table i_makt
where matnr in s_matnr.
end-of-selection.
Fill the fieldcatlog
perform fill_field.
Call the FM
perform call_fm.
*& Form fill_field
text
--> p1 text
<-- p2 text
FORM fill_field.
data wa_fieldcat type slis_fieldcat_alv.
clear : wa_fieldcat.
wa_fieldcat-tabname = 'I_MAKT'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-outputlen = '18'.
wa_fieldcat-seltext_l = 'Material #'.
wa_fieldcat-col_pos = '1'.
append wa_fieldcat to i_fieldcat.
clear : wa_fieldcat.
wa_fieldcat-tabname = 'I_MAKT'.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-outputlen = '40'.
wa_fieldcat-seltext_l = 'Material Desc'.
wa_fieldcat-col_pos = '2'.
append wa_fieldcat to i_fieldcat.
ENDFORM. " fill_field
*& Form call_fm
text
--> p1 text
<-- p2 text
FORM call_fm.
v_repid = sy-repid.
LC_GLAY-EDT_CLL_CB = 'X'.
CLEAR ls_event_exit.
ls_event_exit-ucomm = gc_refresh. " Refresh
ls_event_exit-after = 'X'.
APPEND ls_event_exit TO lt_event_exit.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = g_status_set
I_CALLBACK_USER_COMMAND = g_user_command
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS = LC_GLAY
IS_LAYOUT =
IT_FIELDCAT = i_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT = lt_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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_makt
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. " call_fm
FORM USER_COMMAND *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
data i_RSPARAMS like RSPARAMS occurs 0.
CASE R_UCOMM.
WHEN '&IC1'.
read table i_makt index rs_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD i_makt-matnr.
if not i_makt-matnr is initial.
call transaction 'MM02' and skip first screen.
endif.
when '&REFRESH'.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
CURR_REPORT = v_repid
IMPORTING
SP =
TABLES
SELECTION_TABLE = i_RSPARAMS
EXCEPTIONS
NOT_FOUND = 1
NO_REPORT = 2
OTHERS = 3
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
submit z_get_refresh with selection-table i_RSPARAMS.
rs_selfield-refresh = 'X'.
ENDCASE.
MOVE '&REFRESH' TO r_ucomm.
ENDFORM.
FORM set_pf_status *
FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
DELETE Rt_extab WHERE fcode = gc_refresh.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
EXCLUDING Rt_extab.
*SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
SET TITLEBAR sy-tcode.
ENDFORM. -
How to get check box in alv grid list output
hi gurus,
can anyone inform me
how to get check box in alv output it should not be a pop up window
thank you
regards
kals.or
hi go through the fallowing code.
code*&----
*& Report YGS_ALV_BOM *
REPORT YGS_ALV_BOM .
TABLES : MAST,STKO,STPO.
TYPE-POOLS: SLIS.
TYPES : BEGIN OF TY_MAST,
CHECK_BOX,
MATNR TYPE MAST-MATNR,
WERKS TYPE MAST-WERKS,
STLAN TYPE MAST-STLAN,
STLNR TYPE MAST-STLNR,
STLAL TYPE MAST-STLAL,
END OF TY_MAST.
TYPES : BEGIN OF TY_STKO,
STLTY TYPE STKO-STLTY,
STLNR TYPE STKO-STLNR,
STLAL TYPE STKO-STLAL,
STKOZ TYPE STKO-STKOZ,
BMENG TYPE STKO-BMENG,
BMEIN TYPE STKO-BMEIN,
END OF TY_STKO.
TYPES : BEGIN OF TY_STPO,
LIGHTS,
STLTY TYPE STPO-STLTY,
STLNR TYPE STPO-STLNR,
STLKN TYPE STPO-STLKN,
STPOZ TYPE STPO-STPOZ,
IDNRK TYPE STPO-IDNRK,
MENGE TYPE STPO-MENGE,
MEINS TYPE STPO-MEINS,
END OF TY_STPO.
DATA : IT_MAST TYPE TABLE OF TY_MAST,
WA_MAST TYPE TY_MAST,
IT_STKO TYPE TABLE OF TY_STKO,
WA_STKO TYPE TY_STKO,
IT_STPO TYPE TABLE OF TY_STPO,
WA_STPO TYPE TY_STPO.
DATA : lt_fieldcat TYPE slis_t_fieldcat_alv,
ls_layout TYPE slis_layout_alv,
ls_event TYPE slis_alv_event,
lt_event TYPE slis_t_event,
it_sortinfo type slis_t_sortinfo_alv,
ls_header TYPE slis_listheader,
lt_header TYPE slis_t_listHEADER.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS : S_MATNR FOR MAST-MATNR.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM BUILD_FIELDCAT USING LT_FIELDCAT.
PERFORM BUILD_LAYOUT.
END-OF-SELECTION.
PERFORM DISPLAY_DATA.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
REFRESH : IT_MAST.
SELECT MATNR
WERKS
STLAN
STLNR
FROM MAST
INTO CORRESPONDING FIELDS OF TABLE IT_MAST
WHERE MATNR IN S_MATNR.
endform. " GET_DATA
*& Form BUILD_FIELDCAT
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
REFRESH : LT_FIELDCAT.
L_FIELDCAT-COL_POS = 1.
L_FIELDCAT-FIELDNAME = 'MATNR'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'MATNR'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 2.
L_FIELDCAT-FIELDNAME = 'WERKS'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'WERKS'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 3.
L_FIELDCAT-FIELDNAME = 'STLNR'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
endform. " BUILD_FIELDCAT
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
form BUILD_LAYOUT .
CLEAR LS_LAYOUT.
LS_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
LS_LAYOUT-BOX_TABNAME = 'IT_MAST'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
form DISPLAY_DATA .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = LS_LAYOUT
IT_FIELDCAT = LT_FIELDCAT
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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_MAST
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. " DISPLAY_DATA
FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'YSTATUS' OF PROGRAM SY-REPID
EXCLUDING RT_EXTAB.
ENDFORM.
FORM USER_COMMAND USING RF_UCOMM TYPE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE RF_UCOMM.
WHEN '&NEXT'.
PERFORM GET_DATA_BOM .
PERFORM BUILD_FIELDCAT_BOM USING LT_FIELDCAT.
PERFORM BUILD_LAYOUT_BOM.
PERFORM DISPLAY_DATA_BOM.
ENDCASE.
ENDFORM.
*& Form GET_DATA_BOM
text
--> p1 text
<-- p2 text
form GET_DATA_BOM .
CLEAR : WA_STPO,
WA_MAST.
REFRESH : IT_STPO.
DATA : IT_CHECK TYPE TABLE OF TY_MAST.
LOOP AT IT_MAST INTO WA_MAST.
IF WA_MAST-CHECK_BOX EQ 'X'.
APPEND WA_MAST TO IT_CHECK.
ENDIF.
ENDLOOP.
SELECT STLTY
STLNR
STLKN
VGKNT
IDNRK
MENGE
MEINS
FROM STPO
INTO CORRESPONDING FIELDS OF TABLE IT_STPO
FOR ALL ENTRIES IN IT_CHECK
WHERE IDNRK EQ IT_CHECK-MATNR.
CLEAR WA_STPO.
LOOP AT IT_STPO INTO WA_STPO.
SELECT SINGLE * FROM MAST WHERE MATNR EQ WA_STPO-IDNRK.
IF SY-SUBRC = 0.
WA_STPO-LIGHTS = '2'.
ELSE.
WA_STPO-LIGHTS = '1'.
ENDIF.
MODIFY IT_STPO FROM WA_STPO.
ENDLOOP.
endform. " GET_DATA_BOM
*& Form BUILD_FIELDCAT_BOM
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT_BOM USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
REFRESH : LT_FIELDCAT.
L_FIELDCAT-COL_POS = 1.
L_FIELDCAT-FIELDNAME = 'STLTY'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLTY'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 2.
L_FIELDCAT-FIELDNAME = 'STLNR'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 3.
L_FIELDCAT-FIELDNAME = 'STLKN'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLKN'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 4.
L_FIELDCAT-FIELDNAME = 'IDNRK'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'IDNRK'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 5.
L_FIELDCAT-FIELDNAME = 'MENGE'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'MENGE'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
endform. " BUILD_FIELDCAT_BOM
*& Form BUILD_LAYOUT_BOM
text
--> p1 text
*<-- p2 text
form BUILD_LAYOUT_BOM .
CLEAR : LS_LAYOUT.
LS_LAYOUT-LIGHTS_FIELDNAME = 'LIGHTS'.
LS_LAYOUT-LIGHTS_TABNAME = 'IT_STPO'.
endform. " BUILD_LAYOUT_BOM
*& Form DISPLAY_DATA_BOM
text
--> p1 text
<-- p2 text
form DISPLAY_DATA_BOM .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_BOM'
I_CALLBACK_TOP_OF_PAGE = 'TOP9'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = LS_LAYOUT
IT_FIELDCAT = LT_FIELDCAT
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
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_STPO
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. " DISPLAY_DATA_BOM
FORM TOP9 .
CLEAR LS_HEADER.
REFRESH LT_HEADER.
LS_HEADER-TYP = 'H'.
LS_HEADER-INFO = 'BILL OF MATERIALS'.
APPEND LS_HEADER TO LT_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = LT_HEADER
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID =
ENDFORM.
FORM USER_COMMAND_BOM USING RF_UCOMM_BOM LIKE SY-UCOMM
SEL_FIELD TYPE SLIS_SELFIELD.
CASE RF_UCOMM_BOM.
WHEN '&IC1'.
SET PARAMETER ID 'MAT' FIELD WA_STPO-IDNRK.
SET PARAMETER ID 'WRK' FIELD WA_MAST-WERKS.
SET PARAMETER ID 'CSA' FIELD WA_MAST-STLAN.
CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
ENDCASE.[/code] -
How to get f4 help in alv grid in container-urgent
hi,
how to get f4 help in alv grid in container using abap objects
ganeshHi Ganesh,
Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
Here is part of the header documentation:
*& Report BCALV_GRID_F4_HELP *
Purpose:
~~~~~~~~
This report illustrates the use of f4-Help in an alv grid control.
Background:
~~~~~~~~~~~
There a two possibilities to implement an f4-Help in the alv grid
control: one can either use standard f4-help or write one by Hand.
For the former there is nothing to do at all. This report shows how
to implement user-defined f4-help.
I am sure you will find within this report the solution you are looking for.
Reward points if this Helps.
Manish -
How to get the output in ALV format
Hi All,
this is my program, in this i want to get the output in ALV, i hv created two containers and m able to get the ALV layout successfully but i am not able to fetch the correct data.
the output it is showing is some RFC value.
here we have used - abaplist, soli.
Please provide me the solution.
SELECT * FROM varid INTO CORRESPONDING FIELDS OF TABLE t_varid WHERE report in s_report.
LOOP AT t_varid .
SUBMIT (t_varid-report) USING SELECTION-SET t_varid-variant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listtab
EXCEPTIONS
not_found = 1
OTHERS = 2.
**************Old System Entry********
CALL FUNCTION 'Z_GET_DETAILS'
DESTINATION 'BWDCLNT900'
EXPORTING
report = t_varid-report
variant = t_varid-variant
TABLES
listtab = list_tab.
IF sy-subrc EQ 0.
CALL FUNCTION 'LIST_TO_TXT'
TABLES
listtxt = listtxt1
listobject = list_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2.
ENDIF.
if p_flag eq 'X'.
clear p_flag.
write : / 'Program Name',
41 'Variant Name',
66 'Output Match'.
endif.
IF listtxt EQ listtxt1.
WRITE : / t_varid-report,
41 t_varid-variant,
66 icon_green_light AS ICON HOTSPOT.
ELSE.
WRITE : / t_varid-report,
41 t_varid-variant,
66 icon_red_light AS ICON HOTSPOT.
ENDIF.
CLEAR : listtab,list_tab,listtxt,listtxt1.
REFRESH : listtab[],list_tab[],listtxt[],listtxt1[].
ENDLOOP.
AT line-selection.
v_report = sy-lisel(40).
v_variant = sy-lisel+40(14).
call SCREEN 400.
module STATUS_0400 output.
SUBMIT (v_report) USING SELECTION-SET v_variant
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listtab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_TXT'
TABLES
listtxt = listtxt1
listobject = list_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2.
**************Old System Entry********
CALL FUNCTION 'Z_GET_DETAILS'
DESTINATION 'BWDCLNT900'
EXPORTING
report = v_report
variant = v_variant
TABLES
listtab = list_tab.
CREATE OBJECT CCONT1
EXPORTING
CONTAINER_NAME = 'C1'.
CREATE OBJECT CCONT2
EXPORTING
CONTAINER_NAME = 'C2'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = CCONT1.
CREATE OBJECT GRID2
EXPORTING
I_PARENT = CCONT2.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'abaplist'
CHANGING
IT_OUTTAB = list_tab.
CALL METHOD GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'abaplist'
CHANGING
IT_OUTTAB = listtab.
SET PF-STATUS 'ZUTDEMO2'.
endmodule.
module USER_COMMAND_0400 input.
IF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
endmodule. " USER_COMMAND_0400 INPUTsolved
-
hi,
i am getting dump in my below code in the delete statement line.actually previously it worked fine but now suddenly we r getting dump in the second delete statement below.can some body tell me the reason.
error analysis: You attempted to change, delete or create a line in the
internal table "\PROG=YBDISEMAT\DATA=INT_MARC", but no valid cursor exists
for the table.
Possible reasons:
1. The relevant ABAP/4 statement does not include the addition
"...INDEX...", although the statement is not
inside a "LOOP...ENDLOOP" loop processing this table.
2. The relevant ABAP/4 statement was called from within a
"LOOP...ENDLOOP" loop after a DELETE "\PROG=YBDISEMAT\DATA=INT_MARC".
LOOP AT int_marc INTO wa_marc.
IF wa_marc-werks IN ra_source.
READ TABLE int_disgr WITH KEY zdisgr = wa_marc-disgr
zwerks = wa_marc-werks.
IF sy-subrc NE 0.
DELETE int_marc.
ENDIF.
ENDIF.
IF wa_marc-werks IN ra_zmdc.
READ TABLE int_disgr WITH KEY zdisgr = wa_marc-disgr
zwerks = wa_marc-werks.
IF sy-subrc NE 0.
DELETE int_marc. _______________________________________________ getting dump here
ENDIF.
ENDIF.
CLEAR wa_marc.
ENDLOOP.Hi.
First of all deleting an internal table inside the loop is not a good practise ..You are deleting the same internal table that you are looping..
Instead of that you can make a small modification to your code.
LOOP AT int_marc INTO wa_marc.
IF wa_marc-werks IN ra_source.
READ TABLE int_disgr WITH KEY zdisgr = wa_marc-disgr
zwerks = wa_marc-werks.
IF sy-subrc NE 0.
move 'X' to any field in the internal table.
or you can have an additinal field in the end of the internal table like flag type char01.
and move 'X' to wa_marc-flag.
ENDIF.
ENDIF.
Now outside the loop you can delete
delete int_marc where flag = 'X'.
Regards
Ansari
Maybe you are looking for
-
Not allow order unit in INFO record if it is not in material master
Hello there! In standar SAP any user can introduce any order unit in the info record, even if it is not maintained in the material master alternative units of meassure. We need to block this... The conversion factor is not a problem for us, as we can
-
My ipad is disabled and i am not synced to itunes. How do i enable my ipad?
My mother in law got an ipad for christmas. She put in the wrong pass code one too many times and now it says it is disabled and to connect to itunes. The problem is, my girlfriend never synced in to an itunes account before giving it to her. So itun
-
ITunes videos won't play when artwork is changed
I have some of my own Quicktime videos that I've imported into iTunes (10.1.2) and they play fine. However, when I change the artwork to something custom (like a jpg of a screencap) the file will no longer play within iTunes. My Macbook Pro still pla
-
Squence of events triggered in reports
Hi all, Please specify squence of events trigger. When top-of-page event triggers? When end of selection event triggers venkraa
-
How to drag and drop a sub tree between 2 treeview?
Suppose I have 2 tree rendered in 2 treeview. Then I want to drag and drop any subtree on any node between the 2 tree. For example, in tree 1, if I drag node node1 and drop it on tree 2 node node2. I want all nodes from node1(subtree) moved to node 2