Error in BAPI_SALESORDER_CHANGE -- Enter The Profit Center

Hi All,
Am Creating Sales Order using BDC and getting Sales order number and uploading it's  Item text using
BAPI_SALESORDER_CHANGE , But am getting error as please enter profit center for last record in Bapireturn and text is not getting updated.
Everything is correctly uploaded with material number and profit center for sales order,
while uploading it's item details text error occurs for last record as
please enter profit center .Remaining Sales order text is getting uploaded ..
May i know why this occurs and how to solve it ...

Hi Santhosh
Have Pasted my Code here for your reference ..
\FORM createtext_bapi.
DATA: t_posnr LIKE vbap-posnr occurs 0 with header line.
data: begin of t_posnr occurs 0 ,
      vbeln like vbap-vbeln,
      matnr like vbap-matnr,
      posnr like vbap-posnr,
      end of t_posnr.
DATA: ORD_TEXT LIKE BAPISDTEXT OCCURS 0 WITH HEADER LINE.
DATA : TEXT(125) TYPE C.
DATA: SOHEADER LIKE BAPISDH1.
DATA: SOHEADERX LIKE BAPISDH1X .
DATA: SORETURN  type table of bapiret2 with header line.
DATA: I_ITEM LIKE BAPISDITM OCCURS 0 WITH HEADER LINE.
DATA: I_ITEMX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE.
  DATA:w_item(6) value '000000'.
  DATA:w_item1(6) value '000010'.
  loop at  itab1.
  clear w_item.
   loop at it_sord where salesorder = itab1-salesorder.
      w_item = w_item + w_item1.
      unpack w_item to w_item.
*****HEADER
  SOHEADERX-UPDATEFLAG = 'U'.
****LINE ITEM
I_ITEM-ITM_NUMBER = w_item.
APPEND I_ITEM.
I_ITEMX-ITM_NUMBER = w_item.
I_ITEMX-UPDATEFLAG = 'U'.
APPEND I_ITEMX.
****LINE ITEM TEXT
ORD_TEXT-DOC_NUMBER = it_sord-salesorder.
ORD_TEXT-ITM_NUMBER = w_item.
ORD_TEXT-TEXT_ID    = '0001'.  " IN SO MATERIAL SALES TEXT
ORD_TEXT-LANGU      = 'EN'.
ORD_TEXT-FUNCTION = '004'.
CLEAR : TEXT.
       concatenate  s_date  it_sord-s_date into ORD_TEXT-TEXT_LINE."
       append ORD_TEXT.
     clear ORD_TEXT.
     concatenate  s_time  it_sord-s_time into ORD_TEXT-TEXT_LINE."
      append ORD_TEXT.
     clear ORD_TEXT.
     concatenate  e_date  it_sord-e_date into ORD_TEXT-TEXT_LINE."
      append ORD_TEXT.
     clear ORD_TEXT.
     concatenate  e_time  it_sord-e_time into ORD_TEXT-TEXT_LINE."
      append ORD_TEXT.
     clear ORD_TEXT.
     concatenate  pickup  it_sord-pickup into ORD_TEXT-TEXT_LINE."
      append ORD_TEXT.
     clear ORD_TEXT.
    concatenate  despt  it_sord-despt into ORD_TEXT-TEXT_LINE."
      append ORD_TEXT.
     clear ORD_TEXT.
*APPEND ORD_TEXT.
             CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
               EXPORTING
                 salesdocument               = it_sord-salesorder
                 ORDER_HEADER_IN             = SOHEADER
                 order_header_inx            = SOHEADERX
               tables
                 return                      = SORETURN
                ORDER_ITEM_IN               = I_ITEM
                ORDER_ITEM_INX              = I_ITEMX
                ORDER_TEXT                  = ORD_tEXT.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT = 'X'.
   refresh ORD_TEXT.
READ TABLE SORETURN WITH KEY TYPE = 'E'.
IF SY-SUBRC = 0.
WRITE:/1 ' SO TEXT CHANGE  NOT UPDATED',
           itab1-salesorder, SORETURN-MESSAGE. "SORETURN-row ,
*SORETURN-number,
*SORETURN-MESSAGE_V1.
ELSE.
WRITE: ' SO TEXT CHANGE    UPDATED'.
ENDIF.
refresh:ORD_tEXT.
endloop.
endloop.
ENDFORM.                    " createtext_bapi

