Reading Charact. Selection in Planning Level using Exit Var FM

Hi Expert,
i have to do a data slice with an Exit Variable that looks at selected data in the planning level and check in a custom table if the corresponding charact in the level is flagged in order to fill the variable with this value and lock data.
Any idea of the code for reading, in an Exit Var FM, data from Charact selection in the planning level?
Any hints will be very appreciated and rewarded.
Tanks
Fabio

Hi,
You could check the how to guide variables of type exit at:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/650ee690-0201-0010-4bb7-83c3e2a74039
If you implement the FM 'Z_VARIABLE_GET_DETAIL' you can read the value of the variables and use this in other variables.
Here is part of the code to use a sales organisation to filter the data from 0mat_sales..
Get Marketing mat ind using the ZMARKIND variable in the area
  DATA:
    M_subrc like sy-subrc,
    Ms_return like bapiret2,
    M_type like upc_var-vartype,
    Mto_varsel_all type upc_yto_charsel,
    Mto_varsel type upc_yto_charsel,
    Mto_var type upc_yto_charsel,
    Mt_chavl type /BI0/PMAT_SALES occurs 0,
    Ms_chavl like line of lt_chavl,
    Mto_chanm type upc_yto_cha.
read source value
  call function 'Z_VARIABLE_GET_DETAIL'
    EXPORTING
      i_area         = l_source_area
      i_variable     = 'ZMARKIND'
      i_buffer       = l_buffer_call
    IMPORTING
      e_subrc        = M_subrc
      es_return      = Ms_return
      e_type         = M_type
      eto_varsel_all = Mto_varsel_all
      eto_varsel     = Mto_varsel
      eto_chanm      = Mto_chanm.
  data: Ms_varsel type upc_ys_charsel,
  M_entries type i.
  if l_use_restricted_values is initial.
    lto_var = Mto_varsel_all.
  else.
    Mto_var = Mto_varsel.
  endif.
  read table Mto_var into Ms_varsel index 1.
  if sy-subrc <> 0.
    message i147(upc_fw) with M_source_var.
    exit.
  endif.
  describe table Mto_var lines l_entries.
  if l_entries <> 1.
    message i534(upc) with M_source_var.
    exit.
  endif.
select all materials related to the Line in the source variable valid
for the sales org in the zsorgfix variable.
  case Lso_varsel-chanm.
    when 'ZZLINE'.
      select * from /BI0/PMAT_SALES
      into table lt_chavl
      where /BIC/ZZLINE = ls_varsel-low
      and SALESORG = Gs_varsel-low
      and /BIC/ZMARKIND = ms_varsel-low
      and OBJVERS = 'A'.
    when 'ZZBRAND'.
      select * from /BI0/PMAT_SALES
      into table lt_chavl
      where /BIC/ZZBRAND = ls_varsel-low
      and SALESORG = Gs_varsel-low
      and /BIC/ZMARKIND = ms_varsel-low
      and OBJVERS = 'A'.
    when 'ZZHOUSE'.
      select * from /BI0/PMAT_SALES
      into table lt_chavl
      where /BIC/ZZHOUSE = ls_varsel-low
      and SALESORG = Gs_varsel-low
      and /BIC/ZMARKIND = ms_varsel-low
      and OBJVERS = 'A'.
  endcase.
  ls_varsel-SIGN = 'I'.
  ls_varsel-OPT = 'EQ'.
  ls_varsel-seqno = '0000'.
  ls_varsel-chanm = '0MAT_SALES'.
  loop at lt_chavl into ls_chavl.

