BAPI_PBSRVAPS_GETDETAIL

hi experts,
call BAPI_PBSRVAPS_GETDETAIL ,
date from - 01.04.2007  
date to - 31.12.2009
In TIME_SERIES_ITEM table, i get output in this form
1   20,070,401,000,000        20,070,428,235,959     400
note here for april month only first 28 days are taken since the last few days fall in the next months week
Can the bapi return values exactly in the form of  30 days of april and like wise for all other month i.e time series value for exactly 30 days of april is retrived..
what way is it possible..
thanks in advance.
Bijal

Hi Bijal,
When you call BAPI_PBSRVAPS_GETDETAIL you specify a planning book. This planning book, in turn, has a planning buckets profile. Depending on the setting of the planning buckets profile the BAPI will "group" the data into weeks, periods or months. Therefore, in order for you to able to retrieve data for 30 days of april, you need a planning book with a planning bucket profile which "groups" the days of april into 1 bucket only. If you are the ABAP consultant in your project, please ask help from your APO consultant. If you are the APO consultant, then you need to create the necessary planning buckets profile and planning book to satisfy your requirements
Hope this helps

Similar Messages

  • Max Number of records for BAPI 'BAPI_PBSRVAPS_GETDETAIL'

    Hi All,
    Can you suggest me the number of records to be fed to the 'BAPI_PBSRVAPS_GETDETAIL'.
    I am using a few location products for 9 key figures.Whenever number of records
    in selection table increases BAPI behaves in a strange way and the code written below it does not get executed.
    Please guide me to get full points.
    Thanks in Advance,
    Chandan Dubey

    Hi Uma,
        It comes out of the program after this code is executed.I have 50 location product combinations in vit_selection table.
      CALL FUNCTION 'BAPI_PBSRVAPS_GETDETAIL'
        EXPORTING
          planningbook                = planning_book
          period_type                 = 'B'
          date_from                   = l_from_week
          date_to                     = l_to_week
          logical_system              = logical_system
          business_system_group       = business_system_group
        TABLES
          selection                   = vit_selection
          group_by                    = vit_group_by
          key_figure_selection        = vit_kf_selection
          time_series                 = vit_t_s
          time_series_item            = vit_t_s_i
          characteristics_combination = vit_c_c
          return                      = vit_return.
      LOOP AT vit_return.

  • Max number of records for  'BAPI_PBSRVAPS_GETDETAIL'.

    Hi All,
    Can you suggest me the number of records to be fed to the 'BAPI_PBSRVAPS_GETDETAIL'.
    I am using a few location products for 9 key figures.Whenever number of records
    in selection table increases BAPI behaves in a strange way and the code written below it does not get executed.
    Please guide me to get full points.
    Thanks in Advance,
    Chandan Dubey

    Server memory issue !

  • When I run the BAPI "BAPI_PBSRVAPS_GETDETAIL" .It gives me a short dump.

    When I run the BAPI "BAPI_PBSRVAPS_GETDETAIL" .It gives me a short dump.
    Can anybody help me with this?

    This is the content of the dump.
    Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED
    Except.                CX_SY_REF_IS_INITIAL
    Date and Time          05/17/2007 11:21:29
    Short text
         Access via 'NULL' object reference not possible.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "/SAPAPO/SAPLADVF" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    Error analysis
         An exception occurred that is explained in detail below.
         The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
          caught in
         procedure "/SAPAPO/ADVF_CELL_INPUT" "(FUNCTION)", nor was it propagated by a
          RAISING clause.
         Since the caller of the procedure could not have anticipated that the
         exception would occur, the current program is terminated.
         The reason for the exception is:
         You attempted to use a 'NULL' object reference (points to 'nothing')
         access a component (variable: "C_S_ACTVIEW-AGC_CHILD1-APOGRID").
         An object reference must point to an object (an instance of a class)
         before it can be used to access components.
         Either the reference was never set or it was set to 'NULL' using the
         CLEAR statement.
    Missing RAISING Clause in Interface
        Program                                 /SAPAPO/SAPLADVF
        Include                                 /SAPAPO/LADVFU06
        Row                                     1
        Module type                             (FUNCTION)
        Module Name                             /SAPAPO/ADVF_CELL_INPUT
    Trigger Location of Exception
        Program                                 /SAPAPO/SAPLADVF
        Include                                 /SAPAPO/LADVFU06
        Row                                     81
        Module type                             (FUNCTION)
        Module Name                             /SAPAPO/ADVF_CELL_INPUT
    Source Code Extract
    Line  SourceCde
       51 *#TR# (1) Check arguments: Read only mode must be 0, 1 or 2 and row and column must be provi
       52   if f_argument2 is initial or f_argument3 is initial.
       53     break-point id /SAPAPO/ADV__EXECUTION. clear f_argument. f_calc_error = true. exit.
       54   endif.
       55
       56
       57 *#TR# (1a) Calculate line number of the cell (line + line offset)
       58   l_line = f_argument2 + i_line_offset.
       59
      60 *#TR# (1b) Set L_CELL_READONLY depending on the read only mode F_ARGUMENT
      61   case f_argument.
      62     when 0. l_cell_readonly = /sapapo/cl_agc_base=>gs_c_agc_readonly_values-read_only.
      63     when 1. l_cell_readonly = /sapapo/cl_agc_base=>gs_c_agc_readonly_values-read_write.
      64     when 2. l_cell_readonly = /sapapo/cl_agc_base=>gs_c_agc_readonly_values-stateless.
      65     when others.
      66       break-point id /SAPAPO/ADV__EXECUTION. clear f_argument. f_calc_error = true. return.
      67   endcase.
      68
      69 *#TR# (1c) The input status of cells set to read only by the data view definition (history)
      70   if f_argument3 < g_s_cols_properties-first_input_column.
      71     return.
      72   endif.
      73
      74 *#TR# (1d) Note 1005813: The old APOGRID does not support the read only mode
      75 *#TR# /SAPAPO/CL_AGC_BASE=>GS_C_AGC_READONLY_VALUES-READ_WRITE. For compatibility reasons, w
      76 *#TR# read only mode /SAPAPO/CL_AGC_BASE=>GS_C_AGC_READONLY_VALUES-STATELESS
      77
      78 *#TR# Determine version of APOGRID to check, if new or old APOGRID is used. The version is b
      79 *#TR# reasons
      80   if g_agc_grid_version is initial.
    >>>>     c_s_actview-agc_child1-apogrid->get_control_version(
      82       IMPORTING
      83         apogrid           = l_apogrid
      84       EXCEPTIONS
      85         cntl_system_error = 1
      86         cntl_error        = 2
      87         others            = 3
      88           ).
      89     if sy-subrc <> 0.
      90       break-point id /sapapo/adv__execution. clear f_argument. f_calc_error = true. exit.
    91     endif.
    92
    93     g_agc_grid_version = l_apogrid.
    94   endif.
    95
    96 *#TR# If the old grid is used change read only mode if necessary
    97   if g_agc_grid_version < 200
    98     and l_cell_readonly = /sapapo/cl_agc_base=>gs_c_agc_readonly_values-read_write.
    99
    100     l_cell_readonly = /sapapo/cl_agc_base=>gs_c_agc_readonly_values-stateless.

  • Performance "BAPI_pbsrvaps_getdETAILS"

    HI folks,
    i am facing a performance issue, i am fetching data from the planning book using the function moduel "BAPI_pbsrvaps_getdETAILS", but it takes more time to get the information.
    i want to do some changes for the best performance.
    please suggest....
    Regards,
    Bala.

    Hi,
    Have you tried setting values for the READ_OPTIONS parameter? The ff. parameters can be set:
    NoPbookMacros
    NoDviewMacros
    TimePreselection
    KeyfPreselection.
    You can check the documentation of the FM in SE37.
    What parameters you can set depends on the design of your planning books and the programs that interact with it.

  • BAPI_PBSRVAPS_GETDETAIL - pick only 18 months

    Hi Gurus
    We have 'z' program where in Bapi 'BAPI_PBSRVAPS_GETDETAIL' is used to fetch data from SNP planning book to check available capacity of the the resources.
    Now the problem  is system calculate capacity for only 18 months taking data from LC, eventhough there is data in planning book for complete 24 months and planning area intialized for 24 months.
    If someone has similar issue and it resolved ... please share with me.
    Quick help is much appriciated
    regards
    V

    Hi Kiran,
    What is the range of days maintained in planning parameters of the resource.
    Thanks
    Pavan Verma

  • Error in BAPI BAPI_PBSRVAPS_GETDETAIL - SAP Note required

    Hi All,
    I am using BAPI BAPI_PBSRVAPS_GETDETAIL to read key fig values in background. I am using all the read options to improve the performance of the BAPI. It works fine in foreground and in background too when I schedule it manually for immediate run. Please note that I am reading values for just 1 day.
    When I schedule the program through SAP scheduler for a later execution in night it gives me following error : - Internal error [/SAPAPO/OM_TS_TGRID_CREATE].
    I could see that following function module of the BAPI BAPI_PBSRVAPS_GETDETAIL is not able to create time buckets.
            CALL FUNCTION '/SAPAPO/OM_TS_TGRID_CREATE' 
              EXPORTING                                             
                is_gen_params     = ls_gen_params                   
                iv_tgridid        = iv_tbid                         
                iv_read_only      = true                            
                iv_modus          = gs_c_tgrid_mode-new             
                it_tgrid          = lt_tgrid                        
                iv_lcname         = iv_lcname                       
              IMPORTING                                             
                et_rc             = lt_rc                           
              EXCEPTIONS                                            
                lc_connect_failed = 1                               
                lc_com_error      = 2                               
                lc_appl_error     = 3                               
                OTHERS            = 4.                              
            IF sy-subrc <> 0.                                       
              _debug 'C'.                              "#EC NOBREAK 
                MESSAGE e099 WITH '/SAPAPO/OM_TS_TGRID_CREATE'        
                                  RAISING invalid_data_status.        
              ENDIF.                                                  
            ENDIF.                                                    
    Can somebody suggest me the SAP note or any other resolution to this problem.
    Thanks in advance,
    Chandan

    Hi Paramvir,
    If I remember correct, this is the parameters for the BAPI
    CALL FUNCTION 'BAPI_PBSRVAPS_GETDETAIL2'
    EXPORTING
    planningbook = p_plnbk
    data_view = p_datvw
    planning_version = '000'
    selection_id = 'ALL-SKU'
    read_options = w_read_opt
    period_type = 'B'
    date_from = '012001'
    date_to = '012011'
    TABLES
    group_by = i_groupby
    key_figure_selection = i_keyfig_sel
    key_figure = i_keyfig
    key_figure_value = i_keyfig_val
    characteristics_combination = i_char_comb
    return = i_return.
    I think we have discussed the parametrs part already. In the tables
    group_by, key_figure_selection are input tables.
    key_figure --> This tables returns the Key figure to Charactersitic Combination mapping
    key_figure_value --> This table returns the Key figure value for every key figure for every time period as separate entries.
    Characteristic_combination --> This table returns the charactersitic combination.
    So again, what exactly are you trying to achieve, may be we have the solution in front of us but are not seeing it.
    Rgds
    Mani Suresh

  • A small query about BAPI "BAPI_PBSRVAPS_GETDETAIL"

    Hi All,
    I am Reading key figures from a planning area by parallally running jobs !
    I am using BAPI "BAPI_PBSRVAPS_GETDETAIL" in the code.
    When i run the program parallally for separate locations, run time exceeds.
    Is it because lot of programs are trying to access live cache key figures from the same planning area.
    One more strange thing is that after 5 to 6 runs, even if i run for a single location,
    it takes increasingly bad time. Do you suggest to open and close simsessions in the code?? But how would that be helpful !
    Please win full points by answering this simple question!
    Thanks in advance,
    chandan

    Hi Chandan,
    see note 792626 for performance.
    Other question - which release do you have ? > 4.0 the BAPI_PBSRVAPS_GETDETAIL is obsolete and should be replaced by BAPI_PBSRVAPS_GETDETAIL2
    Regards,
    Ernst

  • Max records for BAPI 'BAPI_PBSRVAPS_GETDETAIL'

    Hi All,
    Can you suggest me the number of records to be fed to the 'BAPI_PBSRVAPS_GETDETAIL'.
    I am using a few location products for 9 key figures.Whenever number of records
    in selection table increases BAPI behaves in a strange way and the code written below it does not get executed.
    Please guide me to get full points.
    Thanks in Advance,
    Chandan Dubey

    Depends upon the system, 1000 records...

  • Internal error [/SAPAPO/OM_TS_TGRID_CREATE]

    Hi All,
    I am using  BAPI BAPI_PBSRVAPS_GETDETAIL to read live cache key figure. Its working finr when I execute the program in foreground and returns values but when I try executing this is background it gives me following error in Job Log:-
    Internal error [/SAPAPO/OM_TS_TGRID_CREATE].
    Can somebody suggest me the root cause and remedy for the same. I try doing planning area initializationa and live cache consistency check also but no luck.
    A timely reply will be highly appreciated.
    Thanks !
    Regards,
    Chandan

    Hi Chandan,
    I checked and found no sap notes similar to scm 4.0.  I would suggest to raise a OSS message to SAP so that they will advise on suitable support pack or sap note to implement.
    Regards
    R. Senthil Mareeswaran.

  • How to extract data from planning book

    nu t apo. need help regarding how to extract data from planning book givn the planning book name , view name & some key figures.
    Total Demand (Key Figure DMDTO):
    o     Forecast
    o     Sales Order
    o     Distribution Demand (Planned)
    o     Distribution Demand (Confirmed)
    o     Distribution Demand (TLB-Confirmed)
    o     Dependent Demand
    Total Receipts (Key Figure RECTO):
    o     Distribution Receipt (Planned)
    o     Distribution Receipt (Confirmed)
    o     Distribution Receipt (TLB-Confirmed)
    o     In-Transit
    o     Production (Planned)
    o     Production (Confirmed)
    o     Manufacture of Co-Products
    Stock on Hand (Key Figure STOCK):
    o     Stock on Hand (Excluding Blocked stock)
    o     Stock on Hand (Including Blocked stock)
    In-Transit Inventory (Cross-company stock transfers)
    Work-in-progress (Planned orders / Process orders with start date in one period and finish date in another period)
    Production (Planned), Production (Confirmed) and Distribution Receipt elements need to be converted based on Goods Receipt date for projected inventory calculation.

    Hello Debadrita,
    Function Module BAPI_PBSRVAPS_GETDETAIL2 or BAPI_PBSRVAPS_GETDETAIL can help you.
    For BAPI BAPI_PBSRVAPS_GETDETAIL, the parameters are:
    1) PLANNINGBOOK - the name of your planning book
    2) DATA_VIEW - name of your data view
    3) KEY_FIGURE_SELECTION - list of key figures you want to read
    4)  SELECTION - selection parameters which describe the attributes of the data you want to read (e.g. the category or brand). This is basically a list of characteristics and characteristic values.
    BAPI_PBSRVAPS_GETDETAIL2 is very similar to BAPI_PBSRVAPS_GETDETAI but is only available from SCM 4.1 onwards.
    For the complete list of parameters, you can go to transaction SE37, enter the function module names above and check out the documentation.
    Please post again if you have questions.
    Hope this helps.

  • Need to change forecast data thru planning book + doubt while creating POS

    hi friends,
    my application creates forecast data for following.
    product , location start date , end date.
    i need to put this data into APO(DP).
    i know i can do it using BAPI CHANGEKEYFIGUREVALUE2 of Planning Book APs
    my doubt is while create a Plng Object store, what fileds do i take as charachteristics which match these, please reply if have some clue

    Hi Rohit,
    I believe i misunderstood your first post. I had given the BAPI parameters that you need to fill up for the given business requirements you have mentioned. I realized you were asking about the POS.
    Answer to Q1: You can not place time characteristics in the POS. You will define the "time characteristics" in your Planning Area by specifying a relevant storage bucket profile.
    Answer to Q2: You dont need to add time characteristics in the POS.
    Answer to Q3: 9AVERSION is not included in the POS. However, when you use BAPIs BAPI_PBSRVAPS_GETDETAIL and BAPI_PBSRVAPS_CHANGEKEYFIGVAL to read/write data from/to the planning area you need to supply a selection for the planning version (9AVERSION).
    Hope this helps.

  • Planned orders in tables

    Hi Experts
    I am working with SNP Tool. I want to know that where I can see my planned orders other then /n/sapapo/rrp3 or is there any table for planned orders storage.
    Please let me know if there is any table for planned order storage values.
    Regards
    guru

    There is no table for the planned order in APO like R/3 ( table PLAF ).
    You can see planned order in /SAPAPO/RRP2 also.
    If you want to read planned order data you need to use FM like
    BAPI_PBSRVAPS_GETDETAIL        Read Data from a Planning Book
    BAPI_MOSRVAPS_REQUESTLIST2     Request: Read Manufacturing Orders for Selection
    Manish

  • Send forecast to another system

    Hi,
    We are on APO 5.0 and want to send our forecast from a planning book to a partner.
    Has anybody ever done this via XML?
    Note that we are not planning to use ICH. But we have XI setup.
    Thanks.
    GM

    Hi Gerald,
    I can not advise you on XI specifics but here are some things that i think might help you. (I am thinking out load here so some things might not be optimal. I am also not sure if you want the your partner to be able to access the planning book data in real time or you will just want them to see a snap shot of the data)
    1) You can read planning book values using BAPI/function module BAPI_PBSRVAPS_GETDETAIL or  bapi_pbsrvaps_getdetail2.
    2) You can create an ABAP Web Service. You can expose that webservice (SOAP based, XML) to your partner. Inside the webservice, you can use BAPI_PBSRVAPS_GETDETAIL/ bapi_pbsrvaps_getdetail2 to read data from the Planning Book.
    3) The BAPIs i have mentioned can be called from external system (they are remote enabled). For example, you can use the SAP JCo (Java Connector) to read data from the BAPI. Using the BAPIs + SAP JCo you can read planning book data in a Java Program.
    4) You can "connect" the Planning Area to an Infocube, construct a query and expose that query to your Enterprise Portal.
    5) You can "connect" the Planning Area to an Infocube. Use an InfoSpoke to construct a flat file and send that file (via FTP or some other ways) to your partner.
    6) how about creating a query and web template and have that accessible to your partner.
    Just thinking out load and trying to help I hope some of the points will help you.

  • Read data from SNP planning book

    Hi Frnds,
    We are faced with a situation in which we need to read certain key figures such as PIR's, Goods Issue from SNP Planning book.
    We tried using BAPI "BAPI_PBSRVAPS_GETDETAIL" to retreive data. But it seems that we are giving wrong input data to the BAPI. Could you please let us know what to be fed into the BAPI in simple terms? If there is any example code for the same , would be very much appreciable.
    Orelse if there is some other way to retreive this data kindly suggest us accordingly...
    Many thanks in advance.
    Regards,
    Karthick

    Hi Karthick,
    The parameters for calling BAPI_PBSRVAPS_GETDETAIL really depends on your Planning Area and Planning Book configurations. The planning book configuration will limit what Characteristics and Key Figures will you be able to read using BAPI_PBSRVAPS_GETDETAIL. Let me give you an example.
    Assumptions: The planning book is configured as follows:
    Name = ZPB1
    Data view  = DV1
    The DV1 data view contains the characteristics 9AMATNR and ZCNTRY and Key Figures ZKF1 and ZKF2.
    Assuming also that we have the following data currently in livecache:
    9AMATNR-ZCNTRY-ZKF1-ZKF2
    000001234-PH       - 143  - 567
    000007891-PH       - 245  - 782
    000007891-US       - 124  - 890
    Let's further assume that you want the data aggregated to country level (e.g. char ZCNTRY), you have 1 planning version 'ZPAV1' and you only want the data for Country=PH, then here are the parameters that you need to pass to  BAPI_PBSRVAPS_GETDETAIL:
    PLANNINGBOOK = 'ZPB1'
    DATA_VIEW = 'DV1'
    SELECTION =  9AVERSION I EQ ZPAV1, ZCNTRY  I EQ 'PH'
    GROUP_BY = 'ZCNTRY'
    KEY_FIGURE_SELECTION  = ZKF1, ZKF2
    Hope this helps. Please post again if you have any questions. I can give you sample code if you can post your email address.
    Message was edited by:
            Emmanuel Nepomuceno (added planning version to selection)

Maybe you are looking for