Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help on BAPI_PO_CREATE?

0 Likes
755

Hi guys,

I developed a program where I able to create from PR to PO.

Everything work great but there some invalid quantity problem, such as:

If my pr item 1 is 150 quantity (100 = 1 box).

When I send over to BAPI_PO_CREATE it generated back only 1 box or 100 quantity?

It should be 1.5 box, is there anything I miss out?

Here is my code:

CALL FUNCTION 'BAPI_PO_CREATE'

EXPORTING

po_header = po_header

skip_items_with_error = ''

IMPORTING

purchaseorder = po_number

TABLES

po_items = po_items

po_item_schedules = po_item_schedules

return = return.

Appreciate if someone able to advise.

Aish.

7 REPLIES 7
Read only

0 Likes
727

hi,

anyone able to help me.

aish.

Read only

Former Member
0 Likes
727

Hi,

I think you didnt use ITEM_SCHEDULE details that is mandatory right.

The most commanly used fields are:

HEADER :

DOC_TYPE NB

CO_CODE 9001

PURCH_ORG 9001

PUR_GROUP 900

VENDOR 100000

ITEM

PO_ITEM 00001

MATERIAL MM10

STORE_LOC 01

MAT_GRP 01

SHORT_TEXT SERVICE (optional )

PLANT 9001

NET_PRICE 500

ITEM_SCHEDULE

PO_ITEM 00001

SERIAL_NO 0001

DELIV_DATE 05.04.2008

QUANTITY 1.000

You can run the BAPI with some test data... if something is missing the BAPI will ask for it... the Results are displayed in Return Table.

Please reward points if it helps

Thanks

Virkanth

Read only

0 Likes
727

Hello Khimavath,

Here is what I wrote.

  • BAPI Header

it_po_header-doc_date = sy-datum.

it_po_header-doc_type = 'NB'.

it_po_header-doc_cat = 'B'.

it_po_header-co_code = pa_bukrs.

it_po_header-purch_org = it_main_loop-ekorg.

it_po_header-pur_group = pa_ekgrp.

it_po_header-vendor = pa_flief.

APPEND it_po_header.

  • BAPI Items

it_po_items-po_item = it_main_items-bnfpo.

it_po_items-material = it_main_items-matnr.

it_po_items-pur_mat = it_main_items-matnr.

it_po_items-plant = it_main_items-werks.

it_po_items-item_cat = it_main_items-pstyp.

it_po_items-ackn_reqd = 'X'. "FOR TEST

it_po_items-store_loc = it_main_items-lgort.

it_po_items-unit = it_main_items-meins.

APPEND it_po_items.

  • BAPI Schedule

it_po_item_schedules-po_item = it_main_items-bnfpo.

it_po_item_schedules-deliv_date = it_main_items-lfdat.

it_po_item_schedules-preq_no = it_main_items-banfn.

it_po_item_schedules-preq_item = it_main_items-bnfpo.

APPEND it_po_item_schedules.

Please advise,

Aish

Read only

0 Likes
727

Hi,

see the sample code

Regards

Kiran Sure

Read only

0 Likes
727

Helo SKK,

Any different between BAPI_PO_CREATE and BAPI_PO_CREATE1?

Read only

0 Likes
727

Hi,

BAPI_PO_CREATE1 is the latest try to use that , i dont say BAPI_PO_CREATE is outdated but try to use latest one that is BAPI_PO_CREATE1.

Thanks

Vikranth

Read only

0 Likes
727

Hi Khimavath,

The problem is I already developed in BAPI_PO_CREATE, which is completed. The only problem i facing at the moment is UOM.

The BAPI_PO_CREATE it round down the quantity that I sent to it.

:~( Aish