abap

ABAP find out all program screens?

落花浮王杯 提交于 2019-12-12 18:46:16
问题 I am new to ABAP and I want to make a program where there are multiple screens and an initial screen/home screen where one can see the list of all the program screens. I understand that I can hardcode them, but there's got to be a better way. And if there is any, what kind of field/area do I need to make for the list to be clickable (to go to screen). So far, I have made an initial screen and when GO button is pressed, it leads to the next screen. REPORT Z_UZD_1_LOCAL. CALL SCREEN 1001.

Transition to OO ABAP?

廉价感情. 提交于 2019-12-12 14:44:40
问题 It appears that most of our SAP programmers are using the old version of ABAP, the one before object-oriented stuff. I also noticed that the language is much cleaner and more modern with OO (they apparently took the opportunity to get rid of deprecated things). As the system is not rolled out yet, the time to make any redesign is now rather than later. It is worth requesting that new code be written as OO ABAP programs? How to sell that to management? Does the interface with non-OO programs

Raise Exception with custom message in ABAP

心已入冬 提交于 2019-12-12 14:42:54
问题 I want the most simple way to raise an exception with a custom message in ABAP. It would be great, if this could be done with few characters as possible. If possible on one line. I want this for debugging, not for running production code. Background: In the past I used the Python programming language. I like to debug without a debugger. I put some assert 0, myvar lines in to the code and execute the code. For me this feels faster then tradition debugger with stepping over or into code lines.

How to convert a structure to an internal table dynamically in ABAP

非 Y 不嫁゛ 提交于 2019-12-12 14:33:43
问题 I'm trying to create a method that will import a structure assuming that all structure elements are flat and the same data type. Then I want to convert it to a table with that type dynamically and return it. Where should I start? I've been trying to get this to work for several hours and am getting nowhere. 回答1: You can use the create_dynamic_table form using cl_alv_table_create like so: * Create dynamic internal table and assign to FS CALL METHOD cl_alv_table_create=>create_dynamic_table

Conversion exception while working with constructor expressions

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 10:54:24
问题 I'm working on a routine which moves the lines of a string table (in this case fui_elements ) into a structure of unknown type ( fcwa_struct ). DATA(li_temp) = ... "fill assignment table here LOOP AT fui_elements ASSIGNING FIELD-SYMBOL(<lfs_element>). ASSIGN COMPONENT li_temp[ sy-tabix ] OF STRUCTURE fcwa_struct TO FIELD-SYMBOL(<lfs_field>). IF sy-subrc <> 0. "somethings wrong with the fui_elements data ENDIF. <lfs_field> = <lfs_element>. ENDLOOP. If the table i_field_customizing ( STANDARD

how to read text files from content repository in sap abap

不问归期 提交于 2019-12-12 02:16:33
问题 My requirement is read text files from content repository in sap abap.I used SCMS_DOC_READ FM to read image file and creating url DP_CREATE_URL for creating image url but SCMS_DOC_READ not working for text. Can any one suggest some code, FM or class . 回答1: There are two options based on your requirement: Option 1: Use READ DATASET to read file. DATA : FNAME(60) type c VALUE 'myfile.txt', TEXT2(5) type c. OPEN DATASET FNAME FOR INPUT IN TEXT MODE. DO. READ DATASET FNAME INTO TEXT2 LENGTH LENG.

Where can I find the names of currency sub-divisions such as cents, centimes,

冷暖自知 提交于 2019-12-11 19:43:25
问题 This should be useful for anyone who needs to write out amounts in words in SAP. I need to convert an amount, e.g. $100.15, into words ("One hundred dollars and fifteen cents"). For the amount, I use function module spell_amount, which gives me "one hundred" and "fifteen". The name of the currency is easily found in table TCURT. Where can I find the name of the currency subdivision? 回答1: I think there is no such table. There are already some discussions about it (e.g at SCN: Table for

Why is r_data_line_descr of cl_salv_bs_runtime_info=>get_data_ref() not bound?

你说的曾经没有我的故事 提交于 2019-12-11 18:26:23
问题 I have this code, which has been working very nice for several months now: SUBMIT (IV_REPORT_NAME) WITH SELECTION-TABLE selection_table USING SELECTION-SET IV_SELECTION_SET_VARIANT AND RETURN. FIELD-SYMBOLS <lt_data> TYPE ANY TABLE. FIELD-SYMBOLS <lt_data_line> TYPE ANY TABLE. DATA lr_data TYPE REF TO data. DATA lr_data_line TYPE REF TO data. DATA lr_data_descr TYPE REF TO cl_abap_datadescr. DATA lr_data_line_descr TYPE REF TO cl_abap_datadescr. cl_salv_bs_runtime_info=>get_data_ref(

Modifying EKPO Fields in ME21n - ME_PROCESS_PO_CUST BADI

早过忘川 提交于 2019-12-11 17:50:04
问题 I am trying to modify the values of field WEORA and BSTAE in ME21n upon saving. I've written my codes in ME_PROCESS_PO_CUST BADI, in method CHECK. Below is my code. DATA: lt_data TYPE PURCHASE_ORDER_ITEMS, lo_header TYPE REF TO CL_PO_HEADER_HANDLE_MM, lt_item TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM, ls_get_item TYPE MEPOITEM, ls_set_item TYPE MEPOITEM, lv_firewall TYPE abap_bool. FIELD-SYMBOLS: <fs_data> TYPE PURCHASE_ORDER_ITEM. lt_data = im_header->get_items( ). READ TABLE lt_data ASSIGNING

ABAP: Report via GUI has 18 columns, via RFC 6 (hierarchical ALV)

纵饮孤独 提交于 2019-12-11 17:32:36
问题 I want to export the report "RM07MLBS" (tcode mb52). If I call this report via the SAP-GUI it has 18 columns. If I call the report with the following abap code, then it has only these column: maktx, werks, matkl, matnr, name1, mtart Here the abap code: FUNCTION /FOO/GET_REPORT_DATA . cl_salv_bs_runtime_info=>set( EXPORTING display = abap_false metadata = abap_false data = abap_true ). SUBMIT (IV_REPORT_NAME) WITH SELECTION-TABLE selection_table AND RETURN. DATA: lo_data TYPE REF TO data. cl