Should an abaper have  knowledge of creating purachse order and sales order

should an abaper have  knowledge of creating purachse order and sales order
if so how to create pls help me
thanks in advance

REPORT ZTEST_BAPI .
*- BAPI related declarations
DATA : g_pohdr TYPE bapimepoheader,
g_pohdrx TYPE bapimepoheaderx,
gt_poitem TYPE TABLE OF bapimepoitem,
gt_poitemx TYPE TABLE OF bapimepoitemx,
gt_posched TYPE TABLE OF bapimeposchedule,
gt_poschedx TYPE TABLE OF bapimeposchedulx,
gt_poacct TYPE TABLE OF bapimepoaccount,
gt_poacctx TYPE TABLE OF bapimepoaccountx,
gt_poservice TYPE TABLE OF bapiesllc,
gt_posrvacc TYPE TABLE OF bapiesklc,
gt_return TYPE TABLE OF bapiret2.
perform prepare_header.
PERFORM prepare_items.
PERFORM prepare_schedule.
perform create_po.
*& Form prepare_header
Set up header structure
FORM prepare_header.
g_pohdr-comp_code = '2000'.
g_pohdrx-comp_code = 'X'.
set up doc type
g_pohdr-doc_type = 'NB'.
g_pohdrx-doc_type = 'X'.
g_pohdr-vendor = '0008000330'.
g_pohdrx-vendor = 'X'.
g_pohdr-langu = sy-langu.
g_pohdrx-langu = 'X'.
g_pohdr-purch_org = 'BA01'.
g_pohdrx-purch_org = 'X'.
g_pohdr-pur_group = '800'.
g_pohdrx-pur_group = 'X'.
g_pohdr-currency = 'USD'.
g_pohdrx-currency = 'X'.
ENDFORM. " prepare_header
*& Form prepare_items
Set up item values
FORM prepare_items.
DATA : ls_poitem TYPE bapimepoitem,
ls_poitemx TYPE bapimepoitemx.
ls_poitem-po_item = '00010'.
ls_poitemx-po_item = '00010'.
ls_poitemx-po_itemx = 'X'.
ls_poitem-short_text = 'ABSORBER,SHOCK:PALLETIZER'.
ls_poitemx-short_text = 'X'.
ls_poitem-material = '000000000001070062'.
ls_poitemx-material = 'X'.
ls_poitem-vend_mat = 'xyz'.
ls_poitemx-vend_mat = 'X'.
ls_poitem-quantity = '100'.
ls_poitemx-quantity = 'X'.
ls_poitem-po_unit = 'EA'.
ls_poitemx-po_unit = 'X'.
ls_poitem-po_unit_iso = 'EA'.
ls_poitemx-po_unit_iso = 'X'.
ls_poitem-net_price = '6.32'.
ls_poitemx-net_price = 'X'.
ls_poitem-price_unit = '1'.
ls_poitemx-price_unit = 'X'.
ls_poitem-item_cat = 'D'.
ls_poitemx-item_cat = 'X'.
ls_poitem-plant = '1575'.
ls_poitemx-plant = 'X'.
ls_poitem-ACCTASSCAT = 'K'.
ls_poitemx-ACCTASSCAT = 'X'.
ls_poitem-acctasscat = <fs_req>-knttp.
ls_poitemx-acctasscat = 'X'.
ls_poitem-distrib = <fs_req>-vrtkz.
ls_poitemx-distrib = 'X'.
ls_poitem-part_inv = <fs_req>-twrkz.
ls_poitemx-part_inv = 'X'.
ls_poitem-gr_ind = <fs_req>-wepos.
ls_poitemx-gr_ind = 'X'.
ls_poitem-gr_non_val = <fs_req>-weunb.
ls_poitemx-gr_non_val = 'X'.
ls_poitem-ir_ind = <fs_req>-repos.
ls_poitemx-ir_ind = 'X'.
ls_poitem-agreement = <fs_req>-konnr.
ls_poitemx-agreement = 'X'.
ls_poitem-agmt_item = <fs_req>-ktpnr.
ls_poitemx-agmt_item = 'X'.
ls_poitem-preq_no = <fs_req>-banfn.
ls_poitemx-preq_no = 'X'.
ls_poitem-preq_item = <fs_req>-bnfpo.
ls_poitemx-preq_item = 'X'.
ls_poitem-preq_name = <fs_req>-afnam.
ls_poitemx-preq_name = 'X'.
ls_poitem-pckg_no = <fs_req>-packno.
ls_poitemx-pckg_no = 'X'.
APPEND : ls_poitem TO gt_poitem,
ls_poitemx TO gt_poitemx.
ENDFORM. " prepare_items
*& Form prepare_schedule
Schedule data
FORM prepare_schedule.
DATA : ls_posched TYPE bapimeposchedule,
ls_poschedx TYPE bapimeposchedulx.
ls_poschedx-po_item = '00010'.
ls_posched-po_item = '00010'.
ls_poschedx-po_itemx = 'X'.
ls_posched-delivery_date = '10/31/2005'.
ls_poschedx-delivery_date = 'X'.
ls_posched-quantity = '100'.
ls_poschedx-quantity = 'X'.
ls_posched-preq_no = <fs_req>-banfn.
ls_poschedx-preq_no = 'X'.
ls_posched-preq_item = <fs_req>-bnfpo.
ls_poschedx-preq_item = 'X'.
APPEND : ls_posched TO gt_posched,
ls_poschedx TO gt_poschedx.
ENDFORM. " prepare_schedule
*& Form create_po
Create PO with ref to the req
FORM create_po.
DATA : lt_return TYPE TABLE OF bapiret2,
l_ponum TYPE banfn.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = g_pohdr
poheaderx = g_pohdrx
testrun = 'X'
IMPORTING
exppurchaseorder = l_ponum
TABLES
return = lt_return
poitem = gt_poitem
poitemx = gt_poitemx
poschedule = gt_posched
poschedulex = gt_poschedx
poaccount = gt_poacct
poaccountx = gt_poacctx
poservices = gt_poservice
posrvaccessvalues = gt_posrvacc.
APPEND LINES OF lt_return TO gt_return.
IF NOT l_ponum IS INITIAL.
MESSAGE s398(00) WITH 'Purchase document ' l_ponum
' successfully created'.
ENDIF.
ENDFORM. " create_po
<b>Reward points</b>
Regards

Similar Messages

  • Ps assembly processing:WBS have not be created when saving the sales order

    In the ps assembly processing, I want to generate a network when I create a sales order.  So I did the following steps:
    1-Use the TCODE cj91 to create a standard WBS "E-000007.1".
    2-Use the TCODE cn01 to create a standard network "10000000" and assign the standard WBS "E-000007.1" to it.
    3-Use the TCODE cn08 to config the Network Parameters from Sales Order like below:
    Material number : 600000-000000-0009
    Order Type      : Z301
    Std network     : 10000000
    Class Type      : 020
    Network Profile : Z0001
    MRP Controller  : 001
    Std WBS element : E-000007.1
    4-Use the TCODE va01 to create a sales order and add an item with the material "600000-000000-0009" and save.
        When the SAP R/3 System is saving the sales order, a WBS ought to be created u2013 based on the assignment of the standard network to the standard project.But I could not found the WBS.I thought I have do all of steps and could not found the reason.
       So I need the experts give me some useful advice and reference to resolve the problem.Thank you.
    Regards
    Yoda

    Hi,
    Maintain strategy group in material master MRP tab....
    If problem still persist then check is there any credit block to that customer...if it is release it in VKM3....
    Once you release it will create automatically.
    Regards

  • Seggragating Deliveries created for STO and Sales Order

    Hi Friends,
    I have a requirement..
    I am looking for list of deliveries in LIPS table. But I find that this table lists all deliveries created for STOs as well as Sales order. My requirement is to select only those deliveries which are created for Sales orders. Can anybody tell me how to seggragate the deliveries for sales order from deliveries created for STOs? Any other table should I look for deliveries created only for sales order?
    Please suggest.
    Thanks & Regards
    Satya

    Hi Satya,
    If you need table level data then you can go with method suggested by Andy Slania or if you have access to SQVI, you can join VBFA and LIKP tables and decide on your choice of search and list display. You can save the query for future use.
    -Naminator

  • How to create service items and sales order for service contracts.

    Hi,
    I have created item using Purchased Item template and one more item(service item) using service /warranty program template. Then I have used these items to create sales order with service item in it and closed that order , but Iam not getting this order in service contracts. Is this right way to create sales order for service items. I
    item name:- personal_computer
    copied from purchased order template. service is enabled and install base is checked and enable service coverage is enabled.
    item name:- service_item
    copied from service /warranty program template
    service is selected to inactive,
    service type: service
    duration: 1 year
    template: Gold
    and saved the item.
    Then I have used these two items in sales order for service contracts. But that sales order is not hitting in service contracts. Is there any error with item creation.
    Thanks,
    Bharat G.

    Following SAP Notes to be referred for Service Tax:
    1.     778976 u2013 Service Tax and Ecess on Service Tax
    2.     1032265 - SEcess on Service Tax
    Regards
    AK

  • Create Business partner and Sales order automatic based on Excel file

    Hello everyone,
    Can anyone help me with the following.
    I need to create automatic Business partner master data and the Sales order in Business One based on the input list from one Excel file.
    Before the new automatic Sales order should to be created  the system need to create first the BP and then the Sales order using the new created BP.
    Is it possible to use some tools like CATT or LSMW for this reason.
    If yes can you please help me with a sample/
    Thanks and regards.

    use DTW (data transfer workbench ) or if you want to automate the entire thing, then an add-on using the DI is best.

  • How to create purchase order and sales orders

    Hi guys,
    i want to create sales order in IDES and i need to create purchase order ECC.
    depending on that i want to create the idoc for that and i want to send info through xi to the other sys.
    will u plz any of u can help me in this query.
    Thanks & Regard,
    Kalyani..

    Hi,
      TCODE for purchase order-  me22n
      TCODE for sales order- va01
    Regards,
    S.RamNarender

  • I would like to create a playlist of some of my voicememos to hear on my iphone5. I have no problem creating the list and can listen on playlist on computer but not when i sync to my phone. How can I listen to voicememos in a playlist on my iPhone?

    I would like to create a playlist of some of my voicememos to hear on my iphone5. I have no problem creating the list and can listen on playlist on computer but not when i sync to my phone. How can I listen to voicememos in a playlist on my iPhone?

    Hi czigrand,
    Thanks for visiting Apple Support Communities.
    Currently, you can gift dollar amounts or individual items (EG. songs) on the iTunes Store. See this article for more information:
    In the iTunes Store, you can gift a dollar amount or specific music, movies, TV shows, or apps from your iPhone, iPod touch, iPad, Mac, or PC. Follow these steps to send a gift from the iTunes Store.
    iTunes: Sending iTunes Gifts
    http://support.apple.com/kb/HT2736
    Best Regards,
    Jeremy

  • I downloaded the 30 day free trial of Photoshop on 9/11, but have not been able to open it, or even find it on my computer.  I do have the Adobe Create Cloud icon, and when I click it it list PS as downloaded and lets me access tutorials, but that is all.

    I downloaded the 30 day free trial of Photoshop on 9/11, but have not been able to open it, or even find it on my computer.  I do have the Adobe Create Cloud icon, and when I click it it list PS as downloaded and lets me access tutorials, but that is all.
    Please let me know how to open and use PS.
    Homer Guy

    Hi Homerguy,
    If you are using Mac, please open the finder window click on go and choose applications and try to launch Photoshop from there.
    If windows, please navigate to C:\Program Files\Adobe\Adobe Photoshop CC 2014 and double click on the Photoshop.exe file.
    Thanks

  • Handling Planned order created from Demand planning and Sales order in MTO

    Hi all
    In MTO\ Repetitive we genrate Dependent requirement from demand planning (PIR) after running MRP which finally planned order created but on the other hand in short term we have Sales order which generate planned order after running MRP(In MTO), How we should handle planned order generated from Demand planning and the ones generated from sales order.(both after MRP Running).
    Regards
    Babak Bolourchi

    Dear,
    You can combine the planning strategy also main as 56 and second as 65 and in demand managment MD61 you have the option select requirement type.
    Then while creating sales order use MTO strategy and take MRP run through MD50 and then MD02.
    and if you want to assign the stock to sales order then you and do it through MB1b with 412 E movement type.
    As per my knowledge, generally 56 strategy only takes Sales Order Stock into consideration.
    Consider setting the Individual/Collective indicator to 2.
    Mark those characteristics that should have a usage probability in demand management as Relevant for planning.
    Hope clear to you.
    Regards,
    R.Brahmankar

  • Wrong VL-367 error while creating delivery from multiple sales orders

    Hi,
    We have a Z program* that runs BAPI_OUTB_DELIVERY_CREATE_SLS with multiple sales order items to create one delivery.
    The program runs as a job. The problem is sometimes Bupi turns "VL367 - an item with no delivery quantity..." error for some of the items. But actually we have no availability problem, after a minute in the next job the delivery is being created for those items.
    We couldnt find the the state that causes this wrong error. Have any ideas, is there any problem with the bapi ?

    Hi,
    You should check if you got other Sales Order that might be have items with quantities confirmed. Quantities confirmed in a sales order will be appear as unrestricted stock, although is reserved, and therefore for example:
    Sales Order A: item 10, quantity 10
    Unrestricted stock: 10
    Sales Order B: item 10 (Same material as Sales Order A), quantity 2
    Creating outbound delivery for Sales Order B will generate the message, because that stock is being taken for the Sales Order A already.
    Hope it helps.

  • Enable - Create With Reference in Sales order

    Hi All,
    I want to enable - Create With Reference in Sales order
    We have 1 billing doc type YX1 to be used as reference for a sales order type ZX3
    How to enable Create with reference from Sales Document type YX1 to Sales Document type ZX3.
    Currently, I am getting error 'Copying from sales document type YX1 to ZX3 is not supported'.
    Please let me know the steps to be followed.
    Thank you!
    Regards,
    Shanu Jain

    Hi,
    The error clearly suggests that there is no copy control maintained b/w invoice YX1 and sales order type ZX3. You need to maintain that in SPRO > Sales and Distribution > Sales Documents > Copy control for sales documents. (You may check the correct node here). Here, you select the billing document to sales document.
    Check for source and destination. You can take the source as F2 and CR (if ZX3 is a credit Memo request) as Destination document. You can copy the same and change the source and destination as YX1 as source and ZX3 as destination. Then, at the item level, if you have a new item category you can specify it as the 'Proposed Item Category'. Save it.
    Now try to create the sales document ZX3 w.r.t YX1... It should work.
    Hope this helps
    Thanks
    Mukund S

  • How To Automatically Create Planned Orders When Sales Order Is Saved

    I have a MTO sceanrio where we need to create planned orders when sales orders are saved without running MRP.
    I have the Planning Strategy Group set to 81 in the material master, but it didnt create the planned orders.
    Could you tell me other settings I should review to make the planned orders create automatically?

    Tony,
    At the "Requir. Classes" (OVZG) customizing screen, field "Automatic start of make-to-order in background mode" affects the automatic planning. See fields help doc. below.
        If you select this indicator, the system automatically carries out
        single-item, multi-level planning for a sales order if a sales order
        item is either created or changed.
        This function can only be used for make-to-order production.
    So check out the Req. Cl that yr Req. type (req. type is part of a strategy).
    BR,
    Elly

  • CO-PA document is not created while doing the sale order cycle

    Dear Experts,
    I have 4 company codes in my controlling area. I did all CO-PA configuration. But CO-PA Document is generated in Only one company code. Remaining company codes CO-PA document is not created while doing the sale order cycle
    I’ve carried a standard sales cycle that contains sales order (VA01),
    and (VF04,VF02). System should generate 4
    documents as follows
    1) FI Document
    2) CO Document
    3) Profit Center Accounting Document
    4) COPA Document
    But in my case for 3 company codes only 3 documents are generated instead of CO-PA. But for one company code 4 documents are generated.
    In my case i did all settings Operation concern level and assign to controlling area. I can,t Understood why system is generating CO-PA document for Only one company
    Please suggest me where i miss the settings..
    Regards,
    Krishna.V

    Dear Ajay,
    Cost element category is 01. Because hear is one another company they have FI only all transactions they maintain through FI only. so hear we maintain Cost elements category 01.
    I think it is not a problem. because hear i got CO-PA document from one company. Remaining 3 company is not generated.
    Hear we maintained all gl's chart of acc level and cost elements also.
    Please suggest me...
    Regards,
    Krishna. v

  • FM:create a delivery for sales order in the background.

    Hi experts
    I want  Function Module to create a delivery for sales order in the background for both inbound and outbound.
    tcode : VL10A.
    Thanks in advance.
    kiran j

    Hi Kiran,
    Welcome to SDN Forums
    Please use the correct or most appropriate forum.
    The ABAP Objects Forum should be used for: ABAP Object definition and implementation including encapsulation, interfaces and inheritance in ABAP Objects.
    This thread will be moved from to .
    The forum is dedicated to: Data Transfer Techniques, Batch Data Communication, Legacy System Migration Workbench, Application Link Enabling, IDOCs, BAPIs.
    Please see the [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
    Also read this thread Welcome and Rules of Engagement.
    Greetings,
    Marcelo Ramos

  • Auto-create delivery for multiple sales orders

    I would like to ask how to create auto-create 'single' delivery
    for multiple sales order during release sales order in R11i.
    It is found in my example during release sales order, multiple
    sales orders fulfill release sales order criteria, a single pick
    slip is generated but it is found that each sales order have
    individual delivery with it. It will casue multiple pack slips
    for a singles pick slip. Is it normal feature for auto-create
    delivery, or any setup to solve it?
    Thanks in advance.

    Am not able to do Single Delivery for Muktiple sales orders
    Have you searched the forum for this question as to why you were not able to generate ??  It could be due to multiple reasons.  Please search the forum and update here what steps you have taken after taking the inputs from here, if the problem is still not resolved.
    thanks
    G. Lakshmipathi

Maybe you are looking for