write an abap program that selects and modifies a row in table AFIH based on field AKKNZ
- User
write an abap program that selects and modifies a row in table AFIH based on field AKKNZ
- Assistant
Here's an ABAP program that selects and modifies a row in table AFIH based on the field AKKNZ:
REPORT ZMODIFY_AFIH. DATA: ls_afih TYPE afih. PARAMETERS: p_akknz TYPE afih-akknz. START-OF-SELECTION. SELECT SINGLE * FROM afih INTO ls_afih WHERE akknz = p_akknz. IF sy-subrc = 0. " Modify the selected row ls_afih-txtsh = 'Modified text'. ls_afih-txtmd = 'Modified medium text'. ls_afih-txtlg = 'Modified long text'. " Update the modified row in the database UPDATE afih FROM ls_afih. IF sy-subrc = 0. WRITE: 'Row modified successfully.'. ELSE. WRITE: 'Error occurred while modifying the row.'. ENDIF. ELSE. WRITE: 'No row found with the specified AKKNZ.'. ENDIF.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.