‎2007 Jun 01 6:01 PM
Hi All,
can anybody tell me how to read segment data (sdata) of idoc.
is there any function module available for that ?
its urgent..
Regards,
Rahul
‎2007 Jun 01 9:25 PM
Hi Rahul,
you have to read the value as in a table.
Please hava a look at the following example (DATA has the structure EDID4):
DATA:
lw_E1MARAM TYPE E1MARAM,
l_matnr TYPE E1MARAM-MATNR.
LOOP AT data WHERE segnam EQ 'E1MARAM'.
MOVE data-sdata TO lw_E1MARAM.
l_matnr = lw_E1MARAM-MATNR.
ENDLOOP.
Kind Regards,
Sergio
‎2007 Jun 01 9:25 PM
Hi Rahul,
you have to read the value as in a table.
Please hava a look at the following example (DATA has the structure EDID4):
DATA:
lw_E1MARAM TYPE E1MARAM,
l_matnr TYPE E1MARAM-MATNR.
LOOP AT data WHERE segnam EQ 'E1MARAM'.
MOVE data-sdata TO lw_E1MARAM.
l_matnr = lw_E1MARAM-MATNR.
ENDLOOP.
Kind Regards,
Sergio
‎2007 Jun 01 9:27 PM
‎2007 Jun 01 9:27 PM
‎2007 Jun 04 8:42 AM
Hi,
you can try with this program:
don't forget to include the "TYPE-POOLS ledid." line at the begining, this is the reason why you are receiving the error message.
REPORT ztestdpo2 .
TYPE-POOLS LEDID.
PARAMETERS: p_segtyp LIKE edisegmhd-segtyp.
DATA t_segment_struct TYPE ledid_t_segment_struct.
DATA wa_segment_struct LIKE LINE OF t_segment_struct.
CALL FUNCTION 'IDOC_SEGMENT_STRUCTURE_READ'
EXPORTING
RELEASE = SY-SAPRL
segtyp = p_segtyp
VERSION = '3'
TABLES
segment_struct = t_segment_struct
EXCEPTIONS
segment_unknown = 1
segment_structure_unknown = 2
segment_not_in_release = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT t_segment_struct INTO wa_segment_struct.
WRITE:/ wa_segment_struct.
ENDLOOP
Regards
‎2007 Oct 25 6:09 AM
Hi,
You can read the control data of IDOC from function module : EDI_DOCUMENT_OPEN_FOR_READ.
And can read IDOC Data from Function module :
EDI_SEGMENTS_GET_ALL. It will return you the internal table of IDOC data , you will have to iterate on this to get the segment infomation that you want .
Regards,
Deepti