‎2007 Mar 06 8:36 AM
Hi all,
I have used bapi BAPI_SALESORDER_CREATEFROMDAT2 for creating a sales order .
when i see the order in va03 the <b>net value</b> and <b> net price</b> are not calculated for the item materials in the sales order . Do i need pass some values for the net value and net price calculation.can any body plz advice.
regards,
‎2007 Mar 06 9:57 AM
Hi,
Here's a code snippet for non-BOM line-item data.
----
form bapi_item .
clear:
item,
itemx,
schedule,
schedulex,
condition,
conditionx.
move item_nr to:
item-itm_number,
itemx-itm_number,
schedule-itm_number,
schedulex-itm_number,
condition-itm_number,
conditionx-itm_number.
d_matnr_n = hl_mat-material.
d_matnr = d_matnr_n.
item-material = d_matnr.
clear: item-hg_lv_item.
item-short_text = hl_mat-description.
schedule-req_qty = hl_mat-quantity.
perform internalize_date using hl_mat-start_date
changing date_int.
schedule-req_date = date_int.
*schedule-req_date = hl_mat-start_date.
condition-cond_type = 'PR00'.
condition-cond_value = hl_mat-price.
condition-condvalue = hl_mat-price.
condition-currency = 'GBP'.
move 'X' to:
itemx-material,
itemx-hg_lv_item,
itemx-short_text,
schedulex-req_qty,
schedulex-req_date,
conditionx-cond_type,
conditionx-cond_value,
conditionx-currency.
append:
item to items,
itemx to itemsx,
schedule to schedules,
schedulex to schedulesx,
condition to conditions,
conditionx to conditionsx.
if hl_mat-ltext ne ''.
clear text.
text-doc_number = book-sap_so_no.
text-itm_number = item_nr.
text-langu = 'EN'.
text-text_id = '0001'.
text-text_line = hl_mat-ltext.
append text to texts.
endif.
endform. " bapi_item
----
Here's our BAPI call.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN = d_vbeln
order_header_in = header
ORDER_HEADER_INX = headerx
BEHAVE_WHEN_ERROR = 'P'
tables
RETURN = returns
ORDER_ITEMS_IN = items
ORDER_ITEMS_INX = itemsx
order_partners = partners
ORDER_SCHEDULES_IN = schedules
ORDER_SCHEDULES_INX = schedulesx
ORDER_CONDITIONS_IN = conditions
ORDER_CONDITIONS_INX = conditionsx
ORDER_TEXT = texts.
Hope this helps,
John
‎2007 Mar 06 10:09 AM
HEllo,
have a look at the Web Dynpro Sample Applications and Tutorials Page here in SDN:
https://www.sdn.sap.com/sdn/developerareas/webdynpro.sdn?page=webdynpro_tutorials.htm. You will find the Example Application "Accessing R/3 Backend in Web Dynpro (4)
" https://www.sdn.sap.com/sdn/developerareas/webdynpro.sdn?page=TutWD4_AccessingABAP.htm. I think that is a good starting point.
Regards,
Vasanth