2013 Sep 27 3:56 PM
Hi Experts,
In our system, there is INBOUND iodc, say, 12345678 of ORDERS05 basic idoc type, there is a segment(for ITEM-POSNR) of E1EDP01 under this, there are 2 child segments of E1EDP19.
E1EDP01 is for ITEM 10........fine, and its contained the data of QUANTITY, UOM fine.
under this(E1EDP01) there are 2 child segments as E1EDP19, as,
1) E1EDP19--QUALIFIER 002, containing the MATERIAL number as 11111111 for the fileld of IDTNR
2) E1EDP19--QUALIFIER 003 containing the External MATERIAL number as 22222222 for the fileld of IDTNR...
Now the Business is asking that in segment E1EDP19 for Qualifer 003, the External Number should populate from the "Z" table and display it in Idoc. For this I have used the Exit called ZXEDFU02. In exit i am looping E1EDP01 and E1EDP19 and read the Z table and am modifying the internal table. For 1 material it is working fine. But for number of materials i am not able to populatin Correct External Number to the Qualifier 003 in segment E1EDP19.
Please guide me regarding this.
Thanks and Regards,
Muralikrishna Peravali.
Hi Experts,
In our system, there is INBOUND iodc, say, 12345678 of ORDERS05 basic idoc type, there is a segment(for ITEM-POSNR) of E1EDP01 under this, there are 2 child segments of E1EDP19.
E1EDP01 is for ITEM 10........fine, and its contained the data of QUANTITY, UOM fine.
under this(E1EDP01) there are 2 child segments as E1EDP19, as,
1) E1EDP19--QUALIFIER 002, containing the MATERIAL number as 11111111 for the fileld of IDTNR
2) E1EDP19--QUALIFIER 003 containing the External MATERIAL number as 22222222 for the fileld of IDTNR...
Now the Business is asking that in segment E1EDP19 for Qualifer 003, the External Number should populate from the "Z" table and display it in Idoc. For this I have used the Exit called ZXEDFU02. In exit i am looping E1EDP01 and E1EDP19 and read the Z table and am modifying the internal table. For 1 material it is working fine. But for number of materials i am not able to populatin Correct External Number to the Qualifier 003 in segment E1EDP19.
Please guide me regarding this.
Thanks and Regards,
Muralikrishna Peravali.
2013 Sep 27 9:55 PM
Hi Murali,
What problem you are facing? just loop the data records and modify the segment data. Can you tell me, how you are comparing actual material so that you can populate corresponding external material number in segment?
2013 Sep 30 10:27 AM
Hi Shreekant,
Thanq for the reply. I am modifying the data. But for first material's External number is populating correctly but second material's External Number is not populating. This means it is populating from Billing but user asking dont want from billing i need the external number from the 'Z' table where all the External numbers maintained for SAP materials.
Thanks and Regards,
Muralikrishna Peravali
2013 Sep 30 10:46 AM
How are you updating the segment ?
It could be that for some materials there is no external materialnr in the IDoc and therefore the segment will not exist. In that case you cannot modify the content since the segment is not there. You will then need to insert the segment in the IDoc in your user exit.
Again, it could be, because you did not post your source code. can you post the code how you are updating the IDoc segments please.
2013 Sep 30 2:35 PM
Hi Peter,
They maintained External Material Numbers for all SAP materials. For one case am inserting the content and it is working fine.
Below is my code for modifying...
LOOP AT int_edidd WHERE segnam = 'E1EDP19'.
MOVE int_edidd-sdata TO l_e1edp19.
IF l_e1edp19-qualf = 003.
* LOOP AT lt_vbrp INTO lw_vbrp.
READ TABLE lt_vbrp INTO lw_vbrp WITH KEY vbeln = lv_invoice.
IF lw_vbrp-ean11 IS NOT INITIAL.
READ TABLE lt_ysd_tesco_mats INTO lw_ysd_tesco_mats WITH KEY matnr = lw_vbrp-matnr.
IF sy-subrc EQ 0.
l_e1edp19-idtnr = lw_ysd_tesco_mats-tesco_matnr.
int_edidd-sdata = l_e1edp19.
MODIFY int_edidd.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Regards,
Murali
2013 Sep 30 2:43 PM
Did you debug the code ?
You have a few conditions and maybe they are not met.
condition 1:
READ TABLE lt_vbrp INTO lw_vbrp WITH KEY vbeln = lv_invoice.
condition 2:
IF lw_vbrp-ean11 IS NOT INITIAL.
condition 3:
READ TABLE lt_ysd_tesco_mats INTO lw_ysd_tesco_mats
WITH KEY matnr = lw_vbrp-matnr.
IF sy-subrc EQ 0.
Also you say that external material numbers are maintained for all materials, but are they also placed in the IDoc for all materials (maybe depending on material type ??)? I guess they are, but did you check it ?
2013 Sep 30 3:44 PM
Hi Peter,
Yes they are placed in IDoc and those are from Billing Document. But User told that populate the External Number from custom(Z or Y) table.
Regards,
Murali
2013 Sep 30 3:50 PM
You say that sometimes it works, since the ABAP source code will always do the same, you really need to debug and check all the conditions. One of the conditions is not met and the fastest way to find out which is by debugging the code and see for every condition if it is fulfilled.
In debug you can then also check what happens after statement
MODIFY int_edidd.
Did the internal table get updated ?
I think you ill only be able to understand what is happening in debug mode.
2013 Sep 30 5:56 PM
Hi Murali,
Your code will work if your document has only one line item (material), for multiple line items your code will not work. The code is always picking 1st material based on the invoice from VBRP table. You should pass invoice and item number while reading VBRP internal table.
2013 Oct 07 9:54 AM
Hi Shreekant,
Thank you for reply. How can I achieve for multiple line items?
Please help me on this..
Regards,
Muralikrishna
2013 Oct 15 6:11 AM
As Peter already mentioned kindly debug it. Plus you have modify statement and index can be reset by the reads which you have in between. Please debug and cross check
MODIFY int_edidd.
2013 Sep 30 11:29 AM
Hi
Can you please check in debugging what exactly your code is doing. Most probably you their is a bug in the logic.
Nabheet
2013 Oct 10 11:36 AM
As you said it is inbound process, I guess you are using FM IDOC_INPUT_ORDERS for the ORDERS05 IDOC processing.
For every occurance of segment E1EDP19 in ORDERS05 IDoc, CALL CUSTOMER-FUNCTION '001'
(INCLUDE ZXVEDU03) triggered. Determine the external material number based on custom logic and change XVBAP-EAN11.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |