How to Update PO(ekko and ekpo) by using Bapi

Hi Experts,
I am very new in Abap ,I want to update some fields of Purchase order through Bapi.
In  Selection screen  i need these things,
PO Number ,  material, Delivery date
and i want to update the below fields of  Purchase order(PO)
1.   Street/House number  ,Postal Code/City  in header level (Give any dummy values for street/house number city  and postal code)
2.  PO quantity, Delivery date , net price  for all items which has matching material as in selection screen
and i am not giving data from excel sheet ,,i am giving data directly or through selection screen for the above mentioned fields.
please give me some solution or sample code so that i can do it.
Thankx in advance..
Ritesh

First declare the header and item structure to pass the values to FM. Now the values that you enter in selection screen are captured in internal table. So you can loop this internal table and pass the values to function module item and header details.
EX:
Decleration
DATA: PO_HEAD TYPE BAPIMEPOHEADER,
           PO_HEADX TYPE BAPIMEPOHEADERX,
           PO_ITEM TYPE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,
           PO_ITEMX TYPE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
           COUNT TYPE I VALUE 1,
           RETS TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
Pass the values to po_head po_headx po_item po_itemx.
loop. selection screen internal tables
append . Append the internal tables
endloop.
now call the bapi and pass the values.
CALL FUNCTION 'BAPI_PO_CHANGE'
   EXPORTING
     PURCHASEORDER                = PO_NUM
*   POHEADER                     =
*   POHEADERX                    =
*   POADDRVENDOR                 =
*   TESTRUN                      =
*   MEMORY_UNCOMPLETE            =
*   MEMORY_COMPLETE              =
*   POEXPIMPHEADER               =
*   POEXPIMPHEADERX              =
*   VERSIONS                     =
*   NO_MESSAGING                 =
*   NO_MESSAGE_REQ               =
*   NO_AUTHORITY                 =
*   NO_PRICE_FROM_PO             =
* IMPORTING
*   EXPHEADER                    =
*   EXPPOEXPIMPHEADER            =
  TABLES
    RETURN                       =  RETS
    POITEM                       = ITEM
    POITEMX                      = ITEMX
*   POADDRDELIVERY               =
*   POSCHEDULE                   =
*   POSCHEDULEX                  =
*   POACCOUNT                    =
*   POACCOUNTPROFITSEGMENT       =
*   POACCOUNTX                   =
*   POCONDHEADER                 =
*   POCONDHEADERX                =
*   POCOND                       =
*   POCONDX                      =
*   POLIMITS                     =
*   POCONTRACTLIMITS             =
*   POSERVICES                   =
*   POSRVACCESSVALUES            =
*   POSERVICESTEXT               =
*   EXTENSIONIN                  =
*   EXTENSIONOUT                 =
*   POEXPIMPITEM                 =
*   POEXPIMPITEMX                =
*   POTEXTHEADER                 =
*   POTEXTITEM                   =
*   ALLVERSIONS                  =
*   POPARTNER                    =
*   POCOMPONENTS                 =
*   POCOMPONENTSX                =
*   POSHIPPING                   =
*   POSHIPPINGX                  =
*   POSHIPPINGEXP                =
*   POHISTORY                    =
*   POHISTORY_TOTALS             =
*   POCONFIRMATION               =
   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
Hope it helps.
Regards,
K.Srikanth Reddy.

