10-05-2008 4:06 PM
Hi
I have the requirement of editing (Modifying) IDocs through a report program..
( My program displays the content of a specified segment of failed IDocs in the ALV format..
Then the changes made to those fields in ALV have to be updated in those failed IDocs.. So that i can reprocess the IDocs.. )
Is there any BAPI or BADI or Any other solution to edit IDocs through a report....??
I dont want to use BDC as the report program is meant for editing huge number of failed IDocs..
Please help me..
Thanks a lot,
Raj
10-05-2008 6:33 PM
Hello Raja
When your editable ALV list is able to update the failed IDocs then I would just add a function to start reprocessing of the selected IDocs on the ALV list, e.g.:
" Works for inbound IDocs, not sure about outbound IDocs:
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_REPROCESS_IDOCS
*&
*&---------------------------------------------------------------------*
*& Thread: How To Edit Failed IDocs Through Report ?
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1074466"></a>
*&---------------------------------------------------------------------*
REPORT zus_sdn_reprocess_idocs.
PARAMETERS:
p_docnum TYPE edi_docnum DEFAULT '93746'.
START-OF-SELECTION.
CALL FUNCTION 'IDOC_MANUAL_INPUT'
EXPORTING
idoc_number = p_docnum
input_exception = '0'
no_dialog = 'X'
* IMPORTING
* DISPLAY_ACTION =
EXCEPTIONS
idoc_not_in_database = 1
no_input_function_found = 2
no_function_parameters_found = 3
no_status_record_found = 4
no_authorization = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.
END-OF-SELECTION.
Regards
Uwe
10-05-2008 6:02 PM
use the following functions
EDI_DOCUMENT_OPEN_FOR_EDIT "First Open the IDOC for Edit
EDI_CHANGE_DATA_SEGMENTS "Change the segments what ever you want.
EDI_DOCUMENT_CLOSE_EDIT "Close the IDoc after edit
10-05-2008 6:17 PM
Thanq vijay,
Hope this will resolve my prob...
will check out...
More solutions are invited as we need to call 3 function modules in a loop for the provided solution....
And my requrement is for editing hundreds of IDocs...
VIJAY : do reply with ur opinion ...
10-05-2008 6:29 PM
The same approach i followed in my case. i am not sure about other ways for this case.
10-05-2008 6:33 PM
Hello Raja
When your editable ALV list is able to update the failed IDocs then I would just add a function to start reprocessing of the selected IDocs on the ALV list, e.g.:
" Works for inbound IDocs, not sure about outbound IDocs:
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_REPROCESS_IDOCS
*&
*&---------------------------------------------------------------------*
*& Thread: How To Edit Failed IDocs Through Report ?
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1074466"></a>
*&---------------------------------------------------------------------*
REPORT zus_sdn_reprocess_idocs.
PARAMETERS:
p_docnum TYPE edi_docnum DEFAULT '93746'.
START-OF-SELECTION.
CALL FUNCTION 'IDOC_MANUAL_INPUT'
EXPORTING
idoc_number = p_docnum
input_exception = '0'
no_dialog = 'X'
* IMPORTING
* DISPLAY_ACTION =
EXCEPTIONS
idoc_not_in_database = 1
no_input_function_found = 2
no_function_parameters_found = 3
no_status_record_found = 4
no_authorization = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.
END-OF-SELECTION.
Regards
Uwe
10-05-2008 9:22 PM
Hi All
Vijay's solution(2nd Post) has reached the requirement.. Thanq Vijay..
but i am afraid about its performance in production environment..
Can anyone please help me with a better solution ... ????
Hi Schieferstein
Thanks for your valuable input..
...
10-07-2008 7:55 AM
Hi
can anyone plz provide an alternative solution for this, which can give better performance .... ??