Skip to Content
0
Former Member
Jul 22, 2009 at 03:37 AM

BAPI_SAG_CREATE Error 'Enter Net Price'

400 Views

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