вторник, 9 ноября 2021 г.

Query Builder. how to check email

 

For publications:

Select SI_ID, SI_NAME, SI_KIND, SI_PARENT_FOLDER  ,

SI_SCHEDULEINFO.SI_DESTINATIONS, SI_INSTANCE, SI_SCHEDULE_STATUS

from CI_INFOOBJECTS where SI_KIND = 'Publication'

and SI_INSTANCE = 0

and SI_SCHEDULEINFO.SI_DESTINATIONS.SI_TOTAL > 0

and "si_scheduleinfo.si_destinations.1.si_progid" = 'CrystalEnterprise.Smtp'

and

( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_SENDER_NAME" like '%email%'

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES" like '%emailh%')

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC" like '%email%')

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC" like '%email%')

)



For schedule of publications:

Select SI_ID, SI_NAME, SI_KIND, SI_PARENT_FOLDER  ,

SI_SCHEDULEINFO.SI_DESTINATIONS, SI_INSTANCE, SI_SCHEDULE_STATUS

from CI_INFOOBJECTS where SI_KIND = 'Publication'

and SI_INSTANCE = 1

and SI_SCHEDULE_STATUS = 9

and SI_SCHEDULEINFO.SI_DESTINATIONS.SI_TOTAL > 0

and "si_scheduleinfo.si_destinations.1.si_progid" = 'CrystalEnterprise.Smtp'

and

( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_SENDER_NAME" like '%email%'

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES" like '%email%')

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC" like '%email%')

or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC.SI_TOTAL" > 0

       and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC" like '%email%')

)


четверг, 18 февраля 2021 г.

Custom hierarchies ( SET )

https://blogs.sap.com/2013/10/21/custom-hierarchies/

https://blogs.sap.com/2012/05/02/custom-hierarchy-extraction-in-sap-bw-73-part1/

https://blogs.sap.com/2012/08/09/custom-hierarchy-extraction-in-sap-bw-73-part2/

https://blogs.sap.com/2012/08/10/custom-hierarchy-extraction-in-sap-bw-73-part3/

понедельник, 7 сентября 2020 г.

среда, 8 июля 2020 г.

Run DTP, run!

Надо перегрузить данные из А в B
Но сделать надо это по некому признаку, в данном случае по дате.
Да, можно было через TVARV, но как то хотелось реализовать по другому.

В общем, идея простая...
Запускается DTP, находит последний загруженный пакет в B, смещает дату и аглы.



DATA: l_date type d.

"get target
DATA(l_target) = i_r_request->get_tgt( ).

"type of target
"DATA(l_target_type) = i_r_request->get_tgttp( ).

"ref to target
DATA(lo_request_list) = cl_rsdso_data_request_list=>create(
                          i_adsonm = l_target(30) ).
"refresh list
lo_request_list->refresh( ).

"get list of all requests in XREF format
DATA(lt_request_xref) = lo_request_list->get_t_request_xref( ).

IF lt_request_xref IS NOT INITIAL.
  "get last request
  SORT lt_request_xref BY SRC_POS DESCENDING.
  ASSIGN lt_request_xref[ 1 ]-SRC_TSN TO FIELD-SYMBOL(<SRC_TSN>).

  TRY.
    "ref to request object (DTP)
    DATA(lo_request) = cl_rsbk_request=>create_from_db(
                        i_process_tsn = <SRC_TSN>
                        i_request_tsn = <SRC_TSN> ).

    "get filters in table view
    DATA(lt_filter) = lo_request->get_th_range( ).
  CATCH cx_rs_not_found.
    p_subrc = 1.
    EXIT.
  ENDTRY.

  "get value for i_fieldnm
  READ TABLE lt_filter
    WITH KEY FIELDNM = i_fieldnm
    ASSIGNING FIELD-SYMBOL(<ls_filter>).

  IF sy-subrc = 0.
    "increment date
    l_date = <ls_filter>-LOW.
    l_date = l_date + 1.

    "set restriction in DTP
    READ TABLE l_t_range
      WITH KEY fieldname = i_fieldnm.

    IF sy-subrc = 0.
      l_t_range-low = l_date.
      modify l_t_range index sy-tabix.
    ELSE.
      l_t_range-FIELDNAME = i_fieldnm.
      l_t_range-SIGN = 'I'.
      l_t_range-OPTION = 'EQ'.
      l_t_range-LOW = l_date.
      append l_t_range.
    ENDIF.
  ENDIF.
ENDIF.

p_subrc = 0.


7.5
DATA: l_date type d.
DATA: l_fiscper type /BI0/OIFISCPER.
DATA: ls_tlogo       TYPE rstran_s_tlogo.

"fill TLOGO structure
ls_tlogo-tlogo = i_r_request->get_tgttp( ).
ls_tlogo-objnm = i_r_request->get_tgt( ).

"ref to target
DATA(lo_request_list) = cl_rsdso_data_request_list=>create(
                          i_s_tlogo   = ls_tlogo ).
"refresh list
lo_request_list->refresh( ).

"get list of all requests in XREF format
DATA(lt_request_xref) = lo_request_list->get_t_request_xref( ).

IF lt_request_xref IS NOT INITIAL.
  "get last request
  SORT lt_request_xref BY SRC_POS DESCENDING.
  ASSIGN lt_request_xref[ 1 ]-SRC_TSN TO FIELD-SYMBOL(<SRC_TSN>).

  TRY.
    "ref to request object (DTP)
    DATA(lo_request) = cl_rsbk_request=>create_from_db(
                        i_process_tsn = <SRC_TSN>
                        i_request_tsn = <SRC_TSN> ).

    "get filters in table view
    DATA(lt_filter) = lo_request->get_th_range( ).
  CATCH cx_rs_not_found.
    p_subrc = 1.
    EXIT.
  ENDTRY.

  "get value for i_fieldnm
  READ TABLE lt_filter
    WITH KEY FIELDNM = i_fieldnm
    ASSIGNING FIELD-SYMBOL(<ls_filter>).

  IF sy-subrc = 0.
    "increment date
    l_fiscper = <ls_filter>-LOW.
    l_date = |{ l_fiscper(4) }{ l_fiscper+5(2) }01|.
    l_date = l_date + 33.
    l_fiscper = |{ l_date(4) }0{ l_date+4(2) }|.

    "set restriction in DTP
    READ TABLE l_t_range
      WITH KEY fieldname = i_fieldnm.

    IF sy-subrc = 0.
      l_t_range-low = l_fiscper.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      modify l_t_range index sy-tabix.
    ELSE.
      l_t_range-FIELDNAME = i_fieldnm.
      l_t_range-SIGN = 'I'.
      l_t_range-OPTION = 'EQ'.
      l_t_range-LOW = l_fiscper.
      append l_t_range.
    ENDIF.
  ENDIF.
ENDIF.

p_subrc = 0.

Вызов цепочки из отчета

ABAP функция на FOX

В общем надо запускать RSPC_API_CHAIN_START с параметром I_NOPLAN = 'X'

Иначе, странная хрень с теи какой статус завершения у цепочки может возникать.

понедельник, 18 ноября 2019 г.

Hierarchy 3.x >> 7.х

Давно не делал эту операцию, в общем даже как то подзабыл что надо подправить чтобы заработало нормально.


+ start routine:

    CALL METHOD cl_rstran_gen_step_hier_split=>reset_interval_nodes
      EXPORTING
        i_iobjnm      = '0COSTELMNT'
        i_t_intervals = SOURCE_PACKAGE_5
      CHANGING
        c_t_nodes     = SOURCE_PACKAGE_3.

То что DTP пакет внутри желтый - это в общем терпимо.