Similar Messages

  • Error While deleting the Profit Center

    Hi I am getting the below error while  deleting the Profit center. Please help me how to fix this issue...
    Profit center Scenario was activated in New GL Accounting
    what configurations do i need to change to fix this error? Kindly advise me..
    Thanks
    Kishore

    Dear,
    while deleting  the profit center we have to requrie follow the steps
    1) OBR1 - Reset Transaction data
    2)OBR2 - Reset the master data
    3)OKKS - Set Controlling Area
    4)OKC3 - Delete Transcation Data
    5) KL14 - Delete Activity Types
    6)OKE5 - Profit center De - Active
    7)OKE1 - Profit center Transcation data delete
    8)OKE2 - profit center delete
    if if you follow above steps easily we can make the delete the profitcenter and we donot have to activate profitcenter
    i hope solve you r problem
    With regards /G chandu

  • Error Message-- For Balancing field "Profit Center" is not filled

    Hi All,
    When I do Shipment Start get Error-Message for Balancing field "Profit Center" is not filled!
    A PGI for the DNXXXXXXXX is not possible!
    Can u please help me how to resolve this issue ?
    WM Baby

    Hi,
    AS per configuration , there is prifit centre assignment  .Enter the profit centre in the field of profit centre by the help opf F4.
    Regards,
    Andra

  • How to make the Profit Center Field Mandatory in Cost center Master Data

    Dear All,
    Please let me know how to make the Profit Center Field mandatory in Cost Center Master Data as well as my Internal Order Master Data?
    Thanks in advance!
    Regards,
    Rajeswari Shankar.

    Hi Rajeswari,
    You can modify message number KS096 to "Error" via OBA5. Thus, the users would no be able to save a cost center without entering a profit center. (Depending on your release you can make KS096 modifiable by implementing note 486781.) 
    Concerning the internal orders (transaction KO01), you can run KOT2 and set Profit center field as required entry in "change field selection" section.
    Regards,
    Greta

  • Error: (GLT2 201) Balancing field "Profit Center " in line item 001 not fi

    Hi All,
    While trying to upload a MT940 bank statement thru FF_5 am facing this error " Error: (GLT2 201) Balancing field "Profit Center " in line item 001 not filled".
    Can any one let me know how to overcome this error.
    Thanks and Regards
    SrihariBolla

    Hi
    Document Splitting is active in your Company Code.
    Hence while doing posting it is mandatory to give Profit Center.
    If you dont enter profit center during postings it will throw errors like this Balancing field "Profit Center " in line item 001 not filled.
    Go to Img -->FinancialAccounting(new) -->General Ledger Accounting(new) -->Business Transactions -->Document Splitting -->Define Document splitting characteristics in General Ledger Accounting
    Deselect the Mandatory Field CheckBox for Profit Center and save.
    Now you will be able to Upload.
    Regards
    Venkat

  • Deriving the profit center / segment during Bank Reconciliation

    Hi SDN,
    One of our requirements is to generate a Financial Statement by Segments.
    For this reason, we also need to derive / tag our Bank Reconciliation documents (Manual and Electronic) to the corresponding profit centers or segments. The problem though is that during FF67 or FF_5, there's no way we can enter these data.
    At the same time, we can't set a default profit center via FAGL3KEH since these bank accounts may be used for multiple profit centers and not defaulted to one only.
    My question now is, can we use the document splitting functionality so that we can "inherit" the profit center / segment from the payment document during bank recon?
    To give you an idea here's a sample flow of what we wanted.
    Customer Invoice (GL view)      - OK in the system
    Dr  Accounts Receivable  (profit center 1) *inherited
    Cr  Revenue Account (profit center 1)
    Incoming Payment (GL view)     - OK in the system
    Dr Incoming Clearing (profit center 1)
    Cr Accounts Receivable (profit center 1)
    Bank Reconciliation        
    Dr Main Bank             (profit center 1)
    Cr Incoming Clearing (profit center 1)
    Currently, system does not inherit the bank reconciliation document to the right profit center. Is there any way we can do this in the system?
    Thanks

    Dear,
    During bank Reco system inherit the Profit Center from the document which it is clearing. There is no need to maintain Default the same in FAGL3KEH.
    Please activate splitting at Profit Center level.
    Hope this helps!!
    Br,Vivek

  • Requirement to populate the Profit center field of Vendor line item thru...

    Hi,
    My requirement is to populate the Profit center field of Vendor line item.
    For this, I want to write a substitution where based on the Business Area of Vendor line item, the system should populate the Profit center while saving.
    Is it possible thru Validation & Substitutions...
    Plz guide me in writing this
    Points will be suitable rewarded for replies.
    regards
    AVM

    Tcode: GGB1
    An example shows how to make a G/L account available for line item substitution.
    GGB1
    Click FA – Doc Header
    Click Create Substitution icon
    Enter the Text
    Click Create Step icon
    Click the field u want – Say - BKPF- BKTXT
    Choose the option – Say :Constant value
    Give description of ur step
    Click Prerequisite
    Double Click Structure BKPF
    Double Click BKPF-AWKEY
    Click Constant button
    Enter the Text u want to make it appler in the Reference key
    Click Substitution and enter the constant value u want
    Go to Tcode: GGB4
    Click Substituted Fields
    Give ur table and field (Here - BKPF- BKTXT)
    Do it in a similar way..if u cannot proceed, let me know the exact field values..and i can take screenshots and send u across
    Thanks,
    Sridevi

  • MM 335 "You want to change the profit center...'

    Hi guys,
    in a material master I have the field profit center blank and I want enter a value but the message MM 335 '"You want to change the profit center but material stock still exists"...I have implemented OSS notes for release 6.03 but the message continues to go out..the stock for the Plant in which I want enter Profit center does not exist, is it correct that this message goes out?In your opinion which is the correct way to update material master?I have tried to transfer all stock present in all Plants on which that material is opned with mov type 309 but the message go out again..It is a strange thing , I don' think taht the unique way is to chenge the nature of message from E to W..
    thanks in advance for your attention
    Bye

    Stock may be there still under Plant Stock and  Storage Location stock, in previous period.
    TO make it Zero do the following things
    If previous period stocks exist, you can make a withdrawal posting as follows:
    1. Post the same amount to current period stock (for example, using movement type 561) so that previous period stock and current period stock are identical.
    2. Make a withdrawal posting in the previous period for the stock together with posting date (for example, using movement type 562).
    Hope the steps will help to resolve the problem.

  • How to manipulate the profit center in the prod order within an mto-flow

    Hello,
    It is allowed in the sales order to change the profit center. I want to copy the entered profit center from my sales order to the profit center of my linked production order which has been created automatically.
    I tried already some user-exits (enhancements PPCO000?) but it doesn't work. Who can help me solving this problem?
    Many thanks for helping,
    Bart

    Dear,
    Maintain the Profit Centre in Costing 1 View of Material Master.
    Then it will be defaulted into the Production Order.
    Profit center can be entered at the item level in the sales order T.Code: VA01, in the Account Assignment Section.
    If Profit Centre is maintained in Material Master Data, in Sales: General / Plant data, then the same will default in sales order.
    Regards,
    R.Brahmankar

  • How to find the profit center group for a profit center?

    How to find the profit center group for a profit center?

    Hi,
    try this also
    In order to pass the setid parameter of the FM, you have to concatenate the following things
    Setid + KOKRS (Controlling area) + Profit Center Group into one variable.
    In my example below, I have declared as constants and concatenating to gv_setid.
    gc_01016 is the set id for profit centers
    gc_kokrs is the controlling area
    gp_pprct is the Profit Center group entered in the selection screen.
    You will get KOKRS value from the cepc-kokrs.
    data :   gc_0106(4)   TYPE c VALUE '0106',
               gc_kokrs      LIKE cepc-kokrs VALUE 'ABCD'.
               gv_setid          LIKE sethier-setid,
               gt_set_values_1   LIKE setvalues OCCURS 0 WITH HEADER LINE.
      CONCATENATE gc_0106  gc_kokrs gp_pprct INTO gv_setid.
      CONDENSE gv_setid.
      CALL FUNCTION 'G_SET_TREE_IMPORT'
        EXPORTING
          client                    = sy-mandt
          fieldname                 = 'RPRCTR'
          langu                     = sy-langu
          setid                     = gv_setid
          tabname                   = 'GLPCT'
          no_table_buffering        = 'X'
        TABLES
          set_values                = gt_set_values_1
        EXCEPTIONS
          set_not_found             = 1
          illegal_field_replacement = 2
          illegal_table_replacement = 3
          OTHERS                    = 4.
    By using the above FM you will get the values into gt_set_values1 once sys-subrc value eq 0, it is internal table which consists of all the profit centers for the proft center group.
    Regards,
    Venkatesh

  • Change the profit center in the material master

    dear All,
    we need to change the profit center but the system is not letting because the is stock.
    i was thinking if we issue this stock on any cost center, change the profit center and then cancel the issuing material document ...
    what do you think ,,,, would this effect the accounting badly ?? if so,, please recommend other ways

    tej yadav wrote:
    Hi, The only solution to change the "PROFIT CENTER"  for you will be to maintain message MM335 in OMT4 as a warning, then change the Profit center & again change it to error.
    Are you really thinking this is the right approach?
    ever thought about how the posting are made in the other modules then? We dont live on an MM island, so a solution  has to cover the requirements of the connected modules as well.
    if you had received stock to a material with profit center A, then value is posted to profit center A.
    if you change the profit center  in material master to B while you have stock, the value of earlier receipts will not move from profit center A to B, they stay at A.
    The next goods issue for this material is made against the profit center B.
    this results in having a postive value at profit center A (which will never go away) and having a negative value at profit center B (because you had never received to profit center B what you just issued)
    Because of this you should not change the message settings.
    Florian LINTNER wrote:
    Hi!
    >
    > post the goods issue in the prior period.
    > Change the profit center.
    > And post a new goods entry with the date of today..
    >
    > regards
    > flo
    you cannot issue anything in the prior period if everything is already issued in the current period.
    One should obtain the quantityof previous period in material master accounting view.
    Finally you have to have zero stock in current and previous period before changing profit center.
    How you approach this is based on the fact if the current period stock is bigger or smaller than the previous period stock.
    if current period stock is bigger, then issue previous period stock with previous peiod date, and issue remaining stock in current period.
    if current period stock is smaller than previous period stock, then you have to write on the delta in the current period, and subsequent issue the total stock in the previous period.
    seesen_rs wrote:
    Your approach is right. when we had this issue we solved through created dummy material and issue it to dummy material, change the profit center and receive it back..
    >
    > Both options dont affect the accounting.
    Goods issue to cost center or goods movement 309 to a dummy material will both affect accounting and create accounting documents.
    of course, if everything works well then you will get  accounting documents with opposite value after you have changed the profit center and you write on the quantity again.

  • Change the profit center of the cost center.

    Hi Friends,
    I want to change the profit center of the one cost center but system is not allowing because the posting done against this cost center. i transfer the value of that cost center in other cost center then i tried but system dose not allow.
    following error is coming.
    Changing profit center from 101257 to 101271 is not permitted
    Message no. FAGL_ORG_UNITS011
    please provide the solution.
    Regards,
    MAhesh

    HI,
    system behaviour is explained in SAPNET note 1358080, there you find also how to change the message. Check the consequences carefully in test client...
    best regards, Christian

  • Accounting error : Posting not possible for profit center XYZ In company Z

    HI folks,
    Do any of you have come accross this error in passing of billing doc to accounting " Posting not possible for profit center 153 in company code Z134. Kindly let me know what could be the possiblity and the solutions
    Thanks,
    Kamal

    Hi,
    Might just be better off to take the guidance from your FI guys. Pl. check if all the assignments are made correctly, like the material is linked with a profit center and this profit center to a cost center and finally to the controlling area. Also check if the currency of the profit center is the same as the controlling area currency.
    Regards
    Sadhu Kishore

  • Using BADI for changing the Profit Center in FI Document during MIRO

    Hi,
    We have an requirement of changing the profit center in FI/CO Document while doing MIRO which is different than the one which is posted at the time MIGO.The system is not allowing us to do this and the field profit center during MIRO is not changeble mode and the business requirement is to change this through any SAP enhancements or program.
    How can I do this ?
    Is there is any standard BADI or User Exit is available for this.
    Pleease help me in this and will give valuable points.

    Hey,
    Use the BADI INVOICE_UPDATE and try with this. Otherwise you try to create Enhancement point to implement your code.
    Note: Inside BADI we can't change the runtime value. So, try to use enhancement point.
    Rewert back for any clarification.
    Regards,
    Saravanan M

  • PS Report with the Profit Center

    Hi All
    Is there a standard PS Report that will give me values as per the hierarchial structure of the WBS Element and additionally the Profit center also as an output.
    Thanks much
    RS.

    Hi
    Some times we do go beyond the question. You can say addon package on foc basis. :). let us not get into aurguement mode and try to share our best experiences to members. There are so many ways and means to accomplish the output so every one is sharing their experiences. By looking at all those possibilities its amazing to see such different approaches being followed.
    In my opinion your answer is the best answer in releavnce to the question. You know one thing CN41N is the best report in my opinion still it does not have field PC to view.
    Regards,
    PSR
    Edited by: PSR on Nov 18, 2011 2:33 AM

Maybe you are looking for