BAPI_PO_CHANGE Extensionin problem

Hi Experts,
i'm tryng to assign the structure bapi_te_mepoheader at extensionin in this way:
MOVE-CORRESPONDING pt_ifile TO s_bapi_te_mepoheader.
pt_extensionin-valuepart1 = s_bapi_te_mepoheader.
pt_extensionin-structure  = 'BAPI_TE_MEPOHEADER'.
but it return error: "pt_extensionin-valuepart1 and s_bapi_te_mepoheader are not mutually convertible in a Unicode program" so i tried with a concatenate:
CONCATENATE pt_ifile-ebeln wa_field-zzsaiso wa_field-zzsaisj ..[etc]...INTO valuepart RESPECTING BLANKS.
but the QUAN and CURR data field types give me problems of irregular shifting of fields. 
How can i solve this problem?
thanks in advance,
Cosimo.

Hi Cosimo,
Check like this and do for that bapi.
DATA: wa_extensionin TYPE bapiparex,
wa_bape_vbap TYPE bape_vbap,
wa_bape_vbapx TYPE bape_vbapx,
wa_bape_vbak TYPE bape_vbak,
wa_bape_vbakx TYPE bape_vbakx,
lv_posnr TYPE posnr.
Processing the header extension
CLEAR wa_bape_vbak.
wa_bape_vbak-ZZFIELD = 'TEST'.
wa_extensionin-structure = 'BAPE_VBAK'.
wa_extensionin+30(960) = wa_bape_vbak.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
Processing the line extension
LOOP AT line_items INTO wa_lineitems.
ADD 10 TO lv_posnr.
CLEAR wa_bape_vbap.
wa_bape_vbap-ZZFIELD = 'TET'.
wa_extensionin-structure = 'BAPE_VBAP'.
wa_bape_vbap-posnr = lv_posnr.
wa_extensionin+30(960) = wa_bape_vbap.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
CLEAR wa_bape_vbapx.
wa_bape_vbapx-ZZFIELD = 'X'.
wa_extensionin-structure = 'BAPE_VBAPX'.
wa_bape_vbapx-posnr = lv_posnr.
wa_extensionin+30(960) = wa_bape_vbapx.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
ENDLOOP.
Then the call to the BAPI
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = ls_order_header_in
order_header_inx = ls_order_header_inx
IMPORTING
salesdocument = lv_salesdocument
TABLES
return = lt_ret2
order_items_in = lt_order_items_in
order_items_inx = lt_order_items_inx
order_partners = lt_order_partners
order_keys = lt_order_keys
extensionin = lt_extensionin.
Note: If you have a need to force a different Business Object type or wish to see the extension return fields then use the function SD_SALESDOCUMENT_CREATE instead.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
sales_header_in = ls_order_header_in
sales_header_inx = ls_order_header_inx
business_object = 'BUS2032'
IMPORTING
salesdocument_ex = lv_salesdocument
sales_header_out = lv_sales_header_out
sales_header_status = lv_sales_header_status
TABLES
return = lt_ret2
sales_items_in = lt_order_items_in
sales_items_inx = lt_order_items_inx
sales_partners = lt_order_partners
sales_keys = lt_order_keys
extensionin = lt_extensionin
incomplete_log = lt_incomplete_log
extensionex = lt_extensionex.
Check this i did for sales order.
Regards,
Madhu.
Moderator message: copy/pasted from previous discussions, please do not repeat, or your user ID might get deleted!
BAPI Enhancement
Edited by: Thomas Zloch on Sep 14, 2011 1:07 PM
Hi Thomas,
Hi,
Actually this code i got from erpgenie.com and i implemented that in my system.If there is any issue related to extension i am giving this code.This is not just copy and paste.I already answered related to  extension three to four times.If it wrong giving code then it wont repeat.
Edited by: madhurao123 on Sep 14, 2011 5:03 PM

Similar Messages

  • Urgent: Bapi_po_change Extensionin Parameter...

    Hi ,
    I want to update a Zfield created in Database using BAPI_PO_CHANGE.
    It would be more helpfull. IF any one can give a sample code for that ...
    i have done the coding but the field is not getting updated ..
    It will helpfull..if i can get the steps and any additional things to be done ....
    i have used Extensionin parameter....

    Hi Gokul,
    Check the following link on Bapi_po_change, It's a sample program.
    http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
    reward points if helpful.

  • Creating of PO in backend

    Hello,
    i would like to transffer some customer fields (for items) to the backend. I wanted to see how the transfer to the backend works so i tried to debug tx BBP_POC(this one is used as Proccess purchase orders in web interface). But i was not able to find the place where is PO transsferred to backend. I also tried to implement badi BBP_CREATE_PO_BACK to see how are customer fileds mapped, but breakpoints in this implementation doesnt works. (Breakpoints in another functions works fine).....so my question is: where is PO transfered to the backend?
    System: srm 5.0.
    backend: ecc 6.0
    thanks
    JJ

    Hi
    Time to check the R/3 system. Seems like some OSS notes are missing in R/3 system.
    <b>936786 BAPI_PO_CHANGE: Customer data is not transferred
    867018 - Customer fields transfer to the back end
    736770 EnjoySAP order BAPI: Customer enhancemnt CI_COBL not changed
    630013 BAPI_PO_CHANGE: ExtensionIn without POItem data
    485557 BAPI_REQUISITION_CREATE: 'EXTENSIONIN' customer enhancements
    612209 EnjoySAP purchase order BAPI: Fields in CI_COBL not copied
    336589 BAPI_PO_CREATE: Customer enhancements
    410491 BAPI_PO_CREATE1: Customer enhancements incorrct from 2. item
    390742 Customer enhancements not transferred
    441907 BAPI_PO_CHANGE: Not transferred customer enhancements
    445169 - BAPI_PO_GET_DETAIL: Integrated customer enhancements
    395311 - BAPI_PO_CREATE: Customer enhancements not copied
    390742 - Customer enhancements not transferred
    Note 593366 - BAdI in EnjoySAP of PO BAPIs in connection with SRM</b>
    Hope this help.
    Regards
    - Atul

  • Problem with BAPI_PO_CHANGE in adding services

    Hello,
    I have a problem in using BAPI_PO_CHANGE in adding new services for an existing po_item . I fill the table POITEM, POITEMX. Then I fill the POACCOUNT and POACCOUNTX table. Lastly I fill the table POSERVICES, POSRVACCESSVALUES. After running it with commit step. I get as return:
    The purchase order .... was updated. But if I look at my purchase order with trans. me23n, there was nothing added. Thus, I do not know what I forget. So it will be great, if someone can provide an example in correct filling the table.
    In Table POSERVICES I add for the field PCKG_NO the value : 0000000001, is this correct? because I will add new services positions.
    Thanks in advance for your support.
    Kind regards,
    Erkan

    Hello Anuradha,
    yes, I used the BAPI Commit command but it did not work.
    Kind regards,
    Erkan

  • HELP bout EXTENSIONIN in BAPI_PO_CHANGE

    I want to use 'BAPI_PO_CHANGE' to update PO items by passing EXTENSIONIN in unicode system ECC6.0. I have update the structure of BAPI_TE_MEPOITEMX and CI_EKPODBX.
    Here's my code, no error, but the value didn't change.Is anything wrong with my code?
    Thanks.
    DATA:
      it_extensionin TYPE STANDARD TABLE OF BAPIPAREX,
      wa_extensionin TYPE BAPIPAREX,
      BAPI_TE_MEPOITEM LIKE BAPI_TE_MEPOITEM,
      BAPI_TE_MEPOITEMX LIKE BAPI_TE_MEPOITEMX.
      BAPI_TE_MEPOITEM-ZZ_COMM_STO_NUM = '111'.
      wa_extensionin-structure = 'BAPI_TE_MEPOITEM'.
      wa_extensionin-valuepart1(5) = '00010'.
    *that's the value i want to update
      wa_extensionin-valuepart1+5(10) = BAPI_TE_MEPOITEM-ZZ_COMM_STO_NUM.
      wa_extensionin- valuepart1+15(10) = ''.
      wa_extensionin-valuepart1+25(8) = ''.
      wa_extensionin-valuepart1+33(8) = ''.
      wa_extensionin-valuepart1+41(8) = ''.
      wa_extensionin-valuepart1+49(8) = ''.
      wa_extensionin-valuepart1+57(1) = ''.
      APPEND wa_extensionin to it_extensionin.
      wa_extensionin-structure = 'BAPI_TE_MEPOITEMX'.
      wa_extensionin-valuepart1(5) = '00010'.
      wa_extensionin-valuepart1+5(1) = 'X'.
      wa_extensionin-valuepart1+6(1) = ''.
      wa_extensionin-valuepart1+7(1) = ''.
      wa_extensionin-valuepart1+8(1) = ''.
      wa_extensionin-valuepart1+9(1) = ''.
      wa_extensionin-valuepart1+10(1) = ''.
      APPEND wa_extensionin to it_extensionin.
      CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          PURCHASEORDER = '4100000533'
        TABLES
          RETURN        = IT_RETURN
          EXTENSIONIN   = it_extensionin.
    Edited by: yang Aiolos on Oct 10, 2008 2:54 AM
    Edited by: yang Aiolos on Oct 10, 2008 2:59 AM

    Hi..
    I am not sure if you have missed something in the extension structure.... what you can do is check by trial and error method by passing values to other fields also.. many times it so happens that you may need to pass values  to some particular fields to update values of some other field....
    regards,
    Madan...

  • Problem in update PO's partner function using BAPI_PO_CHANGE

    Hi All,
    I have some problem when i try to update PO partner function using BAPI_PO_CHANGE.
    If i update partner function where business partner number is vendor (eg. GS) , it run successfully. But when I try to update partner function where business partner number is personnel number (eg. CS, VW, etc) , it was failed. And BAPI return message is "Please enter a partner role".
    Please advice.
    Thanks

    Hi,
             are you executing BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE?
    Check this code for PO update..
    PARAMETERS: p_ebeln LIKE ekko-ebeln.
    DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
    DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
    DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    t_poitem-po_item = '00010'.
    t_poitem-net_price = '17.00'.
    APPEND t_poitem.
    t_poitemx-po_item = '00010'.
    t_poitemx-net_price = 'X'.
    t_poitemx-po_itemx = 'X'.
    APPEND t_poitemx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
    purchaseorder = p_ebeln
    TABLES
    return = t_return
    poitem = t_poitem
    poitemx = t_poitemx.
    COMMIT WORK.
    <b>Reward points</b>
    Regards

  • Problems in the EXTENSIONIN Parameter of BAPI_PO_CREATE1

    Hello Experts,
    I have a cfeild in the table EKKO and want to fill it.
    I have try it over the EXTENSIONIN Parameter of BAPI_PO_CREATE1, but it doesn't work.
    The strucurtes BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERX has also the required customerfields included
    Some Ideas? why it doesn'works ?
    Thanx in Advance
    REPORT  Z_BAPI_PO_CREATE1.
    DATA: LS_POHEADER   TYPE TABLE OF BAPIMEPOHEADER WITH HEADER LINE  .
    DATA: LS_POHEADERX  TYPE TABLE OF BAPIMEPOHEADERX WITH HEADER LINE.
    DATA: LT_RETURN     type TABLE OF BAPIRET2.
    DATA: LT_POITEM     TYPE TABLE OF BAPIMEPOITEM  WITH HEADER LINE.
    DATA: LT_POITEMX    type TABLE OF BAPIMEPOITEMX WITH HEADER LINE .
    DATA: LT_ACCOUNT    type TABLE OF BAPIMEPOACCOUNT WITH HEADER LINE .
    DATA: LT_ACCOUNTX   TYPE TABLE OF BAPIMEPOACCOUNTX WITH HEADER LINE .
    DATA: LT_ADDRDELIV  type BAPIMEPOADDRDELIVERY .
    *********************Setze HEADER**************************
    LS_POHEADER-DOC_TYPE      = 'Z028'.
    LS_POHEADER-CREAT_DATE    = '01032006'.
    LS_POHEADER-ITEM_INTVL    = '00001'.
    *LS_POHEADER-VENDOR       = '0021000000'.
    LS_POHEADER-SUPPL_PLNT    = '4700' .
    LS_POHEADER-PURCH_ORG     = '2700' .
    LS_POHEADER-PUR_GROUP     = '701' .
    LS_POHEADER-CURRENCY      = 'EUR' .
    APPEND LS_POHEADER .
    *********************Setze HEADERX**************************
    LS_POHEADERX-DOC_TYPE    = 'X' .
    LS_POHEADERX-CREAT_DATE  = 'X' .
    LS_POHEADERX-ITEM_INTVL  = 'X' .
    LS_POHEADERX-SUPPL_PLNT  = 'X' .
    *LS_POHEADERX-VENDOR     = 'X' .
    LS_POHEADERX-PURCH_ORG   = 'X' .
    LS_POHEADERX-PUR_GROUP   = 'X' .
    LS_POHEADERX-CURRENCY    = 'X' .
    APPEND LS_POHEADERX .
    *********************Setze ITEMS**************************
    LT_POITEM-PO_ITEM                     = '00001' .
    LT_POITEM-MATERIAL                    = '023JK513' .
    LT_POITEM-PLANT                       = '4700' .
    LT_POITEM-STGE_LOC                    = '7001' .
    LT_POITEM-QUANTITY                    = '1' .
    LT_POITEM-PO_UNIT                     = 'PC' .
    LT_POITEM-ACCTASSCAT                  = 'K' .
    LT_POITEM-PERIOD_IND_EXPIRATION_DATE  = 'D' .
    APPEND LT_POITEM .
    *********************Setze ITEMSX**************************
    LT_POITEMX-PO_ITEM        = '00001' .
    LT_POITEMX-PO_ITEMX       = 'X' .
    LT_POITEMX-MATERIAL       = 'X' .
    LT_POITEMX-PLANT          = 'X' .
    LT_POITEMX-STGE_LOC       = 'X' .
    LT_POITEMX-QUANTITY       = 'X' .
    LT_POITEMX-PO_UNIT        = 'X' .
    LT_POITEMX-PERIOD_IND_EXPIRATION_DATE = 'X' .
    LT_POITEMX-ACCTASSCAT                  = 'X' .
    APPEND LT_POITEMX .
    *********************Setze ACCOUNTPARAMETER**************************
    LT_ACCOUNT-COSTCENTER = '1301000001' .
    LT_ACCOUNT-PO_ITEM    = '00001' .
    APPEND LT_ACCOUNT .
    LT_ACCOUNTX-COSTCENTER = 'X' .
    LT_ACCOUNTX-PO_ITEM    = '00001' .
    APPEND LT_ACCOUNTX .
    DATA:       ls_bapi_te_po_header    type          BAPI_TE_MEPOHEADER,
                ls_bapi_te_po_headerx    type          BAPI_TE_MEPOHEADERX,
                ls_bapi_extension       type          BAPIPAREX,
                it_bapi_extension       type table of BAPIPAREX           WITH HEADER LINE.
    ********************Setze EXTENSIONIN**************************
    ls_bapi_extension-structure     = 'BAPI_TE_MEPOHEADER' .
    *ls_bapi_te_po_header-po_number  = '' .
    ls_bapi_te_po_header-cfield    = '8204' .
    ls_bapi_extension-valuepart1    = ls_bapi_te_po_header .
    append ls_bapi_extension to it_bapi_extension .
    clear ls_bapi_extension .
    ls_bapi_extension-structure     = 'BAPI_TE_MEPOHEADERX' .
    *ls_bapi_te_po_header-po_number  =  '' .
    ls_bapi_te_po_headerx-cfield    = 'X' .
    ls_bapi_extension-valuepart1     = ls_bapi_te_po_headerx .
    append ls_bapi_extension to it_bapi_extension .
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER    = LS_POHEADER
        POHEADERX   = LS_POHEADERX
      TABLES
        RETURN      = LT_RETURN
        POITEM      = LT_POITEM
        POITEMX     = LT_POITEMX
        POACCOUNT   = LT_ACCOUNT
        POACCOUNTX  = LT_ACCOUNTX
        EXTENSIONIN = it_bapi_extension
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

    Hello,
    thank you for your response
    The Problem was on the BADI below:
    it wasn't implemented.
    BAPI_PO_CREATE1->PERFORM move_data_in ->PERFORM move_extensionin->PERFORM move_container_in->CALL BADI lr_badi->map2i_extensionin
    CALL BADI lr_badi->map2i_extensionin
            EXPORTING
              im_container = im_container
              im_name      = im_name
              im_error     = lf_exit
            CHANGING
              ch_struc     = ch_struc.
    Best Regards

  • BAPI_PO_CHANGE problems with Account Assignment in Services

    Hi,
    I´m facing a problem using BAPI_PO_CHANGE, this is the scenario, every time a PO is changed in ME22N for Company Code X, I need to change a "mirror" PO in Company Code Y which has the same information, this PO contains Services, to achieve this I implemented the Badi ME_PURCHDOC_POSTED and used the BAPI_PO_CHANGE.
    It works fine when I change the Service price or Delete an Item, the problem is when I need to remove the delete mark of the deleted item, in both Company the deletion mark is removed but the Account Assignment for the service on Company Code Y is lost even when I'm sending the accounts in the moment I call the BAPI_PO_CHANGE.
    Do you have any idea/solution for this?.
    Thanks and Regards,
    Fabian Fonseca

    hi,
    see this thread
    Re: Using BAPI_PO_CHANGE to change header text of PO
    thanks

  • Problem while updating Delivery date uisng BAPI_PO_CHANGE

    Hi friends,
    Iam facing a problem while updating delivery date of a purchase order using the bapi BAPI_PO_CHANGE
    After the bapi is getting triggered iam geting sy-subrc = 0
    But in the return parameters iam getting 3 error messages so iam unable to update the  delivery date..
    Error meesage which iam getting are
    a) Purchase order still contains faulty items
    b) Enter Tax Code
    c) Instance 1000001 of object type PurchaseOrder could not be changed.
    How can i correct it..
    Please find my code below
    LOOP AT it_eket INTO wa_eket.
        wa_poschedule-po_item = wa_eket-ebelp.
        wa_poschedule-sched_line = wa_eket-etenr.
        wa_poschedule-delivery_date = wa_eket-eindt.
        APPEND wa_poschedule TO poschedule.
        wa_poschedulex-po_item = wa_eket-ebelp.
        wa_poschedulex-sched_line = wa_eket-etenr.
        wa_poschedulex-po_itemX = 'X'.
        wa_poschedulex-sched_lineX = 'X'.
        wa_poschedulex-delivery_date = 'X'.
        APPEND wa_poschedulex TO poschedulex.
    READ TABLE IT_EKPO INTO WA_EKPO WITH KEY EBELN  = WA_EKET-EBELN
                                             EBELP = WA_EKET-EBELP.
          IF SY-SUBRC = 0.
          WA_POITEM-PO_ITEM = WA_EKPO-EBELP.
          APPEND WA_POITEM TO POITEM.
          WA_POITEMX-PO_ITEM = WA_EKPO-EBELP.
          WA_POITEMX-PO_ITEMX = 'X'.
          APPEND WA_POITEMX TO POITEMX.
         ENDIF.
        CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            purchaseorder = wa_eket-ebeln
          TABLES
            return        = t_bapiret2
            POITEM        = POITEM
            POITEMX       = POITEMX
            poschedule    = poschedule
            poschedulex   = poschedulex.
        READ TABLE t_bapiret2 INTO wa_bapiret2 WITH KEY type = 'E'.
        IF sy-subrc NE 0.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =.
          IF sy-subrc = 0.
            WRITE :  'DELIVERY DATE UPDATED'.
          ENDIF.
        ENDIF.
    how can i correct it...
    Regards
    Kumar

    Hi,
    Pass the following values...
    POACCOUNT LIKE BAPIMEPOACCOUNT...
    poaccount-TAX_CODE = ? (value)....
    That should take care of the missing field.
    Regards,
    Madan..

  • Problem in EXTENSIONIN parmeter of SD_SALESDOCUMENT_CHANGE

    Hi all,
    We are using SD_SALESDOCUMENT_CHANGE bapi  to change the schedule agreement created. It is working fine with the normal fields and updating all the fields in the database tables.
    Now, as per our requirement, we added 4 fields
    Veh_num - char(15)
    Depo_Code- numc(2)
    Veh_type - char(5)
    Shipment type - char(20)
    in the VBEP table. We want to update this four fields also through same BAPI. For this, we appended our four fields in other four structures, namely, VBEPKOZ, VBEPKOZX, BAPE_VBEP, BAPE_VBEPX.
    Then, in the  EXTENSIONIN parameterin of bapi, we have passed the data for the two structures BAPE_VBEP and BAPE_VBEPX.
    But the data is updated in the database table VBEP for the four fields added. Can some one please let me know how to get this done.
    Thanks and Regards,
    Avinash Bolisetty

    How are you excatly passing the value to structure BAPIPAREX. Is it like as below? I had a similar problem and it was happening as the fields which were added to VBEPKOZ were at the end and thus were part of VALUEPART4 and somehow VALUEPART4 was not properly passed.
    type: begin of t_ext,
    valuepart1 type  bapiparex-valuepart1,
    valuepart2 type  bapiparex-valuepart2,
    valuepart3 type  bapiparex-valuepart3,
    valuepart4 type  bapiparex-valuepart4,
    end of t_ext.
    data: wa_ext type t_ext,
             wa_bapevbep type bape_vbep,
             wa_bapiparex type bapiparex.
    wa_ext = wa_bapevbep.
    wa_bapiparex-STRUCTURE = 'BAPE_VBEP' .
    wa_bapiparex-VALUEPART1 = wa_ext-valuepart1.
    wa_bapiparex-VALUEPART2 = wa_ext-valuepart2.
    wa_bapiparex-VALUEPART3 = wa_ext-valuepart3.
    wa_bapiparex-VALUEPART4 = wa_ext-valuepart4.
    append wa_bapiparex to i_bapiparex.
    Cheers,
    Shweta

  • Problem in  BAPI_PO_CHANGE

    Hi friends,
    I am trying to update net price in Purchase Order using BAPI BAPI_PO_CHANGE. But Price doesn't get change . When I run BAPI sepratly it shows me an information message i.e.
    Net price could not effect in purchase order.Message no is 664.
    Please guide me
    Thank you
    Amit Sontakke

    this is what I do  (show the code below)  but the problem  seems to be that  the system is unable to perform more than 1 bapi  during the execution of the program ; Indeed the message is "Instance of object type PurchaseOrder could not be changed"
    LOOP AT TAB_UPDVBEP INTO WA_UPDVBEP where UPD = 'X' and AUART = 'UB'.
         T_PURCHASEORDER = WA_UPDVBEP-VBELN.
         T_POITEM-PO_ITEM = WA_UPDVBEP-posnr.
         T_POITEM-NO_MORE_GR = ' '.
         T_POITEMX-PO_ITEM = WA_UPDVBEP-posnr.
         T_POITEMX-NO_MORE_GR = 'X'.
         APPEND T_POITEM.
         APPEND T_POITEMX.
         T_POSCHEDULE-PO_ITEM = WA_UPDVBEP-posnr.
         T_POSCHEDULE-SCHED_LINE = WA_UPDVBEP-ETENR.
         T_POSCHEDULE-DELIVERY_DATE = WA_UPDVBEP-EDATU.
         T_POSCHEDULEx-PO_ITEM = WA_UPDVBEP-posnr.
         T_POSCHEDULEx-SCHED_LINE = WA_UPDVBEP-ETENR.
         T_POSCHEDULEx-DELIVERY_DATE = 'X'.
         APPEND T_POSCHEDULE.
         APPEND T_POSCHEDULEx.
    at END OF vbeln.
      CALL FUNCTION 'BAPI_PO_CHANGE'
      EXPORTING
        PURCHASEORDER                = T_PURCHASEORDER
      TABLES
        RETURN                       = return
        POITEM                       = T_POITEM
        POITEMX                      = T_POITEMX
        POSCHEDULE                   = T_POSCHEDULE
        POSCHEDULEX                  = T_POSCHEDULEX.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDAT.
    endloop.

  • BAPI_PO_CHANGE problem with accounting

    Hello,
    I'm trying to add a new position to an existent purchase order. But I get the "Account 960000 requires an assignment to a CO object" error.
    The line that I add has the same accounting information as the existent line (even the WBS element).
    I have debugged but, in one moment the new line loss the kokrs & wbs_element in the new line, but I have not able to see why. For this reason I get the error
    Has anybody been in this situation before? My structure call is the next.
    thanks.
    BR
    Parámetros: PURCHASEORDER 7000000452
    Parámetros: POITEM
    PO_ITEM                        = 00020
    SHORT_TEXT                     = ANM.003
    PLANT                          = 1000
    MATL_GROUP                     = 03.1
    QUANTITY                       = 1.000
    PO_UNIT                        = LE
    NET_PRICE                      = 78.690000000
    ITEM_CAT                       = 0
    ACCTASSCAT                     = Z
    GR_IND                         = X
    IR_IND                         = X
    GR_BASEDIV                     = X
    PRICE_DATE                     = 20060619
    Parámetros: POITEMX
    PO_ITEM                        = 00020
    PO_ITEMX                       = X
    SHORT_TEXT                     = X
    PLANT                          = X
    MATL_GROUP                     = X
    QUANTITY                       = X
    PO_UNIT                        = X
    NET_PRICE                      = X
    ITEM_CAT                       = X
    ACCTASSCAT                     = X
    GR_IND                         = X
    IR_IND                         = X
    GR_BASEDIV                     = X
    Parámetros: POACCOUNT
    PO_ITEM                        = 00020
    SERIAL_NO                      = 02
    CREAT_DATE                     = 20060619
    QUANTITY                       = 1.000
    NET_VALUE                      = 78.690000000
    CO_AREA                        = 1000
    WBS_ELEMENT                    = SA1102-06
    Parámetros: POACCOUNTX
    PO_ITEM                        = 00020
    SERIAL_NO                      = 02
    PO_ITEMX                       = X
    SERIAL_NOX                     = X
    CREAT_DATE                     = X
    QUANTITY                       = X
    NET_VALUE                      = X
    CO_AREA                        = X
    WBS_ELEMENT                    = X

    Hi,
    Thanks for your response. but
    -I can do the update online without problems (via ME22N)
    - I just created the purchase order when I tried to do the change.
    I don't know why tha information about wbs_element and kokrs disappear in the execution.
    Any other Idea
    Thanks again
    BR

  • BAPI_PO_CHANGE document number leading zero problem

    Hi experts,
    The following code clears the "Delivery Complete" flag on a list of Purchase Orders uploaded from a CSV file.
    The PO number is 9 digits long, however, in EKPO table it is stored as 10 digits (prefixed with a zero). The BAPI does not recognise the document number unless it is prefixed with a zero in the CSV file (which adds extra work for the user to create custom format in Excel to add the leading zero).
    What code is required for the BAPI to recognise the 9 digit number without the leading zero?   Perhaps the leading zero could be hard-coded into the program?
    Any advice is much appreciated.  Thanks for your time.
    REPORT  Z_MASS_REMOVE_FDI_DCI_BAPI.
    *Check if file exists
    DATA: rc TYPE sy-ucomm.
    CALL FUNCTION 'WS_QUERY'
           EXPORTING
                query    = 'FE'  "File Exist?
                filename = 'X:\STO.TXT'
           IMPORTING
               return   = rc.
    IF rc EQ 0.
      WRITE: / 'File does not exist'.
    ENDIF.
    TYPES: BEGIN OF ty_tab,
            DOCNO(10),
            ITEM(4),
           END OF ty_tab.
    DATA : it_tab TYPE STANDARD TABLE OF ty_tab,
           wa_tab TYPE ty_tab.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename = 'X:\STO.TXT'
    *     FILETYPE = 'ASC
          has_field_separator = 'X'
    *     HEADER_LENGTH = 0
    *     READ_BY_LINE = 'X'
    *     IMPORTING
    *     FILELENGTH =
    *     HEADER =
          TABLES
          data_tab = it_tab
          EXCEPTIONS
          file_open_error = 1
          file_read_error = 2
          no_batch = 3
          gui_refuse_filetransfer = 4
          invalid_type = 5
          no_authority = 6
          unknown_error = 7
          bad_data_format = 8
          header_not_allowed = 9
          separator_not_allowed = 10
          header_too_long = 11
          unknown_dp_error = 12
          access_denied = 13
          dp_out_of_memory = 14
          disk_full = 15
          dp_timeout = 16
          OTHERS = 17.
    END-OF-SELECTION.
    LOOP AT it_tab INTO wa_tab.
      WRITE:/ 'DOCUMENT: ',
      wa_tab-DOCNO,
      ' ITEM: ',
      wa_tab-ITEM.
      WRITE: / '-----------------------------------------------------------------------'.
      DATA: s_header TYPE bapimepoheader,
            s_headerx TYPE bapimepoheaderx,
            s_item TYPE bapimepoitem,
            s_itemx TYPE bapimepoitemx,
            i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
            i_extension TYPE bapiparex OCCURS 0 WITH HEADER LINE,
            s_bapimepoheader TYPE bapimepoheader,
            s_bapimepoheaderx TYPE bapimepoheaderx,
            s_bapimepoitem TYPE bapimepoitem occurs 0 with header line,
            s_bapimepoitemX TYPE bapimepoitemX occurs 0 with header line,
            wa_message TYPE c LENGTH 100.
      s_bapimepoheaderx-po_number = wa_tab-DOCNO.
      s_bapimepoheader-po_number = wa_tab-DOCNO.
      s_bapimepoitemx-PO_ITEM = wa_tab-ITEM.
      s_bapimepoitem-PO_ITEM = wa_tab-ITEM.
    *Remove Delivery Complete Indicator (DCI)
      s_bapimepoitemx-NO_MORE_GR = 'X'.
      s_bapimepoitem-NO_MORE_GR = ' '.
      append s_bapimepoitem.
      clear s_bapimepoitem.
      append s_bapimepoitemx.
      clear s_bapimepoitemx.
      CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          purchaseorder = wa_tab-DOCNO
        TABLES
          return        = i_return
          poitem        = s_bapimepoitem
          poitemx      =  s_bapimepoitemx.
    *Message types: S Success, E Error, W Warning, I Info, A Abort
    *Supress all Warning Messages
    DELETE i_return WHERE ( TYPE EQ 'W' ).
    *Commit only if no errors have been returned
      read table i_return with key type = 'E'.
      if sy-subrc ne 0.
        COMMIT WORK AND WAIT.
      endif.
    *Display Return Messages on Screen
      LOOP AT i_return.
        WRITE: /   'RETURN MESSAGE: ',
        'ID: ',
        i_return-id,
        ' TYPE: ',
        i_return-type,
        ' NUMBER: ',
        i_return-number,
        i_return-message.
      ENDLOOP.
      WRITE: / '-----------------------------------------------------------------------'.
      refresh : s_bapimepoitem,s_bapimepoitemx.
    ENDLOOP.

    hi,
    Use the conversion exit to make it as 10 digit char CONVERSION_EXIT_ALPHA_INPUT.

  • Problem changing the Condition Value in Po using BAPI_PO_CHANGE

    Hi Experts,
    My issue is BAPI_PO_CHANGE is not changing the Condition value. and giving message in bapi return as 'cannot be processed manually'.
    Can anybody please help me on this.
    Thanks & Regards,
    Sudheer

    Check this link http://forums.sdn.sap.com/thread.jspa?threadID=652278
    Regards,

  • Problem in MARA extension BAPI 'BAPI_MATERIAL_SAVEDATA' - EXTENSIONIN

    Dear All,
    Im trying to update Z fields in MARA using the BAPI 'BAPI_MATERIAL_SAVEDATA'
    The appends to MARA & BAPI_TE_MARA are done.
    There are lots of appends & it now exceeded 960 characters.
    My Z fields are in the position 974  to 984.
    EXTENSIONIN has 4 Value parts (VALUEPART1, VALUEPART2, VALUEPART3 & VALUEPART4) each of length char240.
    So the Maximum Zextension updates possile are 240*4 = 960.
    Please let me know update Z fields that are higher than 960.
    Thanks in Advance.
    Regards,
    Prabhu Selvaraj.

    Hi Prabhu,
    Can you please provide your code snippet ?
    Regards
    HM

Maybe you are looking for

  • I can't sign in to my computer with my apple id....

    Im trying to sign in to my apple ID on my mac book air but i cant and i cant upgrade to os 10.... what shall i do. Going crazy on this ****! Almost regret bying this advanced ****....

  • Want to take speech to text

    Can I get a program you Can talk into and it will type on the computer?

  • Table border has no bottom line

    I am new ti In Design and have tried everything to find this answer.  You floks are my only hope.  I created a table and for some reason the border around it shows up everywhere except across the bottom.  Any ideas? Thanks in advance.

  • Searching data in datastore - what T-code do I use?

    What transaction code in BW is used to search the data in a datastore? I want to search the data in a datastore in BW GUI similar to how I would search data in a table using SE16N. Thanks.

  • BUILDING OF BIOS WITH VISUAL STUDIO

    Hi I have one doubt "which is the version and edition of visual studio that support that can be used as IDE for  BIOS development. Thanks in advance.