cancel
Showing results for 
Search instead for 
Did you mean: 

UJK_SCRIPT_LOGIC_EXECUTE Function Module BPC 10 NW

Former Member
0 Kudos

Dear Experts,

I would like to create a datamanager package which user may select radio box options, according to selection I would like to execute specific LGF files.

I want to use custom logic badi and get selection parameters then in this badi I want to call other Script Logic files which also call custom logics according to these parameters. In other words I would have SALES_BADI called in SALES.LGF, PRODUCTION_BADI which is called from PRODUCTION.lgf. These scripts can be executed independently. But I want to have a PROCESS_BADI which will call either SALES, or PRODUCTION or maybe both of the logics according to user selection. 

I have hard time using UJK_SCRIPT_LOGIC_EXECUTE function module, I am using UJKT transaction I see log file which shows successful records creation but no records actually written to cube.

Any ideas? May it be related with BPC 10 version or what?

Thanks in advance,

Ergin Ozturk

Accepted Solutions (1)

Accepted Solutions (1)

former_member200327
Active Contributor
0 Kudos

Hi Ergin,

You don't need that FM to achieve that goal. Dynamic Script in DM Package can do this for you.

In RADIOBUTTON PROMPT you can hardcode your script names. Selected name will be populated in Package variable. You can then use that variable in LOGICFILE TASK.

If you still prefer using FM check that you call it with MODE = EXECUTE.

Regards,

Gersh

Former Member
0 Kudos

Thank you Gersh. I was calling FM with Execute mode but I was not sure how to use i_logic parameter, a little inspiration from UJK_SCRIPT_LOGIC_DISPATCH helped me and eventually I have managed to call another logic file from one logic execution with BADI.

Coding is here:

  DATA: lv_docname TYPE uj_docname ,
        lv_mode TYPE uj_run_mode ,
        lv_user type UJ_USER_ID ,
        lo_dispatch TYPE REF TO cl_ujk_dispatch,
        lt_lgx TYPE  ujk_t_script_logic_scripttable  .

  DATA: lo_old_context type ref to if_uj_context ,
        lo_user type ref to CL_UJE_USER .

  lo_old_context = cl_uj_context=>get_cur_context( ).

  CALL METHOD lo_old_context->GET_USER_OBJ
    RECEIVING RO_USER = lo_user.

  lv_user = lo_user->D_OBJ_ID.
  lv_mode = 'EXECUTE' .

  CONCATENATE '\ROOT\WEBFOLDERS\' I_APPSET_ID '\ADMINAPP\' I_APPL_ID '\BADI_SATIS.LGF' INTO lv_docname.

  CREATE OBJECT lo_dispatch.

  CALL METHOD lo_dispatch->get_file
    EXPORTING
      i_appset      = I_APPSET_ID
      i_application = I_APPL_ID
      i_user        = lv_user
      i_filename    = lv_docname
    IMPORTING
      et_lgx        = lt_lgx.

  CALL FUNCTION 'UJK_SCRIPT_LOGIC_EXECUTE'
    EXPORTING
      I_APPSET      = I_APPSET_ID
      I_APPLICATION = I_APPL_ID
      I_USER        = lv_user
      I_LOGIC       = lt_lgx
      I_FILE_TYPE   = 'LGF'
      I_MODULE      = uj00_c_mod_name_dm
      I_LGF         = lv_docname
      I_MODE        = lv_mode.

Answers (0)