Yes I am refreshing the table.
*&---------------------------------------------------------------------*
*& Module ASSIGN_DEFAULT_ORDERID INPUT
*&---------------------------------------------------------------------*
* Assign default temporary value to order id
*----------------------------------------------------------------------*
module assign_default_orderid input.
* Local Constant Declaration
constants : lc_dollar_temp type char10 value '$000000001'. "Temporary dollar value
if zos_order_entry-order_id is initial.
zos_order_entry-order_id = lc_dollar_temp.
endif.
endmodule. " ASSIGN_DEFAULT_ORDERID INPUT
form f_get_number_range.
* Local Data Declaration
data: l_number_range type char10, "Variable to hold Newly generated Number Range
l_return_code type inri-returncode, "Variable to hold the Return Code
li_extract type standard table of zos_order_entry initial size 0, "Table declaration for extract
lw_extract type zos_order_entry. "Extract work area
* Local Constant Declaration
constants : lc_nr type inri-nrrangenr value '1', "Constant for Number Range Number
lc_obj type inri-object value 'ZOS_ORDID', "Name of number range object
lc_dollar_temp type char10 value '$000000001'. "Temporary dollar value
* Local Field Symbol Declaration
field-symbols:
<lfs_extract> type zos_order_entry. " Work Area for Table
li_extract[] = extract[].
* Loop at Extract to add content to previous data in the header
loop at li_extract assigning <lfs_extract> where order_id eq lc_dollar_temp.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = lc_nr "This hold the Newly generated Number
object = lc_obj "Passing the Number Range Object
importing
number = l_number_range "Newly generated Number
returncode = l_return_code "The Return Code Number
exceptions
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
others = 8.
if sy-subrc eq 0.
<lfs_extract>-order_id = l_number_range. "Assign newly generated number range to order-id field of table ZOS_ORDER_ENTRY.
endif.
endloop.
extract[] = li_extract[].
refresh li_extract. "Refresh table.
endform.