Explicit Search Helps Short-Dump in Editable ALV with included structure
I have an editable ALV grid defined as follows:
TYPES: BEGIN OF gs_outtab200.
TYPES: row_indx(4) TYPE n.
TYPES: multipurp TYPE c.
INCLUDE structure zxrfwc_test.
TYPES: end of gs_outtab200.
DATA:
gt_outtab200 TYPE TABLE OF gs_outtab200,
wa_outtab200 TYPE gs_outtab200.
The included structure zxrfwc_test has a component (field) which is defined with a data element that has an explicit search helps associated with it.
I know that this search help is working properly because it works fine in the program's selection screen.
But when I invoke the search help from within a column of the ALV itself, I get a short dump with a "GETWA_NOT_ASSIGNED" error.
I have done plenty of editable ALVs with search helps defined on the data elements and never encountered this problem.
Am I hitting this problem because the zxrfwc_test structure is defined within the
gs_outtab200 structure ??
If not, what is causing this problem. (Please note that I have set ls_fcat-F4AVAILABL = 'X' in the fieldcat routine - this doesn't seem to help at all.)
Please advise!!!!
I'm really stuck on this one because it's always worked before when I'm not dealing with a dictionary structure that's included within a larger ALV structure.
Thanks.
Hi,
How you are creating your field catalog?
Try to create a field catalog in the following way giving reference to your structure. is it possible for you create a DDIC structure as same as
TYPES: BEGIN OF gs_outtab200.
TYPES: row_indx(4) TYPE n.
TYPES: multipurp TYPE c.
INCLUDE structure zxrfwc_test.
TYPES: end of gs_outtab200.
* Form f_generate_fieldcatalog *
* Form generate the field catalog table *
form f_generate_fieldcatalog.
* Private variable
data : v_structure like dd02l-tabname. " Table Name
v_structure = c_yatt_alv. " Structure Name
* Build the fieldcat according to DDIC structure YATT_ALV:
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = v_structure
i_client_never_display = c_x
changing
ct_fieldcat = i_fieldcat[].
endform. " F_generate_fieldcatalog
a®
Similar Messages
-
How-to map multiple explicit search help values to context attributes?
Hi,
I have a custom explicit Search Help with multiple attributes set as export and uses search help exit for data retrieval. I have set this Search Help for one of the context attribute that is binded to one of the input fields on view.
Now, is it possible to dynamically map other export attributes from this Search Help to other Context attributes?
I know this works for Input helps that are directly derived from check tables but not sure how to do it for explicit Search Helps.
Can anyone please confirm and let me if this is possible? If yes, then can you please share an example or describe how to do it?
Thanks and Regards,Hi Srinivas,
Check this ..Search help can be dynamically assigned to a field.
data lo_nd_info type if_wd_context_node_info.
lo_nd_info = lo_nd->get_node_info( ).
CALL METHOD lo_nd_info->set_attribute_value_help
EXPORTING
name = 'ATTR1' " Your attribute Name
value_help_mode = '121' " Valid value help mode
value_help = 'Z187442'. " Search help name
The various possible values that you can pass to value_help_mode are as shown below.
deactivated 101
automatic 111
ddic 121
ovs 131
Also refer this..
Re: How to put dynamic search help in web dynpro ABAP.
Cheers,
Kris. -
Hi Gurus,
I have created an editable ALV with F4 help, but the value doesnt reflect in the F4 help.
Regards,
ChinmayaHi Chinmaya,
Include the field F4AVAILABL in your field catalog internal table.
itab_fieldcatalog-F4AVAILABL = X
if you are not using the data element for the field 'F4' help won't come. in this situation, use the ONF4 event to build the F4 Help.
Reward if found helpful.
Regards,
Boobalan Suburaj -
Hi experts,
Could you plz provede me an example for an EDITABLE ALV with the SAVE option. i.e. i could edit the ALV output and after the changes i should save the changes i made by clicking SAVE button.
Thanks in advance
Regards,
Ramhi,
check the sample code
REPORT ZLAXMI_REPORT6 NO STANDARD PAGE HEADING
MESSAGE-ID ZZ
LINE-SIZE 132
LINE-COUNT 65 .
TABLES: MARA.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF T_MARA,
MATNR TYPE MARA-MATNR, "Material Number
ERSDA TYPE MARA-ERSDA, "Creation date
BRGEW TYPE MARA-BRGEW, "Gross weight
NTGEW TYPE MARA-NTGEW, "Net weight
MTART TYPE MARA-MTART, "Material type
MBRSH TYPE MARA-MBRSH, "Industry Sector
REC_SEL TYPE C , "checkbox
END OF T_MARA.
V A R I A B L E S
DATA: V_REPID LIKE SY-REPID,
V_FLAG(1) TYPE C.
CONSTANTS :
C_X(1) TYPE C VALUE 'X',
C_PF_STATUS TYPE SLIS_FORMNAME VALUE 'F_SET_PF_STATUS',
C_FC_DELETE(6) TYPE C VALUE 'DELETE',
C_FC_MODIFY(6) TYPE C VALUE 'MODIFY',
C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'F_USER_COMMAND',
C_USER_COMMAND_MODIFY TYPE SLIS_FORMNAME
VALUE 'F_USER_COMMAND_MODIFY',
C_ICON_DELETE TYPE ICON-NAME VALUE 'ICON_DELETE', " Icon,Delete'
C_ICON_CANCEL TYPE ICON-NAME VALUE 'ICON_CANCEL', " Icon,Cancel'
C_FC_SAVE(4) TYPE C VALUE 'SAVE'.
*internal table declarations.
DATA: IT_MARA TYPE STANDARD TABLE OF T_MARA WITH HEADER LINE,
IT_MODIFY TYPE STANDARD TABLE OF T_MARA WITH HEADER LINE,
IT_TEMP TYPE STANDARD TABLE OF MARA WITH HEADER LINE,
*-ALV Internal Tables.
*--Field Catalog
IT_FIELDCAT TYPE STANDARD TABLE OF
SLIS_FIELDCAT_ALV WITH HEADER LINE,
*--Layout
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
*--Sort
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV ,
**-Structure for excluding function codes
WA_EXTAB TYPE SLIS_EXTAB,
**-To hold function codes to be excluded in ALV toolbar
IT_EXTAB TYPE SLIS_T_EXTAB.
*selection screen.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
S_ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN: END OF BLOCK B1.
*--Radio buttons to select either Display/Delete/Modify
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME
TITLE TEXT-002.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TEXT-003.
PARAMETERS: P_DISP RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TEXT-005.
PARAMETERS: P_UPD RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TEXT-004.
PARAMETERS: P_DEL RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN END OF BLOCK B2 .
AT SELECTION-SCREEN.
PERFORM VALIDATE_SCREEN.
*start of selection
START-OF-SELECTION.
*clear the internal tables to be used.
CLEAR: IT_MARA,IT_MARA[],
V_FLAG.
*get the data
PERFORM GET_DATA.
*end of selection
END-OF-SELECTION.
IF IT_MARA[] IS INITIAL.
MESSAGE I000 WITH
'No Records found for the given Selection Criteria'(012).
ELSE.
*do alv process
V_REPID = SY-REPID.
*--Sort the Output Fields
PERFORM SORT_FIELDS.
*--Build Field catalog for the Output fields
PERFORM BUILD_FIELDCAT.
*--Set the Layout for ALV
PERFORM SET_LAYOUT.
IF P_DISP = C_X.
*--Exclude any Buttons on the Appn tool bar
perform change_default_pf_status.
MOVE C_FC_DELETE TO WA_EXTAB-FCODE. " DELETE button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
MOVE C_FC_MODIFY TO WA_EXTAB-FCODE. " MODIFY button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
ELSEIF P_UPD = C_X.
*--Exclude DELETE Button on the appn tool bar
MOVE C_FC_DELETE TO WA_EXTAB-FCODE. " DELETE button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
ELSEIF P_DEL = C_X.
*--Exclude MODIFY button on appn tool bar
MOVE C_FC_MODIFY TO WA_EXTAB-FCODE. " MODIFY button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
ENDIF.
*--Exclude SAVE button for all options
MOVE 'SAVE' TO WA_EXTAB-FCODE. " SAVE button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
*--Display ALV output
PERFORM LIST_DISPLAY TABLES IT_MARA
USING C_USER_COMMAND.
ENDIF.
*& Form get_data
text
--> p1 text
<-- p2 text
FORM GET_DATA .
SELECT MATNR
ERSDA
BRGEW
NTGEW
MTART
MBRSH
FROM MARA
INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR
AND ERSDA IN S_ERSDA.
IF SY-SUBRC <> 0.
*no records selected leave processing
STOP.
ENDIF.
SORT IT_MARA.
ENDFORM. " get_data
*& Form sort_fields
text
--> p1 text
<-- p2 text
FORM SORT_FIELDS .
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'ERSDA'.
WA_SORT-SPOS = '2'.
WA_SORT-UP = 'X'.
APPEND WA_SORT TO IT_SORT.
ENDFORM. " sort_fields
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCAT .
IT_FIELDCAT-COL_POS = '1'.
IT_FIELDCAT-FIELDNAME = 'MATNR'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '15'.
IT_FIELDCAT-SELTEXT_L = 'Material number'(022).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '2'.
IT_FIELDCAT-FIELDNAME = 'ERSDA'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '10'.
IT_FIELDCAT-SELTEXT_L = 'Created on'(023).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '3'.
IT_FIELDCAT-FIELDNAME = 'BRGEW'.
IT_FIELDCAT-OUTPUTLEN = '10'.
IT_FIELDCAT-SELTEXT_L = 'GROSS WEIGHT'(024).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '4'.
IT_FIELDCAT-FIELDNAME = 'NTGEW'.
IT_FIELDCAT-OUTPUTLEN = '15'.
IT_FIELDCAT-SELTEXT_L = 'NET WEIGHT'(025).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '5'.
IT_FIELDCAT-FIELDNAME = 'MTART'.
IT_FIELDCAT-OUTPUTLEN = '3'.
IT_FIELDCAT-SELTEXT_L = 'Material type'(026).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '6'.
IT_FIELDCAT-FIELDNAME = 'MBRSH'.
IT_FIELDCAT-OUTPUTLEN = '25'.
IT_FIELDCAT-SELTEXT_L = 'Industry sector'(027).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-FIELDNAME = 'REC_SEL'.
IT_FIELDCAT-NO_OUT = C_X.
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
ENDFORM. " build_fieldcat
*& Form list_display
text
-->P_IT_MARA text
-->P_C_USER_COMMAND text
FORM LIST_DISPLAY TABLES P_IT_MARA
USING P_USER_COMMAND TYPE SLIS_FORMNAME.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = C_PF_STATUS
I_CALLBACK_USER_COMMAND = P_USER_COMMAND
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING = IT_EXTAB[]
IT_SORT = IT_SORT[]
TABLES
T_OUTTAB = P_IT_MARA
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. " list_display
*& Form F_SET_PF_STATUS
Set PF_STATUS STANDARD modifying the standard toolbar
by excluding some buttons
-->P_IT_EXTAB -- TABLE OF EXCLUDING FUNCTIONS
FORM F_SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
CLEAR : WA_EXTAB,
IT_EXTAB.
*--Set the Modified PF status for the ALV.
SET PF-STATUS 'ALV_STATUS_01' EXCLUDING RT_EXTAB.
ENDFORM. " SET_PF_STATUS
*& Form f_user_command
Handle user action on ALV toolbar
FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
RS_SELFIELD-REFRESH = C_X.
IF R_UCOMM = C_FC_DELETE.
*--User Selected DELETE button.
PERFORM DELETE_SELECTED_RECORDS.
ELSEIF R_UCOMM = C_FC_MODIFY.
*--If user selects MODIFY button.
PERFORM CHANGE_RECORDS.
ENDIF.
ENDFORM. "F_USER_COMMAND
*& Form POP_UP_CONFIRMATION
text
<--P_ANSWER text
FORM POP_UP_CONFIRMATION
CHANGING P_ANSWER TYPE C.
DATA:
L_TITLE(14) TYPE C, " Title of pop-up
L_TXT_QUESTION(52) TYPE C, " Text displayed in pop-up
L_DISP_CANCEL TYPE C, " Display 'Cancel' button?
L_BTN1 TYPE ICON-NAME, " Icon on button 1
L_BTN2 TYPE ICON-NAME. " Icon on button 2
L_TITLE = 'Delete'(017). " delete
L_TXT_QUESTION = 'Are you sure to delete?'(018).
L_BTN1 = C_ICON_DELETE.
L_BTN2 = C_ICON_CANCEL.
**-Display pop-up asking user for confirmation
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = L_TITLE
TEXT_QUESTION = L_TXT_QUESTION
TEXT_BUTTON_1 = 'Yes'
ICON_BUTTON_1 = L_BTN1
TEXT_BUTTON_2 = 'No'
ICON_BUTTON_2 = L_BTN2
DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = 'X'
IMPORTING
ANSWER = P_ANSWER
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'Error executing function module:'(019)
'POPUP_TO_CONFIRM'.
ENDIF.
ENDFORM. "pop_up_confirmation
*& Form set_layout
text
--> p1 text
<-- p2 text
FORM SET_LAYOUT .
IF P_DEL = C_X OR P_UPD = C_X.
*--Allow Input only if user choose 'UPDATE'/ 'DELETE' radio buttons
WA_LAYOUT-BOX_FIELDNAME = 'REC_SEL'.
WA_LAYOUT-BOX_TABNAME = 'IT_MARA'.
ENDIF.
*--Display Header based on the user selection
IF P_DISP = C_X.
WA_LAYOUT-WINDOW_TITLEBAR =
'Display '(036).
ELSEIF P_DEL = C_X.
WA_LAYOUT-WINDOW_TITLEBAR =
'Delete '(037).
ELSEIF P_UPD = C_X.
WA_LAYOUT-WINDOW_TITLEBAR =
'Change '(038).
ENDIF.
ENDFORM. " set_layout
*& Form change_default_pf_status
text
--> p1 text
<-- p2 text
FORM CHANGE_DEFAULT_PF_STATUS .
MOVE C_FC_DELETE TO WA_EXTAB-FCODE. " DELETE button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
MOVE C_FC_MODIFY TO WA_EXTAB-FCODE. " MODIFY button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
ENDFORM. " change_default_pf_status
*& Form f_user_command
Handle user action on ALV toolbar
FORM F_USER_COMMAND_MODIFY USING R_UCOMM LIKE SY-UCOMM "#EC *
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA : L_ANSWER TYPE C. "#EC *
IF R_UCOMM = C_FC_SAVE.
*user selected save button
READ TABLE IT_MODIFY WITH KEY REC_SEL = 'X'.
*check if user selected atleast one line.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'No record(s) Selected to Modify'(016).
EXIT.
ENDIF.
LOOP AT IT_MODIFY WHERE REC_SEL = 'X'.
*--Check the entered values are valid or not.
IF NOT ( it_modify-status = 'A' OR
it_modify-status = 'C' OR
it_modify-status = 'E' ).
*--User Entered invalid value for STATUS field,so Display Error Msg
CLEAR R_UCOMM.
MESSAGE e000 WITH 'Invalid value '''(031)
'' for Status in the Record # '(032)
sy-tabix.
ENDIF.
ENDLOOP.
CLEAR: IT_TEMP,
IT_TEMP[].
LOOP AT IT_MODIFY WHERE REC_SEL = 'X'.
MOVE-CORRESPONDING IT_MODIFY TO IT_TEMP.
APPEND IT_TEMP.
CLEAR IT_TEMP.
ENDLOOP.
*--start new code
DATA : IT_TEMP2 LIKE STANDARD TABLE OF MARA WITH HEADER LINE.
SELECT * FROM MARA
INTO TABLE IT_TEMP2
FOR ALL ENTRIES IN IT_TEMP
WHERE MATNR = IT_TEMP-MATNR.
IF SY-SUBRC = 0.
LOOP AT IT_MODIFY WHERE REC_SEL = 'X'.
READ TABLE IT_TEMP2 WITH KEY MATNR = IT_MODIFY-MATNR.
IF SY-SUBRC = 0.
IT_TEMP2-NTGEW = IT_MODIFY-NTGEW.
IT_TEMP2-BRGEW = IT_MODIFY-BRGEW.
MODIFY IT_TEMP2 INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ENDIF.
*modify mara table with the changed values
MODIFY MARA FROM TABLE IT_TEMP2 .
*--end new code
IF SY-SUBRC = 0.
COMMIT WORK AND WAIT.
*--Display message with Success in Updating database
MESSAGE I000 WITH SY-DBCNT
' Record(s) has been Updated'(020).
CLEAR :
IT_MARA,
IT_MARA[].
*get-data again from database.
PERFORM GET_DATA.
RS_SELFIELD-REFRESH = C_X.
ELSE.
*--Error occurred
MESSAGE I000 WITH 'Error occured in Modifying the database'(021).
ENDIF.
ENDIF.
ENDFORM. "f_user_command_modify
*& Form validate_screen
text
--> p1 text
<-- p2 text
FORM VALIDATE_SCREEN .
DATA : LV_MATNR LIKE MARA-MATNR.
*--validate product
IF NOT S_MATNR[] IS INITIAL.
SELECT MATNR
INTO MARA-MATNR
FROM MARA
WHERE MATNR IN S_MATNR.
ENDSELECT.
IF SY-SUBRC <> 0.
*--Error
MESSAGE E000 WITH 'Invalid Material'(034).
ENDIF.
ENDIF.
ENDFORM. " validate_screen
*& Form delete_records
text
--> p1 text
<-- p2 text
FORM DELETE_RECORDS .
LOOP AT IT_MARA.
MOVE-CORRESPONDING IT_MARA TO IT_TEMP.
APPEND IT_TEMP.
CLEAR IT_TEMP.
ENDLOOP.
DELETE MARA FROM TABLE IT_TEMP.
IF SY-SUBRC = 0.
*--Successfully selected records Deleted.
COMMIT WORK AND WAIT.
*--Display Success Message to the user
MESSAGE I000 WITH SY-DBCNT
' Record(s) deleted Successfully'(010).
ELSE.
*--Error occured in deletion
MESSAGE I000 WITH 'Error occured in Deleting the Record(s)'(011).
ENDIF.
CLEAR: IT_MARA,
IT_MARA[],
IT_TEMP,
IT_TEMP[].
V_FLAG = C_X.
STOP.
ENDFORM. " delete_records
*& Form delete_selected_records
text
--> p1 text
<-- p2 text
FORM DELETE_SELECTED_RECORDS .
DATA : L_ANSWER(1) TYPE C.
READ TABLE IT_MARA WITH KEY REC_SEL = C_X.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'No record(s) Selected to Delete'(013).
EXIT.
ELSE.
*--Ask for delete confirmation
PERFORM POP_UP_CONFIRMATION
CHANGING L_ANSWER.
IF L_ANSWER = '1'. " 'Yes'
CLEAR: IT_TEMP,
IT_TEMP[].
LOOP AT IT_MARA WHERE REC_SEL = 'X'.
MOVE-CORRESPONDING IT_MARA TO IT_TEMP.
APPEND IT_TEMP.
CLEAR IT_TEMP.
ENDLOOP.
DELETE MARA FROM TABLE IT_TEMP.
IF SY-SUBRC = 0.
*--Successfully selected records Deleted.
COMMIT WORK AND WAIT.
*--Display completed work information to the user
MESSAGE I000 WITH SY-DBCNT
' Record(s) deleted Successfully'(014).
*--Clear the Internal tables
CLEAR: IT_MARA,
IT_MARA[].
*--Reselects entries from Database again & display in ALV
PERFORM GET_DATA.
ELSE.
*--Error occured
MESSAGE I000 WITH
'Error occured in Deleting the Record(s)'(015).
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " delete_selected_records
*& Form change_records
text
--> p1 text
<-- p2 text
FORM CHANGE_RECORDS .
READ TABLE IT_MARA WITH KEY REC_SEL = 'X'.
*--check user selected at least 1 record to MODIFY or not
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'No record(s) Selected to Modify'(016).
EXIT.
ELSE.
CLEAR : IT_MODIFY,
IT_MODIFY[].
LOOP AT IT_MARA WHERE REC_SEL = 'X'.
IT_MODIFY = IT_MARA.
APPEND IT_MODIFY.
CLEAR IT_MODIFY.
ENDLOOP.
*--Change PF status for this new ALV list.
PERFORM CHANGE_PF_STATUS_AGAIN.
*--Change Field Catalog to make INPUT enabled.
READ TABLE IT_FIELDCAT WITH KEY FIELDNAME = 'NTGEW'.
IT_FIELDCAT-INPUT = C_X.
MODIFY IT_FIELDCAT INDEX SY-TABIX.
*--Call ALV LIST DISPLAY with this new values.
PERFORM LIST_DISPLAY TABLES IT_MODIFY
USING C_USER_COMMAND_MODIFY.
ENDIF.
ENDFORM. " change_records
*& Form change_pf_status_again
text
--> p1 text
<-- p2 text
FORM CHANGE_PF_STATUS_AGAIN .
MOVE C_FC_DELETE TO WA_EXTAB-FCODE. " DELETE button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
MOVE C_FC_MODIFY TO WA_EXTAB-FCODE. " MODIFY button on ALV
APPEND WA_EXTAB TO IT_EXTAB.
ENDFORM. " change_pf_status_again -
Short Dump while executing ALV Grid.
Hi All,
I m getting a short dump while trying to execute an ALV.
The dump exception is of type
CX_SY_DYN_CALL_ILLEGAL_TYPE class.
The message displayed is : " Call to form 'GI_FIELDCAT' is incorrect .The actual parameter in PERFORM is different data type than requested for form GI_FIELDCAT " .
The part of programe included is as follows:
FORM build_fieldcat .
PERFORM gi_fieldcat USING 'MBLNR' text-014 '1' '20'.
PERFORM gi_fieldcat USING 'ZEILE' text-005 '2' '4'.
PERFORM gi_fieldcat USING 'MATNR' text-006 '3' '18'.
PERFORM gi_fieldcat USING 'MAKTX' text-028 '4' '40'.
PERFORM gi_fieldcat USING 'MATKL' text-029 '5' '40'.
PERFORM gi_fieldcat USING 'BUDAT' text-027 '6' '10'.
PERFORM gi_fieldcat USING 'MENGE' text-026 '7' '9'.
PERFORM gi_fieldcat USING 'DMBTR' text-025 '8' '13'.
PERFORM gi_fieldcat USING 'WAERS' text-011 '9' '5'.
PERFORM gi_fieldcat USING 'RSNUM' text-012 '10' '10'.
PERFORM gi_fieldcat USING 'PSPHI' text-013 '11' '10'.
ENDFORM. " build_fieldcat
FORM gi_fieldcat USING fieldname TYPE slis_fieldcat_alv-fieldname
colmname TYPE slis_fieldcat_alv-seltext_m
colmpos TYPE slis_fieldcat_alv-col_pos
outputlen TYPE slis_fieldcat_alv-outputlen.
wa_fieldcat-fieldname = fieldname.
wa_fieldcat-seltext_m = colmname.
wa_fieldcat-col_pos = colmpos.
wa_fieldcat-outputlen = outputlen.
wa_fieldcat-
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " gi_fieldcat
Can ayone gimmi a solution for the same.Hi,
Try to change ur code like the below.
Attached: sample code
Building field catalog
PERFORM modify_catlog USING:
'GT_OUTPUT' 'AUART' text-t02 '1',
'GT_OUTPUT' 'KUNNR' text-t03 '2',
'GT_OUTPUT' 'NAME' text-t04 '3',
'GT_OUTPUT' 'KWMENG' text-t05 '4',
'GT_OUTPUT' 'VRKME' text-t06 '5',
'GT_OUTPUT' 'LFIMG' text-t07 '6',
'GT_OUTPUT' 'GEWEI' text-t08 '7',
'GT_OUTPUT' 'VOLUM' text-t09 '8',
'GT_OUTPUT' 'VOLEH' text-t10 '9',
'GT_OUTPUT' 'BRGEW' text-t11 '10',
'GT_OUTPUT' 'UOMGW' text-t12 '11',
'GT_OUTPUT' 'VARCE' text-t13 '12',
'GT_OUTPUT' 'UOMVR' text-t14 '13'.
FORM modify_catlog USING pa_tabname TYPE string
pa_field TYPE string
pa_text TYPE string
pa_pos TYPE string.
CLEAR gs_fieldcatalog.
*Modifying field catalog
gs_fieldcatalog-col_pos = pa_pos.
gs_fieldcatalog-fieldname = pa_field.
gs_fieldcatalog-tabname = pa_tabname.
gs_fieldcatalog-seltext_m = pa_text.
APPEND gs_fieldcatalog TO gt_fieldcatalog.
CLEAR gs_fieldcatalog.
l_repid = sy-repid.
To call function to display ALV output
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
it_fieldcat = gt_fieldcatalog
TABLES
t_outtab = gt_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-t16.
ENDIF.
Reward if helpful.
Regards,
Ramya -
How to add a search help for a field in alv?
HI!Everyone ,
i want to add a search help created by myself for one field in alv,
and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
can anyone help me ?
thanks!HI,Vijay.
My code like this :
PERFORM build_fcat.
PERFORM build_objects.
PERFORM layo_build.
PERFORM set_drdn_table .
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'STU_S'
is_layout = s_layo
CHANGING
it_outtab = itab_out
it_fieldcatalog = i_fcat
."Period
IF sy-subrc <> 0.
EXIT.
ENDIF.
for example, there is a field 'UNAME' IN Structure 'STU_S',
i want to add a search help for 'UNAME'.
the 'UNAME' is not users in SAP R/3 , i want to add some data by myself or from a table . -
Short dump SAPLSLVC_FULLSCREEN in ALV mode
Hi all
I encountered a short dump in production after i load a text file in my customised program. I did not encountered such error in DEV and UAT. This dump occurs when i add or remove the columns in ALV mode.
Runtime Error PERFORM_NOT_FOUND
Exception CX_SY_DYN_CALL_ILLEGAL_FORM
Occurred on 22.05.2008 at 15:02:44
Call (PERFORM) to a non-existent routine.
What happened?
The current program attempted to call an externally defined routine
that does not exist.
Error in ABAP application program.
The current ABAP program "SAPLSLVC_FULLSCREEN" had to be terminated because one
of the
statements could not be executed.
This is probably due to an error in the ABAP program.
The current ABAP program had to be terminated because the
ABAP processor detected an internal system error.
The current ABAP program "SAPLSLVC_FULLSCREEN" had to be terminated because the
ABAP
processor discovered an invalid system state.
Can anyone kindly advice? Thanks.** WA-NAME = 'TOP_OF_PAGE'. "'SLIS_EV_TOP_OF_PAGE'.
** WA-FORM = 'TOPOFPAGE'.
** APPEND WA TO T_EVENTS.
** WA-NAME = 'END_OF_PAGE'.
** WA-FORM = 'ENDOFPAGE'.
** APPEND WA TO T_EVENTS.
** WA-NAME = 'END_OF_LIST'.
** WA-FORM = 'ENDOFLIST'.
** APPEND WA TO T_EVENTS.
please comment like this code in your code.. -
A short dump in the program with a certain error message...
Hi all,
I'd run a program to do an insertion into a customized table.
During the run, it popped up a short dump error messages below :
value larger than specified precision allows for this column#TC020 %M
I've search for that column #TCO20 .... and i couldn't find it in my custom table...
Why SAP gave such a hard description on the error found? I can't determine which field/column in my table that is causing the error dump during INSERT event in my program.
Is there any explanation on that message that could help me?
Thanks
William WilstrothHi,
Better u seee again where u r getting error i the code . still if u r not getting see in dump analysys(ST22) and select
no:8 -- which is source code extract where u can get correct error inf.
Plz reply me.
Regards
Durgaprasad. -
Short dump while PO creation with Tax Code
we are facing problem while creation PO, while providing the Tax code(Example V0), its going for short dump, check the below
the program SAPLV61Z and
The exception must either be prevented, caught within the procedure
"SEL_KONDTAB"
"(FORM)", or declared in the procedure's RAISING clause.
To prevent the exception, note the following:
Check the field names in the SELECT clause.
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
"SAPSQL_INVALID_FIELDNAME" CX_SY_DYNAMIC_OSQL_SEMANTICSC
"SAPLV61Z" or "LV61ZU01"
"SEL_KONDTAB"
The termination occurred in the ABAP program "SAPLV61Z" in "SEL_KONDTAB".
The main program was "RM_MEPO_GUI ".
The termination occurred in line 537 of the source code of the (Include)
program "LV61ZU01"
of the source code of program "LV61ZU01" (when calling the editor 5370).
Processing was terminated because the exception "CX_SY_DYNAMIC_OSQL_SEMANTICS"
occurred in the
procedure "SEL_KONDTAB" "(FORM)" but was not handled locally, not declared in
the
RAISING clause of the procedure.
The procedure is in the program "SAPLV61Z ". Its source code starts in line 254
of the (Include) program "LV61ZU01 ".
005360 IF se_read_all_prestep IS INITIAL.
> SELECT * FROM (t681-kotab) APPENDING TABLE <cond_tab>
005380 UP TO 1 ROWS
005390 WHERE kappl = se_kappl
005400 AND kschl = se_kschl
005410 AND datbi >= se_date
005420 AND datab <= se_date
005430 AND (coding_tab).
005440 h_subrc = sy-subrc.
In the above statement execution its going for dump, when the (t681-kotab) value is A980 when i checked at debugging
Kindly help me out to solve the issue
Thanks in advance
Regards
KesavHi,
Do you have an integer field in the condition table A980? It looks like a field in the table is integer one and the system during creation of custom dynamic select statement adds as many spaces as possible before the integer value (integer values are right justified), so the statement exceeds the maximum length with an 'AND' or another condition clause.
Please check and provide more details if the issue is not resolved.
Regards,
Marcin -
Search help is populating the input field with wrong data
Hi Guys,
I have created a ZCITY table for which has below 2 field
ZZCITY (Code ) (5 Char) u2013 Key field
ZZNAME (City Name ) (40 Character)
I have added a custom field ZZCITY & ZZNAME in CI_CATSDB. Funtional guy has configured to make ZZNAME as VISIBLE and ZZCITY is HIDDEN on CAT2 screen in Data Entry area.
I created search help on table ZCITY with export parameters as ZZCITY and ZZNAME.
In SE11, I have mapped the export parameters with CI_CATSDB
Now in tcode CAT2, when I press F4 on City Name field, the list is displayed with City code and City names. And when I select any city code, the ZZNAME is populated by City code instead of City name.
I want that City Name should be populated in ZZNAME and City Code should be populated in hidden field ZZCITY.
Please tell me how I can fix this problem.
Thanks in advance.
miniHi
Try selecting the Improting Check box aswell. if a screen field is hidden or display mode we can not use F4 help for that field.
you can also take the help of DYNP_READ_VALUES to get the selected value before PAI
Check whats happening in Debug.
Cheers
Ram -
Regarding short dump in program SAPLCNDP with Raise_Exception
Hi all,
I am getting short dump "RAISE_EXCEPTION" in my system .
Exception condition "CNTL_ERROR" raised.
A RAISE statement in the program "SAPLCNDP " raised the exception
condition "CNTL_ERROR".
Since the exception was not intercepted by a superior program
in the hierarchy, processing was terminated.
Information on where termination occurred
The termination occurred in the ABAP/4 program "SAPLCNDP " in
"DP_SYNC_URLS".
The main program was "SAPLSMTR_NAVIGATION ".
The termination occurred in line 31
of the source code of program "LCNDPU40 " (when calling the editor 310).
Needed reply urgently.
Thanks in Advance,
NagamaniIn the shortdump, look for the value of the feature on which the error occurred.. ie the variable FEATURE_ID & try if you can activate that feature using Tcode PE03.
~Suresh -
Editable ALV with checkbox, how to use on_change event
Hi experts,
I used an editable ALV. In firs collumn I Used an cell editor checkbox (cl_salv_wd_uie_checkbox). I neet to react on each click on each checkbox in order to do some actions in context, that is not part (mapped) to ALV.
There are IF_SALV_WD_CONFIG~CHANGED event in checkbox class. Is it possible to use (and how) this event for my task ? Any example ?...
Thanks, GabrielHi Gabriel,
Try uisng ON_DATA_CHECK event.
Create a method and assign the above mentioned event. In the method have the folleoing code.
FIELD-SYMBOLS: <l_value> TYPE ANY .
Find the check box that has modified
LOOP AT r_param->t_modified_cells INTO ls_modified_cell
WHERE attribute EQ 'ATTRIBUTE NAME'.
ASSIGN ls_modified_cell-r_value->* TO <l_value> .
CLEAR lv_index .
lv_index = ls_modified_cell-index .
ENDLOOP
<l_value> should have the value. In your case X or space.
You can also find index for that which is lv_index.
So now you know the index so u know in which cell the check box is modified.
Try that.
Thank You,
Gajendra. -
Editable ALV with dynamically growing columns
Hi Gurus,
I have one Parameter table and another data (transaction) table
When I fetch the data from data table I have put a when condition to one of date field in data table with between sy-datum and sy-datum + need to run days in parameter table
Its working properly
So my requirement is . 
There are three key fields (fixed) and
when the parameter value = 4 ALV columns must be 7
when the parameter value = 6 ALV columns must be 9
like that.
So I want to know how can I do this?
My second question is when the ALV displaying, user need to change there value in ALV list, so therefore ALV should be editable.
Please help me o solve these problems.below is the program to make an parameter as Editable in the ALV Grid . example <b> Net price</b> .
see the field catalog statement for netprice * edit parameter for that field .
*& Report ZDEMO_ALVGRID_EDIT *
*& Example of a simple ALV Grid Report *
*& The basic ALV grid, Enhanced to display specific fields as *
*& editable depending on field value *
REPORT ZDEMO_ALVGRID_EDIT .
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
field_style TYPE lvc_t_styl, "FOR DISABLE
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: it_fieldcat TYPE lvc_t_fcat, "slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat TYPE lvc_s_fcat,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE lvc_s_layo, "slis_layout_alv,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM set_specific_field_attributes.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-scrtext_m = 'Purchase Order'.
wa_fieldcat-col_pos = 0.
wa_fieldcat-outputlen = 10.
wa_fieldcat-emphasize = 'X'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-scrtext_m = 'PO Item'.
wa_fieldcat-col_pos = 1.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'STATU'.
wa_fieldcat-scrtext_m = 'Status'.
wa_fieldcat-col_pos = 2.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-scrtext_m = 'Item change date'.
wa_fieldcat-col_pos = 3.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-scrtext_m = 'Material Number'.
wa_fieldcat-col_pos = 4.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MENGE'.
wa_fieldcat-scrtext_m = 'PO quantity'.
wa_fieldcat-col_pos = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-scrtext_m = 'Order Unit'.
wa_fieldcat-col_pos = 6.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
<b>wa_fieldcat-edit = 'X'. "sets whole column to be editable</b>
wa_fieldcat-col_pos = 7.
wa_fieldcat-outputlen = 15.
wa_fieldcat-datatype = 'CURR'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PEINH'.
wa_fieldcat-scrtext_m = 'Price Unit'.
wa_fieldcat-col_pos = 8.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
* Set layout field for field attributes(i.e. input/output)
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
* call function 'REUSE_ALV_GRID_DISPLAY'
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = gd_repid
* i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = gd_layout
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
TABLES
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
*& Form set_specific_field_attributes
* populate FIELD_STYLE table with specific field attributes
form set_specific_field_attributes .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
* Populate style variable (FIELD_STYLE) with style properties
* The NETPR field/column has been set to editable in the fieldcatalog...
* The following code sets it to be disabled(display only) if 'NETPR'
* is gt than 10.
LOOP AT it_ekko INTO wa_ekko.
IF wa_ekko-netpr GT 10.
ls_stylerow-fieldname = 'NETPR' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
"set field to disabled
APPEND ls_stylerow TO wa_ekko-field_style.
MODIFY it_ekko FROM wa_ekko.
ENDIF.
ENDLOOP.
endform.
reward points if it is usefull ....
Girish -
Editable ALV with New Row and Save
Hi Experts,
I created an ALV report which is editable, add a New Row with SAVE options.
Problem is: when i try to save the changes using SAVE button in the application tool bar for the coloumn in the specific row, the event is not triggered and the changes were not available. However if i press Enter and then the SAVE the changes were available and i am able to update it.
I do not want to press ENTER after doing the changes, All i want is to press SAVE to save my changes.(one click)
How can I do that? Thanks.Thanks satish,
From the thread,
We have to either press return key (enter) or switch between cells. But the problem here is with the user, they do not want to do it either way. All they want is to press the save button in the application tool bar after the data is changed in the cell.
Any inputs will be greatly appreicated.
Thank you. -
Short dump in VF01 transaction with error id SAPSQL_ARRAY_INSERT_DUPREC
Hi,
We are getting shortdump SAPSQL_ARRAY_INSERT_DUPREC when running VF01 transaction.
The ABAP/4 Open SQL array insert results in duplicate database records.
The termination occurred in the ABAP/4 program "SAPLV60U " in
"VBUK_BEARBEITEN".
Line Number 536
>>>>> INSERT vbuk FROM TABLE da_xvbuki.
Could some one please reply me when you have the time.
Regards,
Vishal
Moderator Message: De-prioritized.
Edited by: kishan P on Aug 29, 2011 2:05 PMDuplicate records is being tried to enter in table VBUK, which is not allowed due to primary key concept. Hence the error.
For details, you can get help of the technical person in your team
Maybe you are looking for
-
How to add Content workflow to Webcenter spaces/ custom application
I would like to add Content work-flows ( Add - review - publish of content) to Webcenter spaces.so that users of Spaces/ application can work with add- publish-review cycle. I want to know if any thing like portlet or something available that can be
-
Can I use the Iphone 6 in Belgium?
I am a student in the USA and I want to buy the Iphone 6 contract free. Can I use this phone in Belgium? Thanks !
-
Printing from Internet TransactionServer(ITS)
Printing from Internet TransactionServer(ITS) Posted: Sep 12, 2005 7:23 AM Reply E-mail this post Hi All, I have a list for example. Write "hello World". I would like top print this list on the local printer on the press of the push butt
-
I didn't put a rescue email when i first created my account
i didn't put a rescue email when i first created my apple account and i've forgot my security answers , how could i reset them thanks
-
Automatic Settings Lightroom 1.0
Hi, I don't know why, when I import an image from my card reader and open it in Develop, some settings are already changed. It does not happen all the time. I must be doing something. I would like for the settings to always be in zero, when I open an