You are on page 1of 22

Mickael QUESNOT © https://s4hclub.

com/

Outbound INVOIC IDoc User Exit - EXIT_SAPLVEDF_002 in @SAP

User_EXit Customer Enhancement in Data Segments Billing Document Output

User-Exit SAPLVEDF Billing Doc-Outgoing

This include is used for exit processing for EDI Outbound Invoice, also it is used for IDOC Invoice Extensions .

Case 1 :

This can be used, for example, to add custom segments to a standard IDOC structure.

For example, let's say that when you want to send an invoice to your customer, you need to add a custom
segment showing custom fields that are captured in your sales order and invoice. The only way to send this to
your customer is to:

a) Create an IDOC extension where you add a custom segment. This is development activity you do once,

test and transport to production. For example, let's

say you need to add Z1EDP01 as a segment containing the

asset tag numbers for the equipment you are shipping to the customer (this is a hypothetical example). So you
would define segment Z1EDP01 and add it as a "child" of E1EDP01 in the extension structure.

b) Then use this user-exit to append the actual data for

the custom segment at run-time. For example, let's

say that your custom segment follows E1EDP01 (item data).

Then you would check in this user-exit whether an E1EDP01 was just processed. Then you would fill your
custom segment Z1EDP01 and add it to the internal EDIDD table.

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
1
Mickael QUESNOT © https://s4hclub.com/

Case 2 :

I need to update the standard segment type E1EDP30 in the standard IDOC INVOIC structure.

Segment Type E1EDP30 IDOC: Document Item Account Assignment Intercompany Billing

QUALF 045 : Cost Center IDOC qualifier reference document


IVKON CRP14440 30 Characters

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
2
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
3
Mickael QUESNOT © https://s4hclub.com/

*&---------------------------------------------------------------------*
*& Include ZXEDFU02
*&---------------------------------------------------------------------*

*44 Finance Refac SiFi "Champ spécifique dans la donnée de base de l’élément d’OTP pour porter le centre de c

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
4
Mickael QUESNOT © https://s4hclub.com/

oût cible :
*Il s'agit de répondre par un spécifique aux besoins exprimés dans le cadre des Refacturations.
*Il faut créer un champ spécifique dans l'eOTP afin d'y renseigner le 'centre de coût cible' qui sera repris dans l'é
criture miroire (pour la comptabilisation de la facture d'achat).
*Exemple : La société 1010 refacture la société 1030 et cela sera chargé sur le CC 59900C de la société 1030. Le
CC 59900C sera renseigné lors de la création de
*l'eOTP qui sert à la refacturation."

IF INT_EDIDD-SEGNAM = 'E1EDP04'.

CLEAR INT_EDIDD.
CLEAR E1EDP30.
INT_EDIDD-SEGNAM = 'E1EDP30'. "IDOC: Document Item Account Assignment Intercompany Billing
E1EDP30-QUALF = '045'.

*Facture: Données au niveau du poste


SELECT SINGLE * INTO @DATA(GS_VBRP) FROM VBRP WHERE VBELN = @XTVBDPR-VBELN
AND POSNR = @XTVBDPR-POSNR.

IF SY-SUBRC = 0.

IF NOT GS_VBRP-PS_PSP_PNR IS INITIAL. "Elément d'organigramme technique de projet (élt OTP)

LV_PSPNR = GS_VBRP-PS_PSP_PNR.

CLEAR LV_ZZAKSTL.
*Elément d'OTP - données de base
SELECT SINGLE ZZAKSTL FROM PRPS
INTO LV_ZZAKSTL "Centre de coût demandeur
WHERE PSPNR = LV_PSPNR.

IF NOT LV_ZZAKSTL IS INITIAL. "Centre de coût demandeur not empty


E1EDP30-IVKON = LV_ZZAKSTL.
CONDENSE E1EDP30-IVKON.
MOVE E1EDP30 TO INT_EDIDD-SDATA.
APPEND INT_EDIDD.
ENDIF.

ENDIF.

*Reprise du Centre de coûts destinataire (Pièce comptable MM) à partir de la commande client
IF NOT GS_VBRP-ZZ1_KOSTL_BDI IS INITIAL. "Cost center (MM)

E1EDP30-IVKON = GS_VBRP-ZZ1_KOSTL_BDI.
CONDENSE E1EDP30-IVKON.
MOVE E1EDP30 TO INT_EDIDD-SDATA.
APPEND INT_EDIDD.

ENDIF.

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
5
Mickael QUESNOT © https://s4hclub.com/

ENDIF.

ENDIF.

DEMO

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
6
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
7
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
8
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
9
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
10
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
11
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
12
Mickael QUESNOT © https://s4hclub.com/

SET EXTERNAL BREAKPOINT

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
13
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
14
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
15
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
16
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
17
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
18
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
19
Mickael QUESNOT © https://s4hclub.com/

WE05

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
20
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
21
Mickael QUESNOT © https://s4hclub.com/

Mickaël QUESNOT © - Copyright

https://www.linkedin.com/in/mickaelquesnot/
22

You might also like