BAPI_SALESORDER_CREATEFROMDAT1 - using this to create Sales orders in R3
Hi
Does anyone out there - know the limitations of using this BAPI BAPI_SALESORDER_CREATEFROMDAT1 to create sales orders in R3 system - from a functional standpoint ? i.e any known issues - in terms of not being able to pass - all aspects of sales order data using the BAPI , any onscreen validations being done in VA01/VA02 not being done in the BAPI etc.
Can this BAPI be used for sales order create/change ? Or is there any other BAPI out there that is better suited and more well rounded for sales order creation in R3 ?
REPORT z_bapi_create_sales_order_test .
* Order header:
* - Order type: OR Important you must use the german code TA
* - Sales org: 1000
* - Distrb. chan.: 10
* - Division: 00
* - Sold to party: 1032
* - Ship to party: 1032
* - Purch order: DG-19970626-3
* Order item:
* - Material: P-100
* - Qty: 1
DATA:
* Order partners
li_order_partners TYPE STANDARD TABLE OF bapiparnr,
l_order_partners LIKE bapiparnr,
* Structures for order header
l_order_header_in LIKE bapisdhd1,
l_order_header_inx LIKE bapisdhd1x,
* Tables for order items
li_order_items_in TYPE STANDARD TABLE OF bapisditm,
l_order_items_in LIKE bapisditm,
li_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
l_order_items_inx LIKE bapisditmx,
* Return table from bapi call
li_return TYPE STANDARD TABLE OF bapiret2,
l_return TYPE bapiret2,
* Sales document number
l_vbeln LIKE bapivbeln-vbeln,
* Error flag
l_errflag(1) TYPE c.
START-OF-SELECTION.
* Build partner information
CLEAR l_order_partners.
l_order_partners-partn_role = 'AG'. "Remember German codes !
l_order_partners-partn_numb = '0000001032'.
APPEND l_order_partners TO li_order_partners.
* Build order header
* Update flag
l_order_header_inx-updateflag = 'I'.
* Sales document type
l_order_header_in-doc_type = 'TA'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
* Sales organization
l_order_header_in-sales_org = '1000'.
l_order_header_inx-sales_org = 'X'.
* Distribution channel
l_order_header_in-distr_chan = '10'.
l_order_header_inx-distr_chan = 'X'.
* Division
l_order_header_in-division = '00'.
l_order_header_inx-division = 'X'.
* Purchase order
l_order_header_in-purch_no_c = 'DG-19970626-300'.
l_order_header_inx-purch_no_c = 'X'.
* Build order item(s) - Only 1 is used in this example
l_order_items_in-itm_number = '10'.
l_order_items_inx-itm_number = '10'.
l_order_items_in-material = 'P-100'.
l_order_items_inx-material = 'X'.
l_order_items_in-comp_quant = '1.000'.
l_order_items_inx-comp_quant = 'X'.
APPEND l_order_items_in TO li_order_items_in.
l_order_items_inx-updateflag = 'I'.
APPEND l_order_items_inx TO li_order_items_inx.
* CALL Bapi
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header_in
order_header_inx = l_order_header_inx
testrun = 'X'
IMPORTING
salesdocument = l_vbeln
TABLES
return = li_return
order_items_in = li_order_items_in
order_items_inx = li_order_items_inx
order_partners = li_order_partners.
END-OF-SELECTION.
* Check and write Return table
CLEAR l_errflag.
WRITE: / 'Sales dcoument: ', l_vbeln.
LOOP AT li_return INTO l_return.
WRITE: / l_return-type, l_return-message(50).
IF l_return-type = 'E'.
l_errflag = 'X'.
ENDIF.
ENDLOOP.
* No errors - Commit
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Similar Messages
-
How to use Bapi for creating sales order
Dear All,
I am facing problem in creating Sales orders using BAPI.
Actually I am getting one file as an input and after validating the contents in the file i am preparing an internal table which has 6 fields - Customer number,PO Number,Material Number,Quantity,Price,Unit of measure.
Now my doubt is that while using BAPI_SALESORDER_CREATEFROMDAT2 , I am not getting how to pass PO Number and Customer number.
Please Help.
Regards,
ShwetaHi shweta upadhyay
I have gone through you are post i have done some coding for creating sales order using bapi , I think it is helpful for you.
*& Report YOBJ_BAPI_SALESORDER
*& REPORT : CREATING SALES ORDER USING STANDARD BAPI
*& AUTHOR : S.PAVAN KUMAR INUMARTHY
REPORT YOBJ_BAPI_SALESORDER.
DATA : ORDER_HEADER_IN LIKE STANDARD TABLE OF BAPISDHD1 WITH HEADER LINE.
DATA : ORDER_ITEMS_IN LIKE STANDARD TABLE OF BAPISDITM WITH HEADER LINE.
DATA : ORDER_PARTNERS LIKE STANDARD TABLE OF BAPIPARNR WITH HEADER LINE.
DATA : RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.
DATA : SALESDOCUMENT LIKE BAPIVBELN-VBELN.
*APPENDING VALUES FOR HEADER.
ORDER_HEADER_IN-DOC_TYPE = 'TA'.
ORDER_HEADER_IN-SALES_ORG = '1000'.
ORDER_HEADER_IN-DISTR_CHAN = '10'.
ORDER_HEADER_IN-DIVISION = '00'.
ORDER_HEADER_IN-SALES_GRP = '130'.
ORDER_HEADER_IN-SALES_OFF = '1030'.
APPEND ORDER_HEADER_IN.
*APPENDING VALUES FOR ITEM
ORDER_ITEMS_IN-MATERIAL = 'M-13'.
ORDER_ITEMS_IN-PLANT = '1000'.
ORDER_ITEMS_IN-SALES_UNIT = 'ST'.
ORDER_ITEMS_IN-DIVISION = '07'.
ORDER_ITEMS_IN-GROSS_WGHT = '28000'.
ORDER_ITEMS_IN-NET_WEIGHT = '28000'.
ORDER_ITEMS_IN-UNTOF_WGHT = 'KG'.
ORDER_ITEMS_IN-VOLUME = '0.780'.
ORDER_ITEMS_IN-VOLUNIT = 'M3'.
APPEND ORDER_ITEMS_IN.
*APPENDING VALUES FOR PARTNER
ORDER_PARTNERS-PARTN_ROLE = 'AG'.
ORDER_PARTNERS-PARTN_NUMB = '0000001000'.
ORDER_PARTNERS-COUNTRY = 'DE'.
ORDER_PARTNERS-TRANSPZONE = 'D000080000'.
APPEND ORDER_PARTNERS.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
* SALESDOCUMENTIN =
ORDER_HEADER_IN = ORDER_HEADER_IN
* ORDER_HEADER_INX =
* SENDER =
* BINARY_RELATIONSHIPTYPE =
* INT_NUMBER_ASSIGNMENT =
* BEHAVE_WHEN_ERROR =
* LOGIC_SWITCH =
* TESTRUN =
* CONVERT = ' '
IMPORTING
SALESDOCUMENT = SALESDOCUMENT
TABLES
RETURN = RETURN
ORDER_ITEMS_IN = ORDER_ITEMS_IN
* ORDER_ITEMS_INX =
ORDER_PARTNERS = ORDER_PARTNERS
* ORDER_SCHEDULES_IN =
* ORDER_SCHEDULES_INX =
* ORDER_CONDITIONS_IN =
* ORDER_CONDITIONS_INX =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* ORDER_CCARD =
* ORDER_TEXT =
* ORDER_KEYS =
* EXTENSIONIN =
* PARTNERADDRESSES =
IF SY-SUBRC = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
ENDIF.
WRITE : 'SALES ORDER IS :', SALESDOCUMENT.
This will be very helpful for you .
this one is the correct answer I have tried it and I am posting it for you.
Message was edited by: pavan inumarthy -
Using BAPI_ACTIVITYCRM_CREATEMULTI for creating sales order in CRM
Hello Experts,
I am creating a sales order using BAPI_ACTIVITYCRM_CREATEMULTI, But I am getting the following errors:
1. Reference Object Type (ORGMAN) not allowed
2. Reference Object Type (PARTNER) not allowed
3. Incomplete interface data - No reference specified
4. Item was not found
Can you please help me with the mandatory fields, that has to be filled in the BAPI, and do I need to use Commit BAPI after this BAPI.
Please I am in critical postion,
Now I am able to create a sales order there is no data it like the partner number and Item.May be I am missing some important fileds.
Please help.
Thanks,
Suma
Edited by: Suma B on Aug 8, 2008 1:05 PMHi,
I am passing data using SE37 T-Code.
I was told by the fucntioal guys that GUID will be generated by CRM, so we dont need to send that as an input.
Still facing the same error...
These are my input fields:
REF_HANDLE
REF_GUID
R
OBJECTNAME
LOGICAL_KEY
FIELDNAME
C
|
0000000000
ORDERADM_H
PROCESS_TYPE
0000000000
ORDERADM_H
POSTING_DATE
0000000000
ACTIVITY_H
CATEGORY
0000000000
ACTIVITY_H
PRIORITY
0000000000
ACTIVITY_H
DIRECTION
0000000000
PARTNER
000000000022XXXXXXX
REF_PARTNER_FCT
0000000000
PARTNER
000000000022XXXXXXX
REF_PARTNER_NO
0000000000
PARTNER
000000000022XXXXXXX
PARTNER_FCT
0000000000
PARTNER
000000000022XXXXXXX
PARTNER_NO
0000000000
ORGMAN
DIS_CHANNEL
0000000000
ORGMAN
DIVISION
0000000000
ORGMAN
SALES_ORG
0000000000
ORDERADM_I
PRODUCT
0000000001
B
SCHEDLIN
00000000000000000000000000000000
QUANTITY
|
This is error log:
T
ID
NUM
MESSAGE
LOG_NO
LOG_MS
MESSAGE_V1
MESSAGE_V2
MESSAGE_V3
MESSAGE_V4
PARAMETER
ROW
FIELD
SYSTEM
|
W
CRM_ORDER
004
Referenced object type (ORGMAN) not allowed
$000001
000001
ORGMAN
ORDER
0
CR5CLNT100
W
CRM_ORDER
004
Referenced object type (PARTNER) not allowed
$000001
000002
PARTNER
ORDER
0
CR5CLNT100
W
CRM_ORDER
005
Incomplete interface data - No reference specified
$000001
000003
ORDER
0
CR5CLNT100
E
CRM_ORDERADM_I
006
Item was not found.
$000001
000004
ORDER
0
CR5CLNT100
E
CRM_ORDER
005
Incomplete interface data - No reference specified
$000001
000005
ORDER
0
CR5CLNT100
S
CRM_MESSAGES
005
A log has been generated for single document
$000001
000006
MESSAGES
0
CR5CLNT100
E
COM_PARTNER
119
Enter Sold-To Party
$000002
000001
Sold-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Ship-To Party
$000002
000002
Ship-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Bill-To Party
$000002
000003
Bill-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Payer
$000002
000004
Payer
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Sold-To Party
00000000000000047612
000001
Sold-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Ship-To Party
00000000000000047612
000002
Ship-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Bill-To Party
00000000000000047612
000003
Bill-To Party
PARTNER
0
PARTNER_NO
CR5CLNT100
E
COM_PARTNER
119
Enter Payer
00000000000000047612
000004
Payer
PARTNER
0
PARTNER_NO
CR5CLNT100
|
Thanks,
Suma -
Using BAPI to create sales order
Hi
i use this BAPI 'BAPI_SALESORDER_CREATEBOS' to create SO, and This BAPI is with SAP E&C solution.
it is similar to BAPI_SALESORDER_CREATEFROMDAT2. and when i call this BAPI, it give the error 'only quantity 1 ST are permitted (item 000010)'. This because the material i use is service material and with unit 'ST' and only 1. it means one project i sell.
The partial code is as below.
i_orderitemsin-itm_number = '000010'.
i_orderitemsin-material = it_sdmaster-MATNR.
I_ORDERITEMSIN-SHORT_TEXT = it_sdmaster-ARKTX.
I_ORDERITEMSIN-TARGET_QU = 'ST '.
I_ORDERITEMSIN-SALES_UNIT = 'ST '.
I_ORDERITEMSIN-TARGET_QTY = '1.000'.
I_ORDERITEMSIN-TARGET_QU = 'ST '.
I_ORDERITEMSIN-TRG_QTY_NO = 1.
I_ORDERITEMSIN-TRGQTY_DEN = 1.
i_orderitemsin-pckg_no = v_package.
APPEND i_orderitemsin .
clear i_orderitemsin .
You see, i have input the unit(ST) and quantity(1). tks for ur advice.I think you dont need to pass data in the fields TRG_QTY_NO and TRGQTY_DEN.
Refer the data element documentation of the above fields.
-Kiran -
Documentation on Creating Sales Order using Web Services
hi,
I can goto ESA Preview system using SAPGUI and create a sales order (using va01 transaction).
I tried to do the similar thing using the WebService (Create Sales order), but have lots of problems.
->Fields used in WebServices are not in sync with what would be if you use the GUI. (example u enter sales region, buyer id, ship address and the items for a standard sales order.
->There is not much documentation on what the fields in the webservice mean. (e.g. what is the difference between BuyerParty and BuyerInternalId? )
->There are no sample combination of values that work. (Belive me it would take hours to figure out right combination of values needed..)
Any hints would be appreciated
Kiran
http://erp.esworkplace.sap.com/socoview(bD1lbiZjPTgwMCZkPW1pbg==)/smdisplay.asp?id=138ABFEEA8A34999BFCEB31537EC8D65&fragID=&packageid=CBD4F2B708B8144DAEA05442D8FD491E&context=&iv=
http://erp.esworkplace.sap.com/socoview(bD1lbiZjPTgwMCZkPW1pbg==)/smdisplay.asp?id=5640EE01E71B11DAB5240007E9102256&fragID=&packageid=CBD4F2B708B8144DAEA05442D8FD491E&iv=Hi...
you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
Here are required Bapis... select which one you want....
BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
BAPI_SALESORDER_GETSTATUS Sales order: Display status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
check this thread SALES ORDER creation using BAPI
sample java program which will call SAP bapi function sales order create
PradeeP -
Creating Sales order texts while using BDC session method is not working
Hi All,
I have an existing program which creates sales order using BDC session method.( Actual program uses BAPI to create sales order and in case if any error occurs during creation of sales order BDC session is generated so that user can process it later and i am facing issues in this part of code where it uses BDC)
I wanted to modify this BDC sesion to update the sales order text also. I tried recording VA01 for creationg sales order text unfortunatly it is not capturing the data i am entering in the text fields.
Please suggest if there is any way to create sales order using BDC.
Regards
SheebaHi Madhu,
'=TP_CREATE' is the OK code i am getting for creating TEXTS. But the text entered are not captured in BDC.
Part of BDC program generated for cretaing sales order texts.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=%_GC 128 22'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=%_GC 128 22'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
Regards,
Sheeba -
Pricing determination for creating sales order using BAPI
Hi,
I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating sales order. I am filling conditions structures
'BAPICOND' and 'BAPICONDX' .
fs_order_conditions_in-itm_number = '00010'.
fs_order_conditions_in-cond_type = 'ZNTP'.
fs_order_conditions_in-cond_value = zsalesinput-price.
fs_order_conditions_in-currency = 'INR'.
append fs_order_conditions_in to order_conditions_in.
fs_order_conditions_inx-itm_number = '00010'.
fs_order_conditions_inx-cond_type = 'ZNTP'.
fs_order_conditions_inx-cond_value = 'X'.
fs_order_conditions_inx-currency = 'X'.
fs_order_conditions_inx-updateflag = 'U'.
append fs_order_conditions_inx to order_conditions_inx.
I am filling the conditions table with above mentioned fields.
Sales order is getting created successfully but I am getting two condition records in the conditions tab of sales order, one which is filled using the BAPI and the other one which is automatically picked by the system. Please tell me how to restrict the one which is created automatically by the system.
Because I want the one which is created by BAPI only.
Helpful posts will be rewardedHello Manchu.
Basically, it is an SD customizing issue. During the creation of the Sales Order you cannot "restrict" any other condition type. The SD guys must customize the condition type to allow for zero value so that the sales order is successfully created without this conition type.
Regards,
George -
VA01 to create sales order?
Hi, gurus:
when I use VA01 to create sales order, after I input order type,
then click button 'Create with Reference'. Then popup one window let me input
Billing Document. but The window just let me input ONE billing document.
Can we input Multiple Billing Document and then create one Sales Order number.
Thanks,hi Yunfa,
multiple billing documents can't have one sales order if u want to create with reference one billing document can refer to one sales order only
SD Transaction Code Flow:
Inquiry / Document type IN
Tcode for creation VA11,VA12,VA13. tables VBAK,VBAP
Quotation / QT
Tcode for creation VA21,VA22,VA23. tables VBAK,VBAP
Purchase Order PO
Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
Sales Order OR
Tcode for creation VA01,VA02,VA03. tables VBAK,VBAP
Delivery LF
Tcode for creation VL01,VL02,VL03. tables LIKP,LIPS
Billing F2
Tcode for creation VF01,VF02,VF03. tables VBRK,VBRP
these are transaction codes needed and these are tables get updated
please reward if this information is useful -
BAPI does not create Sales order
Hi All,
I am using BAPI_SALESORDER_CREATEFROMDAT2 to create sales order.
It is working fine till now.
But I found that whenever there is a material whose condition price is maintained and doesnot match with the valuation type, the Sales order does not get created, neither it gives any error msg.
For e.g For Valuation type Consign , condition type ZPCS is valid and similarly for Turnkey , condition type ZPTK is valid.
if a material has valuation type consign and condition type ZPTK.. The SAP system ofcourse will not allow to create a SO unless we delete the ZPTK entry from the SO and create ZPCS...
BAPI also doesnot create the SO but doesnot return the error messge too.
I try to put the ZPCS value to BAPI thru BAPICOND..but still not working?
How do i handle such case?
Points will be awarded to useful ansHi,
If you are saying that you cannot create a sales order with the Valuation type and Condition type mismatch even through VA01 manually, then there is nothing much you can do in BAPI also.
2nd Case is you say that that BAPI RETURN table is not getting populated and it is empty in this issue which is not letting you know that Sales order is not Created.
The one work around for this issue is you can check the exporting parameter SALESDOCUMENT if it has the Sales Order number or not. if the RETURN table is empty and the SALESDOCUMENT field has SO Number, then SO is created and if RETURN table is Initial and SALESDOCUMENT is also Initial, then it is the issue that you are facing.
Also try posting a Query in OSS.
regards,
Mahesh -
Create Sales Order with reference to Quote for different customer
HI Expert
Any idea how I may be able to do this?
Create Sales Order - for Customer B (VA01) with reference to a completed Quote for Customer A. While keeping the line items, quantity and pricing exactly the same.
Quote - Customer A -
> Sales Order - Customer B
Any suggestion will be greatly appreciated.
ThanksHI
Go toT-Code VTAA , IN Header Level "Copy Requirements" Field Maintain Routine "002"
Go to VA01 , Enter the Order Type and press Enter and Enter the Sold to party , after that Sales Documents --> Create with Reference
Regards,
Prasanna -
Creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1'
Hi ,
i have a problem in creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1 ' .
order number is created and every thing unless the order quantity isn't created for material item .
my inputs are .
in "ORDER_HEADER_IN"
(DOC_TYPE , SALES_ORG , DISTR_CHAN , DIVISION ,SALES_OFF )
in " ORDER_ITEMS_IN"
(MATERIAL ,PLANT ,REQ_QTY )
in "ORDER_PARTNERS"
(PARTN_ROLE , PARTN_NUMB)
so the order created but as i say the the order quqntity isn't created for the material so the "net value and maertial net valve )
aren't calcoluted .
<< Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
waiting .
thanks for all
Edited by: Rob Burbank on Jan 7, 2011 4:28 PMHi Mr. Ahmed Tohamy,
my point is just create a schedule line with each item line. The relevant code we used was (excerpt)
perform bapi_map_filled using:
lv_matnr 'MATERIAL' space
changing ls_in ls_inx,
lv_tax_class1 'TAX_CLASS1' gc_true
changing ls_in ls_inx,
lv_qty 'TARGET_QTY' space
changing ls_in ls_inx, "QTY to item line
lv_qty 'REQ_QTY' space
changing ls_schdl ls_schdlx,"QTY to schedule line
lv_itm_number 'ITM_NUMBER' space
changing ls_in ls_dummy,
lv_itm_number 'ITM_NUMBER' space
changing ls_schdl ls_dummy,
lv_ref_doc_ca 'REF_DOC_CA' space
changing ls_in ls_inx,
lv_orderid 'ORDERID' space
changing ls_in ls_inx,
lv_ref_doc 'REF_DOC' space
changing ls_in ls_inx.
append:
ls_in to pt_order_items_in,
ls_inx to pt_order_items_inx,
ls_schdl to pt_order_schdl,
ls_schdlx to pt_order_schdlx.
Here the quantity is put to item line and schedule line, we always mark the correspoing X structure fields:
*& Form bapi_map_filled
* if the value passed is not initial, it is moved to the field
* and the corresponding (BAPI-) X-field is marked
* if no x-structure is required, a dummy structure is passed
* if p_initial parameter is filled, initial fields will be marked
* in x-structure. Purpose: transfer of initial values to BAPI
form bapi_map_filled using p_value type any
p_fieldname type fieldname
p_initial type flag
changing p_structure type any
p_structurex type any.
field-symbols:
<any> type any,
<c> type c.
check:
not ( p_value is initial and p_initial is initial ).
assign:
component p_fieldname of structure p_structure to <any>,
component p_fieldname of structure p_structurex to <c>.
<any> = p_value.
check <c> is assigned.
<c> = gc_true.
endform. " bapi_map_filled
Also, we did something to create conditions (i.e. tax) but I think that was project-specific.
We used BAPI_SALESORDER_CREATEFROMDAT2, I do not know about BAPI_SALESORDER_CREATEFROMDAT1.
Regards,
Clemens -
Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER
Hi,
How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
Thanks in advance,
Alejandro.I have to create sales order with reference to existing billing document. I have tried to following bapis.
1. BAPI_SALESORDER_CREATEed
I have successfully created document with following details.
-->ORDER_HEADER_IN:
DOC_TYPE = ZRK
SALES_ORG = 3000
DISTR_CHAN = 00
DIVISION = 00
ORD_REASON = 100
SD_DOC_CAT = L
CURRENCY = EUR
REF_DOC = 100000028
REF_DOC_CA = M
-->ORDER_ITEMS_IN:
ITM_NUMBER = 000010
MATERIAL = 701791
TARGET_QTY = 0000000001000
CURRENCY = EUR
REF_DOC = 100000028
REF_DOC_CA = M
-->ORDER_PARTNERS:
PARTN_ROLE = SP
PARTN_NUMB = W12001
COUNTRY = NL
by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in ORDER_ITEMS_IN
COND_TYPE = PNET
COND_VALUE = 14,56
COND_D_UNT = PC.
folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
is it something related to configuration problem?
2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
Unpermitted combination of business object BUS2032 and sales doc. category L. -
Creating sales order using web dynpro JAVA
Hello everyone,
i am new to web dynpro. Can any one tell me how to creating sales order by web dynpro JAVA using BAPI.
Thanks.
Vinita SharmaHi...
you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
Here are required Bapis... select which one you want....
BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
BAPI_SALESORDER_GETSTATUS Sales order: Display status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
check this thread SALES ORDER creation using BAPI
sample java program which will call SAP bapi function sales order create
PradeeP -
Web Service for "Creating Sales Order" by using BAPI
Hello All,
I am trying to create a WS for "Creating Sales Order". The corresponding BAPI that I am using for this purpose is BAPI_SALESORDER_CREATEFROMDAT1. I am able to create the Web Service and run the WSDL on WS Navigator.
But there is a problem whil executing the Web Service. In the interface of WS, we can only enter item level details of "Order Partner". So when I enter the details and click on Execute, it returns me an error message "Please enter Ship to Party and Sold to Party". I have already given these details.
Does any one have any idea of what is going wrong?
Regards,
AbhishekAs you suggested i have passed the suggested parameters in item level..But this time i was not ablet to create the SO also..earlier i am able to creat SO but not line item, But now ia m not able to creat salesdocuement also.
Return talbe filled with belwo messages.
S V4 233 SALES_HEADER_IN has been processed successfully
E V1 320 No item category available (Table T184 ZKB TEXT )
E V4 248 Error in SALES_ITEM_IN 000000
W V1 555 The sales document is not yet complete: Edit data
E V4 219 Sales document was not changed -
How to create sales order using bapi( test purpose)
Hi all,
while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,
version 0 is not defined for the fiscal year ****.
I have given the fallowing parameters as input
ORDER_HEADER_IN
DOC_TYPE OR
SALES_ORG 1000
DISTR_CHAN 10
DIVISION 00
ORDER_PATNERS
PARTN_ROLE SP
PARTN_NUMB 1000
ORDER_ITEMSIN
MATERIAL M-13
I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).
Regards
Deviprasad.Hi Prasad,
Try using BAPI_SALESORDER_CREATEFROMDAT2.
While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.
Pricing Conditions will not be mandatory to create a sales order via BAPI.
As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.
Also try to pass the item number internally, this will help you in identifying the schedule lines.
Regards,
Priyanka.
Maybe you are looking for
-
How to use PDF417 Bar Code in Oracle Reports 6i
How to Use PDF417 Bar Code in Oracle 6i. One of my clients has a requirement that Customer Name and Address to be converted into PDF417. Any help greatly appreciated. Thanks, PN
-
I have a two-disc DVD set and when i have copied them to iTunes (11) they are imported as two separate DVDs (movies), despite them being the same name and data. Is there anyway of grouping a 2 part DVD as one DVD. I know you can do it if I set the Me
-
Tcode CM25:BDC or function module to dispatch planned orders
Hi all, Could you please suggest a BAPI/FM for CM25 -dispatching the planned orders. While i try BDC, it requires the line selection for dispatch,which does not get captured in recording. Can anyone throw light on this or suggest any alternative. tha
-
Font management software?
Is there a well recommended application for managing fonts? I use the native Font Book but not sure it's the best? Use Linotype FontExplorer too. Ideally, I want to be able to print a catalogue of all my fonts, there must be software that caters for
-
Apps to download burned music to new computer
My computer took a dump, bought new computer but I can only download purchased music to iTunes via my Ipod touch, It will not download my burned music from my ipod. I heard their are free apps or some that you have to pay for that can transfer your b