Similar Messages

  • How to update a People and group field using a sandbox solution

    Hi,
    I am creating a sandbox solution for office 365 and creating a custom form using visual web part, which will allow users to enter data in a custom list.
    And that list also have a user field. I am able to get SharePoint user field on the form (using javascript) which is searching for the user and get a value (working fine).
    Issue: But I am not able to save the user value. Because to save user value I require web, UserID and login name, to construct SPFieldUserValue object or string in "111;#TestUser" format. Moreover that user should be present in
    SiteUserInfoList. 
    I tried web.EnsureUser() but did not work under sanbox solution.
    Can you please provide any pointer or workaround to the problem? I may be missing something here.
    Thanks,
    Himanshu

    Hi,
    According to your description, my understanding is that you want to update the people and group field in Sandbox solution.
    In the sandbox solution, you can still use the web.EnsureUser() function to get the user information, see the thread below:
    EnsureUser in sandboxed solution
    In additional, there is a demo with your similiar requirement for your reference:
    Using the People Picker Control in Sandbox Solutions / Office 365
    Thanks
    Best Regards,
    Jerry Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to update delivery block in delivery(vl02n) using BAPI

    hi all,
    i have to update delivery block of a delivery using a BAPI. can any one suggest which bapi i have to use. and if possible let me know what are the mandatory fields that i have to fill in that bapi.
    thank you all in advance

    HI,
    Use the BAPI BAPI_OUTB_DELIVERY_CHANGE..
    Pass the delivery number DELIV_NUMB in both HEADER_DATA and HEADER_CONTROL..
    In HEADER_DATA-DLV_BLOCK pass the delivery block.
    In HEADER_CONTROL-DLV_BLOCK_FLG pass 'X'
    Thanks
    Naren

  • How to update VBFA while sales order creation using BAPI

    Hi,
    I am trying to create sales orders for each schedule line items while inquiry creation.
    This I have done in the user exit in the VA11 program MV45AFF using BAPI "BAPI_SALESORDER_CREATEFROMDAT2".
    along with the Inquiry, Sales orders are also getting created. But I am facing 2 problems.
    1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order   
        number.
    2) It is not updating the VBFA (SD flow) table.
    Regards,
    Krishna.

    Hello,
    1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order
    number.
    - are you passing simulation parameter (TESTRUN) as 'X'
    2) It is not updating the VBFA (SD flow) table.
    - Please use BAPI_SALESDOCUMENT_COPY for copying and updating VBFA table
    Thanks
    Krish

  • I updated to ios8 and tried to use Health Application. In Sources I get a message that other applications will show up on the list as they request permission to update your data. How does it happen? No apps are listed on my Sources section

    I updated to ios8 and tried to use Health Application. In Sources I get a message that other applications will show up on the list as they request permission to update your data. How does it happen? No apps are listed on my Sources section

    I have an answer to my question. There is a bug in IOS8 that prevents third party applications to talk to the Health Application. Apple is trying to fix it ASAP

  • Urgent!! How to update Planning book and change when planning will start

    Hi Gurus,
                 I had configured the system and we can initilize planning area every month and my question is 
    1. How to update planning book and change planning start date every month?
    Thanks a Lot
    Regards,
    Raj

    Hi,
    In the planning book-dataview, you will assign the time bucket profile, and will be on rollling basis. if you want the forecast profile on rolling basis, maintain the forecast and history horizon as periods then that will also be on rolling basis.
    Regards,
    Raj

  • How to correlate lips table and ekpo table?

    Hi,gurus:
    How to correlate lips table and ekpo table? We want to find the purchase order no. in the delivery table.
    Thanks in advance.

    Hi xinjiang 
    You can try using VBFA table. give input as VBELN = deliver no.,POSNN = item no.and VBTYP_N = 'J' and VBTYP_V = 'V'. Then VBELV,POSNV  will give you the purchase order no. or else you can get all the preceding documents of delivery like sales order and then input sales order and get purchase order from VBFA

  • LT06 enhancement - How to update Storage type and Storage section

    Hi,
    My requirement is to update Storage bin, Storage type and Storage section, while creating Transfer order from through LT06. So I used the enhancement MWMTO003 to update Storage Bin in LT06 and it is also working.
    Similarly I need to update Storage type and Storage section using userexit or BADI.
    Is there any way to update Storage type and storage section in LT06?

    Check enhancement MWMTO007.
    regards

  • How to update the iTunes in the iPad using the I pad

    How to update the iTunes in the iPad using the I pad?

    Then you cannot update without Conecting to iTunes on a computer.
    The Over the Air Feature is only available on iOS 5 or later.
    You have iOS 4... See Here...
    http://support.apple.com/kb/HT4972
    OR...
    Connect to iTunes on the computer you usually Sync with and “ Check for Updates “...
    See the Using iTunes Section Here...
    How to update your iPhone, iPad, or iPod touch

  • How to update the data in sqlserver table using procedure in biztalkserver

    Hi,
    Please can any one answer this below question
    how to update the data in sqlserver table using procedure in biztalkserver
    while am using executescalar,typedprocedure getting some warning
    Warning:The adapter failed to transmit message going to send port "SendtoSql1" with URL "mssql://nal126//MU_Stage2?". It will be retransmitted after the retry interval specified for this Send Port. Details
    Please send me asap....
    Thanks...

    Hi Messip,
    A detailed error would have helped us to answer you more appropriately but
    You can follow the post which has step by step instructions, to understand how to use Stored Procedure:
    http://tech-findings.blogspot.in/2013/07/insert-records-in-sql-server-using-wcf.html
    Maheshkumar
    S Tiwari|User
    Page|Blog|BizTalk
    2013: Inserting RawXML (Whole Incoming XML Message) in SQL database

  • My MacBook Pro hard drive is almost full and I wish to store my Aperture Library on an external drive, how do I do this and is the use of USB2 suitable or do I need to use a Firewire external hard drive?

    My MacBook Pro hard drive is almost full and I wish to store my Aperture Library on an external drive, how do I do this and is the use of USB2 suitable or do I need to use a Firewire external hard drive?

    You'll get better performance if you use a Firewire hard drive (especially if you buy a 7200 RPM drive). Firewire's IO speed is significantly faster than USB 2.  USB 2 has a theoretical max speed of 480 Mbps except that it has extremely high over-head.   The fastest speeds you can typically get are about 300 Mbps.   Firewire, on the other hand, has very little overhead.  The fastest speeds you can get are very nearly 800 Mbps.  You will typically be constrained by the maximum read/write speed of the drive, not the speed of the I/O on the Firewire bus.  Now if you had one of those nice shiny new Macs with the Thunderbolt I/O and a Thunderbolt drive (Light Peak) ... I think they alter space and time so that your data arrives before you know you want it. 
    Also... unless you want to buy a solid state drive (very expensive), try to keep your hard drives from becoming much more than about 60% full if you want great performance.  A nearly "full" hard drive is, on average, only about half as fast as the same hard drive when nearly empty.
    USB 2 will work perfectly fine... just not as fast.
    Also... it's much safer to move the entire Aperture library than to "relocate masters".  Your images must be managed.  You can Aperture manage them, or you can manage them.  But someone has to manage them.  If you "relocate" them so that they are no longer stored inside the Aperture library then you'll need to work out a system of how you decide to organize things and it's critically important that you don't start moving files around or deleting things without Aperture's knowledge.  If you do, you'll break the links to your masters and start having problems with missing masters.  If you have Aperture manage the library then you don't need to worry about any of that stuff.... it's safer.
    Do make backups (use the Aperture Vault or use some other backup program, but make sure you back up your work if you care about it.)  There are only two kinds of hard drives in the world:  (1) those that have failed and (2) those that are going to fail.  There are no exceptions to this rule.  Hard drives are cheap.  Backup software is built into Aperture and into your Mac.

  • How to create a partner and header record using CRM_ORDER_MAINTAIN?

    Hi any one knows how to create a partner and header record using the function module CRM_ORDER_MAINTAIN??
    I tried to  create a record, but i only managed to create a header record and the partner record is not reflected in the transaction.  Why is that so? is there any indicator that i need to include?
    Thanks..
    Jen

    Hi Jen!
    I use this FM and it works perfectly.
    Use this to create a partner:
      gs_partner-ref_handle    = '0000000001'.
      gs_partner-ref_kind      = 'A'.
      gs_partner-ref_partner_handle = '0001'.
      gs_partner-partner_fct   = '00000001'.
      gs_partner-partner_no    = NO_PARTNER. "number of the partner, bu_partner
      gs_partner-display_type  = 'BP'.
      gs_partner-no_type       = 'BP'.
      gs_partner-kind_of_entry = 'C'.
    *  ls_partner_l-ref_handle    = '1'.
      gs_partner-ref_guid      = '00000000000000000000000000000000'.
      APPEND gs_partner  TO gT_partner .
      ls_input_field-ref_kind  = 'A'.
      ls_input_field-logical_key   = '0001'.
      ls_input_field-objectname  = 'PARTNER'.
      ls_input_field-ref_handle  = '0000000001'.
      ls_input_field_names-fieldname = 'DISPLAY_TYPE'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'KIND_OF_ENTRY'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'NO_TYPE'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'PARTNER_FCT'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'PARTNER_NO'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      INSERT ls_input_field  INTO TABLE  gt_input_fields.
      clear ls_input_field-field_names[].
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
      EXPORTING
    *    it_schedlin_i   = gt_schedlin_i_com
        it_partner      = gt_partner
    *    it_sales        = gt_sales
    *      it_orgman       = gt_orgman
    *      it_appointment  = gt_appointment
    *      it_ordprp_i     = gt_ordprp_i
    *   it_product_i    = gt_product_i
    *      it_activity_i   = gt_activity_i
    *      it_pridoc       = gt_pridoc_com
      CHANGING
        ct_orderadm_h   = gt_orderadm_h
    *   ct_orderadm_i   = gt_orderadm_i
        ct_input_fields = gt_input_fields.
    *      ct_doc_flow     = gt_doc_flow
    *      cv_log_handle   = gv_log_handle.
    Hope it helps u,
    Regards,
    Mon.

  • How to do an inbound and outbound interfacing using UTL_FILE ?

    dear members,
    How can we do interfacing from a legacy system to oracle and vice versa using the UTL_FILE package. I mean how to do an INBOUND and OUTBOUND interfacing using utl_file.
    regards
    sandeep

    in/
    file/
    bad/
    done/
    out/
    file/
    bad/
    done/
    I would start by ftping / putting the file in in/file/ folder, once ftp has completed move it to complete/ folder and process the file. If errorrs are generated move the file over to bad folder. If completed successfully move over to done folder.
    Having said that you would use UTL_FILE_DIR init parameter to set your directory.
    ALTER SYSTEM SET UTL_FILE_DIR='directory1','directory2' scope=spfile;
    Then you would use the regular utl_file packages to read / write to the files.
    UTL_FILE.FOPEN and so on.

  • TS4006 I have iPhone 4 with updated latest iOS And i am using FIND IPHONE application. But everytime when ever i login in it and serch for the device its shows but never give me the location"NO LOCATION AVAILABLE".It is already connected with WIFI but no

    I have iPhone 4 with updated latest iOS And i am using FIND IPHONE application. But everytime when ever i login in it and serch for the device its shows the device  but never give me the location"NO LOCATION AVAILABLE".It is already connected with WIFI and i tried all the stuffs that has been written in the manual. Plese give me the Proper suggetion about this issue..!!

    If your router is not identified in a national database (don't recall who maintains it or where it is) then there is no location associated with it.  Hence your device cannot be located.  I suggest you try your test at some public wifi spot, like a bookstore or coffee shop.  These places usually have a location associated with their wifi router.

  • How do I authorise computers and iPads to use iTunes related purchases

    how do I authorise computers and iPads to use iTunes related purchases

    You can authorise up to 5 computers via iTunes by signing in with your ID.
    On iPads you enter your iTunes/AppStore store ID in Settings if it's not configured or different to your iCloud ID (if you have one).  These do not count as computer authorisations.
    AC

Maybe you are looking for