Code: Alles auswählen.
ls_object-vater = 'xyz'.
ls_object-kind = 'abc'.
APPEND ls_object TO lt_object.
CLEAR ls_object.
ls_object-vater = 'xyz'.
ls_object-kind = 'fcf'.
APPEND ls_object TO lt_object.
CLEAR ls_object.
ls_object-vater = 'xyz'.
ls_object-kind = 'dfr'.
APPEND ls_object TO lt_object.
LOOP AT lt_object into ls_object.
endloop
Code: Alles auswählen.
loop at lt_object into ls_object.
data(lv_vater) = ls_object-vater.
data(lv_kind) = ls_object-kind.
endloop.
Folgende Benutzer bedankten sich beim Autor Aba für den Beitrag:
Geny
Code: Alles auswählen.
ls_object-vater = 'xyz'.
ls_object-kind = 'abc'.
APPEND ls_object TO lt_object.
Code: Alles auswählen.
APPEND VALUE #( vater = 'xyz'
kind = 'abc' ) TO lt_object.
Folgende Benutzer bedankten sich beim Autor DeathAndPain für den Beitrag:
Geny
Code: Alles auswählen.
lt_object = value #( ( vater = 'xyz' kind = 'abc' )
( vater = 'xyz' kind = 'def' )
( vater = 'xyz' kind = 'ghi' ) ).
Loop at lt_object assigning field-symbol(<wa_object>).
write <wa_object>-vater.
write <wa_object>-kind.
endloop.
Code: Alles auswählen.
lt_object = value #(
( object = 'J_1IG_ODN' subobject = 'CDP018' )
( object = 'J_1IG_ODN' subobject = 'GDG018' )
( object = 'J_1IG_ODN' subobject = 'GDR018' )
( object = 'J_1IG_ODN ' subobject = 'GKG018')
( object = 'J_1IG_ODN ' subobject = 'GKG018')
( object = 'J_1IG_ODN ' subobject = 'GST018')
( object = 'J_1IG_ODN ' subobject = 'VDP01')
).
*****************End Test***********************************************
* Call this to reload internal tables (esp. isobj with
* ugmd200s
********************
LOOP AT lt_object assigning field-symbol(<wa_object>)."INTO ls_object.
* APPEND ls_interval.
* CALL FUNCTION 'NUMBER_RANGE_UPDATE_INIT'
* EXPORTING
* object = ls_object-object
* EXCEPTIONS
* object_not_found = 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.
* ENDIF.
* enqueue
CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
EXPORTING
object = <wa_object>-object"ls_object-object
EXCEPTIONS
foreign_lock = 1
object_not_found = 2
system_failure = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* create number range
CLEAR ls_interval.
"P_Range'." gc_nrobj_range_val.
* ls_interval-object = 'J_1IG_ODN'.
ls_interval-subobject = <wa_object>-subobject."ls_object-subobject.
ls_interval-nrrangenr = '01'.
ls_interval-toyear = '1940'." Test Datum
ls_interval-fromnumber = '0000000001'.
ls_interval-tonumber = '9999999999'.
ls_interval-externind = ''.
ls_interval-procind = 'I'. " Insert
* INSERT ls_interval INTO TABLE lt_interval.
*Append ls_interval TO lt_interval.
APPEND ls_interval.
CALL FUNCTION 'NUMBER_RANGE_INTERVAL_UPDATE'
EXPORTING
object = <wa_object>-object"ls_object-object "gc_nrobj_obj_val
* SUBOBJECT = ls_object-subobject
TABLES
error_iv = lt_error
interval = ls_interval. "lt_interval.
CALL FUNCTION 'NUMBER_RANGE_UPDATE_CLOSE'
EXPORTING
object = <wa_object>-object"ls_object-object " gc_nrobj_obj_val
EXCEPTIONS
no_changes_made = 0
object_not_initialized = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* * dequeue
CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
EXPORTING
object = <wa_object>-object."ls_object-object. "gc_nrobj_obj_val.
ENDLOOP.