The core of this program is running the method RUN_PACKAGE from class CL_UJD_PACKAGE.
And to run that method we need the ‘selection’ alike on EPM Package Script, or on script named ‘prompt’.
The essential of the input method is on ITH_ANSWER_PROMPT.  We need to fill up those with correct prompt format.

So here some of my snippet to run that method.

 

“This program running on uj_custom_logic
DATA: LD_PROMPT       TYPE STRING,
          LD_PROMPT_FINAL TYPE STRING.
DATA: LX_CV LIKE LINE OF IT_CV.
DATA: LT_MEMBER    TYPE UJA_T_DIM_MEMBER,
          LX_MEMBER    TYPE UJ_DIM_MEMBER.
DATA:       LT_TH_VALUE TYPE UJD_TH_VALUE,
                LX_TH_VALUE TYPE UJD_S_VALUE.
DATA: LD_UNAME             LIKE SY-UNAME,
          LD_CYCLE(32),
          LD_CYCLE_MIN_ONE(32).
DATALR_DATA TYPE REF TO CL_UJD_PACKAGE.
CREATE OBJECT LR_DATA.

    “get base parameter
    LOOP AT IT_CV INTO LX_CV
      WHERE DIMENSION NE ‘TIME’
        AND USER_SPECIFIED EQ ‘X’.

      LT_MEMBER = LX_CV-MEMBER.
     “set-up prompt for each member
      LOOP AT LT_MEMBER INTO LX_MEMBER.
        CONCATENATE LD_PROMPT_FINAL ‘DIMENSION:’ LX_CV-DIMENSION ‘|’ LX_MEMBER ‘|’
      INTO LD_PROMPT_FINAL.
        CONDENSE LD_PROMPT_FINAL NO-GAPS.

      ENDLOOP.

    ENDLOOP.
“set-up header for prompt format
CONCATENATE ‘/BPC_PIHC/Production_Rate/PRIVATEPUBLICATIONS/’ LD_UNAME
    ‘/TempFiles/FROM.TMP@@@SAVE@@@@@@EXPAND@@@|’ LD_PROMPT_FINAL
    INTO LD_PROMPT_FINAL.
    CONDENSE LD_PROMPT_FINAL NO-GAPS.
“Running Package for each Time
LOOP AT LT_TIME ASSIGNING <LS_TIME>.

      CONCATENATE LD_PROMPT_FINAL ‘DIMENSION:TIME|’ <LS_TIME>-ID
     INTO LD_PROMPT.
      CONDENSE LD_PROMPT NO-GAPS.
      LX_TH_VALUE-FIELDNAME = ‘%SELECTION%’.
      LX_TH_VALUE-VALUE = LD_PROMPT.
      INSERT LX_TH_VALUE INTO TABLE LT_TH_VALUE.

      “event trigger for run package
      CALL METHOD LR_DATA->RUN_PACKAGE
        EXPORTING
          I_APPSET_ID       = I_APPSET_ID
          I_APPL_ID         = I_APPL_ID
          I_TEAM_ID         = ”
          I_GROUP_ID        = ‘PIHC’
          I_PACKAGE_ID      = ‘CALC_PROD_REQ_QTY_BACKGROUND’ “Name of Package
          ITH_ANSWER_PROMPT = LT_TH_VALUE
*         IS_SCHEDULE_INFO  =
*         I_CHAIN           =
          IF_SCHEDULE       = ”
          IF_DEBUG          = ”.
*     CATCH CX_UJD_DATAMGR_ERROR .
*     CATCH CX_UJ_DB_ERROR .
*     CATCH CX_UJ_STATIC_CHECK .
*    ENDTRY.

      DELETE LT_TH_VALUE WHERE FIELDNAME EQ ‘%SELECTION%’.

    ENDLOOP.