Error in BAPI_SALESORDER_CREATEFROMDAT1
Hi,
Am using BAPI_SALESORDER_CREATEFROMDAT1 BAPI for sales order creation but while executing this BAPI am getting error like this "751 For object RV_BELEG , number range interval does not exist".
In SNRO Tcode already Interval is maintained for object RV_BELEG . So anybody can help me to sole this issue?
Thanks,
Arun
Hello Arun,
According to your system configuration the BAPI is trying to get the "Serialization Procedure for Serial Number Management" number from the configuration and looks like it is not configured.
Please check with the SD consultant and they can give you the correct test data or try with some other material that is not relevant to the "Serialization Procedure for Serial Number Management" .
Hope this answers your question.
Thanks,
Greetson
Similar Messages
-
Error in Creating Bapi_salesorder_createfromdat1
Dear Friends,
I have defined all the mandatory fields in my BAPI, BAPI_SALESORDER_CREATEFROMDAT1. But even after defining the partners in Order_partners in my BAPI, i am getting an error message saying "Please fill Sold-to-party or ship-to-party". Can any one plse suggest me whether i need to give partner data any where in the BAPI other than order_partners. Plse help in this regard. I am in need of it urgently.
Regards,
Santosh Kumar Mukka.Hi,
I'm sure you have to enter the sold to party as a bare minimum with the partner role set to = SP. If you don't enter a ship to it will take the sold to and use that. I can't think of anything else that needs the partner in - and there is nothing ni the documentation as yuo say.
Gareth.
Also, forgot to say, that the ship to needs WE as the partner role. Also look at OSS note 93091 for more info according to the help.
Message was edited by:
Gareth @ Atos Origin UK -
Unable to capture error message while creating an SO using bapi
Hi,
Can anybody suggest how to capture the error message while creating a SO using BAPI.
I have developed a customeized BAPI and using the BDC format to create the SO.
Note: i am using a call transaction method for the BDC.
I am sending the message into message1.
but i am unable to send the same into an internal table
shyam.Hi Shyam
If my understanding is correct, you are performing BDC process within the customized BAPI...
And you want to collect the messages from BDC to an internal table and pass to the output.
Proceed as below:
1. While calling BDC, use CALL TRANSACTION .... with addition: <b>MESSAGES INTO itab</b>. The structure of itab should be like <b>BDCMSGCOLL</b>.
2. Now the messages will be collected in ita.
3. Prepare the messages using FM: <b>FORMAT_MESSAGE</b>
4. Collect to the returning table.
Hope this helps...
Though i could not understand the reason of creating a BDC within BAPI, you can opt for loading orders via BAPI's like: BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2.
Kind Regards
Eswar -
Error while creating Salesorder using BAPI
hello frnds,
I m new to abap and tryin to make use of BAPI_SALESORDER_CREATEFROMDAT1 to create Sales Order
I have used the progrtam below.
*& Report ZSALESBAPITRIAL
REPORT zsalesbapitrial.
TABLES : vbak , vbap.
Parameter Screen.
Sales Document Type.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Sales document type.
PARAMETERS: p_auart TYPE vbak-auart OBLIGATORY.
Sales Organisation.
PARAMETERS: p_vkorg TYPE vbak-vkorg OBLIGATORY.
Distribution channel.
PARAMETERS: p_vtweg TYPE vbak-vtweg OBLIGATORY.
Division.
PARAMETERS: p_spart TYPE vbak-spart OBLIGATORY.
SKIP 1.
Sold to.
PARAMETERS: p_sold TYPE vbak-kunnr OBLIGATORY.
Ship to.
PARAMETERS: p_ship TYPE vbak-kunnr OBLIGATORY.
SKIP 1.
Material(Article No).
PARAMETERS: p_matnr TYPE vbap-matnr OBLIGATORY.
Quantity (Cummulative quantity of sales Order)
PARAMETERS: p_menge type vbap-kwmeng obligatory.
Plant(Site )
parameters: p_plant type vbap-werks obligatory.
SELECTION-SCREEN END OF BLOCK b1.
Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Header data
Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
Ship to
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Check the return table.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in creating document'.
ELSE.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
but its giving 'Error in creating document' I m unable to figure wat i m missing . Is it tht i m gving wrong parameters.
Please help !!!Does tht mean i need to add the following code
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
For second item.
Line item number.
item-itm_number = '000020'.
itemx-itm_number = 'X'.
Material
item-material = '600020001'.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule lines
lt_schedules_in-itm_number = '000020'.
lt_schedules_in-sched_line = '0002'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Fill schedule line flags
lt_schedules_inx-itm_number = '000020'.
lt_schedules_inx-sched_line = '0002'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
But i guess it is overwritting my frst material..
Also i m gettin a error
For object rv_beleg, number range interval doesnot exist
Pls suggest -
Hi Experts
I am trying to create a sales order using BAPI FM BAPI_SALESORDER_CREATEFROMDAT1. After executing the program it shows in output screen that the sales order created and also displays the newly created sales order number. But when I want to check the order from VA03 it shows Express document "Update was terminated" received by author AAA, where AAA is login name.
I also analysis the sort dump for which the update process was terminated. I give the error details
Runtime Errors DBIF_RSQL_INVALID_REQUES
Error analysis
An invalid request was made to the SAP database interface in a statement
in which the table "KONV " was accessed.
Below are the module name and report from where the error is coming.
Function Module name RV_SALES_DOCUMENT_ADD
Program Name SAPLV45U
Include LV45UF0K
Row 26
Source code from Rruntime Error
Line SourceCde
1 *****************************************************************
2 * Unterroutinen RV-Auftragsabwicklung alphabetisch sortiert:
3 * ----------------------------------------------------------
4 * Buchstabe K:
5 *
6 *****************************************************************
7
8 *----------------------------------------------------------------
9 * FORM KONV_BEARBEITEN
10 *----------------------------------------------------------------
11 FORM KONV_BEARBEITEN.
12
13 CHECK: FKONV_GEAENDERT NE SPACE OR
14 VORGANG = CHARH.
15
16 IF VORGANG NE 'H'.
17 DELETE FROM KONV WHERE KNUMV = VBAK-KNUMV.
18 ENHANCEMENT-POINT KONV_BEARBEITEN_10 SPOTS ES_SAPLV45U.
19 ENDIF.
20
21 LOOP AT FXKOMV.
22 FXKOMV-MANDT = VBAK-MANDT.
23 FXKOMV-KNUMV = VBAK-KNUMV.
24 MODIFY FXKOMV.
25 ENDLOOP.
>>>>> INSERT KONV FROM TABLE FXKOMV.
27 IF SY-SUBRC NE 0.
28 MESSAGE A100 WITH
29 ENDIF.
30
31 ENHANCEMENT-POINT KONV
32 ENDFORM.
33 *eject
Below is my source code.
*& Report Z_BAPI_SALESORDER
REPORT z_bapi_salesorder.
* Sales document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
PARAMETERS: p_auart TYPE auart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Sales organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Distribution channel
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Division.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
* Sold-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Ship-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
PARAMETERS: p_ship TYPE kunnr.
SELECTION-SCREEN END OF LINE.
SKIP 1.
* Material
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Quantity.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
PARAMETERS: p_menge TYPE dzmengc OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF LINE.
* Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapiitemin OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapireturn1 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapisdhedu
WITH HEADER LINE.
* Initialization.
INITIALIZATION.
v_text = 'Order type'.
v_text1 = 'Sales Org'.
v_text2 = 'Distribution channel'.
v_text3 = 'Division'.
v_text4 = 'Sold-to'.
v_text5 = 'Ship-to'.
v_text6 = 'Material'.
v_text7 = 'Quantity'.
v_text9 = 'Plant'.
* Start-of-selection.
START-OF-SELECTION.
* Header data
* Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
* Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
* Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
* Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
* Partner data
* Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
* Ship to
partner-partn_role = 'WB'.
partner-partn_numb = p_ship.
APPEND partner.
* ITEM DATA
itemx-updateflag = 'I'.
* Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
* Material
item-material = p_matnr.
itemx-material = 'X'.
* Plant
item-plant = p_plant.
itemx-plant = 'X'.
* Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
* Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
* Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
EXPORTING
order_header_in = header
* WITHOUT_COMMIT = ' '
* CONVERT_PARVW_AUART = ' '
IMPORTING
salesdocument = v_vbeln
* SOLD_TO_PARTY =
* SHIP_TO_PARTY =
* BILLING_PARTY =
* RETURN =
TABLES
order_items_in = item
order_partners = partner
* ORDER_ITEMS_OUT =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CCARD =
* ORDER_CFGS_BLOB =
order_schedule_ex = lt_schedules_in
* Check the return table.
IF v_vbeln <> space.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'Document ', v_vbeln, ' created'.
ELSE.
WRITE: / 'Error in creating document'.
ENDIF.
I am unable to trace the exact reason. Please help and thanks in advance.
Edited by: Joy Banerjee on Oct 12, 2009 7:47 AMHi Prashant,
Set the profile parameter abap/buffersize value to maximum.Get the virtual memory increased.
If it doesn't work, see in transaction db02 if there is sufficient tablespace.
Let me knoe the status of tablespaces.
Regards,
Sabita -
Error in sales order creation using bapi
Hi,
Iam trying to create sales order by using BAPI_SALESORDER_CREATEFROMDAT1 and when iam trying to execute
the function module by passing all th eparameters and iam getting the error as
inspite of entering sold_to_party and ship_to_party details in table ORDER_PARTNERS
"enter the sold_to_party or ship to party details"
please help me out in this isue its an urgent.
Thanks.
sayed.Can you share the codes ?
Thanks.
Ashish -
Getting error in while changing sales order which is created using BAPI
Hi All,
I have created the sales order using BAPI ( BAPI_SALESORDER_CREATEFROMDAT1 ) and i am successfully creating sales order using this BAPI. But while i want to change sales order iam changing Shipping Conditions in Header Data of sales order .its giving an error .can any know any thing about this.
Error mesage : No status object is available for SDI 300082407/10 (Order Number/Item Number)
In Header i am passing these values ...
wa_order_header_in-doc_type = vbak-auart.
wa_order_header_in-sales_org = vbak-vkorg.
wa_order_header_in-distr_chan = vbak-vtweg.
wa_order_header_in-division = vbak-spart.
Do i required to pass the below values ? in Header structure ( BAPISDHEAD1 ).
REFOBJECTTYPE
REFOBJECTKEY
REFDOCTYPE
Regards,
Sudhakar Reddy Arectified
-
BAPI_SALESORDER_CREATEFROMDAT1 Purchase Requisition Creation
I am creating sales orders using BAPI_SALESORDER_CREATEFROMDAT1. Some of the sales orders include a third-party item which require a PO. Well I have it creating the purchase requisition it errors out because it can't determine the consumption account. What is happening is the Value Price is coming through blank, on the requisition, so the sales order fails. How can I pass the Value Price or what configuration do I need to do to the material master for automatic entry?
DavisHi,
I have got some fields.
Thank You,
KishoreJ. -
BAPI for sales order BAPI_SALESORDER_CREATEFROMDAT1
i am getting an error sold yo patry shouls be specified even after given all the reqiired data can any one tell mewhat is the problem?
TYPES : begin of ty_head,
IDENT(4) TYPE C,
DOC_TYPE(4) type c, "Sales Document Type
SALES_ORG(4) type c, " Sales Organization
DISTR_CHAN(2) TYPE C, "Distribution Channel
DIVISION(2) TYPE C, " DIVISION
SALES_OFF(4) TYPE C,
SALES_GRP(3) TYPE C,
PURCH_NO_C(35) TYPE C, "Customer purchase order number
PURCH_DATE(8) TYPE C,
PRICE_DATE(8) TYPE C,
PMNTTRMS(4) TYPE C,
INCOTERMS1(3) TYPE C,
INCOTERMS2(28) TYPE C,
DLV_BLOCK(2) TYPE C,
BILL_BLOCK(2) TYPE C,
end of ty_head.
TYPES : BEGIN OF TY_ITEM,
IDENT(4) TYPE C,
ITM_NUMBER(6) TYPE C,
MATERIAL(18) TYPE C,
QUAN
TARGET_QTY(13) type c, " Target quantity in sales units
TARGET_QU(3) type c, " Target quantity UoM
PLANT(4) TYPE C,
SHORT_TEXT(40) type c,
CURRENCY(5) type c,
SHIP_POINT(4) type c,
STORE_LOC(4) type c,
NET_WEIGHT(25) type c,
UNTOF_WGHT(3) type c,
GROSS_WGHT(15) type c,
PARTN_ROLE(2) TYPE C, "ship-to party we can give any kunnr
PARTN_NUMB(10) TYPE C,
REQ_DATE(8) type c,
REQ_DLV_BL(2) type c,
COND_VALUE(28) type c,
COND_P_UNT(5) type c,
COND_UNIT(3) type c,MBER(6) type c,
COND_TYPE(4) type c,
END OF TY_ITEM.
DATA : wa_head type ty_head.
data : wa_item type ty_item.
data : tt_head type standard table of ty_head.
data : tt_item type standard table of ty_item.
data : wa_BAPISDHEAD type BAPISDHEAD,
wa_BAPISDHD1X type BAPISDHD1X,
wa_BAPIITEMIN type BAPIITEMIN,
wa_BAPISDITMX type BAPISDITMX,
wa_BAPIPARTNR type BAPIPARTNR,
wa_BAPISDHEDU type BAPISDHEDU,
wa_BAPISCHDLX type BAPISCHDLX,
wa_BAPICOND type BAPICOND,
wa_BAPICONDX type BAPICONDX.
data : TT_BAPIITEMIN type standard table of BAPIITEMIN,
TT_BAPISDITMX type standard table of BAPISDITMX,
TT_BAPIPARTNR type standard table of BAPIPARTNR,
TT_BAPISDHEDU type standard table of BAPISDHEDU.
data : wa_return type BAPIRETURN1.
DATA : TT_RETURN TYPE STANDARD TABLE OF BAPIRET2.
data : v_msg type string.
data : Q_FNAME TYPE STRING.
parameters : p_fname type rlgrap-filename.
parameters : s_fname type rlgrap-filename.
at selection-screen on value-request for p_fname.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = p_fname
move p_fname to q_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = q_fname
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = tt_head
clear q_fname.
at selection-screen on value-request for s_fname.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = s_fname
move s_fname to q_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = q_fname
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = tt_item
loop at tt_head into wa_head.
move : wa_head-DOC_TYPE to WA_BAPISDHEAD-DOC_TYPE,
wa_head-SALES_ORG to WA_BAPISDHEAD-SALES_ORG,
wa_head-DISTR_CHAN to WA_BAPISDHEAD-DISTR_CHAN,
wa_head-DIVISION to WA_BAPISDHEAD-DIVISION,
wa_head-SALES_OFF to WA_BAPISDHEAD-SALES_OFF,
wa_head-SALES_GRP to WA_BAPISDHEAD-SALES_GRP,
wa_head-PURCH_NO_C to WA_BAPISDHEAD-PURCH_NO_C,
wa_head-PURCH_DATE to WA_BAPISDHEAD-PURCH_DATE,
wa_head-PRICE_DATE to WA_BAPISDHEAD-PRICE_DATE,
wa_head-PMNTTRMS to WA_BAPISDHEAD-PMNTTRMS,
wa_head-INCOTERMS1 to WA_BAPISDHEAD-INCOTERMS1,
wa_head-INCOTERMS2 to WA_BAPISDHEAD-INCOTERMS2,
wa_head-DLV_BLOCK to WA_BAPISDHEAD-DLV_BLOCK,
wa_head-BILL_BLOCK to WA_BAPISDHEAD-BILL_BLOCK.
LOOP AT TT_ITEM INTO WA_ITEM WHERE IDENT = WA_HEAD-IDENT.
MOVE : WA_ITEM-ITM_NUMBER to wa_BAPIITEMIN-ITM_NUMBER,
WA_ITEM-MATERIAL to wa_BAPIITEMIN-MATERIAL,
WA_ITEM-TARGET_QTY to WA_BAPIITEMIN-TARGET_QTY,
WA_ITEM-TARGET_QU to wa_BAPIITEMIN-TARGET_QU,
WA_ITEM-PLANT to wa_BAPIITEMIN-PLANT,
WA_ITEM-SHORT_TEXT to wa_BAPIITEMIN-SHORT_TEXT,
WA_ITEM-CURRENCY to wa_BAPIITEMIN-CURRENCY,
WA_ITEM-SHIP_POINT to wa_BAPIITEMIN-SHIP_POINT,
WA_ITEM-STORE_LOC to wa_BAPIITEMIN-STORE_LOC.
MOVE : WA_ITEM-ITM_NUMBER TO WA_BAPIITEMIN-ITM_NUMBER,
WA_ITEM-COND_VALUE TO WA_BAPIITEMIN-COND_VALUE,
WA_ITEM-CURRENCY TO WA_BAPIITEMIN-CURRENCY,
WA_ITEM-COND_P_UNT TO WA_BAPICOND-COND_P_UNT,
WA_ITEM-COND_UNIT TO WA_BAPIITEMIN-COND_UNIT,
WA_ITEM-COND_TYPE TO WA_BAPIITEMIN-COND_TYPE.
APPEND wa_BAPIITEMIN TO TT_BAPIITEMIN.
move : WA_ITEM-ITM_NUMBER TO WA_BAPIPARTNR-ITM_NUMBER,
WA_ITEM-PARTN_ROLE TO WA_BAPIPARTNR-PARTN_ROLE,
WA_ITEM-PARTN_NUMB TO WA_BAPIPARTNR-PARTN_NUMB.
APPEND WA_BAPIPARTNR TO TT_BAPIPARTNR.
move : WA_ITEM-ITM_NUMBER TO wa_BAPISDHEDU-itm_number,
WA_ITEM-REQ_DATE TO WA_BAPISDHEDU-REQ_DATE,
WA_ITEM-REQ_DLV_BL TO WA_BAPISDHEDU-REQ_DLV_BL.
APPEND WA_BAPISDHEDU TO TT_BAPISDHEDU.
ENDLOOP.
AT END OF IDENT.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
EXPORTING
ORDER_HEADER_IN = wa_BAPISDHEAD
WITHOUT_COMMIT = ' '
CONVERT_PARVW_AUART = ' '
IMPORTING
SALESDOCUMENT =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN = WA_return
TABLES
ORDER_ITEMS_IN = tt_BAPIITEMIN
ORDER_PARTNERS = tt_BAPIPARTNR
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CCARD =
ORDER_CFGS_BLOB =
ORDER_SCHEDULE_EX = tt_BAPISDHEDU
*& COMMIT WORK
LOOP AT tt_return into wa_return WHERE type = 'S' OR type = 'I' OR type = 'W'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ELSE.
*& ROLL BACK
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
ENDIF.
ENDLOOP.
ENDAT.Hi,
You can try by passing the item number in the partner table as '000000' because sold to party belongs to header mainly.
Thanks,
radha. -
Error thrown in BAPI for SALE order
Hi,
In BAPI_SALESORDER_CREATEFROMDAT1 i got one error
Personnel master record (some number) does not exist for sales
How to solve this issue. Please give the solution.
thanks,
Suresh.MHi,
Can you please mention the exact data you are passing to the bapi ?
Kindly, check the partners details you are passing in the bapi as well.
KR Jaideep, -
hi,
iam getting following error in file to bapi scenario.plz help me
2007-11-02 17:21:20 Success RFC adapter received a synchronous message. Attempting to send sRFC for BAPI_SALESORDER_CREATEFROMDAT1
2007-11-02 17:21:21 Error Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.af.rfc.util.bapi.BapiException: Parameter RETURN has type "BAPIRETURN1" which is unknown.
2007-11-02 17:21:21 Error The message status set to NDLV.
2007-11-02 17:21:21 Error Delivery of the message to the application using connection AFW failed, due to: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.af.rfc.util.bapi.BapiException: Parameter RETURN has type "BAPIRETURN1" which is unknown..
T & G
vijuhi vijendra
check this forum discussion
Treating BAPI return in RFC Receiver Adapter
regards
Ramesh P -
Hi all,
I have been given with a task like creating function module for sales return For that i am using standard BAPI BAPI_SALESORDER_CREATEFROMDAT1 .To this BAPI i am passing all necessary inputs with doc_type as RE.When i execute this Function module ,its showing Following error
EV1 761Unpermitted combination of business object BUS2032 and sales doc. category H
This BAPI is working for Sales order creation ,But for Sales return not working .what would be the problem?please help me out.
with regards
naresh bammidiUnpermitted combination of business object BUS2032 and sales doc. category H
The business object for returns is BUS2102. TheBAPI you mentioned has a hard coded value of BUS2032 which is not for a return sale order. Have a look into the bapi function available in SWO1 for BUS2102, its BAPI_CUSTOMERRETURN_CREATE. Please try with that.
Kesav -
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. -
Sales Order Creation from BAPI Error
Hi Friends,
I am using BAPI_SALESORDER_CREATEFROMDAT1 to create the Sales Order. But I am getting an error when I am executing the FM. I am filling the following Information and passing on the information to the BAPI FM. Details:
IMPORT PARAMETERS:
ORDER_HEADER_IN:
DOC_TYPE: OR
SALES_ORG: BP01
DISTR_CHAN: 01
DIVISION: 01
REQ_DATE_H: 29.08.2008
PURCH_DATE: 29.08.2008
INCOTERMS1: FH
INCOTERMS2: PALO ALTO
PMNTTRMS: 0001
SHIP_COND: 01
CURRENCY: USD
TABLES:
ORDER_ITEMS_IN:
ITM_NUMBER: 10
MATERIAL: XXXX-6
PLANT: BP01
REQ_QTY: 20
SALES_UNIT: EA
ITEM_CATEG: AGN
SHORT_TEXT: TEST MATERIAL
ORDER_PARTNERS:
PARTN_ROLE: SH
PY
BP
SP
PART_NUMB: 1000
1000
1000
1000
By using the above information, when I am executing the FM I am getting error
EXPORT PARAMETERS
RETURN:
TYPE: E
ID AM
NUMBER 216
MESSAGE Incomplete address; enter country
But when I am creating it from the VA01 Transaction, I am able to create Sales Order Successfully.
Friends, please help me in this regard.
Yours
Pradeep Goli
Edited by: Pradeep Goli on Sep 8, 2008 2:56 PMHi,
I hope the below link will help you.
Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
Thanks,
Khushboo. -
Error in starting Adobe Bridge in Photoshop CS2
I've just installed Photoshop CS2, however upon opening Adobe Bridge this error message appears " The application has failed to start because libagluc28.dll was not found. Reinstalling to application may fix the problem"
I have reinstalled and click repair but to no avail
I followed Adobe Support Knowledgebase solution and run CMD and this appears:
c:Documents and Settings/Jesus M Ferraris>
then i entered the command
cacls c:\windows\installer /T /E /C /G administrators:F
but an error message appears - 'cacls' is not recognized as an internal or external command, operable program or bathc file
I also entered the next command
cacls "c:\documents and setting\all users" /Y /E /C /G administrators:F
still the same error as above appears, Please help, have I miss something or was my procedure correct...
P4, 512ram, WXP 80gHDVery useful.
Good Luck.
My
Si
tes
Maybe you are looking for
-
MacBook Pro (2010) Trackpad 2 finger scroll gesture
I upgraded to OS Lion and I cannot get the scroll direction: natural two finger scroll to work. I have tried playing around with the trackpad in system preferences to no avail. Any ideas from anyone? I saw something about Terminal in another threa
-
Jar file for tcRequestOperationsIntf class
Hi, Could you please let me know the jar file name where tcRequestOperationsIntf class is present. I need to do some API operation using this class. Please help. Thanks
-
TSA error code: fffcffce in SBCON NW6.5
Hi, I have HP Proliant ML 530 G4 1GB RAM XEON 3GHz server with installed HP StorageWorks DAT 72i. Dat 72i is corectly installed , i can add and change label of tape, but when a try make backup using SBCON i got following eror information. Tape casset
-
App Store is crashing out, what can I do?
AppStore crashing 2 seconds after opening. Anyone have any ideas on what to do? Just wait and hope it works again sometime in the near future?
-
Guided Procedures - Hiding the attachments bar
I've been able to hide the titlebar and the sidebar from a GP task by changing the Portal page delivered by SAP: (pcd:portal_content/com.sap.pct/platform_add_ons/com.sap.caf.eu.gp.folders.gp/com.sap.caf.eu.gp.folders.pages/com.sap.caf.eu.gp.pages.pro