KP06 : BAPI_COSTACTPLN_POSTPRIMCOST problem

Hi,
I am using BAPI "BAPI_COSTACTPLN_POSTPRIMCOST"  to uploaded Plan fixed cost & actual fixed cost.
Now i am passing value in BAPI as
Ex: Plan fixed cost period 1 = 10.
      Plan fixed cost period 2 = 10.
&   Plan variable cost period 1 = 10.
final output in KP06 is :
      Plan fixed cost period 1 = 20.
      Plan fixed cost period 2 = 20.
can any one tell me why this value is summing up.
please find code below :
*& Report  ZSOU_TEST
REPORT  ZSOU_TEST.
data : HEADERINFO LIKE  BAPIPLNHDR.
data : INDEXSTRUCTURE like BAPIACPSTRU occurs 0 with header line.
data : COOBJECT like BAPIPCPOBJ occurs 0 with header line.
data : PERVALUE like BAPIPCPVAL occurs 0 with header line.
data : RETURN like BAPIRET2 occurs 0 with header line.
HEADERINFO-CO_AREA = 'SD00'.
HEADERINFO-FISC_YEAR = '2008'.
HEADERINFO-PERIOD_FROM = '001'.
HEADERINFO-PERIOD_TO = '012'.
HEADERINFO-VERSION = '0'.
*HEADERINFO-DOC_HDR_TX
HEADERINFO-PLAN_CURRTYPE = 'C'.
INDEXSTRUCTURE-OBJECT_INDEX = '000001'.
INDEXSTRUCTURE-VALUE_INDEX = '000001'.
append INDEXSTRUCTURE.
COOBJECT-OBJECT_INDEX = '000001'.
COOBJECT-COSTCENTER = 'US00401100'.
append COOBJECT.
PERVALUE-VALUE_INDEX = '000001'.
PERVALUE-COST_ELEM = '501000'.
*RESOURCE
*TRANS_CURRENCY_ISO
*TRANS_CURR
*UNIT_ISO
*PERVALUE-UNIT_OF_MEASURE = 'EA'.
PERVALUE-FIX_VAL_PER01 = '10.00'.
PERVALUE-FIX_VAL_PER02 = '10.00'.
*PERVALUE-FIX_VAL_PER03 = '10.00'.
*PERVALUE-FIX_VAL_PER04 = '10.00'.
*PERVALUE-FIX_VAL_PER05 = '10.00'.
*FIX_VAL_PER06
*FIX_VAL_PER07
*FIX_VAL_PER08
*FIX_VAL_PER09
*FIX_VAL_PER10
*FIX_VAL_PER11
*FIX_VAL_PER11
*FIX_VAL_PER12
*FIX_VAL_PER13
*FIX_VAL_PER14
*FIX_VAL_PER15
*FIX_VAL_PER16
PERVALUE-VAR_VAL_PER01 = '10.00'.
*PERVALUE-VAR_VAL_PER02 = '10.00'.
*PERVALUE-VAR_VAL_PER03 = '10.00'.
*VAR_VAL_PER04
*VAR_VAL_PER05
*VAR_VAL_PER06
*VAR_VAL_PER07
*VAR_VAL_PER08
*VAR_VAL_PER09
*VAR_VAL_PER10
*VAR_VAL_PER11
*VAR_VAL_PER12
*VAR_VAL_PER12
*VAR_VAL_PER13
*VAR_VAL_PER14
*VAR_VAL_PER15
*VAR_VAL_PER16
*PERVALUE-FIX_QUAN_PER01 = '5.00'.
*PERVALUE-FIX_QUAN_PER02 = '5.00'.
*FIX_QUAN_PER03
*FIX_QUAN_PER04
*FIX_QUAN_PER05
*FIX_QUAN_PER06
*FIX_QUAN_PER07
*FIX_QUAN_PER08
*FIX_QUAN_PER09
*FIX_QUAN_PER10
*FIX_QUAN_PER11
*FIX_QUAN_PER12
*FIX_QUAN_PER13
*FIX_QUAN_PER13
*FIX_QUAN_PER14
*FIX_QUAN_PER15
*FIX_QUAN_PER16
*PERVALUE-VAR_QUAN_PER01 = '11.00'.
*PERVALUE-VAR_QUAN_PER02 = '11.00'.
*PERVALUE-VAR_QUAN_PER03 = '11.00'.
*VAR_QUAN_PER04
*VAR_QUAN_PER05
*VAR_QUAN_PER06
*VAR_QUAN_PER07
*VAR_QUAN_PER08
*VAR_QUAN_PER09
*VAR_QUAN_PER10
*VAR_QUAN_PER11
*VAR_QUAN_PER12
*VAR_QUAN_PER13
*VAR_QUAN_PER14
*VAR_QUAN_PER15
*VAR_QUAN_PER16
*FUND
*FUNCTION
*GRANT_NBR
append PERVALUE.
*INDEXSTRUCTURE-ATTRIB_INDEX
CALL FUNCTION 'BAPI_COSTACTPLN_POSTPRIMCOST'
  EXPORTING
    HEADERINFO           = HEADERINFO
   DELTA                = 'X'
  TABLES
    INDEXSTRUCTURE       = INDEXSTRUCTURE
    COOBJECT             = COOBJECT
   PERVALUE             = PERVALUE
  TOTVALUE             =
  CONTRL               =
    RETURN               = RETURN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
  WAIT          =
