Error in sales order transfer using BDOC
Hi Experts,
I have some sales orders which are created at CRM system and posted to R/3 system using BDOC's. I have problem that the orders which are created on CRM system are coming to R/3 using BDOC but they we are not able to change them in R/3.
In R/3 transaction VA02 its saying that this order is already getting edited by some system user and it is locked and cannot be changed.
Can anyone help me on this issue.
Thanks&Regards,
Hemanth
Can you share the codes ?
Thanks.
Ashish
Similar Messages
-
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 -
Sales Orders transfer using CIF
Hi,
We are having a rather peculiar situation in our project where Sales orders do not get CIFfed across to APO. The suspicion that it could be due to a RFC issue seems to be pretty slim, considering the fact that Product and Locations are getting CIFfed across properly. When the integration model is activated there is a clear message however that the sales order is transmitted. But same is not seen using the CIF comparison report /SAPAPO/CCR.
Have any of you guys observed a situation like this?
Thanks much,
SrikanthSrikanth,
we are not able to access the inbound queue of APO using the button still.
QRFC monitor is the equivalent of SMQ1. You can review, delete, or reprocess outbound queues, or individual Logical Unit of Work (LUWs) here. In R/3, generally, you cannot repair any APO queues, such as the APO inbound. For this, you must log onto APO.
When you click 'ignore', the error is ignored and the next LUW is processed. If there are no futher errors, or if you press ignore repeatedly, you will eventually process every possible LUW in the queue. The errored LUWs remain in the queue, unprocessed, with an error status, and the final queue event is never reached. Without the final event the IM will not be activated
There are 4 possible queues. 1. R/3 outbound and optionally 2. APO inbound; 3. APO outbound and optionally 4. R/3 inbound.
Using SMQ1 and SMQ2 in R/3 you can only manage the R/3 queues (r/3 outbound and r/3 inbound). If you wish to repair or delete the APO outbound or inbound, you must log ont APO and use SMQ1 (outbound) and SMQ2 (inbound). Most people I know just use /SAPAPO/CQ, where, assuming proper authorization is set up, it can be configured to both review and edit all four queues in one transaction.
Now you say you cannot get new orders to go across without Deactivate/reactivate. This implies that the IM is not configured properly for real time replication. Did you read the connectivity and replication guides I mentioned earlier? Specifically the section about "Activating the Application Indicator" (BF11)?
Regards,
DB49 -
Error in sales order creation using FM IDOC_INPUT_ORDERS
Hi experts,
I am using FM IDOC_INPUT_ORDERS for IDoc processing for creating sales order.
I have added customized fields over VA03 screen and to VBAP table.
I am using user exit EXIT_SAPLVEDA_001 for populating these additional fields.
Here I am writing below code for customized segment:
WHEN 'Z1EDP01'.
x_Z1EDP01 = segment-sdata.
xvbap-ZZNETWR = x_Z1EDP01-ZZNETWR.
xvbap-ZZTAX = x_Z1EDP01-ZZTAX.
xvbap-ZZGRSWR = x_Z1EDP01-ZZGRSWR.
Move-Corresponding xvbap to dxvbap.
After this, sales order is getting created but these additional fields are not populated over the VA03 screen. Can you tell me whats wrong in code or any configuration error?
Thanks,
~SachinDXVBAP is an internal table for this exit, where do you modify the line of this itab. (can you post the code with the READ TABLE dxvbap and MODIFY wa/fs statements)
([Note 753153 - FAQ: Customer-functions in IDOC_INPUT_ORDERS|https://service.sap.com/sap/support/notes/753153])
Regards,
Raymond -
Error in sales order creation using BAPI_SALESORDER_CREATEFROMDAT2
Hi all,
Pl look into below code :
Here order is getting created , however ship to party and sold to party shows the same value.
*& Report ZSD_SALEORDCRE
report zsd_saleordcre.
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,
schedules*
li_order_schedules_in type standard table of bapischdl,
l_order_schedules_in like bapischdl,
li_order_schedules_inx type standard table of bapischdl,
l_order_schedules_inx like bapischdl,
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 = 'WE'. "Remember German codes !
l_order_partners-partn_numb = '0000000101'.
append l_order_partners to li_order_partners.
l_order_partners-partn_role = 'SP'. "Remember German codes !
l_order_partners-partn_numb = '0000000107'.
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 = 'ZOD2'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
Sales organization*
l_order_header_in-sales_org = '1100'.
l_order_header_inx-sales_org = 'X'.
Distribution channel*
l_order_header_in-distr_chan = '20'.
l_order_header_inx-distr_chan = 'X'.
Division*
l_order_header_in-division = '10'.
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'.
l_order_header_in-purch_date = '20090817'.
l_order_header_inx-purch_date = '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 = 'X'.
l_order_items_in-material = '29019501AA'.
l_order_items_inx-material = 'X'.
l_order_items_in-plant = 'WH03'.
l_order_items_inx-plant = 'X'.
append l_order_items_in to li_order_items_in.
l_order_items_in-itm_number = '20'.
l_order_items_inx-itm_number = 'X'.
l_order_items_in-material = '29066641'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = l_order_items_in-material
importing
output = l_order_items_in-material.
l_order_items_inx-material = 'X'.
l_order_items_in-plant = 'WH03'.
l_order_items_inx-plant = '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.
l_order_schedules_in-itm_number = '10'.
l_order_schedules_in-req_qty = '10.00'.
append l_order_schedules_in to li_order_schedules_in.
l_order_schedules_in-itm_number = '20'.
l_order_schedules_in-req_qty = '20.00'.
append l_order_schedules_in to li_order_schedules_in.
CALL Bapi*
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
order_header_in = l_order_header_in
order_header_inx = l_order_header_inx
testrun = ' '
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
order_schedules_in = li_order_schedules_in.
order_schedules_inx = li_order_schedules_inx.*
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.
What could be problem ?
Pl help
Regards
NagarajanHi,
Go through this sample code
LOOP AT t_salesorder INTO wa_salesorder.
t_header-sales_org = wa_salesorder-vkorg.
t_header-distr_chan = wa_salesorder-vtweg.
t_header-division = wa_salesorder-spart.
t_header-doc_type = wa_salesorder-auart.
APPEND t_header.
t_headerx-sales_org = 'X'.
t_headerx-distr_chan = 'X'.
t_headerx-division = 'X'.
t_headerx-doc_type = 'X'.
APPEND t_headerx.
t_itemx-material = 'X'.
t_itemx-target_qty = 'X'.
APPEND t_itemx.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_salesorder-kunnr
IMPORTING
output = wa_alpha-kunnr.
wa_partner-partn_role = 'AG'.
wa_partner-partn_numb = wa_alpha-kunnr.
APPEND wa_partner TO t_partner.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_salesorder-kunnr1
IMPORTING
output = wa_alpha-kunnr1.
wa_partner-partn_role = 'WE'.
wa_partner-partn_numb = wa_alpha-kunnr1.
APPEND wa_partner TO t_partner.
wa_item-po_itm_no = wa_salesorder-bstnk.
wa_item-itm_number = wa_salesorder-posnr.
wa_item-material = wa_salesorder-matnr.
wa_item-target_qty = wa_salesorder-kwmeng.
APPEND wa_item TO t_item.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = t_header
order_header_inx = t_headerx
IMPORTING
salesdocument = gv_doc_no
TABLES
return = t_return
order_items_in = t_item[]
order_items_inx = t_itemx
order_partners = t_partner[].
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = t_return.
ENDLOOP.
Please paste only the portion of your code that gives you trouble. -
Sales Order Upload using IDOC : Batch Input error
Hi all
When I am uploading sales order data using <b>idoc</b> method it was giving the below error when the Items are more than 10,if the items are less than 10 it was creating the sales order successfully.
<b>Screen 0000 is too large for internal batch input area</b>
for upload I am using the standard Meassege type and Basic idoc type
Message type : ORDERS
Basic idoc type : ORDERS05
Function Module : idoc_input_orders(ORDE)
Please help if there is any Idea
Thanks in Advance
Warm regards
RajasekharHi Madhu,
This error might be due to screen resolution. Try to reduce screen resolution and run your program.
Cheers
Manohar -
Error in creation of sales order bu using BAPI_SALESORDER_CREATEFROMDAT2
Hi ,
I am trying to create sales order by using bapi.
after passing all the parameters to bapi iam getting message as shown below.
SALES_HEADER_IN has been processed successfully
SALES_ITEM_IN has been processed successfully
<b>Order receipt/delivery not possible, credit customer blocked</b>
I had passed scedule line data ,and BAPI_TRANSACTION_COMMIT
also still iam getting this message.
please help me out of this problem.
Thanks,
Shuja.Hi Shuja
I guess the message is just a warning eventhough the order is created. The warning message states that Auto-Delivery can not be created.
Please check below to understand how the customer is blocked:
1. Manual Block -> Transaction XD03
-->Menupath: Extras->Blocking Data
2. Credit Block -> Transaction FD33
--> In the overview screen check the difference of value between Credit Limit & Credit Exposure
I guess in the case whereby Credit Limit value is less than Credit Exposure also this can happen.
Please try using a different Customer. Also simulate via transaction VA01.
Hope this helps.
Kind Regards
Eswar -
Miss value FI Posting on Sales Order Transfer Posting movement Type 413 E
Dear Expertise
I've a problem about sales order transfer posting. My both of Sales order (Source & Destination) are make to order and open with configurable material(KMAT). Both of sales order contain only one item on the same material no.
Assume scenario material vastr
Assume that material vastr is configurable material wait for sales order to fill characteristic and it was maintained standard price value = 1100
Sales order A has plan cost on material VASTR 1000
Sales order B has plan cost material VASTR 980
When we make a sales order transfer posting(Transfer from Sales Order A-> B) by transaction MIGO_TR by use movement type 413 E. It can post a transfer complete. But my problem is when I trace to FI-Document
It was post like this
Dr. Standard price 1100
Cr. price for Sales order A(src.) 1000
Cr. Cost Variance +100
I don't want it to offset with standarad price value. I want it to do like this
Dr. price for Sales order B(Des.) 980
Cr. price for Sales order A(src.) 1000
Dr. Cost Variance +20
How can I configure it? I trial to clear standard price by MR21, System can do it . But I don't want to clear it because it impact to other. I want to know. How can I configure system to take both of plan cost of sales order to offset each other please.
Edited by: Gareth John on Aug 16, 2010 2:23 PM
Edited by: Gareth John on Aug 16, 2010 2:42 PM
Edited by: Gareth John on Aug 16, 2010 2:42 PMHi,
411- E- sales order to own stock
412-E- Reversal of 411 E
& 413-E-Sales order to sales order.
Regards,
Piyush -
Change only material qunatity in sales order by using BAPI
Hi All,
How to change only the material quantity in existing sales order by using BAPI.
Please help me in this regards.
Regards
Deekshitha.Hi
See the sample code and do accordingly
REPORT Z_SALES_ORDER_CHANGE
NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 65(0)
MESSAGE-ID ZZ.
TABLES: VBAP.
DATA:
V_FILEIN(90) TYPE C,
V_RECIN TYPE I,
V_RECVBAP TYPE I,
V_RECORDER TYPE I,
V_VBELN LIKE VBAP-VBELN,
ORDERHEADERINX LIKE BAPISDH1X.
DATA: BEGIN OF I_ORDERS OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
BRGEW(18) TYPE C,
VOLUM(18) TYPE C,
END OF I_ORDERS.
DATA: BEGIN OF I_OUTPUT OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
GEWEI LIKE VBAP-GEWEI,
BRGEW LIKE VBAP-BRGEW,
VOLUM LIKE VBAP-VOLUM,
CKWGT TYPE C,
CKVOL TYPE C,
END OF I_OUTPUT.
DATA: BEGIN OF ORDERITEMIN OCCURS 0.
INCLUDE STRUCTURE BAPISDITM.
DATA: END OF ORDERITEMIN.
DATA: BEGIN OF ORDERITEMINX OCCURS 0.
INCLUDE STRUCTURE BAPISDITMX.
DATA: END OF ORDERITEMINX.
DATA: BEGIN OF RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF RETURN.
DATA: BEGIN OF BAPIRETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF BAPIRETURN.
PARAMETERS:
P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
START-OF-SELECTION.
CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
OPEN DATASET
IF V_FILEIN IS INITIAL.
MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
ELSE.
OPEN DATASET V_FILEIN
FOR INPUT
IN TEXT MODE.
IF SY-SUBRC = 0.
READ DATASET
DO.
READ DATASET V_FILEIN INTO I_ORDERS.
IF SY-SUBRC = 0.
APPEND I_ORDERS.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET
CLOSE DATASET V_FILEIN.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
ENDIF.
ELSE.
MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
ENDIF.
ENDIF.
SORT AND REMOVE DUPLICATES FROM I_ORDERS
SORT I_ORDERS BY VBELN POSNR.
DELETE ADJACENT DUPLICATES FROM I_ORDERS.
POPULATE I_OUTPUT
LOOP AT I_ORDERS.
SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
SELECT SINGLE BRGEW VOLUM
FROM VBAP
INTO (VBAP-BRGEW, VBAP-VOLUM)
WHERE VBELN = I_ORDERS-VBELN
AND POSNR = I_ORDERS-POSNR.
IF SY-SUBRC = 0.
IF VBAP-BRGEW = 0.
I_OUTPUT-CKWGT = 'X'.
ENDIF.
IF VBAP-VOLUM = 0.
I_OUTPUT-CKVOL = 'X'.
ENDIF.
I_OUTPUT-VBELN = I_ORDERS-VBELN.
I_OUTPUT-POSNR = I_ORDERS-POSNR.
I_OUTPUT-GEWEI = 'ST'.
I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
APPEND I_OUTPUT.
CLEAR: I_OUTPUT.
ENDIF.
V_RECIN = V_RECIN + 1.
ENDLOOP.
POPULATE BAPI DATA AND RUN BAPI
CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ORDERHEADERINX-UPDATEFLAG = 'U'.
LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
V_RECVBAP = V_RECVBAP + 1.
IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
CLEAR: ORDERITEMIN, ORDERITEMINX,
RETURN, BAPIRETURN.
REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
ENDIF.
ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
IF NOT I_OUTPUT-CKWGT IS INITIAL.
ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
ORDERITEMINX-GROSS_WGHT = 'X'.
ENDIF.
IF NOT I_OUTPUT-CKVOL IS INITIAL.
ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
ORDERITEMINX-VOLUME = 'X'.
ENDIF.
APPEND ORDERITEMIN.
ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
ORDERITEMINX-UNTOF_WGHT = 'X'.
ORDERITEMINX-UPDATEFLAG = 'U'.
APPEND ORDERITEMINX.
V_VBELN = I_OUTPUT-VBELN.
ENDLOOP.
RUN BAPI ON LAST ORDER
IF NOT ORDERITEMIN IS INITIAL.
V_RECORDER = V_RECORDER + 1.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = V_VBELN
ORDER_HEADER_INX = ORDERHEADERINX
TABLES
RETURN = RETURN
ORDER_ITEM_IN = ORDERITEMIN
ORDER_ITEM_INX = ORDERITEMINX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
WRITE OUT RETURN
LOOP AT RETURN.
WRITE: / RETURN.
ENDLOOP.
WRITE: / BAPIRETURN.
SKIP.
ENDIF.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
SKIP.
WRITE OUT RECORD COUNT FROM FILE
WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
SKIP.
TOP OF PAGE
TOP-OF-PAGE.
WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
100(8) TEXT-H02, 126(8) SY-PAGNO.
WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
20(77) TEXT-H04,
100(8) TEXT-H05, 108(25) SY-REPID.
WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
20(4) TEXT-H07, 25(32) SY-HOST,
100(13) TEXT-H08, 121(8) SY-SYSID,
129 '/', 130(3) SY-MANDT.
ULINE.
SKIP.
Reward points if useful
Regards
Anji -
Error in sales order when selecting a warranty item in configurator 'Please enter required information - Service Reference Type Code'
Not able to book the sales order because of this issueOrder Management does not support the inclusion of optional service items in a configured Model BOM (see Support article #1296751.1 for more detail). Allowing for such would therefore require customization.
As you've found, there's no modeling restriction that prevents you from creating a Model BOM that includes optional service items, nor is there any problem with creating a Configurator Model for it. And required service items (such as a warranty item that is a required child of an optional BOM component) do not present a problem; they have nothing to do with Configurator, and would never appear as sub-lines in OM. The problem arises in OM, which requires that any service item be "associated" to the item it's "servicing". OM does not automatically make such an association with service sub-lines, even though it might be argued that an association may be inferred by the BOM structure (i.e., OM does not assume that an optional service sub-line is necessarily associated, from a service standpoint, with its BOM parent). OM customization is therefore required in order to hook any service item up to its corresponding product item. Many customers who configure service along with product have implemented such a customization.
(Another gap in such a solution that may be relevant to you is that for an included optional service item requiring recurring billing, Order Management does not create the requisite Service Contract. Customers have likewise developed customizations to address this, as well.)
As this is not specifically a Configurator matter (you could have created your order without using Configurator at all, and you would have experienced the exact same behavior), please do not take my explanation as being either authoritative or comprehensive (I am a Configurator expert, and only knowledgeable enough about Order Management to be dangerous). It would be advisable for you to seek more detailed information/recommendations from the Order Management forum.
Eogan -
Reena Prabhakar - Sales order creation Using BAPI
Hi Reena,
This is Dinesh,i also face problem in Sales order creation using BAPI if you can send me the code it would be great help to me.
Regards,
DineshAnyhow, here is the code that I am using currently which works perfectly well. Not sure if it will be of any help to you, since the values to the BAPI come from the Webdynpro application. I have values stored in my "Test data directory" which I use for testing from the backend.
FUNCTION ztest.
Call the BAPI to create Sales Order
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header
IMPORTING
salesdocument = l_salesdocument
TABLES
return = it_return
order_items_in = it_order_items
order_partners = it_order_partners
order_schedules_in = it_order_schdl
order_conditions_in = it_order_conditions
order_text = it_order_text.
READ TABLE it_return WITH KEY type = 'E'.
IF sy-subrc = 0.
*-- error occured
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
*-- no error
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDFUNCTION. -
Error with sales order header text
Hi All,
I am getting 3 texts from 850 IDOC on to Sales order header texts. I created 3 new textid's for them. This is working properly in Dev system and I just moved them to Test system. I created a sales order by using the IDOC. I tried to go to order header texts and it is giving me the error saying 'Error in opening text file'.
"The SD_WORD_PROCESSING function module is for creating the "Maintain Text" dialog box. You have called up the function module with the wrong values so it is not possible to edit text properly.
Check the parameters for the SD_WORD_PROCESSING_PUT function module."
Please help me to solve this issue.
Thanks,
Veni.Hi Naren,
I was just checking my Transport organizer and found that there is one customizing request which is still in modifiable mode, not released yet. It is related to Access Sequence for text id's. I forgot to move this, is this the one causing the error.
Thanks,
Veni.
5 View Cluster Maintenance: Data
5 VC_SHPH
5 TTXERN
400VBBK BZ20021009
400VBBK BZ20022010
400VBBK BZ20023011
5 IMG Activity Define Text Types
5 View Cluster Maintenance: Data
5 VC_ORDH
5 TTXERN
400VBBK AZ10021009
400VBBK AZ10022010
400VBBK AZ10023011
4 TTXZ
4 TTXZT -
CRM - automated error monitoring tools to track errors in sales orders
could you please let me know whether we have any
automated error monitoring tools to track errors in sales orders
Thanks in advanceI wont recommend turning off cookies in production.
Turning off cookies was only from a Performance
Testing perspective, Not using cookies for a performance test but using them in production, sort of invalidates the test, since much of the issue I had was the testing tool waiting for data to be returned to the cookies so it could be used to move to the next page.
Partner Management uses all of them. I uses iStore for its external launch page, OA framework for its functionality, but then links to Sales online for Opportunities, and Quotes which I believe is AK framework. so you have a mixture of several
frameworks involved...... plus Discoverer Viewer... -
Error in : Purchase order Creation using BAPI_PO_CREATE1
Hell guys,
I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
I want the new PO to have all the characteristics of an existing PO. whose PO # is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
* Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
* Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
* Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
* Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
* Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
* Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa[].
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
poitem = i_bpoi[]
poitemx = i_bpoix[]
poschedule = i_bpos[]
poschedulex = i_bposx[].
i_order = i_new_ebeln .
SHIFT i_order LEFT DELETING LEADING '0' .
i_return-errortype = c_char_i .
i_return-workarea = c_zsw .
i_return-message = '064' .
i_return-variable1 = i_order .
loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
append i_bapiretn to t_bapi_return .
endloop .
if t_bapi_return[] is initial .
i_create_order = c_char_x .
CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
EXPORTING
act_return = i_return. "Popup with new PO no.
ENDCASE . " Docind
ENDIF .
ENDLOOP.Hi Shareen,
I think in the following parts of the code,
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa[].
Error in : Purchase order Creation using BAPI_PO_CREATE1
Posted: Mar 20, 2006 7:39 PM Reply E-mail this post
Hell guys,
I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
I want the new PO to have all the characteristics of an existing PO. whose PO # is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = <b>i_ekpa[].</b>
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
<b> poitem = i_bpoi[]
poitemx = i_bpoix[]
poschedule = i_bpos[]
poschedulex = i_bposx[].</b>
it should be only i_bpoi, i_bpoix, i_bpos, i_bposx but not i_bpoi[], i_bpoix[], i_bpos[], i_bposx[].
CHange the code as follows:
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa.
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
poitem = i_bpoi
poitemx = i_bpoix
poschedule = i_bpos
poschedulex = i_bposx.
i_order = i_new_ebeln .
SHIFT i_order LEFT DELETING LEADING '0' .
i_return-errortype = c_char_i .
i_return-workarea = c_zsw .
i_return-message = '064' .
i_return-variable1 = i_order .
loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
append i_bapiretn to t_bapi_return .
endloop .
if t_bapi_return[] is initial .
i_create_order = c_char_x .
CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
EXPORTING
act_return = i_return. "Popup with new PO no.
ENDCASE . " Docind
ENDIF .
ENDLOOP. -
Sales order creation using LSMW
Hi All,
I am creating open sales order (VA01) using LSMW where I am using BAPI: BUS2032 and Method CREATEFROMDAT2.
I need to pass multiple line items for the same Header data, but the LSMW is creating multiple sales orders with a single line item every time.
I tried giving "on_change_transfer_record" after Header record but that doesn't work.
Can anyone suggest any suitable solution for this using BAPI only other than BDC, report program etc.
Thanks in Advance
Asif Ali KhanHi Asif Khan,
Please check this link
BAPI_SALESORDER_CREATEFROMDAT2 - Sales Order Create
http://sap-img.com/abap/bapi-salesorder-createfromdat2.htm
Best regards,
raam
Maybe you are looking for
-
Standard Report for missing parts at production order operation level?
Hi PP Gurus, We have standard report for missing parts at production orders level. For our client, they need a report for missing parts analysis at production order operation level. Do we have any such standard report in the SAP? Please h
-
Creating Check Manually for Vendor Invoice
I want to create a Check in SAP from a Vendor invoice manually. What steps do I need to take to do so? I am creating vendor invoice in FB60 I can create a outgoing Payment F-07 How do I create a Payment document in reference to the vendor invoice? I
-
Output of RFC FM in background job
Hello, I have a report which call an RFC FM. The FM calls a class which write some output using write statement. How can this output be captured in the spool request of job for my report? Is it possible? Regards, Ahmed
-
Hi I am scanning large A1 documents as colour PDFs and I need to reduce the filesize and also clean up the image by removing all the background noise in the image but keeping the detail. I used the optimize pdf function on the old version of Acrobat
-
Purchase value key..?
hi all anybody explain me about purchase vaku key, what is use and significance. And what are the configuration for the same we have to do in SPRO Thanks sap-mm