‎2007 Aug 09 6:30 PM
Hi All,
I am going to get FI IDOCs (FIDCCP02) at Inbound R/3 system, But some of them we dont dont want to post it based on Doc. type ( BLART)
ex. If BLART = ( ex..AB ), we dont want to post (set to 68 status) (or) delete the corresponding IDOC number (DOCNUM).
1)
So Inorder set this to 68 , whether i can use corresponding User exit ( mean function exit ) ? or i have to use BADI of corresponding IDOC type ?
2)
other way around, if i want to delete the IDOC number based on Doc. type ( BLART), how i can do that ? because I dont found any DB table that includes both
BLART and DOCNUM fields ?
some pls suggest me which should be the efficient manner
Regards,
Sridhar
‎2007 Aug 13 7:29 PM
Hi Sridhar,
If the IDoc number is available when during user exits EXIT_SAPLF050_006, then please add the IDoc number in addition to my above logic.
I thought the IDoc number is not available when the logic get executed in above user exits.
Well ... it sounds your problem solved
Regards,
Ferry Lianto
‎2007 Aug 09 7:55 PM
Hi Sridhar,
1) So in order set this to 68 , whether I can use corresponding user exit ( mean function exit)? or I have to use BADI of corresponding IDOC type?
You can use user exits EXIT_SAPLF050_004 (FM IDOC_INPUT_FIDCC1) or user exits EXIT_SAPLF050_006 (FM IDOC_INPUT_FIDCC2) to set IDoc status to 68 if the document type (BLART) = 'AB'.
DATA: WA_E1FIKPF LIKE E1FIKPF.
LOOP AT IDOC_DATA WHERE SEGNAM = 'E1FIKPF'.
WA_E1FIKPF = IDOC_DATA-SDATA.
IF WA_E1FIKPF-BLART = 'AB'.
POSTING_TYPE = '1'.
IDOC_STATUS = '68'.
EXIT.
ENDIF.
ENDLOOP.
2) Other way around, if i want to delete the IDOC number based on Doc. type ( BLART), how i can do that ? because I dont found any DB table that includes both
BLART and DOCNUM fields?
You can use transaction WE09/WE10 to search IDoc(s) content of IDoc type FIDCCP02 for segment E1FIKPF and field BLART = 'AB'. If found, the system will returm the corresponding IDoc numbers. Then you use program RSETESTD or FM EDI_DOCUMENT_DELETE to delete the corresponding IDocs.
Regards,
Ferry Lianto
‎2007 Aug 09 8:18 PM
Thank you ferry,
thats really helpful .. , points awarded.
Regards,
Sridhar
‎2007 Aug 09 8:56 PM
Ferry,
if i want to delete the IDOCs, as you said with program (RSETESTD) or FM EDI_DOCUMENT_DELETE
with is FM i can only delete the IDOCs one by one right ? is there is any option can delete all at once.. ?
with program (RSETESTD) the IDOC selection will be with Message type and date and time. is there any selection from IDOC no. to IDOC No. ?
which one would you suggest delete the IDOCs or set to 68 ?
‎2007 Aug 10 9:20 PM
Ferry,
when I tried to change the status of the IDOC to 68 ... ended up with following error.
.....EDI: Field DOCNUM in status record with value '68' is valid
pls suggest me accordingly
Code I am using as follows...
LOOP AT IDOC_DATA.
CASE IDOC_DATA-SEGNAM.
WHEN 'E1FIKPF'.
MOVE IDOC_DATA-SDATA TO I_E1FIKPF.
IF I_E1FIKPF-BLART = 'RI'.
POSTING_TYPE = '1'.
IDOC_STATUS = '68'.
EXIT.
ENDIF.
ENDLOOP.
‎2007 Aug 09 9:07 PM
Hi Sridhar,
The best is to write a simple ABAP report to select IDoc numbers from table EDIDC based on IDoc type (FIDCCP02) and IDoc status (68) and save in internal table. Next, you loop at the internal table and call FM EDI_DOCUMENT_DELETE by passing the IDoc number to delete the IDoc.
If you don't need to worry about archiving IDoc(s) then I would set status 68 instead of delete the IDoc. In this case, if you need to perform system/data audit, you still have the incoming FI information. You can also reprocess the data (if needed).
Regards,
Ferry Lianto
‎2007 Aug 10 9:32 PM
Hi Sridhar,
What is the IDoc status after you processed the IDoc?
Is it 68 in WE02?
Regards,
Ferry Lianto
‎2007 Aug 10 11:26 PM
Ferry,
IDOC status was 62 , I tried this through test transation WE19 .
whether I am passing the correct parameters to Posting type = ? is it 1 or 2 .
I am using following FM and EXIT
IDOC_INPUT_FIDCC2
EXIT_SAPLF050_006 ( function exit)
ZX050U06 ( include)
Regards,
Sridhar
‎2007 Aug 13 5:49 PM
Ferry,
when these Parameters passed (POSTING_TYPE = 1, IDOC_STATUS = 68 ) with in function Exit.
I found some problem in Debug... when the flag returns to POSTING TYPE = 1 X-(SEND_C2), the DOCUM becomes the value 68, this value should appear in STATUS field right ! found this when i debug.. So thats the reason why it returns the error message which I indicated erlier.
Pls suggest me accordingly
Sridhar
‎2007 Aug 13 7:11 PM
Hi Sridhar,
I thought you does not want the IDoc to be posted to application and give you IDoc status 68. Doesn't my logic do that (try to see in debugging)?
If not, what exactly do you need?
Regards,
Ferry Lianto
‎2007 Aug 13 7:17 PM
Ferry,
I found the problem in Debug...
i need to pass the IDOC number as well in IDOC staus record.. now it is changed to 68
code as follows.. pls let me know if there is any conflit with it
LOOP AT IDOC_DATA.
CASE IDOC_DATA-SEGNAM.
WHEN 'E1FIKPF'.
MOVE IDOC_DATA-SDATA TO I_E1FIKPF.
IF I_E1FIKPF-BLART = 'RI'.
POSTING_TYPE = '1'.
<b>IDOC_STATUS-DOCNUM = IDOC_CONTRL_DOCNUM</b>
IDOC_STATUS -STATUS= '68'.
EXIT.
ENDIF.
ENDLOOP.
‎2007 Aug 13 7:29 PM
Hi Sridhar,
If the IDoc number is available when during user exits EXIT_SAPLF050_006, then please add the IDoc number in addition to my above logic.
I thought the IDoc number is not available when the logic get executed in above user exits.
Well ... it sounds your problem solved
Regards,
Ferry Lianto
‎2007 Aug 13 8:55 PM
Ferry,
Thank you, Points awarded.
Yes, now the status has been changed to 68, but it indicates Green light in WE05 ! is this OK ? even it indicate green also it wont post it right !
Apart from it, if I want to delete these IDOCs ( 68 Status) from the list, I need to write a ABAP program, selection based of IDOC type (FIDCCPO2) and Staus (68) from EDIDC , then delete those perticular IDOCs right !
Regards,
Sri
‎2007 Aug 13 9:05 PM
Hi Sridhar,
Yes, now the status has been changed to 68, but it indicates Green light in WE05! is this OK ? even it indicate green also it wont post it right!
Yes, it is fine ... but please test properly thru automate interface (partner profile) instead using WE19 just in case behave differently.
Apart from it, if I want to delete these IDOCs ( 68 Status) from the list, I need to write a ABAP program, selection based of IDOC type (FIDCCPO2) and Staus (68) from EDIDC , then delete those perticular IDOCs right !
Yes, you need to write a simple ABAP program which will select all IDoc numbers from table EDIDC based on the corresponding IDOC type (FIDCCPO2) and IDoc status (68) and call FM EDI_DOCUMENT_DELETE to delete the corresponding IDoc by passing the IDoc number.
Regards,
Ferry Lianto
Please reward points and close the thread if your problem solved.
‎2007 Aug 13 9:39 PM
‎2007 Aug 13 9:48 PM
Hi Sridhar,
Glad to help you ... but please be generous rewarding points
Regards,
Ferry Lianto