[ABAP] learning summary - common statements and functions
- -----------------------Pointer------------------------
- Pointer FIELD-SYMBOLS
- Usage and comparison of FIELD SYMBOL and TYPE REF TO
- -----------------------Internal table------------------------
- Delete address duplicates from comparing
- SORT inner table from small to large
- Determine whether there is any data in the internal table READ TABLE [index|with key] transportation no fields
- Statistics inner table row number Description
- sum number field COLLECT in the inner loop table
- String type \ `... ` '...'
- -----------------------String------------------------
- Concatenate & &&
- SPLIT string
- String to space CONDENSE
- SEARCH string search
- Replace string replace [all occurs of regenx] regex in dobj with new
- String match CO/CN CA/NA CS/NS CP/NP
- CORRESPONDING operation between structures
- -----------------------DATA&TYPE------------------------
- Define TYPES to INCLUDE
- Define constant / RANGE variable / workspace
- -----------------------Loop control and standard statements------------------------
- Global breakpoint BREAK username
- Cycle / subprogram control CHECK|EXIT|CONTINUE
- Exception capture TRY
- CLEAR REFRESH FREE
- Memory variable EXPORT|IMPORT internal variable = change TO MEMORY ID 'memory name'
- -----------------------Business module function------------------------
- Query inventory / demand list (MD04) 'MD_STOCK_REQUIREMENTS_LIST_API'
- Query MRP list (MD06) 'MD_MRP_LIST_API'
- Demand traceability 'MD_PEGGING_NODIALOG'
- Get planned order 'BAPI_PLANNEDORDER_GET_DETAIL'
- Get production order 'BAPI_PRODORD_GET_DETAIL'
- Get order process information 'BAPI_PROCORD_GET_DETAIL'
- -----------------------General function------------------------
- Two ALV functions' REUSE_ALV_GRID_DISPLAY' 'REUSE_ALV_GRID_DISPLAY_LVC'
- Download template file ZCL_ salv=>down_ temp
- Button pop up_ TO_ CONFIRM'
- Format / internal and external code CONVERSION_EXIT_ABPSP_OUTPUT' 'CONVERSION_EXIT_CUNIT_OUTPUT' 'CONVERSION_EXIT_ALPHA_OUTPUT'
- Write long text 'SAVE_TEXT'
- Get long text 'READ_TEXT'
- Field reference 'F4IF_INT_TABLE_VALUE_REQUEST'
- Get guid'guid_ CREATE'
- Get UUID method Cl_ system_ uuid=>if_ system_ uuid_ static~create_ uuid_ C32
Field 2 of field 1 of COMPARING table in delete assistant duplicates from
#According to the field de duplication after COMPARING, sort and use according to these fields first, and keep the first one
SORT inner table [BY key 1 Key 2 ] [STABLE] [DESCENDING]
#For rows with the same keyword, the STABLE keyword can keep the original order after sorting
#DESCENDING (from large to small)
================================ CONDENSE <c> [NO-GAPS]. 1. If it is C The type only removes the space in front (because it is fixed length, even if the space in the back is removed, the space will be filled after the left alignment); 2. If it is String Type, the space after will also be removed; 3. Multiple consecutive spaces in the middle of a string are replaced with one space(String So is the type); 4. NO-GAPS: All spaces in the middle of the string are also removed(String So is the type); 5. Left aligned when spaces are removed ================================SEARCH string search ================================ Search for < C > in < STR > SEARCH <c> FOR <str> <options>. If successful, set SY-SUBRC to 0 and SY-FDPOS to the offset of the string in the field < C >. Otherwise, set SY-SUBRC to 4. ================================ Replace string replace [all occurs of regenx] regex in dobj with new ================================ REPLACE [ALL OCCURRENCES OF REGEX] regex IN dobj WITH new Replace the first [all] regex in dobj with new ================================ String match CO/CN CA/NA CS/NS CP/NP ================================ CO contain only str1 CO str2 Traversal str1, where each character exists in str2, returns true For example: str1 = 'I a' STR2 = 'hub' ----- false str1 = 'ba' str2='hubab' -----true CA contain any str1 CA str2 Traverse str1, and return true if there is a character in str1 in str2 For example: str1 = 'I a' STR2 = 'hub' ----- true CS contain string str1 CS str2 Determine if str1 contains str2. CP contains pattern str1 CP str2 After the comparison, if the result is true, sy fdpos will give the offset information of s2 in s1 str1 = 'aac' str2 = '#aA#c' true str1 = 'aAc' str2 = '#aA#c' true str1 = '123abc123' str2 = '*abc*' sy-fdpos = 3. pattern matching CO / CN contains only or not CA / NA contains any or not any CS / NS contain string or not CP / NP contains pattern or not ================================ CORRESPONDING operation between structures MOVE-CORRESPONDING ADD- SUBTRACT- MULTIPLY- DIVIDE- -----------------------DATA&TYPE------------------------ Define TYPES to INCLUDE
================================ TYPES: BEGIN OF ty_data, fldate TYPE sflight-fldate. INCLUDE TYPE spfli. TYPES: END OF ty_data. ================================Define constant / RANGE variable / workspace
================================ //Defining constants CONSTANTS:c_cm TYPE slis_formname VALUE 'FRM_USER_COMMAND', c_pf TYPE slis_formname VALUE 'FRM_ALV_STATUS'. //Define range: DATA r_ebeln TYPE RANGE OF Field name WITH HEADER LINE. * r_ebeln-sign = 'I'. * r_ebeln-option = 'EQ'. * r_ebeln-low = ''. * r_ebeln-high = ''. * APPEND r_ebeln. //Define workspace: DATA ... LIKE LINE OF Internal table. ================================-----------------------Loop control and standard statements------------------------ Global breakpoint BREAK username BREAK user name: the user name will BREAK here every time the program runs Cycle / subprogram control CHECK|EXIT|CONTINUE 1. CHECK condition: if the condition is true, execute the following code, otherwise jump out of the loop (end subroutine in subroutine) 2. EXIT: jump out of loop (end subroutine in subroutine) 3. CONTINUE: jump out of this cycle Exception capture TRY ================================ 1. Syntax: DATA: exref TYPE REF TO CX_ROOT. TRY. Statement block CATCH general exception (CX_SY_ARITHMETIC_ERROR) INTO exref. Exception handling statement block after capture CATCH exception name (example CX_CX_SY_CONVERSION_NO_NUMBER) INTO exref. Exception handling statement block after capture CLEANUP. Clean statement block after any exception is caught ENDTRY. 2. Properties and methods of exref: Textid Property that defines the different text of the exception and also affects the method get_text. Previous Property, which stores the original exception and allows you to build an exception chain get_text Method, which returns the text representation as a string based on the system language of the exception. get_longtext Method, which returns the long variant of the text representation of the exception as a string. get_source_position Method, returns the program name and line number that threw the exception. ================================ CLEAR REFRESH FREE ================================ CLEAR Clear only the table work area. To reset the entire inner table without clearing the table workspace, use clear < itab > [] without freeing up space REFRESH If you add brackets or not, you can only clear the inner table. REFRESH is specifically for clearing the inner table. It cannot clear basic type variables and does not release space FREE At the same time of initialization, the space occupied shall be released. The usage is the same as that of CLEAR ================================ Memory variable EXPORT|IMPORT internal variable = change TO MEMORY ID 'memory name' ================================ 1. ABAP memory variables are similar to local variables, which can be used to communicate between main processes and subprocesses. Different external sessions have different memory spaces Store data in memory: EXPORT internal variable 1 = variable 1 internal variable 2 = variable 2 TO MEMORY ID 'memory name' Read data from memory: IMPORT internal variable 1 = change 3 internal variable 2 = change 4 FROM MEMORY ID 'memory name' Clear all ABAP memory variables: FREE MEMORY. Clear the specified ABAP memory variable: FREE MEMORY ID 'memory name' 2. SAP memory variables are similar to global variables. They are used for communication between external sessions. Different users have different spaces. When users log out, they are cleared Store data in memory: SET PARAMETER ID 'memory name' FIELD variable Read data from memory: GET PARAMETER ID 'memory name' FIELD variable ================================ -----------------------Business module function------------------------ Query inventory / demand list (MD04) 'MD_STOCK_REQUIREMENTS_LIST_API’
================================ DATA: lt_mdpsx TYPE STANDARD TABLE OF mdps WITH HEADER LINE, lt_mdezx TYPE STANDARD TABLE OF mdez WITH HEADER LINE, lt_mdsux TYPE STANDARD TABLE OF mdsu WITH HEADER LINE. DATA: lw_mt61d TYPE mt61d, lw_mdkp TYPE mdkp. CLEAR: lt_mdpsx[],lt_mdezx[],lt_mdsux[]. CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API' EXPORTING matnr = '704001800243' werks = '3012' IMPORTING e_mt61d = lw_mt61d "Material master record: MRP e_mdkp = lw_mdkp "MRP Header data of voucher TABLES mdpsx = lt_mdpsx "MRP Items in voucher mdezx = lt_mdezx "MRP Individual lines of elements mdsux = lt_mdsux "MRP Element all rows EXCEPTIONS material_plant_not_found = 1 plant_not_found = 2. ================================Query MRP list (MD06) 'MD_MRP_LIST_API’
================================ DATA: lt_mdezx TYPE STANDARD TABLE OF mdez WITH HEADER LINE. CALL FUNCTION 'MD_MRP_LIST_API' EXPORTING matnr = '704001800243' werks = '3012' TABLES mdezx = lt_mdezx[] EXCEPTIONS mrp_list_not_found = 1 material_plant_not_found = 2 error = 3 OTHERS = 4. ================================Demand traceability 'MD_PEGGING_NODIALOG’ Get planned order 'BAPI_PLANNEDORDER_GET_DETAIL’ Get production order 'Bapi'_ PRODORD_ GET_ DETAIL’ Get order process information 'BAPI_PROCORD_GET_DETAIL’ -----------------------General function------------------------ Two ALV functions' REUSE_ALV_GRID_DISPLAY’ ‘REUSE_ALV_GRID_DISPLAY_LVC’
================================ 1. 'REUSE_ALV_GRID_DISPLAY' -------------------------DATA------------------------------------ DATA:gt_fieldcat TYPE slis_t_fieldcat_alv, gs_fieldcat TYPE slis_fieldcat_alv, gt_events TYPE slis_t_event WITH HEADER LINE, gs_layout TYPE slis_layout_alv, gt_sort TYPE slis_t_sortinfo_alv, go_grid TYPE REF TO cl_gui_alv_grid. DEFINE add_field. CLEAR gs_fieldcat. gs_fieldcat-no_zero = 'X'. gs_fieldcat-fieldname = &1. "Field name gs_fieldcat-reptext_ddic = &2. "Field text gs_fieldcat-key = &3. "Freeze column gs_fieldcat-edit = &4. "Editable gs_fieldcat-checkbox = &5. "Selection box gs_fieldcat-do_sum = &6. "Summable gs_fieldcat-outputlen = &7. "Field length gs_fieldcat-ref_tabname = &8. "Reference table name gs_fieldcat-ref_fieldname = &9. "Reference field APPEND gs_fieldcat TO gt_fieldcat. END-OF-DEFINITION. -------------------------FORM------------------------------------ FORM frm_display_data. PERFORM frm_set_fieldcat. PERFORM frm_set_layout. PERFORM frm_set_events. PERFORM frm_call_alv_list. ENDFORM. FORM frm_set_fieldcat. * field Field name Freeze optional summing long parameter table add_field 'EBELN' 'Purchase voucher No' ' ' ' ' ' ' '' ' ' 'ZTSD005' 'EBELN'. ENDFORM. FORM frm_set_layout. CLEAR gs_layout. gs_layout-zebra = 'X'."Zebra stripes * gs_layout-info_fieldname = 'COLOR'."colour gs_layout-colwidth_optimize = 'X'."Optimize width * gs_layout-min_linesize = 40."Minimum row width ENDFORM. FORM frm_set_events. * CLEAR gt_events. * gt_events-name = slis_ev_user_command. * gt_events-form = 'FRM_USER_COMMAND'. "Button action * APPEND gt_events. * CLEAR gt_events. gt_events-name = slis_ev_pf_status_set. gt_events-form = 'FRM_PF_STATUS_SET'. "Button settings APPEND gt_events. * gt_events-name = 'CALLER_EXIT'. * gt_events-form = 'FRM_CALLER_EXIT'. * APPEND gt_events. ENDFORM. FORM frm_call_alv_list. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = sy-repid it_fieldcat = gt_fieldcat is_layout = gs_layout it_events = gt_events[] it_sort = gt_sort[] i_save = 'A' TABLES t_outtab = gt_data 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. "Standard error reporting format ENDIF. ENDFORM. FORM frm_pf_status_set USING i_extab TYPE slis_t_extab. SET PF-STATUS 'ZERP_MM105' EXCLUDING i_extab. ENDFORM. 2.'REUSE_ALV_GRID_DISPLAY_LVC' -------------------------DATA------------------------------------ DATA:go_container TYPE REF TO cl_gui_custom_container, go_alvgrid TYPE REF TO cl_gui_alv_grid, gt_fieldcat TYPE lvc_t_fcat, gs_fieldcat TYPE lvc_s_fcat, gs_layout TYPE lvc_s_layo, gs_excluding TYPE ui_func, gt_excluding TYPE ui_functions, gs_event TYPE LINE OF slis_t_event, gt_events TYPE slis_t_event. CLASS lcl_event_receiver DEFINITION. PUBLIC SECTION. METHODS handle_modify FOR EVENT data_changed_finished OF cl_gui_alv_grid IMPORTING e_modified et_good_cells. ENDCLASS. *----------------------------------------------------------------------* * CLASS LCL_EVENT_RECEIVER IMPLEMENTATION *----------------------------------------------------------------------* CLASS lcl_event_receiver IMPLEMENTATION. METHOD handle_modify. CHECK e_modified EQ 'X'. LOOP AT et_good_cells INTO DATA(ls_good_cells). * READ TABLE et_good_cells INTO DATA(ls_good_cells) INDEX 1. READ TABLE gt_items ASSIGNING FIELD-SYMBOL(<fs_items>) INDEX ls_good_cells-row_id. IF ls_good_cells-fieldname EQ 'WERKS1' OR ls_good_cells-fieldname EQ 'LGORT1'. CLEAR gs_items. MOVE-CORRESPONDING <fs_items> TO gs_items. CONDENSE gs_items-werks1 NO-GAPS. CONDENSE gs_items-lgort1 NO-GAPS. CONDENSE gs_items-matnr NO-GAPS. * Factory name PERFORM frm_get_werks_name USING 'GS_ITEMS-WERKS1' CHANGING gs_items-name1. * Take inventory location description PERFORM frm_get_lgort_name USING 'GS_ITEMS-LGORT1' gs_items-werks1 CHANGING gs_items-lgobe1. * Update inventory information PERFORM frm_get_stock_single USING gs_items-matnr gs_items-werks1 gs_items-lgort1 CHANGING gs_items-labst gs_items-lgpbe. MOVE-CORRESPONDING gs_items TO <fs_items>. PERFORM frm_refresh_alv USING go_alvgrid. ENDIF. PERFORM frm_calcu_sum. ENDLOOP. LEAVE TO SCREEN 300. ENDMETHOD. ENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATION DATA go_event_receiver TYPE REF TO lcl_event_receiver . -------------------------FORM------------------------------------ FORM frm_display_data . PERFORM frm_set_fieldcat."set up ALV field PERFORM frm_set_layout."set up Layout PERFORM frm_set_events."register ALV event PERFORM frm_call_alv_list."call ALV function ENDFORM. FORM frm_set_fieldcat . FIELD-SYMBOLS <fs_fieldcat> TYPE lvc_s_fcat. CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING i_structure_name = 'ZSMM049' CHANGING ct_fieldcat = gt_fieldcat EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. READ TABLE gt_fieldcat ASSIGNING <fs_fieldcat> WITH KEY fieldname = 'SEL'. IF sy-subrc EQ 0 . <fs_fieldcat>-edit = 'X'. <fs_fieldcat>-checkbox = 'X'. <fs_fieldcat>-key = 'X'. ENDIF. gs_fieldcat-col_opt = 'A'. MODIFY gt_fieldcat FROM gs_fieldcat TRANSPORTING col_opt WHERE fieldname NE ''. ENDFORM. FORM frm_set_layout . CLEAR gs_layout. gs_layout-zebra = 'X'. * gs_layout-cwidth_opt = 'X'. gs_layout-info_fname = 'COLOR'. gs_layout-stylefname = 'STYLE'. ENDFORM. FORM frm_set_events . CLEAR gt_events. gs_event-name = slis_ev_user_command. gs_event-form = 'FRM_USER_COMMAND'. APPEND gs_event TO gt_events. CLEAR gs_event. gs_event-name = slis_ev_pf_status_set. gs_event-form = 'FRM_PF_STATUS_SET'. APPEND gs_event TO gt_events. CLEAR gs_event. gs_event-name = slis_ev_caller_exit_at_start. gs_event-form = 'FRM_CALLER_EXIT'. APPEND gs_event TO gt_events. ENDFORM. FORM frm_call_alv_list . CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' EXPORTING i_callback_program = sy-repid is_layout_lvc = gs_layout it_fieldcat_lvc = gt_fieldcat i_save = 'A' it_events = gt_events TABLES t_outtab = gt_data EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. ENDFORM. FORM frm_user_command USING VALUE(r_ucomm) LIKE sy-ucomm CHANGING rs_selfield TYPE slis_selfield. DATA: lv_valid TYPE c. DATA:es_row_id TYPE lvc_s_row, es_col_id TYPE lvc_s_col, es_row_no TYPE lvc_s_roid. DATA: lv_confirm TYPE boolean, lv_error TYPE boolean. CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' IMPORTING e_grid = go_alvgrid. CALL METHOD go_alvgrid->check_changed_data IMPORTING e_valid = lv_valid. rs_selfield-refresh = 'X'. * Fixed cursor rs_selfield-row_stable = 'X'. rs_selfield-col_stable = 'X'. CASE r_ucomm. WHEN 'SELALL'."Select all PERFORM frm_sel_all. WHEN 'NOTSEL'."Deselect all PERFORM frm_not_sel. WHEN OTHERS. ENDCASE. ENDFORM. "FRM_USER_COMMAND FORM frm_pf_status_set USING i_extab TYPE slis_t_extab. DATA fcode TYPE TABLE OF sy-ucomm. REFRESH fcode. IF sy-tcode = 'ZEMM49'. APPEND 'DELETE' TO fcode. APPEND 'DELETE' TO i_extab. ENDIF. IF p_ygzcx = 'X'. APPEND 'GOODSMVT' TO fcode. SET PF-STATUS 'ZERP_MM039' EXCLUDING fcode. ELSE. SET PF-STATUS 'ZERP_MM039' EXCLUDING i_extab. ENDIF. ENDFORM. "FRM_PF_STATUS_SET FORM frm_caller_exit USING ls_data TYPE slis_data_caller_exit. CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' IMPORTING e_grid = go_alvgrid. CREATE OBJECT go_event_receiver. SET HANDLER go_event_receiver->handle_modify49 FOR go_alvgrid. CALL METHOD go_alvgrid->register_edit_event EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified EXCEPTIONS error = 1 OTHERS = 2. ENDFORM. "CALLER_EXIT ================================Download template file ZCL_ salv=>down_ temp
================================ zcl_salv=>down_temp( EXPORTING i_fname = file name i_objid = file id ). ================================Button pop up_ TO_ CONFIRM’
================================ CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING text_question = 'There are already posting records. Do you want to continue?' text_button_1 = 'yes'(003) text_button_2 = 'no'(004) IMPORTING answer = l_answer EXCEPTIONS text_not_found = 1 OTHERS = 2. IF sy-subrc <> 0. ENDIF. IF l_answer EQ 'A'. "cancel EXIT. ELSEIF l_answer <> '1'. "yes EXIT. ENDIF. ================================Format / internal and external code CONVERSION_EXIT_ABPSP_OUTPUT’ ‘CONVERSION_EXIT_CUNIT_OUTPUT’ ‘CONVERSION_EXIT_ALPHA_OUTPUT’
================================ # Enter the field, and double-click the routine field in the definition tab to see the conversion function IF gt_data-pspel IS NOT INITIAL. CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' "Function 1. WBS Internal code to external code EXPORTING input = gt_data-pspel "perhaps projn IMPORTING output = gt_data-posid. "(40) TYPE C ENDIF. IF gt_data-posid IS NOT INITIAL. CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT' "Function 2. WBS Outer code to inner code EXPORTING input = gt_data-posid IMPORTING output = gt_data-pspel. "perhaps projn ENDIF. IF gwa_dis-meinh IS NOT INITIAL. CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' "Function 3. Change the outer code of the unit of measurement to the inner code EXPORTING input = gwa_dis-meinh IMPORTING output = gwa_dis-meinh. ENDIF. IF gwa_dis-meinh IS NOT INITIAL. CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT' "Function 4. Conversion of internal code to external code of measurement unit EXPORTING input = gwa_dis-meinh IMPORTING output = gwa_dis-meinh. ENDIF. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' "Function 5. Remove leading zeros EXPORTING input = ls_sd002-kunnr IMPORTING output = lv_kunnr. CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL' "Function 6. Date to number: the date format of this function is related to the current login user settings EXPORTING date_external = 'YYYY-MM-DD' IMPORTING date_internal = 00000000 CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL' "Function 7. The format of the parameter date of this function is related to the setting of the current login user EXPORTING date_internal = 00000000 IMPORTING date_external = 'YYYY-MM-DD' ================================Write long text 'SAVE_TEXT’
================================ DATA:lt_text LIKE STANDARD TABLE OF tline WITH HEADER LINE. "book DATA:ls_header LIKE thead. DATA:lt_editor TYPE STANDARD TABLE OF ty_editor. CALL FUNCTION 'RH_EDITOR_GET' EXPORTING controlname = 'NOTE' "Custom control name TABLES lines = lt_editor EXCEPTIONS internal_error = 1 OTHERS = 2. ls_header-tdobject = 'ZERP_SD002'. "Text object ls_header-tdname = ztsd006_header-znumber. "Text object name ls_header-tdspras = sy-langu. "language ls_header-tdid = 'Z001'. "text ID ls_header-tdlinesize = '72 '. "Line width MOVE-CORRESPONDING lt_editor TO lt_text[]. CALL FUNCTION 'SAVE_TEXT' EXPORTING client = sy-mandt header = ls_header savemode_direct = 'X' * INSERT = 'X' TABLES lines = lt_text. ================================Get long text 'READ_TEXT’
================================ DATA:l_name LIKE thead-tdname, lt_lines LIKE STANDARD TABLE OF tline, lwa_lines TYPE tline, lv_maktx(200) TYPE C. IF gs_data-matnr IS NOT INITIAL. CLEAR: l_name,lt_lines,lwa_lines. l_name = gt_data-matnr. CALL FUNCTION 'READ_TEXT' EXPORTING * CLIENT = SY-MANDT id = 'GRUN' "STXL-TDID Read text's id language = sy-langu name = l_name "STXL-TDNAME Reading the value of a text object object = 'MATERIAL' "STXL-TDOBJECT Text object TABLES lines = lt_lines EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. IF sy-subrc = 0. CLEAR gs_Data-maktx. LOOP AT lt_lines INTO lwa_lines. CONCATENATE lv_maktx lwa_lines-tdline INTO lv_maktx. ENDLOOP. gs_data-maktx = lv_maktx. CLEAR:lwa_lines,lv_maktx. ENDIF. ENDIF. # Get parameter method: 1.Edit mode double click long text or click to enter WORD pattern 2.menu bar"go to"menu,click"Header"option 3.Pop up"identification"Field is ID,"Text object"That is, text object ================================Field reference 'F4IF_INT_TABLE_VALUE_REQUEST’
================================ CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING retfield = 'GRUND' value_org = 'S' TABLES value_tab = lt_t157e return_tab = pt_f4 EXCEPTIONS parameter_error = 1 no_values_found = 2 OTHERS = 3. "See code template for details # ALV input reference ================================Get GUID 'GUID_CREATE’
================================ DATA: l_id32 TYPE guid_32. *DATA: l_id16 TYPE guid. CALL FUNCTION 'GUID_CREATE' IMPORTING ev_guid_32 = l_id32. * ev_guid_16 = l_id16. ================================Get UUID method Cl_ system_ uuid=>if_ system_ uuid_ static~create_ uuid_ C32
================================ DATA: l_id32 TYPE guid_32. TRY. CALL METHOD cl_system_uuid=>if_system_uuid_static~create_uuid_c32 RECEIVING uuid = l_id32. CATCH cx_uuid_error . MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDTRY. ================================