‎2005 May 26 4:21 PM
Hi All..
I'm having a problem with the Bapi BAPI_SALESORDER_CREATEFROMDAT2. The problem is that I have Header conditions and also conditions for the positions. Where can I put the values for this conditions.. I'm moving them to the order_conditions_in structure, but when I run it the ones that belongs to the header shows me the following message: "ZPRE condition as a header condition is not allowed2".
Is this procedure right? or I have to put the header's condition anywhere else?...
Thank you so much for your comments!!!...
‎2005 May 26 4:30 PM
You are passing them to the correct structure, but are you sending ITM_NUMBER as '000000'?
‎2005 May 26 4:30 PM
You are passing them to the correct structure, but are you sending ITM_NUMBER as '000000'?
‎2005 May 26 4:39 PM
Yes... This is a piece of my code:
This first piece is the one that the condicion is for
any position
es_bapicond-itm_number = cont_pos.
es_bapicond-cond_type = 'ZPRE'.
es_bapicond-cond_value = ti_datos_pedidos-zpre.
es_bapicond-currency = ti_datos_pedidos-zpre_m.
APPEND es_bapicond.
This second piece is for header conditions
es_bapicond-itm_number = '000000'.
es_bapicond-cond_type = 'ZVAR'.
es_bapicond-cond_value = ti_datos_pedidos-zvar.
APPEND es_bapicond.
I think I'm passing them in the right way.. :S
Thanks in advance
‎2005 May 26 4:49 PM
Hi Maria,
It may be an obvious one, but are you sure that the condition is a header condition? Item level conditions are also displayed at the header in summarised form.
The field V_T685A-KKOPF should be set to 'X' for it to allow header level conditions.
Sorry if this is a too obvious...
Also, you don't put a currency for ZVAR, is this intended?
Brad
‎2005 May 26 5:04 PM
Hi Brad...
I'm sure the condition is not a header condition, the error that the return structure shows tells me it and also the SD Functional also told me. I don't know what's happening here :S.. The currency of ZVAR as Initial is intended... Sorry for asking so much, but I'm a begginner.. :S
‎2005 May 26 5:08 PM
Is this what you meant to say?
<i>I'm sure the condition is not a header condition</i>
If you are sure that ZVAR is not a header condition then how can you add it to the header of the sales order?
ZVAR must be marked as a header condition to add it to the header level.
Brad
‎2005 May 26 5:24 PM
Sorry.. I think we're not understanding each other... What I'm trying to say is.. I have 2 conditions, ZPRE and ZVAR. ZPRE is a position condition and ZVAR is a header condition. I'm having problems when I'm trying to indicate thar ZPRE is a position one. With ZVAR I'm not having problems. Hope this can help to explain.
Thanks a lot.
Maria
‎2005 May 26 5:33 PM
ok, now I understand, seems I'm not reading so well today.
So, another obvious question, have you debugged the code and confirmed the value of cont_pos when it gets added into the internal table? Maybe its getting initialised at some point???
Brad
‎2005 May 26 5:39 PM
Jajaja.. don't worry.. it's ok.. thanks for your time.
Yes I've debugged the code and the values for the header has the itm_number = '000000' and the position ones has a number different from '000000'.
Another question is.. Exists the posibility of just pass the positions conditions and later using another FM pass the header ones?...
Thanks again!
Maria
‎2005 May 26 5:50 PM
Thank you so much!
I've solved the problem.. The conditions where ok, was a problem with the items and a field that hadn't the right values...
Thank yoy so much for your time and suggestions!
‎2005 May 26 4:51 PM
Hello Maria,
Is ZPRE a manual condition. In SD certain condition types are derived from the pricing procedure and some can be added manually. You need check ZPRE which category it belongs
regards,
Samir.
‎2005 May 26 5:02 PM
Hi Samir...
Yes, ZPRE is a manual condition. I don't know why this isn't working.. the others conditions works perfectly.. that's why I asked earlier if the header and position conditions where in the same structure.
Thanks a lot for your help...
‎2007 Feb 13 8:23 PM
Inform field ITM_NUMBER for BAPISDITM and bapicond. It works!!!
By Cramp
Message was edited by:
Luiz Mourã