05-17-2006 9:52 PM
Hi All-
My scenario is to create IDOC whenever they create Invoice using FB60. I found the user-exit corresponding to that.
I am using FIDCC1/FIDCCP02....
Enhancement:F050S003
Project: I created ZFIU002 and I am using User-Exit EXIT_SAPLF050_003...In that include(ZX050U03) writing custom program and I am using FM to create IDOC(MASTER_IDOC_DISTRIBUTE)inside that custom program....
I have activated my user-exit...and I configured(port, Partner Profile and RFC) all the necessary steps to send IDOC to XI system..
When I set the debugger at the include(ZX050U03) the cursor is not going inside when I try to create invoice using FB60 and also IDOC is not creating...
Can anyone please help me out?
Thank-You,
Venky
05-17-2006 9:55 PM
05-17-2006 9:55 PM
05-17-2006 9:56 PM
05-17-2006 10:03 PM
If it is activate then it should go inside the Include.
put BREAK-POINT in the include and then execute business scenerio.
Swithc on the System DEBUGGING from inside the Debugger-> setting ->click on system debugging.
Try this.
If it did't work then it might possible that you are looking a wrong user exit.
05-17-2006 11:57 PM
Main program is SAPLF050 and inside this program the user-exit is calling....When I create invoice using FB60, the cursor is going inside the user-exit. But my problem is how to restrict IDOC to create when they use only FB60 not any other t-codes...But Tcode value will be stored in BKPF table....
How to mention inside the user-exit...I have mentioned like this
IF fi_document_header-tcode = 'FB60'.
ELSE.
EXIT.
ENDIF.
but how to come out of the main program(SAPLF050) if the condition fails....
Can anyone please help me out?
Thanks,
Venky
05-18-2006 12:13 AM
05-18-2006 12:22 AM
Hi Venky,
Did you check the documentation on the enhancement??
User exit 003 is called up twice during processing.
1. The first call takes place during online processing in function
module FI_IDOC_PREPARE.
2. The second call takes place at the time of the update.
During the online processing, a copy of the complete FI document is
transferred to the user exit (BKPF, BSEG).
This could also be a cross-company code document, in which case, for
example, two documents are transferred.
During online processing, the system checks whether ALE FI, message type
FIDCC2 is active for the document concerned. In addition, using the user
exit, you can also prevent the IDoc being sent.
If the system determines that an IDoc should be created for the FI
document, the system writes the clearing information in the FI document during online processing (BSEG-AUGBL = 'ALE external').
At the time of the update, a copy of the complete FI document is
transferred to user exit 003 (BKPF, BSEG, BSEC, BSET, ACCIT_WT for
extended withholding tax).
This could also be a cross-company code document (for example, two
documents) from which one IDoc is created for each document.
In the user exit, you can change the FI documents and send the changed
documents as IDocs via ALE.
In addition, an indicator NO_DISTRIBUTION = 'X' can be returned from the
user exit if this document is not to be distributed. If the indicator is
zero, that is, it is not changed, the document is sent as an IDoc as
long as the appropriate settings have been made in ALE Customizing.
In user exit 003 you can also change the company code in the FI document
(copy), as well as the other fields. The system checks the changed
company code rather than the original company code to determine whether
it should be sent according to the ALE Customizing setting. The IDoc can
then be posted in a different receiving company code.
Since the user exit only contains a copy of the FI document, changes to
the fields may not have any effect on the original FI document in the
sender system. The original FI document is posted in the sender system,
not the copy.
Any changes are only passed on and sent in the IDoc. It is only in the
receiving system that an FI document with changed fields is posted from
the IDoc.
As seen from the documentation.
1). Try to set a breakpoint in the FM FI_IDOC_PREPARE
as mentioned in point 1 above. See if it calls ur exit.
2). Did you check if the message type FIDCC2 is active for your document concerned??
Cheers
VJ
05-18-2006 12:29 AM
Vijay-
Thanks for your efforts...I am using Message type FIDCC1 and the FI_IDOC_PREPARE is calling my user-exit...
Anything do I need to do?
Thanks,
Venky
05-18-2006 2:37 AM
Try this. Take a peek into other include programs before your include program. Maybe there "check" statement which is throwing the control out of the loop or FM. If there is a check statement like check 1 = 2 in an include program before yours, your code will never get executed. Try putting your include program above all other custom includes.
05-17-2006 10:02 PM
Venky,
First set breakpoint in program where it is calling exit 'EXIT_SAPLF050_003'. Check if its stop there. If it is not stopping then probably u r working on wrong exit.
Cheers,
Nilesh