10-05-2012 6:18 AM
Hi Experts,
Please advice me. I've a requirement to delete Idoc segment and also it sub-segment E1EDP01. The user requirement as below:
Scenario:
1. User would like to reject the material in the 1st line item of the standard order (VA02) due to customer would like to change to other material number and set a reason for rejection under the "Reason for rejection" for the 1st line item.
2. User than enter another material number in the 2nd line item of the same standard order (VA02) without deleting the 1st line item.
3. After entering the material number, the user will click Extras->Output->Header->Edit.
4. Choose an output type and set the medium "EDI"
5. Click "Further Data" and choose the "Dispatch time" to 4. Click back and save
6. Therefore an EDI will be generated. To view the IDoc number, go back to the sales order and click on the "Processing Log"
7. Go to transaction WE02 and enter the idoc number.
Expected Result:
1. If there is an reason for rejection maintain in either 1 of the line item material in a standard order, the segment and its sub-segment for E1EDP01 must be deleted for the respective line item.
My Blocking point:
1. May i know how to delete an idoc segment and its sub-segment in abap? I've also researched in the internet but i could find any function module which is able to delete the segment and its sub-segment of the IDoc.
Please advice me as I'm very new to IDoc. Thanks so much.
Regards,
Shawn
10-05-2012 6:37 AM
Dear Shawn Tan,
Function module is not required to delete the segments.
You need to implement the exit EXIT_SAPLVEDC_002 and directly write delete statement.
This exit will be triggered for each segment.
pseudo code in ZXVEDU02 after implementation:
loop at idoc_data.
if idoc_data-segnam = 'E1EDP01.'
if E1EDP01-ABGRU is not initial.
local_varible = idoc_data-segnum. (catch the segment no.)
delete idoc_data index sy-index. "delete header segment
delete idoc_data where psgnum = local_variable "deletes child segments.
endif.
endif.
endloop.
Regards,
SG.
Message was edited by: Sravan Guduru
10-08-2012 6:36 PM
As far as I know it is not possible to change a segment definition which is released in lower release. This is a basic concept of our release strategy to guarantee compatibility between different releases. You must create a new segment definition.
If relevant to you, please refer to the note 1147252 and implement the report from the correction instructions, and run it once in all relevant ALE systems with SAP_APPL Release > 4.6C.
Good luck