10-24-2011 1:13 PM
Hi everybody,
I receive vendor information from a external system.
I want to import them by idoc type CREMAS05.
Everthing works fine.
But I have the problem that sometimes the external system sents a vendor number which is outside the allowed number range.
Therefore I want to implement a check. If this check is wron, I set a error status and message and the inbound will be canceld.
I have implemented Enhancement VSV00001 and User Exit EXIT_SAPLKD02_001 (Inbound: Read and process vendor segments)
the Problem is, that this user exit will be only called if the idoc includes a filled customer segment.
But in my case it didn't.
I had the idear to change the flag outside where are responsible for calling the user exit in that way, that evertime the exit will be called.
But there is no enhancement point there and I don't want to modify the SAP standard source.
How can I handle this?
Regards
Christian
10-24-2011 2:04 PM
You don't have any explicit point available but you can implement implicit enhancement. Try implementing the implicit enh point in the subroutine FILL_CRE_DATA_WITH_E1LFA1C towards end.
Regards,
Naimesh Patel
10-24-2011 2:04 PM
You don't have any explicit point available but you can implement implicit enhancement. Try implementing the implicit enh point in the subroutine FILL_CRE_DATA_WITH_E1LFA1C towards end.
Regards,
Naimesh Patel
10-24-2011 5:34 PM
Hi,
thanks for the information.
You are right,
I tried to implement it inside subroutine for segment LFA1M.
But I don't know what is wrong.
If I want to activate the implementation I get the message the attribiute should be named as "ICON_CUSTOMER...".
I don't know why.
And I am sure that i have the right attribiute changed because I copied it from the original source code.
What's wrong?
I tried a static and dynmaic enhancement point
10-25-2011 4:48 PM
Ok, I found the problem.
It was a misstake of myself.
The variable was in a other submethod. So it was not known.
If have now used an enhancement point idoc_post_01 at spot es_saplkd02
The problem is now, that the inbound process stops after calling
PERFORM call_transaction TABLES t_idoc_status
t_return_variables
t_bdifibiwa
USING v_workflow_result
f_idoc_control
h_mode
ip_xk99_used . "Note 523930
IF v_workflow_result = 99999.
EXIT.
ENDIF.
I don't know exactly why. But it seems that at this point it was a first try to book the vendor. and if something wrong the import ends.
But then then the user exit at the end makes no sence...
10-25-2011 5:12 PM
If you have duplicate Vendor number, it should not be able to reach to the point where it calls the subroutine call_transaction.
If you have implemented the implicit point at subroutine FILL_CRE_DATA_WITH_E1LFA1C, your code should be similar to this:
" do the validation of Vendor #
v_workflow_result = 99999. "<< this makes it to exit out and stops processing
CLEAR t_idoc_status.
t_idoc_status-docnum = f_idoc_control-docnum.
t_idoc_status-status = c_idoc_stat_input_error.
t_idoc_status-msgty = sy-msgty.
t_idoc_status-msgid = sy-msgid.
t_idoc_status-msgno = sy-msgno.
t_idoc_status-msgv1 = sy-msgv1.
t_idoc_status-msgv2 = sy-msgv2.
t_idoc_status-msgv3 = sy-msgv3.
t_idoc_status-msgv4 = sy-msgv4.
t_idoc_status-segnum = segnum.
t_idoc_status-segfld = 'LIFNR'. "<<
t_idoc_status-uname = sy-uname.
t_idoc_status-repid = sy-repid.
APPEND t_idoc_status.
t_return_variables-doc_number = f_idoc_control-docnum.
t_return_variables-wf_param = c_retv_error_idocs.
APPEND t_return_variables.
Regards,
Naimesh Patel
10-25-2011 6:03 PM
Both cases are possible.
New vendors and also updates.
The user exit should reached in both cases and everytime if I process a idoc with message type CREMAS
11-18-2011 11:53 AM
Hi Nimesh,
Now I understand what your idear was.
I implemeneted different kind of enhancement in sub routines and it looks pretty good.
It was not the solution I expect but who cares?
Thanks a lot.
Regards