IMPORTING
  RETURN        =
write 'done'.           .

Hello,
If you use DELTA = 'X' then the BAPI summing up the value.
Thierry

Similar Messages

  • KP06 Download problem

    Hi All,
    I am using ECC 6.0.
    I want to automate the process of downloading data from Kp06 to Excel.
    Process: KP06 tcode.
    When I click on the Overview Screen button on KP06 tcode it takes us to excel format. From there i need to download the data to PC.
    But When i click on save button it does not happen as desired. So i am unable to catch in Batch and proceed further.
    Help required on this.
    With advance thanks
    praveen

    Hi,
    I'm now in this exact situation as you were, and i see this thread is answered,
    Kindly please share with me the solution.

  • Problem with KP06 Tcode

    Dear ALL,
    I Have one problem, that is when i Goto KP06 Tcode, it will give me information message "Fund Accounting active: Layout 1-101 is unsuitable" . Becase of this i am not able to enter planned values. please let me know how to solve this problem.
    Regards
    Manohar

    Hi,
    You seems to have activated funds management in your company.
    Change your planner profile by using T code KP04.
    Change it from SAPALL to SAPFUND. This may help you. Revert the result.
    Regards,
    Jagadeesh S

  • LSMW problem (KP06)

    Hi SAP,
    I have created LSMW to upload budget (Txn: KP06). But when i upload the budget i received error message "Field BDC03(12) does not exist in the screen SAPLKPP20110". I am using ECC6 now. There's no problem when i upload the budget in 4.6C before. I just want to know what is the error message means for?
    For your info, it stucked at field WKF (eg: January, February, etc.) when i upload the budget in period screen (KP06). Please help me. I will give points for those who helps me out this problem.
    TQ
    Regards,
    Nazrul

    Hello,
    To do integrated excel upload of cost center plan data.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Manual Planning User Defined Layouts - Create your own layout or copy from standard layout and change it.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Define User Defined Planner Profiles
    Copy the SAPALL to ZSAPALL. You cannot change SAPALL as it is standard.
    In ZSAPALL planner profile, select proper planning area and enter your layout.
    Tick Integrate Excel.
    Once the popup for KP06 comes, you need enter the data and save it. It would generate the file name.
    With the same file name you need upload the plan data by using KP06.
    In KP06
    Extras ==> Excel Planning ==> Upload
    Select the file as prepared in accordance with format at the time of generating the file name.
    Hope this solves your problem.
    Regards,
    Ravi

  • KP06 Planning Excel Problem

    Hi All, I have issue withn KP06 Planner Profile with Excel Uploading,when I do Excel Uploading it is working well but once I
    verify the results I came to know only few months got uploaded eventhough I have
    numbers for all 12 months in my uploaded excel file,what is making the system to take only few months instead od taking
    all 12 months, Please help me,
    Thank you ,
    Sandhya

    Hi,
    cost center / activity type / cost element master data (all can be planned in KP06) are all time dependent. Please check if one of the master data has limited validity during your planning period. >If yes, plan data can not be uploaded if the validity period is not hit.
    Another constellation is:
    Cost center "A" to be planned is valid for half the planning period with cost center category "A" and the other half planning period with cost center category "B".
    Activity type to be planned is valid the whole planning period with cost center category "A". You will not be able to post/upload plan data for cost center / act. type  for the time intervall the cost center is assigned to cost center category "B".
    best regards, Christian

  • Problem in Recroding KP06 tcode

    Hi Gurus,
    I want to download the data which will be displayed in Kp06 in excel sheet.
    But KP06 will show different layouts.
    How can I record the KP06 and how can i pass different values to different layouts.
    Is there any alternative to download the data from Kp06 for different layouts using any FM or any other.
    Thanks in advance.
    With Warm Regards,
    Praveen Kumar M

    Hi,
    I'm now in this exact situation as you were, and i see this thread is answered,
    Kindly please share with me the solution.

  • Problem with long text

    Hi folks,
    iam uploading longtext in transaction KP06 in bdc programing using create_text.
    now my problem is if i pass selection criteria
    case 1:
    Vertion : N0
    fiscal year : 2007
    planner profile: CCPLAN4
    then the budeget plan data uploading successfully along with long text.
    case2: Vertion : N1
    in this case also everthing wrking fine
    case3: Vertion : 001
    in this case budgetplan data uploading sucessfully but longtext is not uploading,
    i debbug the proragm , create_text also returning sy-subrc = 0. but if i check in KP06  the long text is not there.
    data declaration
    vertion : VERSN type C(3)
    can u tell me the problem is in logic or with FM ?
    note : i checked with save_text also.
    regards
    neeru

    HI Naimesh,
    the FM Create_text internally contains both FMs save_text and commit_text,
    even i debug the FM in case of vertion N1, N0 and 001,
    all the cases sy-subrc = 0.
    code:
    CLEAR G_OBJNR.
    LOOP AT RECORD.
    COST = RECORD-BDC01.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = COST
        IMPORTING
          output = COST.
        CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.
            SELECT SINGLE * FROM COSP WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
      IF SY-SUBRC = 0.
          LEDNR = COSP-LEDNR.
          OBJNR = COSP-OBJNR.
          GJAHR = COSP-GJAHR.
          WRTTP = COSP-WRTTP.
          VERSN = COSP-VERSN.
          KSTAR = COSP-KSTAR.
          HRKFT = COSP-HRKFT.
          VRGNG = COSP-VRGNG.
          VBUND = COSP-VBUND.
          PARGB = COSP-PARGB.
          BEKNZ = COSP-BEKNZ.
          TWAER = COSP-TWAER.
    CONCATENATE LEDNR OBJNR INTO OBJNR.
    CONCATENATE OBJNR GJAHR INTO TNAME1 separated BY SPACE10.
    CONCATENATE TNAME1 WRTTP VERSN INTO TNAME2.
    CONCATENATE TNAME2 KSTAR INTO TNAME3 separated BY SPACE.
    CONCATENATE TNAME3 VRGNG INTO TNAME4 separated BY SPACE4.
    CONCATENATE TNAME4 BEKNZ INTO TNAME5 separated BY SPACE10.
    CONCATENATE TNAME5 TWAER INTO TNAME.
    I_THEAD-TDOBJECT = 'CCSS'.
    I_THEAD-TDID = 'COSP'.
    I_THEAD-TDNAME = TNAME.
    I_THEAD-TDSPRAS = 'E'.
    APPEND I_THEAD.
    i_tline-tdformat = '*'.
    I_TLINE-TDLINE = RECORD-LONGTEXT.
    APPEND I_TLINE.
    loop at i_thead.
    CALL FUNCTION 'CREATE_TEXT'
      EXPORTING
        FID               = I_THEAD-TDID
        FLANGUAGE         = I_THEAD-TDSPRAS
        FNAME             = I_THEAD-TDNAME
        FOBJECT           = I_THEAD-TDOBJECT
      SAVE_DIRECT       = 'X'
      FFORMAT           = '*'
      TABLES
        FLINES            = i_tline
    EXCEPTIONS
      NO_INIT           = 1
      NO_SAVE           = 2
      OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CLEAR I_TLINE.
    REFRESH I_TLINE.
    CLEAR I_THEAD.
    REFRESH I_THEAD.
      SELECT SINGLE * from cokp into itab WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
    if sy-subrc = 0.
       itab-TXFLG = 'X'.
       append itab.
       write:/ 'Text saved for', record-bdc00 , record-bdc01.
       else.
          write:/ 'Text saved for', record-bdc00 , record-bdc01.
          ENDIF.
    ENDIF.
    my program wrking fine but the long text is not visible for vertion 001.
    regards
    niru

  • Run time error while executing KP06

    Hello All,
    A run time error is being returned when I execute the tcode KP06. After entering all required field such as cost elements, cost center / CCgroup, then I pressed period screen / overview screen ... and it went to abap dump ...
    FYI, I have upgraded to 4.7 to ECC system.
    Regards,
    Bharath.
    Moderator message: please do more research before asking, use ST22, search for SAP notes, check your custom enhancements.
    Edited by: Thomas Zloch on Aug 22, 2011 9:58 AM

    Ok. Look at the dump in ST22 and solve your problem.

  • Erro while saving KP06, system gives error message

    I have a issue with cost element planning.
    When requester is processing the transaction KP06, and he tries to save it, the system gives message stating Ledger 0 has fiscal year variant instead of V3
    Details of message is
    Ledger 0 has fiscal year variant instead of V3
    Message no. GI 174
    Diagnosis
    When transferring planning data, the receiver ledgers must have the same fiscal year variant as the sender system, since all planned periods are transferred and not just one period with a posting date. Therefore, the period cannot be converted.
    Procedure
    Compare the fiscal year variant of the sender system with the FI-SL fiscal year variant.
    You can access this in FI-SL Customizing by choosing Basic Settings Master Data -> Ledger (select the ledger specified in this message) -> Assign Comp.Cd/Comp. -> After selecting the company code, the system displays the assigned fiscal year variant.
    Note u2013 Although error is a u2018Greenu2019 error system is not allowing to post transaction.
    Although special purpose ledger is activated for LOCAL LEDGERS (i.e. for company code) and one of company code has been assigned).
    However Special Purpose ledger for this company code is not activated hence according to me there is no need to assign company code in special purpose ledger customizing.
    Please help

    Hi,
    In case of Active Integrated Planning, the Customization of all integrated Special Purpose Ledger has to match the Customizing in CO. If you want to copy plan data from CO into a ledger, the fiscal year variants must match.
    You need to correct the settings or deactivate the corresponding Ledger.
    Pls refer the SAP Notes : 433367 and 745240, you should be able to solve the problem.
    Pls revert back with update...
    Srikanth Munnaluri

  • Problem with selection fields in SAP Quick Viewer

    Hi Friends
    I am using SQVI t-code to develop the SAP queries. I have developed a query using tables KNA1, VBAK and VBAP. Initially I used customer number, customer name, city, document creation data, document type and document number as selection fields. Now I have removed customer name, city, document creation data, document type from selection fields.  I am executing this query through a Function module "RSAQ_REMOTE_QUERY_CALL". While passing the data to selection table, even after deleting the 4 selection fields, still I have to pass the sales document number positioning as 6. Is there any way to solve this and make its position as 2.
    I have gone through the FM "RSAQ_IMPORT_QUERY", there one table parameter O_DBSE will retrieve the values for selection fields are designed for that query, again its tedious process, I have create a customized function module and make the required changes. Instead of using this FM, is there any table which stores the data of the selection fields of a query. I have tried for the table and I failed to find that.
    Please help me in this regards
    Regards
    Praveen

    Hello, I am trying to create LSMW to upload KP06 also, we have been uploading by copying and pasting once we run the iverview layout and then save. The problem is that we can only do this by G/L account. We want to use one file to upload all. Can you give me some tips how you were able to accomplished. I am familiar with LSMW, but tcode KP06 behaves in different ways. Do you use the flexible upload to load the fiel thru LSMW? Can you tell me which fields you touch in KP06 when you were recording?
    Thanks You,

  • KP06 Cost center Planning

    HI all we have a issue with KP06 Plannig to Cost centers and Cost elements,using Excel Upload option we have
    our own layout maintained in KP66 ,report painter and assigned the same in to Planning layout,
    it shows uploaded correctly in kp06 but some how doesn't show any values or some time only few values out of 12 months,
    Please help me ,
    Thank you ,
    Sandhya

    Hi,
    It is hard to tell where the problem is, since you say the log shows the upload successful. I think some of the data which you see as uploaded may be entered manually by someone and may not be from your upload.
    I suggest you try the following (am not sure if already tried this), instead of creating the file from scratch:
    1. KP06 > Enter your parameters.
    2. Click on Overview (<F5>).
    3. Confirm macro warning with u201Cactivate macrosu201D if this message appears.
    4. Delete last line Cost Element Total. If necessary remove Excel worksheet protection for deleting these entries.
    6. From the menu, choose File -> Save Copy As and save the file as *.csv or *.txt.
    7. Make necessary changes to the file.
    8. Choose Extras -> Excel Planning -> Upload.
    9. Note that last line cost element (total) must be deleted in the file.
    Check the log...if successful check the report KSBL.
    Hope this helps.
    PS: Please don't open multiple threads for the same issue...

  • Funtional Area issue in KP06

    We have customized a planning layout in KP06, where we want to capture Actual cost along with planned figure. Actuals will be in display mode only at the time of making planning.
    Since we are also using functional area which is also defined in cost center master we are facing a problem where we are not getting the actual cost in case the document contains functional area either through cost center or cost element master. Only those doumcuments are captured in actual cost column where functional area is blank.
    The problem is there only when we are using KP06 (Cost center planning) layout to have the actual cost as well so that user can view the actual cost at the time of putting the planned values. In this layout actual cost is not coming, if the controlling douments contains functional area, even it is appearing in all SAP standard report's.
    Any solution in this reard will be of great help
    Thanks in advance
    Aseem Arora

    Check this note 902985
    This problem is caused by a program error. However, the error only occurs when the cost-of-sales accounting (and the update of the functional area) is active.
    Check also note 431167 which advises that not all transactions can be shown in actual.
    In particular, this means that during the course of Primary cost planning only the business transactions COIN (External postings), RKU1, RKU2, RKU3 (Manual repostings), KAZI (Accrual calculation), KOAO (Settlement of primary costs),     KZPI (Overhead rates),   are taken into account

  • Forecast for planning over the Cost element/Cost center with KP06

    Hi all
    I'm searching a idea: one of our chief controller need to insert a "forecast" of budget inserted over the various cost elements/cost centers using the transaction KP06. THe problem is that he don't want lost the budget because he can need the reload the previous budget data during the year if the actual situation change. Obvisiously the insertion of the forecast overwrite the budget data over the version 0. This forces us to download over a file the budget and archive it, and reload it eventually. But this solution, a part the programming effort, don't permit to have both the data at the same time in the system. Exist a pratical customizing solution in CO for manage a "forecast"? Our release is 46c.
    thanks
    Davide

    Thanks Pascal.
    Some questions (i dont' have a CO background ):
    >execute charge transferts and plan distribution in the new >version
    Can you explicate me these concepts (or the transaction used for make this, probably I know this but in italian the name is different)? The KP47 copy the value over the single cost element or only the total of cost center?
    >KP98 is the transaction to copy postings from version 0 to >another version. In this case version 0 is the template.
    Are you sure? The KP98 have the description "Copy by actual version to planned version", the KP97 "copy from planned to planned"
    thanks in advance
    Davide

  • Cost Center & Cost Element Excel Planning Profile Error - KP06

    Hi,
    I have created a layout for cost center/cost element planning.after that i have created planner profile.but while saving the generic file,i am getting the below error and not able to save that.Kindly advice me.
    A later upload is not possible with this layout
    Message no. K9363
    Diagnosis
    The layout cannot be used for an upload. This can be caused by one of the following situations:
    The layout does not contain a data field that is ready for input.
    The layout has a lead column that only contains the text for the characteristic value and not the characteristic value itself
    The layout contains formulas
    The layout has a complex lead column and contains empty lines.
    System response
    If generic file names have already been created (that is, an upload is intended), the file description cannot be saved.
    Procedure
    If you want to use the layout for an upload, configure it accordingly.
    If one of the last three situations is the case, the layout can only be used for manual planning and not for an upload. In this case, remove the generic file name.
    Thanks
    Supriya

    Hi Supriya,
    Can you please review the attached notes as they should fix the problem.
    489867     KP06 and following: Setting up an Excel upload
    319713     Error with Excel upload - possible causes
    Regards,
    Abhisek

  • Blank Excel 2007 sheet when I open KP06

    Hello,
    Has anyone encounter this problem were you run tcode KP06 and two excel sheet comes up? the excel sheet with your data but in addition a blank excel sheet? It is kind of annoying to get rid of it every time.
    We have Excel 2007
    We are running on 7.1 SAP version.
    We were fine up until two weeks ago. Is there something I have to do with SAP or Excel?

    No feed back, it appears that it is an SAP problem...

Maybe you are looking for

  • Calculation in Alv Report

    Hi SDN's I need to calculate Total(Cost1Cost2Cost3 = Total) in my alv report Date          Acc.no  Doc.Typ   Cost1  Cost2  cost3   Total 20061206   123        GG         121     23        45       ???? 20070203   405         BL         234     67    

  • How do I extract a substring when I know what become before and after it

    I am able to get the HTML source of a web page and I want to get certain information from it. I am trying to extract a 1 or 2 digit number but sometimes it is not there but I know that this comes exactly before the number if it exists or not "</td>  

  • Best way to Confirm a Delete

    I need some advice here. I have an application that will be used by large groups of people. This application allows Super Administrators (set in a database) to delete a group. A group has an administrator, a supervisor and students. Since it would be

  • Data structure similar to database table

    i have the need for a data structure that will essentially be the same as a database table. this "table" can be queried against and sorted. currently, i am using an interface to abstract this "table" datastructure, and implementing the interface via

  • Dynamic Headers in adobe form

    Hi, I want to display dates as headers  in my form.How can I implement this? I am using this form in a ABAP WD application. I was able to get statis text on multiple pages but dynamic text is only appearing one time. I have created a new content area