Similar Messages

  • Setting # for 0CALYEAR in selection for planning level in BPS

    hi all!
    when i try to set # for 0CALYEAR (and other time variables) in selection for planning level in BPS, i recieve the following error message: 'Value # is not permitted for characteristic Calendar Year' (UPC003). As i understand, this problem began to occur after upgrading to SPS12.
    we have BI 7.0 installed
    can anyone help me solve this problem please?

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Hi<br>
    Check in year master data if value BLANK (#) exists. System should permit only those values for characteristics which are available in master data tables.<br><br>
    Secondly, does system allow you to select value # for calendar year using the F4 drilldown?
    <br><br>
    Hope it helps.<br>
    Cheers Abhijit</FONT><FONT FACE = "Verdana", Font Color = "Red">
    Please assign Reward Points if I above information was useful
    </FONT>

  • Selecting the Planning Level for Statistical Forecast in S&OP on HANA

    Hello together,
    we currently face an issue regarding the statistical forecast in S&OP on HANA:
    The customer wants to implement an S&OP process containing the two steps statistical forecast (automatically calculated) and sales forecast (manually determined). The planning level of the statistical forecast should be higher than the planning level of the sales forecast, i.e. the statistical forecast is calculated on a higher planning level and then disaggregated to be an input for the manually determined sales forecast.
    Since it doesn't seem to be possible to disaggregate any key figure below its base planning level we need to have the lower sales planning level as base planning level in all key figures, including the input and output key figures of the statistical forecast.
    When running a statistical forecast with a defined forecasting profile, the planning level used for the forecast seems to be the base planning level of the input/output key figures defined in the forecasting profile.
    However, we need to define a higher planning level for the statistical forecast in order to have a better data base for recognizing trends and sesonality. In APO DP it is possible to define the planning level for the forecast when running/scheduling the forecasting job. Is this also possible in S&OP on HANA? Can we define the planning level for the forecast in the forecasting profile or when running the forecast from the Excel AddIn? I tried to use the field "Filter" in the forecasting profile as it listed all the planning levels (as well as a lot of other things, we don't know where they come from), but the forecast was still carried out on the base planning level.
    Do you have any other idea where to define the forecasting planning level that is different from the base planning level of the input/output key figures?
    Thank you in advance,
    Jonathan

    Hi Bert,
    thank you for your fast answer. I checked the forum again and found this post:
    Question about Statistical Forecast
    However, I don't really get how the disaggregation is meant to work; the suggestion seems to be to calculate a forecast on an aggregated level, i.e. with input and output key figure with an aggregated base planning level, and then disaggregate it "somehow".
    Do you have any idea how this disaggregation might work and what other steps I have to consider?
    It seems as if I'd have to define a whole bunch of new key figures and have more than one output key figure but no input key figure for the statistical forecast, which doesn't make sense in my eyes.
    Actually I was looking for a solution where I can define my forecasting profile with both input and output key figure on the lower planning level and then insert the level I want the forecast to be done at either in the profile as well, or even more flexible when running or scheduling a forecast. Defining more key figures any time I need another forecasting level does not appear very comfortable. Is it meant to be like that or is there another way to reach the goal mentioned above?
    Cheers,
    Jonathan
    Edit: The mentioned thread contains some valuable information on how to disaggregate key figures. However, the really tricky decision is how to define the disaggregation ratio.

  • Read Infopackage selection from a table using ABAP

    Hello Experts,
    I have a flat file consisting of 3 columns which I want to use as selection fields for the Infopackage. Now, is it possible to load this flat file to an ODS or a master data table and then write some ABAP  in the Infopackage to read the values of the columns and populate the selection fields.
    This is what I want: The columns of the flat file are  - Company Code, Doc number, Fiscal Year
    Now, I loaded this file into a tables (around 2 million records) and then use ABAP to populate the entire file into the selection tab of the Infopackage.
    What would be the best approach for this?
    Thanks in advance
    Vivek

    Hi,
    It's possible in theory. Just one thing, too many selections in an InfoPackage may not work (I remember about 1,000 or 10,000, not very sure).
    I'd like suggest loading a range rather than so many selections. For example, say you have below documents:
    1000
    1001
    1005
    1010
    Then just load from 1000 to 1010, and create a start routine in your update rule/transformation. There you can do this:
    1. select records from the table where you store flat file, using the same selection (1000 to 1010)
    2. For every records in DATA_PACKAGE, using READ TABLE statement to check whether that record exist in the table. If not exist then simply delete it from DATA_PACKAGE
    I think that would have much better performance. Let us know if you have further questions.
    Regards,
    Frank

  • Affect of a new planning level selection

    Hi,
    we have a BW-BPS environment with lots of BPS functionalities, palnning sequenses, save, copy functions...
    Until now we have all products from SAP R/3 extracted.
    Newly there are now in SAP R/3 lots of small products. Planning people donu2019t want to see and plan all products in planning layouts. They want to see to plan only the "important products".
    The following solution is thought.
    we will create a product hierachie with 2 hierarchie node: "important products" and "small products".
    the hier. node u201Cimportant productsu201D should be used in all planning levels in selections.
    How can it (selection in planning level) affect the current planning functions ?
    What would you suggest here?

    Hi,
    Planning functions are assigned to just one planning level. So if you have planned to restrict the values using Hierarchy at planning level, then the underlying functions will apply only to that hierarchy members.
    regards,
    Lokesh Nandula

  • KF defaulting to multiple sources, both defined at more granular planning levels

    Hello Experts,
    I hope this will be an easy one for you Personally, I have been trying to figuring out how to overcome this issue and I must admit that I am short of solution.
    So here is the situation:
    I have two sets of data for my actual sales :
    - First one is loaded at planning level @ Period | Product | National Group | Point of Sales(POS)
    - The other is loaded @ Period | Product | National Group | Ship-To Party
    To get a valid portrait of my actual sales, I must compare these two sets of data at a common planning level (i.e. @ Period | Product | National Group).
    Then, the adjusted result must be "re"disaggregated @ Period | Product | National Group | Point of Sales, the base planning level used to forecast. 
    Based on what I could understand from SAP2 model, I created the following key figures:
    ActualsQtyPOS : Stored at base planning level @PERPRODNATPOS and calculated @PERPRODNAT. Here are the 2 calculation definitions I used:
    ActualsQtyPOS@REQUEST = SUM ("ActualsQtyPOS@ERPRODNATPOS")
    ActualsQtyPOS@PERPRODNAT = SUM ("ActualsQtyPOS@ERPRODNATPOS")
    ActualsQtyShipTo : Stored at base planning level @PERPRODNATSHIPTO and calculated @PERPRODNAT. Defined with this calculation:
    ActualsQtyShipTo@REQUEST = SUM ("ActualsQtyShipTo@PERPRODNATPOS")
    ActualsQtyShipTo@PERPRODNAT = SUM ("ActualsQtyShipTo@PERPRODNATPOS")
    AdjustedActualsQty : Created at base planning level @PERPRODNAT. This KF must be stored and editable. The value must be defaulted to ActualsQtyPOS@PERPRODNAT, unless no data exist (then, default to ActualsQtyShipTo@PERPRODNAT).
    AdjustedActualsQty@REQUEST=SUM ("AdjustedActualsQty@PERPRODNAT")
    AdjustedActualsQty@PERPRODNAT=IF(ISNULL("AdjustedActualsQty@PERPRODNAT"),IF(ISNULL("ActualsQtyPOS@PERPRODNAT"),"ActualsQtyShipTo@PERPRODNAT","ActualsQtyPOS@PERPRODNAT"),"AdjustedActualsQty@PERPRODNAT").
    My issue : I tried several (and I mean several!) configuration possibilities. So far, the best result that I got was to default the good value in AdjustedActualsQty based on the calculation rule above. But my core problem persists: I am not able to edit manually the defaulting value and save the new value in the database.
    Based on my comprehension, the problem would be related to ActualsQtyPOS and ActualsQtyShipTo Key Figures. Both are stored at a more granular planning level, and then calculated @PERPRODNAT level. In addition to storing them at their base planning level, would it be possible to store the aggregated results at a higher level (@PERPRODNAT)? This way, I would be able to use them as stored input in AdjustedActualsQty@PERPRODNAT calculation and duplicate the AdjustedActualsQty KF used in SAP2.
    Any help would be greatly appreciate.
    (I tried to summarize the best I can, don't hesitate if you need more details on some points.)
    Best regards

    Hi Philippe
    you dont  need access to HANA, it is pure config
    Go to Configuration -> Miscellanious --> Manage Planning Operator
    If not existing yet, create a new type by clicking on teh white "sheet" symbole "create new" on the right side.
    In the popup enter the EXACT name COPY (not more than one possible):
    Provide info for "Add Job Procedure" and "Schedule Procedure":
    Add Job Procedure = "SAP_SFND"."sap.sop.sopfnd.catalogue::SOPAPI_OPERATOR_SCHEDULER_JOB_ADD"
    Schedule Procedure = "SAP_SFND"."sap.sop.sopfnd.catalogue::SOPAPI_EXECUTE_SCHEDULER_COPY_JOB"
    Than add you operator lines by clicking on the plus symbol
    with the following parameter:
    DURATION
    PERIOD_OFFSET
    SOURCE_KFID1
    SOURCE_KFID2
    DURATION: e.g. 24 if you want to copy 24 months
    PERIOD_OFFSET: e.g. 0 when you want to copy starting current months, or -1 if you want to start previous months
    SOURCE_KFID1: starting keyfigure FROM which you copy. MUST NOT have any UoM or currency conversion
    TARGET_KFID1: your target keyfigure. UoM or currency conversion in here is allowed
    You could have SOURCE_KFID2 and TARGET_KFID2 as well. And you can have more than just one line.
    Flag the batch and filter mode flags, but not interactive (not supported yet)
    Provide a useful DESCRIPTION as that is seen by the users
    Make sure that not too many users get the authoriozation for it as if you execute that withiout a filter accidentially it does not only change all values, but if you run more than one at a time that migt get to conflicts. Like normal batch jobs: You usually give admins or power users access
    It copies on the very lowest possible level. You cannot tell the system as in APO-DP to copy on an aggregated level. PLus, source and target kf must have the same planning level. So you may copy from a calculated kf that does the calculation on the level of the target kf
    Dont have any docu, sorry. Hope that helps
    Yours
    Irmi

  • Reading from select-options field into the internal table

    Hi,
      I have to read the low and high ranges from the select-options fields into a field in the internal table in order to update the same field in line item table. since the user may change the screen fields, i need to pass the values directly from the screen and store it in a variable in the internal table. Is there a way to pass both ranges, low and high to one variable which holds the entire range?
    Thanks,
    Sruthy

    Hi,
    In the Selection screen you can directly read the field(Select-option)value using read statement as follows:
    READ TABLE <SELECT-OPTIONS field name> [using index] INTO <work area>.
    After reading you can directly access all the values as follows and can store them in the variables:
    var1 = <work area>-LOW
    var2 = <work area>-HIGH
    var3 = <work area>-SIGN
    var4 = <work area>-OPTION
    as per your requirement.
    I think this will help you.
    <b>Kindly reward if helpful.</b>
    Regards,
    Shakuntala.

  • Characteristic Selection u201Cnot assignedu201D on planning level

    Hi experts,
    we are using BW-BPS.
    On planning level selection some characteristics have the following condition.
    0PROFIT_CTR     Equal to: #
    What does it mean exactly ?
    What is the difference between  u201Cno selectionu201D and  = u201C#u201D ?
    Thanks

    If it is blank, then any underlying layouts, or functions can be run for any specifiv profit centres, or all possible profit centres including 'not assigned' - there is no restriction at the Level, so all will be read.
    if the restriction is set to #, then the functions/layouts can have no assigned profit centre, and no postings will be made on any profit centre (or whatever the characteristic is set to). (It is more like leaving the chracteristic completely out of the level than leaving it blank).

  • User Exit QAAT0001 to select insp. plan based on movement type during stock

    Hello,
    I am have a scenario mentioned in subjectline and would be thankful if somebody can share some detail about it.
    I created one more Inspection type Z1 apart from 08. Assigned it to insp. origin 08 as variant 03.
    Created Z1 usage that i am using in my inspection plan. Assigned 08 and Z1 inspection types in material master and two insp. plans with usage 08 and Z1.
    Now wanted to use user exit QAAT0001to select insp. plan. It would be a greatr help to me if somebody let me know the steps I am doing are correct and what could be the ABAP CODE for that Exit.
    Thanks in anticipation

    Hi,
    use EXIT_SAPLQAAT_002 under importing parameters ...unser I_TQ32 ...check the values....
    and try to modify E_NO_INSPECTION under exporting parameters .
    Thanks,
    Shailaja Ainala.

  • ASCP: How do I get the list of 1st level planned orders using msc_full_pegging table

    How do I get the list of 1st level planned orders using msc_full_pegging table, is any one having the script.

    Do you mean supply_type? If so, yes it will be in pegging table as supply_type or otherwise you can join this table with msc_supplies by joining transaction_id column and get the order_type from that which will be the supply type.
    Thanks,
    Abhishek Sharma
    P.S:- Try opening the discussion in a separate window and see if you get the option to mark it correct or helpful,

  • Why do I receive this message? The Adobe Acrobat Reader that is running cannot be used to view PDF files in a browser. Please exit Adobe Acrobat Reader and your web browser and try again.

    The Adobe Acrobat Reader that is running cannot be used to view PDF files in a browser. Please exit Adobe Acrobat Reader and your web browser and try again.
    == This happened ==
    A few times a week
    == Early this year

    See these KB articles:
    https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox
    https://support.mozilla.com/en-US/kb/Opening+PDF+files+within+Firefox

  • Can't select an image to use for a signature in Reader XI

    Using Adobe Reader XI, I can't select an image to use as a signature.  I have an image saved as a JPEG, but using an image is never an option.  I only see the option to use a certificate.
    Help!

    A signature in a PDF is a digital signature. It consists of metadate, and not an image or physical signature.

  • Select planning level for forecast caluculation manually

    Dear all,
    In S&OP on HANA we would like to run the forecast on a more aggregated level than the base planning level.
    The base planning level in the input/output key figure of the forecast profile is supposed to be lower than the level which should be used for forecast calculation. If the filter in the forecast profile menu is set to the higher level, the forecast is still calculated on the base planning level and aggregated according to the settings in the key figures.
    Is it possible to manually define the planning level the statistical forecast is supposed to be run on?
    Thank you in advance!
    Jamie

    Hi Nikhita
    There is a transaction " define planning levels for logistic". In this step you allocate transaction from MM and SD to the planning levels you ahve defined.  this allocation is neccessary since the system cannot determine planning level  by using master record fields as it does to access data from FI.
    In FI planning level for G/L is specified in  G/L master.  However a business transaction in logistics is represented by an Internal ID
    1 = PR
    2 = PO
    3 = Scheduling agreement
    you must assign these transactions to a plannning level  in CM
    T-code :- Financial Supply Chain Management> Cash and Liquidity Management>Cash Management>Structuring>Define planning levels for Logistics
    Please let me know if you ahve done this setting. Would advise you to revisit your config for INT code - level- Planning group.
    Hope this helps. Please let me know if you still cant get around.
    Thanks
    Sanjeev

  • Ability to call selection profiles in planning book using popup box

    Hello does anyone know if it is possible to call a selection profile in a planning book using a popup box?
    i.e. perhaps using a macro ?
    Any help is greatly appreciated.
    Thanks
    Edited by: Ballance Agri-Nutrients on Feb 17, 2009 3:10 AM

    Just wondering what is the business need this pop-up, based on user settings list of selection profiles already filtered and displayed in the planning book. User can select the profile just by clicking the list of selection profiles provided.
    For the web enabled users, they can select data view, and selection profiles before they view the planning book screen. Check with your technical person they should be able to tell you if the same can be used and built a pop-up.
    Hope this helps

  • ASAP :: Variables used in planning Level

    Dear All ,
    I m using variable for each characteristics in Planning Level. This level further is used for Web Interface. Would like to know if in this case if i use Planning variable's in Level  ,, will it  affect in performance ????????????
    Regards
    Anup Singh

    HI
    It will not effect in Performance much. It is advisable to use variables only. (There are so many other advantages using variables). It is not advicable to fix the values for characteristics  in planning level until and unless u are confident that the value will not change. For eg: Fisc Yr Varnt , u can fix as K4 etc.
    srin

Maybe you are looking for