10-02-2008 6:28 PM
Hello,
I'm trying to change a sales orders with EDI with message type ORDCHG / IDOC type ORDERS05.
The problem i have is in identifying item to update. I thougth the field to enter VBAP-POSNR was POSEX in segment E1EDP01. But if VBAP-POSNR = 000010 and I enter 000010 in E1EDP01-POSEX the item is not changed and a new item is created.
I can use segment E1EDP19 with qualifier 002 to identify the item by vendor material number, but if I have in the sales order several items for the same material, always the 1st item with that material is updated.
Does anyone knows how to use this message type / idoc type and identify uniquely the sales order item to update ?
Thanks,
Paulo Sousa
10-02-2008 6:32 PM
Hi,
We had the same issue, and what we discovered is that Customer material number along with the POSEX field is should be there in the IDoc in order to identify the correct item.
Check if
1 ) for that order VBAP-POSEX is filled or not.
2) You need to pass the customer material number in E1EDP19-002 with the customer material number as well.
Also make sure you are passing E2EDP01-ACTION as 002
Check here for further details [http://itknowledgeexchange.techtarget.com/itanswers/change-idoc-for-ordchg-behavior/]
regards,
Advait
Edited by: Advait Gode on Oct 2, 2008 7:34 PM
10-02-2008 6:44 PM
Hi Advait,
In VBAP the field POSEX is not filled.
In E1EDP19 the problem we can identify the item by material, but if in the sales order we have several items with the same material, always the 1st one is updated.
We have the following situations :
VBAP POSNR = 000010
MATNR = 111111
POSEX = 000020
POSNR = 000020
MATNR = 111111
POSEX =
and we tried the following alternatives in the IDOC
1) I want to change VBAP-POSNR = 000010
E1EDP01 - POSEX = 000010
E1EDP19 - QUALF = 002
IDTNR = 111111
a new item is created
2) I want to change VBAP-POSNR = 000020
E1EDP01-POSEX = 000020
E1EDP19-QUALF = 002
IDTNR = 111111
The item with VBAP-POSNR = 000010 is changed
The problerm is we may have several items in the sales order with the same material. Do you have the same issue ?
Thanks,
Paulo Sousa
10-02-2008 8:43 PM
Hi, The problem is clearly visible
>
> In VBAP the field POSEX is not filled.
>
> We have the following situations :
>
> VBAP POSNR = 000010
> MATNR = 111111
> POSEX = 000020
>
> POSNR = 000020
> MATNR = 111111
> POSEX =
>
This means that item 000010 VBAP-POSNR corresponds to item 000020 in VBAP-POSEX. So if you want to update item 000010 in vbap, the posex should be 000020, i.e E1edp01-posex should be 000020..
However for VBAP-POSNR 00020, the POSEX field is blank which is strange, this might have happened when you posted the first order change and it created item 000020 instead of updating item 000010
Remember That POSEX is the reference of the line item number in the custmers/external system. And when the IDoc Order change comes in, the POSEX is used to identify the correct line item number of VBAP.
regards,
Advait
10-03-2008 9:20 AM
Hi,
The problem is in VBAP we have 2 entries :
1) POSNR = 000010
MATNR = 111111
POSEX =
2) POSNR = 000020
MATNR = 111111
POSEX =
So if we want to change item 000020,as MATNR and POSEX are equal in both lines, how do I identify the second line only with POSEX and MATNR ? There's no field to identify POSNR ?
Thanks,
Paulo Sousa
10-03-2008 9:50 AM
Hi,
I just looked up the coding in the function module Idoc_input_ordchg
Here is the statement, from include LVEDBF3E, that determines if a item should be changed or new item created
* determine item number from customer item number
READ TABLE yvbap WITH KEY mandt = sy-mandt
vbeln = yvbak-vbeln
posex = xvbap-posex BINARY SEARCH.
da_subrc = sy-subrc.
Posnr merken, um später ev. Satz aus xvbpa zu löschen
store itemno. to delete corresponding record from xvbpa eventually
da_yvbap_posnr = yvbap-posnr.
* Position vorhanden ?
* existing item ?
IF da_subrc = 0. " --> Ja
*- Wenn VRKME identisch mit Auftrag, dann nicht aufs Dynpro, da Feld
*- möglicherweise nicht änderbar (teilbeliefert)
*- If Sales Unit is the same as in order, don't change. Maybe it is
*- greyed out, if already delivered.
IF NOT xvbap-vrkme IS INITIAL.
CLEAR da_vrkme.
WRITE yvbap-vrkme TO da_vrkme. "Benutzereinstellung/Usersettings
IF xvbap-vrkme = da_vrkme.
CLEAR xvbap-vrkme.
MODIFY xvbap.
ENDIF.
ENDIF.
* Only if idoc Customer-Material is different from kdmat in Order
* transfer
IF NOT xvbap-kdmat IS INITIAL and
xvbap-kdmat eq yvbap-kdmat.
CLEAR xvbap-kdmat.
MODIFY xvbap.
ENDIF.
* auf vorhandene Position positionieren
* place on an existing item
PERFORM va02_dynpro_pos_positionieren USING
yvbap-posnr.
So I'm afraid if the POSEX is missing, then it will create a new item every time. As I said earlier that POSEX is the reference line item of th external partner/customer.
The KDMAT is only used for determining the SAP Material number. And yes the same material can be used on 2 line items and would end up in a problem if POSEX is missing.
regards,
Advait