Skip to Content
0
Former Member
Feb 06, 2009 at 09:51 AM

Summarize prices for INVOIC02 in Message Mapping

97 Views

Hello,

I have to summarize prices in the INVOIC02 IDOC. In the invoice there is

header items and kit order items. The prices is found in the field BETRG

in the Y_E1EDP05 segment. It is only the prices with KSCHL = IV01 that

should be summarized. The link between header and kit items is found in

the field UEPOS, so the prices should be calculated to the correct header.

To only show the header items I can use this function:

UEPOS -> exists -> not -> createIf -> removeContext -> E1EDP01

So that is ok, but to get the correct prices to the header I guess one would need

some kind of UDF. I am a bit lost at this mapping, so I hope anyone can help.

I have provided the corresponding structures:

Here is the source message:

		<E1EDP01 SEGMENT="1">
			<POSEX>000010</POSEX>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000020</POSEX>	
			<UEPOS>000010</UEPOS>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>2.00</BETRG>
				<KRATE>1.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000030</POSEX>
			<UEPOS>000010</UEPOS>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>2.00</BETRG>
				<KRATE>1.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000040</POSEX>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000050</POSEX>	
			<UEPOS>000040</UEPOS>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>12.00</BETRG>
				<KRATE>1.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000060</POSEX>
			<UEPOS>000040</UEPOS>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>20.00</BETRG>
				<KRATE>1.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>

This is how the target message should look:

		<E1EDP01 SEGMENT="1">
			<POSEX>000010</POSEX>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>4.00</BETRG>
				<KRATE>0.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>
		<E1EDP01 SEGMENT="1">
			<POSEX>000040</POSEX>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>IV01</KSCHL>
				<BETRG>32.00</BETRG>
				<KRATE>0.00</KRATE>
			</Y_E1EDP05>
			<Y_E1EDP05 SEGMENT="1">
				<ALCKZ>+</ALCKZ>
				<KSCHL>MWST</KSCHL>
				<BETRG>0.00</BETRG>
				<KRATE>0.000</KRATE>
			</Y_E1EDP05>
		</E1EDP05>

Kind regards,

Per Rune