11-11-2005 6:28 AM
Hi,
I'm coding a user exit for INVOIC02 IDOC.
The exit is EXIT_SAPLVEDF_002. This FM however does not import the segment name related information. I need to populate a new segment detail after E1EDK18. Any pointers on this. Anyone has had a similar requirement?
Thanks for the help in advance
Regards,
Vijay
11-11-2005 6:32 AM
I was thinking maybe query the INT_EDIDD table on its size. i.e describe table INT_EDIDD lines N, and read the table on index N. if that record has segment name E1EDK18, then I would populate my segment in INT_EDIDD. Is this the right approach, in the next record. This way I would be searching for the last accessed segment...I'm sorry if my questions are a bit acamedic in nature. New to user exits and IDOCS.
Regards,
Vijay
11-11-2005 6:49 AM
Hi!
EXIT_SAPLVEDF_002 is called just after new segment is formed and added to INT_EDIDD. That is right and for E1EDK18 also. So you have to imply your logic after the segment name of last record in INT_EDIDD is E1EDK18:
data:
wa_edidd like line of int_edidd,
int_edidd_lines type i.
describe table int_edidd lines int_edidd_lines.
read table int_edidd index int_edidd_lines into wa_edidd.
if 'E1EDK18' = wa_edidd-segnam.
*TODO: your logic here
endif.
Regards,
Maxim.
Message was edited by: Maxim Polonevich
11-11-2005 7:14 AM
Hi Maxim,
One more query, I have extended the basic IDOC Type INVOIC02. Now do I have to create a new Basic IDOC Type that has the extension, or can I use the extension INVOIC02 as it is.
Regards,
Vijay
11-11-2005 7:21 AM
You can use extension INVOIC2 , but this will have to maintained in partner profile as well , I mean the extension name . Also you may have to create a custom message type in WE82 with INVOIC02 and your extension.
For adding segment simply use -
statics added .
If added ne 'X'.
Loop at IT_EDIDD where SEGNAM 'E1EDK18'.
<Move Your new segment data to INt_EDIDD >.
append INT_EDIDD .
added = 'X'
ENDLOOP.
endif.
Have used statics as this FM will be called multiple times and you need to add data only once to this internal table.
Cheers.
Sanjay
11-11-2005 7:58 AM
Hi Sanjay,
Why would I create a custom message type. There's already a message type available for INVOIC02.
I could just create a new entry in WE82 and add INVOIC message type to my idoc type and the extension.
Regards,
Vijay
11-11-2005 8:00 AM
Yes you can do that also. But mind it in partner profile you should enter the extension with basic type.
Cheers.
Sanjay