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

BAPI_SAG_CREATE Error 'Enter Net Price'

Former Member
0 Likes
1,748

Hi Experts,

I'm creating Puchase Schedule Agreement using BAPI BAPI_SAG_CREATE, but encounted an error saying 'Enter Net Price' ME 083.

In the SAG_RETURN, MESSAGE_V1 = 'Eneter Net Price', PARAMETER = 'HEADER'.

I tried passing the field net_price, but still got that error. Also I tried passing field info_rec, didn't work either.

Seems the error is at header level, but I didn't find any field for net price in sag_header.

Can anyone help on this?

Thanks.

Legend.

Code as follow:



* Header

  CLEAR sag_header.
  sag_header-vendor = pr_lifnr.
  sag_header-doc_type = pr_evart.
  sag_header-creat_date = pr_vedat.
  sag_header-purch_org = pr_ekorg.
  sag_header-pur_group = pr_ekgrp.
  sag_header-vper_start = pr_kdatb.
  sag_header-vper_end = pr_kdate.

* Headerx

  CLEAR sag_headerx.
  sag_headerx-vendor = 'X'.
  sag_headerx-doc_type = 'X'.
  sag_headerx-creat_date = 'X'.
  sag_headerx-purch_org = 'X'.
  sag_headerx-pur_group = 'X'.
  sag_headerx-vper_start = 'X'.
  sag_headerx-vper_end = 'X'.

LOOP at gt_rb1_item.
*   Item
    wa_item-item_no = l_item.
    wa_item-material = gt_rb1_item-matnr.
    wa_item-plant = gt_rb1_item-werks.
    wa_item-info_rec = ''.
    wa_item-target_qty = gt_rb1_item-menge.
    wa_item-po_unit = gt_rb1_item-meins.
    wa_item-item_cat = gt_rb1_item-pstyp.
    wa_item-firm_zone = gt_rb1_item-firm_zone.
    wa_item-rel_create_profile = gt_rb1_item-rel_create_profile.
    wa_item-est_price = gt_rb1_item-est_price.
    wa_item-conf_ctrl = '0004'.
    APPEND wa_item TO sag_item.
* ItemX
    wa_itemx-item_no = l_item.
    wa_itemx-item_nox = 'X'.
    wa_itemx-material = 'X'.
    wa_itemx-plant = 'X'.
    wa_itemx-info_rec = 'X'.
    wa_itemx-target_qty = 'X'.
    wa_itemx-po_unit = 'X'.
    wa_itemx-item_cat = 'X'.
    wa_itemx-firm_zone = 'X'.
    wa_itemx-rel_create_profile = 'X'.
    wa_itemx-est_price = 'X'.
    wa_itemx-conf_ctrl = 'X'.
    APPEND wa_itemx TO sag_itemx.
ENDLOOP.

* Call BAPI

  CALL FUNCTION 'BAPI_SAG_CREATE'
    EXPORTING
      header             = sag_header
      headerx            = sag_headerx
*          testrun            = 'X'
    IMPORTING
      purchasingdocument = sag_nbr
      exp_header         = sag_exp_header
    TABLES
      return             = sag_return
      item               = sag_item
      itemx              = sag_itemx

6 REPLIES 6
Read only

Former Member
0 Likes
1,200

Hi,

Please Check whether Purchase Organization is passed properly.

Thanks & Regards,

ShreeMohan

Read only

0 Likes
1,200

Hi, Purchase Org is already passed to header SAG_HEADER.

Thanks.

Legend.

Read only

0 Likes
1,200

Is Net Price and weight greater than 0.

Edited by: ShreeMohan Pugalia on Jul 22, 2009 8:05 AM

Read only

0 Likes
1,200

net_price is greater than 0, weight is not passed.

but after executing the bapi, in sag_item, the net_price is 0.

Thanks.

Legend.

Read only

0 Likes
1,200

Hi,

Can you please describe in detail

Read only

0 Likes
1,200

I found the reason.

There is check on the currency key on header level, so

sag_header-CURRENCY = pr_waers

is necessary.

Thanks.

Legend.

Edited by: legend li on Jul 22, 2009 3:52 PM