Quantcast
Channel: SCN : All Content - SAP Business Process Management
Viewing all articles
Browse latest Browse all 887

How to add content to a decision table which already exists in BRFplus

$
0
0

Hi guys,

 

If i want to add content to a decision table which already exists in BRFplus. what should i do?

For example, the id of decision table is FA163E1001DC1ED3BF8997A76884C553, and it already contains 4 rows, and here if i want to add the fifth rows, you can see the ABAP code below, but after executing, the fifth row still can not be added. so could you help me for this issue? maybe the way i do it is not correct.  Thank you very much!

 

 

DATA: lo_decision_table TYPE REF TO if_fdt_decision_table.

DATA: lt_table_data TYPE if_fdt_decision_table=>ts_row_data,
           ls_table_data TYPE if_fdt_decision_table=>s_row_data,
           lt_cell_table TYPE SORTED TABLE OF if_fdt_decision_table=>s_cell_data  WITH UNIQUE KEY col_no,
           ls_cell_table type if_fdt_decision_table=>s_cell_data,
           ls_range      type if_fdt_range=>s_range.
FIELD-SYMBOLS: <lv_value>         TYPE any.

lo_decision_table ?= cl_fdt_factory=>if_fdt_factory~get_instance( )->get_expression( EXPORTING iv_id = 'FA163E1001DC1ED3BF8997A76884C553'
                                                                                         ).
ls_table_data-row_no = 5.

ls_cell_table-col_no = 1.
ls_range-position = 1.
ls_range-sign     = if_fdt_range=>gc_sign_include.
ls_range-option   = if_fdt_range=>gc_option_equal.
CREATE DATA ls_range-r_low_value TYPE if_fdt_types=>element_text.
ASSIGN ls_range-r_low_value->* TO <lv_value>.
<lv_value> = 'P'.
INSERT ls_range INTO TABLE ls_cell_table-ts_range.
append ls_cell_table to lt_cell_table.
CLEAR ls_cell_table.

ls_cell_table-col_no = 2.
ls_range-position = 1.
ls_range-sign     = if_fdt_range=>gc_sign_include.
ls_range-option   = if_fdt_range=>gc_option_equal.
CREATE DATA ls_range-r_low_value TYPE if_fdt_types=>element_text.
ASSIGN ls_range-r_low_value->* TO <lv_value>.
<lv_value> = '>100'.
INSERT ls_range INTO TABLE ls_cell_table-ts_range.
append ls_cell_table to lt_cell_table.
CLEAR ls_cell_table.

ls_cell_table-col_no = 3.
ls_range-position = 1.
ls_range-sign     = if_fdt_range=>gc_sign_include.
ls_range-option   = if_fdt_range=>gc_option_equal.
CREATE DATA ls_cell_table-r_value TYPE if_fdt_types=>element_text.
ASSIGN ls_cell_table-r_value->* TO <lv_value>.
<lv_value> = '17'.
append ls_cell_table to lt_cell_table.
CLEAR ls_cell_table.

ls_table_data-ts_cell_data = lt_cell_table.

append ls_table_data to lt_table_data.

lo_decision_table->insert_rows( exporting iv_row_no = 5
                                           its_row_data = lt_table_data ).


Viewing all articles
Browse latest Browse all 887

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>