2008 Jun 30 10:53 AM
I have the IDOC Number with me. How to fetch the Data Records from that ?
2008 Jun 30 11:06 AM
If you want to read the idoc records in your program:
use the folloing fms:
Sample code:
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_opening_idoc.
ENDIF.
* Read IDOC data segments
CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
EXPORTING
document_number = p_docnum
TABLES
idoc_containers = t_idoc_data
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_reading_idoc.
ENDIF.
* Close IDOC
CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_closing_idoc.
ENDIF.
If you want to read the idoc records in your program:
use the folloing fms:
Sample code:
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_opening_idoc.
ENDIF.
* Read IDOC data segments
CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
EXPORTING
document_number = p_docnum
TABLES
idoc_containers = t_idoc_data
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_reading_idoc.
ENDIF.
* Close IDOC
CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_closing_idoc.
ENDIF.
2008 Jun 30 10:58 AM
Hi,
You can achieve this from Tcode WE19 .
Pls reward if helpfull..
Regards,
sharath
2008 Jun 30 10:58 AM
Hi Manjunath,
From EDID4 table...
Or if you want to view the data records in IDOC u can use WE02 TCODE...
Double click on the IDOC number , and u get the DATA records of the IDOC
Regards,
Sachin M M
2008 Jun 30 11:06 AM
If you want to read the idoc records in your program:
use the folloing fms:
Sample code:
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_opening_idoc.
ENDIF.
* Read IDOC data segments
CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
EXPORTING
document_number = p_docnum
TABLES
idoc_containers = t_idoc_data
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_reading_idoc.
ENDIF.
* Close IDOC
CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = f_idoc_control
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING error_closing_idoc.
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |