Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Inbound IDoc

Former Member
0 Likes
414

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
383

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.

2 REPLIES 2
Read only

Former Member
0 Likes
384

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

Read only

0 Likes
383

hi,

Thanks a lot!!!!!!!!!!:)