cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction /sapapo/snpaplog Deployment Results Details

Former Member
0 Kudos

Hi All,

I am new to SAP APO and need some help regarding Transaction /sapapo/snpaplog.

If we execute this transaction and on the selection screen we enter the following:

Application : Deployment

From (Date/Time) : some date / Time (Enter these values such that some log gets

To (Date/Time) : some date / Time selected)

After executing the Transaction with the above details on the seln Screen,

On the next screen double click on "Stock Transfers" (on the left side of the screen).

Then click on "Detail Exists" button corresponding to the "Deployment Result Details", this displays a table on the lower part of the screen.

The data that are displayed on this table is

1) Product (2) Start Location (3) Destination Location (4) Push

5) Fair Share Rule (6) Demand Date (7) ATD Qty (8) Roll Fwd (9) Confirmed Qty

(10) Distribution demand (11) Storage Qty (12) Target Stock Level (12) Unit.

I need to find out how to get the data that this table displays.

I did a lot of debugging but with not much success. May be some standard FM is involved.

Thanks in advance

Ramesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ramesh - this data is stored in the application log which can be accessed via several FM's. The tables where this data is stored are BALHDR and BALDAT along with several other supporting tables beginning with BAL*. The data is stored in a cluster so you will need to use a FM to read the data. The object for what you are looking for is APO_SNP and the subobject is TLB. Most function modules to read/write the application logs begin with the following:

APPL_LOG*

BAL_LOG*

BAL_DB*

BAL_DSP*

Regards

Andy

Former Member
0 Kudos

Hi Andy...... Thanks for ur reply....... and my appologies for the delay in responding......

The following piece of code does this....... After lot of debugging I got this and today this program has been tested successful.

I am writting the code below, (data declaration part omitted as the internal tables used should be compatible with the FM interfaces).



  CALL FUNCTION '/SAPAPO/MSDP_LOG_GET_BAL_OBJ'
    EXPORTING
      iv_appl              = c_dep
    IMPORTING
      ev_object            = g_object
      ev_subobject         = g_subobject
    EXCEPTIONS
      bal_object_not_found = 1
      OTHERS               = 2.

  IF sy-subrc <> 0.
  ELSE.
  ENDIF.

  CALL FUNCTION 'BAL_FILTER_CREATE'
    EXPORTING
      i_object       = g_object
      i_subobject    = g_subobject
      i_extnumber    = p_extid
      i_aldate_from  = p_datefr
      i_aldate_to    = p_datefr
      i_altime_from  = p_timefr
      i_altime_to    = p_timefr
    IMPORTING
      e_s_log_filter = g_filter.

  CALL FUNCTION 'BAL_DB_SEARCH'
    EXPORTING
      i_s_log_filter     = g_filter
    IMPORTING
      e_t_log_header     = it_log_header
    EXCEPTIONS
      log_not_found      = 1
      no_filter_criteria = 2
      OTHERS             = 3.

  IF sy-subrc <> 0.
  ELSE.
  ENDIF.

  READ TABLE it_log_header INTO wa_log_header INDEX 1.

  IF sy-subrc = 0.
    g_log_number =  wa_log_header-lognumber.
  ENDIF.

  SELECT SINGLE *                                           
    FROM bal_indx INTO bal_indx
    WHERE lognumber = g_log_number.

  TRY.
      IMPORT gt_log_det TO gt_log_det
       FROM DATABASE bal_indx(al)
       ID g_log_number.

    CATCH cx_sy_import_mismatch_error.                  


  ENDTRY.

*The last row of gt_log_det[] contains the value needed.


  DESCRIBE TABLE gt_log_det LINES l_lines.
  READ TABLE gt_log_det INTO wa_log_det INDEX l_lines.

  IF sy-subrc = 0.
    it_podet[] = wa_log_det-podet.
    SORT it_podet BY matnr  locfr.
  ENDIF.

Answers (1)

Answers (1)

Former Member
0 Kudos

Detailed summary solution posted in the thread.

0 Kudos

Hello Ramesh!

I know it's been a long time since you coded this but I need your help on this because I have the exact same problem and this is what I'm looking for.

I did copy your code but I got stuck on "IMPORT gt_log_det TO gt_log_det".

I don't know what type should I declare this gt_log_det.

Found the table type /SAPAPO/MSDP_DEP_LOG_PODET_TAB which probably is the "podet" but can't find anything else.

Can you help me?

Thanks in advance!!!

Former Member
0 Kudos

I've tried with below logic and it worked.

DATA: lt_demsatui TYPE /sapapo/ctmindc_demsatui_tab,

      lt_src TYPE STANDARD TABLE OF /sapapo/ctmindc_srcarrui_str,

      lt_resu TYPE STANDARD TABLE OF  /SAPAPO/CTMINDC_RESUTLUI_STR.

*****************************

***To Read Application Log***

*****************************

CALL FUNCTION 'APPL_LOG_READ_DB'

EXPORTING

   OBJECT                   = 'APO'

   SUBOBJECT                = 'CTM'

   EXTERNAL_NUMBER          = 'XXXX' "CTM Profile

   DATE_FROM                = 'XXXX'

   DATE_TO                  = 'XXXX'

   TIME_FROM                = 'XXXX'

   TIME_TO                  = 'XXX'

TABLES

   HEADER_DATA              = header_data

   HEADER_PARAMETERS        = header_parameters

*    MESSAGES                 =

*    MESSAGE_PARAMETERS       =

   CONTEXTS                 =  contexts.

*    T_EXCEPTIONS             = .

****************************************

*Result Indicator for CTM Planning Run***

*************************************​***

***Demand Coverage

TRY.

    IMPORT indc_demsat = lt_demsatui

    FROM DATABASE bal_indx(al)

    ID g_log_number.

  CATCH cx_sy_import_mismatch_error.

ENDTRY.

***Sources of Supply Used

TRY.

    IMPORT indc_srcarr = lt_src

    FROM DATABASE bal_indx(al)

    ID g_log_number.

  CATCH cx_sy_import_mismatch_error.

ENDTRY.

***Resource Utilization

TRY.

    IMPORT indc_resutl = lt_resu

    FROM DATABASE bal_indx(al)

    ID g_log_number.

  CATCH cx_sy_import_mismatch_error.

ENDTRY.​