Skip to content

Instantly share code, notes, and snippets.

@larshp
Created March 3, 2021 07:32
Show Gist options
  • Save larshp/cca0ce0ba65efcde5dfcae416b0484f7 to your computer and use it in GitHub Desktop.
Save larshp/cca0ce0ba65efcde5dfcae416b0484f7 to your computer and use it in GitHub Desktop.
change_tadir.abap
METHOD zif_abapgit_exit~change_tadir.
* this cherry picks objects from different packages into a dummy package
* make sure to enable write protection for the repository
* and dont do this setup :)
TYPES: BEGIN OF ty_object_and_name,
type TYPE tadir-object,
name TYPE tadir-obj_name,
END OF ty_object_and_name.
TYPES: ty_cherry TYPE STANDARD TABLE OF ty_object_and_name WITH EMPTY KEY.
IF iv_package = '$SOMETHING'.
ASSERT lines( ct_tadir ) = 1. " it contains the dummy package
DATA(lt_cherry) = VALUE ty_cherry( (
type = 'PROG'
name = 'ZSOMETHING' ) ).
LOOP AT lt_cherry INTO DATA(ls_cherry).
APPEND VALUE #(
pgmid = 'R3TR'
object = ls_cherry-type
obj_name = ls_cherry-name
devclass = iv_package
path = '/src/' ) TO ct_tadir.
ENDLOOP.
ENDIF.
ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment