You can edit the contents of an existing IDOC using standard transaction WE05. Use WE05 to select the IDOC you wish to edit, expand the Data Records until your segment is visible, double click the segment you wish to edit (not single point and click), this should open the "Display Data Record for IDOC" screen, from the menu select Data Record -> Display -> Change, change the data and save it.
Hope this helps.
Hi Kiran,
You can use FM <b>EDI_DOCUMENT_OPEN_FOR_EDIT</b> and <b>EDI_CHANGE_DATA_SEGMENTS</b> to edit the IDoc segment(s) and save the segment changes.
Please check this sample codes.
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_EDIT' EXPORTING document_number = t_docnum IMPORTING idoc_control = itab_edidc TABLES idoc_data = itab_edidd EXCEPTIONS document_foreign_lock = 1 document_not_exist = 2 document_not_open = 3 status_is_unable_for_changing = 4 OTHERS = 5. LOOP AT itab_edidd WHERE segnam = 'E1EDKA1'. e1edka1 = itab_edidd-sdata. IF e1edka1-parvw = 'LF'. e1edka1-partn = t_eikto. itab_edidd-sdata = e1edka1. MODIFY itab_edidd. EXIT. ENDIF. ENDLOOP. CALL FUNCTION 'EDI_CHANGE_DATA_SEGMENTS' TABLES idoc_changed_data_range = itab_edidd EXCEPTIONS idoc_not_open = 1 data_record_not_exist = 2 OTHERS = 3.
Other alternative, please find user exits available in the correspondence inbound function module to edit the segment(s).
Here is an example for FM IDOC_INPUT_ORDERS.
CALL CUSTOMER-FUNCTION '001' EXPORTING SEGMENT = IDOC_DATA DVTCOMAG = VTCOMAG DXMESCOD = IDOC_CONTRL-MESCOD CONTRL = IDOC_CONTRL TABLES DXBDCDATA = BDCDATA DXVBAP = XVBAP DXVBEP = XVBEP DYVBEP = YVBEP DXVBADR = XVBADR DYVBADR = YVBADR DXVBPA = XVBPA DXVBUV = XVBUV DD_FLAG_P = D_FLAG_P DXKOMV = XKOMV DXVEKP = XVEKP DYVEKP = YVEKP CHANGING DXVBAK = XVBAK DD_FLAG_K = D_FLAG_K EXCEPTIONS USER_ERROR = 01.
Hope this will help.
Regards,
Ferry Lianto
Add a comment