cancel
Showing results for 
Search instead for 
Did you mean: 

How stock on hand from APO Tables can be updated in SNP Planning Book?

former_member379943
Participant
0 Kudos

Hi all

How stock on hand can be updated in SNP Planning book using ABAP or functional module,this is reference to SAP APO SNP Planning Book

Regs

Poorna

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190993
Active Participant
0 Kudos

Hi Poorna,

If I understand your question correctly, you want to know how the stock on hand appears in the SNP planning book?

In APO the stock and other transactional data are stored in live cache order series objects with reference to order categories. For example the stock on hand has category CC.

In the planning area configuration, you define the category groups against the key figures used. So for Stock on hand key figure you define a category group which has categories like CC and other stock categories.

The stock data under these categories is then reflected in the stock on hand key figure of planning book.

Hope this helps!

Regards,

Umesh

Former Member
0 Kudos

Hi Poorna,

First of all the stock on hand is a standard key-figure in the SNP planning book so i could not understand the logic behind reading it from APO tables and writing it into the SNP planning book. But if any such requirement is there following BAPI can be used to write the stock on hand into SNP planning book in a time series key-figure:

BAPI_PBSRVAPS_CHANGEKEYFIGVAL2 : Change Key Figure Values.

if you want to read different type of stock from the planning book as well following BAPI can be used for this purpose:

BAPI_STSRVAPS_GETLIST2 : Read Stocks for Selection Criteria

I have used both the BAPIs in my previous projects and if you want any help in this regard please let me know.

Regards,

Mukesh Pandey

former_member379943
Participant
0 Kudos

Hi Mukesh

We tried using the above BAPIs but  unable to update stock on hand from APO tables in planning book.Could you more elaborate in more detailed way.

Thanks

Poorna

Former Member
0 Kudos

Hi Poorna,

Try following BAPI :

"BAPI_STSRVAPS_SAVEMULTI2" "Create or Change Stocks"

psedo code is as below:

CLEAR:e_stock,

        w_flag1,

        w_flag2,

        w_discontinue.

  FREE: i_stock,

        i_return.

  MOVE:c_11                           TO e_stock-stock_type,

       <fs_pktotal_data>-ziv_dp_py    TO e_stock-product,

       c_x                            TO e_stock-delta_change_flag,

       us_statp                       TO e_stock-atpcat,

*       c_1001                         TO e_stock-loctype,

*       <fs_pktotal_data>-ziv_dp_ap    TO e_stock-location,

       us_loctype                     TO e_stock-loctype,

       us_location                    TO e_stock-location,

       <fs_pktotal_data>-ziv_dp_60    TO e_stock-quantity.

  APPEND e_stock TO i_stock.

*End of update JM Macariola 04/17/2009

  CALL FUNCTION 'BAPI_STSRVAPS_SAVEMULTI2'

    EXPORTING

      logical_system                      = va_logsys

      commit_control                      = 'E'

*     PLANNING_MODE_USAGE                 =

      planning_version                    = '000'

*     NO_AUTOMATIC_VERSION_CREATION       =

    TABLES

      stock                               = i_stock

*     CLASSVALUESCHAR                     =

*     CLASSVALUESNUM                      =

*     CLASSVALUESCURR                     =

      return                              = i_return

*     EXTENSION_IN                        =

*     FCS_REDUCTION                       =

Regards,

Mukesh Pandey