2008 May 28 9:30 PM
Hi all,
i have to read an idoc with only one segment.
i am using he following code:
IF ls_idoc_control-idoctp = lc_idoctyp
READ TABLE it_idoc_data INTO wa_idoc_type WITH KEY SEGNAM = 'lc_segnam.
the segment contains a field called as aufnr.
how can i access this field?
how can i use a select query to fetch data for the field aufnr??
please help.
Thanks,
Anand.
2008 May 28 9:36 PM
You have to define a work area of the segmet type.
For example:
DATA wa_e1pityp type e1pityp.
and then use
LOOP AT i_idocdata INTO wa_edidd.
CASE wa_edidd-segnam.
WHEN c_e1pityp.
CLEAR: wa_e1pityp.
wa_e1pityp = wa_edidd-sdata.
If multiple segments use:
APPEND wa_e1pityp TO i_e1pityp.
ENDCASE.
ENLOOP.
you can then use wa_e1pityp-aufnr as you want.
Edited by: Aparna Shekhar on May 28, 2008 3:37 PM
Hi all,
i have to read an idoc with only one segment.
i am using he following code:
IF ls_idoc_control-idoctp = lc_idoctyp
READ TABLE it_idoc_data INTO wa_idoc_type WITH KEY SEGNAM = 'lc_segnam.
the segment contains a field called as aufnr.
how can i access this field?
how can i use a select query to fetch data for the field aufnr??
please help.
Thanks,
Anand.
2008 May 28 9:36 PM
You have to define a work area of the segmet type.
For example:
DATA wa_e1pityp type e1pityp.
and then use
LOOP AT i_idocdata INTO wa_edidd.
CASE wa_edidd-segnam.
WHEN c_e1pityp.
CLEAR: wa_e1pityp.
wa_e1pityp = wa_edidd-sdata.
If multiple segments use:
APPEND wa_e1pityp TO i_e1pityp.
ENDCASE.
ENLOOP.
you can then use wa_e1pityp-aufnr as you want.
Edited by: Aparna Shekhar on May 28, 2008 3:37 PM
2008 May 28 9:51 PM