Changing Payment terms using Bapi

Hi Gurus,
     I want to change the Payment terms in Purchase order / Scheduling agreement Using Bapi.
    I used BAPI_PO_CHANGE.but Payment terms are not updating.
   Useful Answers will be rewarded with Points.

Did you use BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE.
Look also at this <a href="http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm">Sample Abap code on BAPI_PO_CHANGE</a>
  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      PURCHASEORDER = T_POHEADER-PO
      POHEADER      = T_BAPI_POHEADER
      POHEADERX     = T_BAPI_POHEADERX
    TABLES
      RETURN        = T_BAPIRETURN
      POITEM        = T_BAPI_POITEM
      POITEMX       = T_BAPI_POITEMX.
  READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
  IF sy-subrc NE 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = c_x.
  ENDIF.
Regards

Similar Messages

  • How to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?

    Can any body give me an idea on how to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?
    Regards,
    Dantham Conpolwedson

    Hi,
    try the link
    Link:[https://forums.sdn.sap.com/click.jspa?searchID=24060901&messageID=7265357]

  • BAPI/FM to Change Payment Terms ZTERM of FI Invoice

    Hi,
    I am trying to chnage Payment Terms(BSEG-ZTERM) using FM FI_DOCUMENT_CHANGE and FM FI_ITEMS_MASS_CHANGE but none of these FM is working.
    For FI_DOCUMENT_CHANGE it is giving error "You cannot change Payment Terms(ZTERM) and inFM FI_ITEMS_MASS_CHANGE it is not providing option to change Payment Terms (I have checked Coding of the FM FI_ITEMS_MASS_CHANGE).
    Can anyone guide me on this? How can I change Payment Terms(ZTERM) of FI Document.?
    Thanks.

    Sapan,
    My requirement is to Develop an Interface, through which you can change payment terms of Customer open line items.
    Manually in FB02 I am able to change the Payment Terms but when I am not able to change it using FM FI_DOCUMENT_CHANGE and FM FI_ITEMS_MASS_CHANGE.

  • Change Payment terms invoices

    Hi
    is it possible to change payment term in transaction VF01 or VF02 with standard SAP??

    Hi,
    Maybe you can try this userexit
    USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)
    This user exit is only called when the billing document is created. It is used to provide the header and the item of the new billing document with deviating or additional data
    Reward points if helpful
    Regards,
    Amrish Purohit

  • How to prevent change payment term in sales order?

    Hi,
    My client not allow sales admin. to change payment term in sales order. How to do this? (by standard SAP functions or authorization)
    Thanks & Regards,
    Jr.SD

    Either you can run T.Code shd0 or apply User exits in the program MV45AFZZ - USEREXIT_MOVE_FIELD_TO_VBAP to achieve this.
    thanks
    G. Lakshmipathi

  • How to allow a user to change Payment terms on A/R documents

    Hi All,
    I want to allow one of my user to change payment terms on A/R documents. I could'nt found it where to authorize a user for this purpose. Can anybody help me out with this?
    BR

    Dear Naveed,
    To enable users to change the Payment Terms in A/R, please give the user Full Authorization for Price Lists (Inventory -> Price Lists -> Price Lists).
    Hope this helps.
    Regards,
    Lorna

  • How to change Payment Terms in multiple orders at same time?

    How to change Payment Terms in multiple orders at same time?
    I have got 10,000 Order, I need to change the payment terms for all these Orders.
    Can I Know the way out for this.
    Regards,
    Dantham Conpolwedson
    Edited by: Dantham Conpolwedson on Mar 25, 2009 11:18 AM

    Hi
    There are as many options for that
    You can go for
    1)MASS t code
    2) LSMW  (by recording)
    3)BDC (by recording)
    and the most easiest way is by doing the MASS tcode
    goto MASS and enter the object type as BUS2032
    execute now select the sales order haeader data and execute and now enter the sales doc from and to range and execute now all the sales dox will be displayed
    and from the menu click on select fields  and select the terms of payment
    now select the terms of payment row and enter the new values  and click on carry out new changes
    regards

  • Change payment terms

    Hi,
    How do i change payment terms for an invoice after few installments have been made.
    ex.Lets say there is an invoice for Rs 500 and the number of installments to pay it is 2 250 for the first installment  and 250 for second installment.The first installment is made,Now the customer wants to change his installments to 3 for the remaining amount.Can this be donw in SBO.
    Thanks in Advance

    Dear Vikas,
    Yes I beleieve this can be done.
    Initially you set up the 2 Installments in the payment Terms Table and carry on with your Transactions like the Sales Order and the Delivery and create the A/R Down Payment invoice for say 50% and then make the payment for this 50% Amount WRT the A/R Down Payment Invoice. Now while you are creating the final A/R Invoice for the remaining amount in the accounting Tab go to the payment terms tab change the Installments to 3 and eneter the other relevant data. After this is done go to the Installmant tab and chane the Installments to 3.
    Hope this is helpful.
    Nagesh

  • Change vendor address using bapi

    Hi all,
    How to change vendor address using bapi.
    The address,and vendornumber coming from XL file.
    Based on the vendor number I want to change the address.
    Please give me the example.
    regards,
    rakesh.

    Hi Vijay,
    Please help me in the following.
    As Vendor/Customer Master dont have all the address fields ( like Street4-5), we use FM BAPI_ADDRESSORG_SAVEREPLICA to overcome this problem.
    In my case i have created one Custom load program to upload address data using
    BAPI_ADDRESSORG_SAVEREPLICA and then LSMW project to upload rest of the data.
    In this case when i upload rest of the data by LSMW using BI standard program ( having NODATA indicator "/" in my source file for the fields already uploaded using BAPI above) , address data which uploaded through FM should get populate automatically (by concept of Central Address management) but in my case <b>for some of the Account Group it is not getting populated,</b> please suggest.
    regards
    Sonal

  • How to change payment terms in FV70

    Hi All,
    I am trying to post FV70 Customer invoice park but system defaultly picking paymnet terms from master data, i want to change payment terms in FV70 but it displaying in graed mode, How to chage payment tems
    thanks & regards
    mohiddin

    Hi ,
    Go to T.code OB32 Path: SPRO >FA (New)> Financial Accounting Global Settings (New)> Document> Rules for changing document --> Document Change Rules, Document Header
    Select Document Change Rules, Document Header Execute button go to new entries  select Field name BSEG-ZTERM
    Account Type = A     Assets,D     Customers,K     Vendors,M     Material,S     G/L accounts
    Company Code = xxx
    Field can be change check box
    and  save
    Thanks,
    Raviteja
    Edited by: Ravi Teja.T on Feb 6, 2012 11:57 AM

  • Business Partner approval when changing payment term

    Hi Expert,
    Is it possible to set up approval process when user changing payment term in existing Business Partner?
    Thank you in advance.

    Hi,
    Try this:
    IF @object_type = '2' AND @transaction_type = 'U'
    BEGIN
         IF EXISTS
         (SELECT T0.CardCode from OCRD T0 INNER JOIN ACRD T1 On T1.CardCode=T0.CardCode
    WHERE CardCode = @list_of_cols_val_tab_del AND T1.GroupNum !=T0.GroupNum)
         BEGIN
               SELECT @error = 2, @error_message = 'Payment Terms should not be changed'
         END
    END
    Thanks,
    Gordon

  • Please provide me how change the Materil using BAPI...?

    Hi Guru's,
    could please provide me how change the Materil using BAPI...
    please provide the BPAI name and step by step process...
    if ou provide any program logic that would be helpfull to me...
    thanks in advance
    Srinivas....

    Hi,
    THis is code .
    *& Report Zs_MATMAS_BAPI
    *& This program demonstrates how easy it is to create Material master
    *& data using BAPI_MATERIAL_SAVEDATA
    *& The program also generates a report post-execution displaying errors
    *& as well as successful uploads
    REPORT Zs_MATMAS_BAPI.
    TABLES
    FLAGS *
    DATA: F_STOP. " Flag used to stop processing
    DATA DECLARATIONS *
    DATA : V_EMPTY TYPE I, " No. of empty records
    V_TOTAL TYPE I. " Total no. of records.
    STRUCTURES & INTERNAL TABLES
    *BAPI structures
    DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
    BAPI_MAKT LIKE BAPI_MAKT, " Material Description
    BAPI_MARA1 LIKE BAPI_MARA, " Client Data
    BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
    BAPI_MARC1 LIKE BAPI_MARC, " Plant View
    BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
    BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
    BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
    BAPI_RETURN LIKE BAPIRET2. " Return Parameter
    *--- Internal table to hold excel file data
    DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *--- Internal table to hold Matetrial descriptions
    DATA: BEGIN OF IT_MAKT OCCURS 100.
            INCLUDE STRUCTURE BAPI_MAKT.
    DATA: END OF IT_MAKT.
    *--- Internal to hold the records in the text file
    DATA : BEGIN OF IT_DATA OCCURS 100,
                WERKS(4), " Plant
                MTART(4), " Material type
                MATNR(18), " Material number
                MATKL(9) , " Material group
                MBRSH(1), " Industry sector
                MEINS(3), " Base unit of measure
                GEWEI(3), " Weight Unit
                SPART(2), " Division
                EKGRP(3), " Purchasing group
                VPRSV(1), " Price control indicator
                STPRS(12), " Standard price
                PEINH(3), " Price unit
                SPRAS(2), " Language key
                MAKTX(40), " Material description
                END OF IT_DATA.
    SELECTION SCREEN. *
    SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
    PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
    'C:\Material_master.XLS'.
    PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
    PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
    PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
    P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
    P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
    P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK SCR1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *--- Validating file
      PERFORM VALIDATE_FILE USING P_FILE.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--- Perform to convert the Excel data into an internal table
      PERFORM CONVERT_XLS_ITAB.
      IF NOT IT_DATA[] IS INITIAL.
    *--- Perform to delete Header lines
        PERFORM DELETE_HEADER_EMPTY_RECS.
      ENDIF.
    END OF SELECTION. *
    END-OF-SELECTION.
    *--- Perform to upload Material Master data
      PERFORM UPLOAD_MATMAS.
    Form : validate_input_file
    Description : To provide F4 help for file if read from PC
    FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = F_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC  0.
        MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
      ENDIF.
    ENDFORM. " validate_input_file
    *& Form CONVER_XLS_ITAB
    text
    FORM CONVERT_XLS_ITAB.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = P_FILE
          I_BEGIN_COL = P_BEGCOL
          I_BEGIN_ROW = P_BEGROW
          I_END_COL   = P_ENDCOL
          I_END_ROW   = P_ENDROW
        TABLES
          INTERN      = IT_INTERN.
      IF SY-SUBRC  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--- Perform to move the data into an internal data
      PERFORM MOVE_DATA.
    ENDFORM. " CONVERT_XLS_ITAB
    *& Form MOVE_DATA
    text
    FORM MOVE_DATA.
      DATA : LV_INDEX TYPE I.
      FIELD-SYMBOLS <FS>.
    *--- Sorting the internal table
      SORT IT_INTERN BY ROW COL.
      CLEAR IT_INTERN.
      LOOP AT IT_INTERN.
        MOVE IT_INTERN-COL TO LV_INDEX.
    *--- Assigning the each record to an internal table row
        ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS>.
    *--- Asigning the field value to a field symbol
        MOVE IT_INTERN-VALUE TO <FS>.
        AT END OF ROW.
          APPEND IT_DATA.
          CLEAR IT_DATA.
        ENDAT.
      ENDLOOP.
    ENDFORM. " MOVE_DATA
    *& Form DELETE_HEADER_EMPTY_RECS
    To delete the Header and empty records
    FORM DELETE_HEADER_EMPTY_RECS.
      DATA: LV_TABIX LIKE SY-TABIX.
      IF NOT P_HEADER IS INITIAL.
        LOOP AT IT_DATA.
          IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
            DELETE IT_DATA FROM 1 TO P_HEADER.
    P_HEADER = 0.
            EXIT.
          ENDIF.
        ENDLOOP.
      ENDIF.
      CLEAR IT_DATA.
    *--- To delete the empty lines from internal table
      LOOP AT IT_DATA.
        LV_TABIX = SY-TABIX.
        IF IT_DATA IS INITIAL.
          V_EMPTY = V_EMPTY + 1.
          DELETE IT_DATA INDEX LV_TABIX..
        ENDIF.
      ENDLOOP.
      CLEAR IT_DATA.
    *--- Total no of recs in file
      DESCRIBE TABLE IT_DATA LINES V_TOTAL.
      IF V_TOTAL = 0.
        MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
        F_STOP = 'X'.
        STOP.
      ENDIF.
    ENDFORM. " DELETE_HEADER_EMPTY_RECS
    *& Form UPLOAD_MATMAS
    to upload Material Master data
    FORM UPLOAD_MATMAS .
      LOOP AT IT_DATA.
    Header
        UNPACK IT_DATA-MATNR TO IT_DATA-MATNR.
        BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
        BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
        BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
        BAPI_HEAD-BASIC_VIEW = 'X'.
        BAPI_HEAD-PURCHASE_VIEW = 'X'.
        BAPI_HEAD-ACCOUNT_VIEW = 'X'.
    Material Description
        REFRESH IT_MAKT.
        IT_MAKT-LANGU = IT_DATA-SPRAS.
        IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
        APPEND IT_MAKT.
    Client Data - Basic
        BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
        BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
        BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
        BAPI_MARA1-DIVISION = IT_DATA-SPART.
        BAPI_MARAX-MATL_GROUP = 'X'.
        BAPI_MARAX-BASE_UOM = 'X'.
        BAPI_MARAX-UNIT_OF_WT = 'X'.
        BAPI_MARAX-DIVISION = 'X'.
    Plant - Purchasing
        BAPI_MARC1-PLANT = IT_DATA-WERKS.
        BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
        BAPI_MARCX-PLANT = IT_DATA-WERKS.
        BAPI_MARCX-PUR_GROUP = 'X'.
    Accounting
        BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
        BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
        BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
        BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEWX-PRICE_CTRL = 'X'.
        BAPI_MBEWX-STD_PRICE = 'X'.
        BAPI_MBEWX-PRICE_UNIT = 'X'.
    *--- BAPI to create material
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
        HEADDATA = BAPI_HEAD
        CLIENTDATA = BAPI_MARA1
        CLIENTDATAX = BAPI_MARAX
        PLANTDATA = BAPI_MARC1
        PLANTDATAX = BAPI_MARCX
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA = BAPI_MBEW1
    VALUATIONDATAX = BAPI_MBEWX
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA = BAPI_MVKE1
    SALESDATAX = BAPI_MVKEX
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
        IMPORTING
        RETURN = BAPI_RETURN
        TABLES
        MATERIALDESCRIPTION = IT_MAKT
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
        IF BAPI_RETURN-TYPE = 'E'.
          WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-MATNR.
        ELSEIF BAPI_RETURN-TYPE = 'S'.
          WRITE: 'Successfully created material' ,IT_DATA-MATNR.
        ENDIF.
      ENDLOOP.
    ENDFORM. " UPLOAD_MATMAS
    Thanks
    Sarada

  • How can we change payment terms in existing billing documents

    Hi all,
    we created a billing document with reference to delivery ,before creating accounting document for that billing someone deleted payment terms which are existing in that billing , so i tried to delete billing document and recreate by changing payment terms in sales order ,but while creating billing system throwing error as "update was terminated'.
    what is the best way to process this.
    Edited by: suresh saketh on Aug 27, 2010 2:54 AM

    Hi,
    It has happened billing index is not properly updated-
    check this snote -12934 - how to correct billing index
    Thanks
    Chidambaram

  • Bapi changing payment terms in purchase order

    hi to all abap gurus
    I want to change the Payment terms in Purchase order using bapi_po_change . can u pls give coding for this bapi with all required int tables declarations . points will berewarded for good ansers

    There is a documentation available for this BAPI and there is an example (although it is a bit confusing). You need to send the folowing parameters:
    Parameter: PURCHASEORDER = <PO number>
    Parameter: POHEADER                          
    PMNTTRMS             =                    <payment term value>
    Parameter: POHEADERX                         
    PMNTTRMS             =                    X  
    Declare your structures/tables using the same type as in BAPI - just copy/paste.

  • BAPI - Change Payment Terms - FI Document

    Hi,
    I need a BAPI to change the payment terms and the payment method supplement of FI documents. I'm trying the Function Module FI_ITEMS_CHANGE, even though I can change the payment block and some other fields with this one, I'm not able to change the 2 above fields mentionned.
    Thanks for your collaboration!
    Martin

    Hi,
    I'm doing it with transaction FB02. But I would like to do it with a BAPI and I'm looking for it. Are you sure there is not?
    Anyway, this is my BDC code, you can get it doing a recording of the transaction you want in the SM35.
    data: lt_bdcdata   type table of bdcdata,
             lwa_bdcdata  type bdcdata,
             lv_pos(2)    type n,
             lv_buzei(15) type c,
             lv_line      type i.
      define bdc_dynpro.
        clear lwa_bdcdata.
        lwa_bdcdata-program  = &1.
        lwa_bdcdata-dynpro   = &2.
        lwa_bdcdata-dynbegin = 'X'.
        append lwa_bdcdata to lt_bdcdata.
      end-of-definition.
      define bdc_field.
        clear lwa_bdcdata.
        lwa_bdcdata-fnam = &1.
        lwa_bdcdata-fval = &2.
        append lwa_bdcdata to lt_bdcdata.
      end-of-definition.
      bdc_dynpro 'SAPMF05L' '0100'.
      bdc_field  'BDC_OKCODE' '/00'.
      bdc_field  'RF05L-BELNR' if_belnr.
      bdc_field  'RF05L-BUKRS' if_bukrs.
      bdc_field  'RF05L-GJAHR' if_gjahr.
      if if_buzei <= 31.
        lv_pos = if_buzei.
      else.
        lv_line = if_buzei.
        while lv_line > 31.
          bdc_dynpro 'SAPMF05L' '0700'.
          bdc_field  'BDC_OKCODE' '=P+'.
          lv_line = lv_line - 31.
        endwhile.
        lv_pos = lv_line.
      endif.
      concatenate 'RF05L-ANZDT(' lv_pos ')' into lv_buzei.
      bdc_dynpro 'SAPMF05L' '0700'.
      bdc_field  'BDC_OKCODE' '=PK'.
      bdc_field  'BDC_CURSOR' lv_buzei.
      bdc_dynpro 'SAPMF05L' '0301'.
      bdc_field  'BDC_OKCODE' '=ZK'.
      bdc_dynpro 'SAPMF05L' '1301'.
      bdc_field  'BDC_OKCODE' '=ENTR'.
      bdc_field  'BSEG-ZLSCH' if_zlsch.
      bdc_dynpro 'SAPMF05L' '0301'.
      bdc_field  'BDC_OKCODE' '=AE'.
      call transaction 'FB02'  using lt_bdcdata
                               mode  if_mode
                               messages into et_msg.
    Hope this helps you.
    If anyone knows a BAPI for this, please tell me.
    regards,
    Ainara

Maybe you are looking for