Application Development 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: 

adding lines to segment of Idoc in User Exit ZXEDFU02

former_member699400
Active Participant
0 Kudos
1,522

Hi!

do I need to maintain Idoc in WE30 if I need to add some lines to one segment in User Exit ZXEDFU02?

Here is my sample code placed in ZXEDFU02 for adding a line, but it is not making an effect:

WHEN 'E1EDP01'.

CLEAR E1EDP26.

E1EDP26-QUALF = '003'.

E1EDP26-BETRG = 777.

or maybe it depends on Idoc that I use in We19?

For example, if Idoc that I use in WE19 for testing my User Exit does not has qualifier 003 in segment E1EDP26... could it be a reason?

Will reward,

Mindaugas.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
334

Hi

The IDOC which you are using should have a segment

called E1EDP26

and this segment should have the fields QUALF and BETRG

other wise there is no use by writing the user exit

So keep a break point and see whether it is stopping there or not.

Why you arewriting the code under line WHEN 'E1EDP01'

write the code like

WHEN 'E1EDP26'.

clear e1edp26.

E1EDP26-QUALF = '003'.

E1EDP26-BETRG = 777.

Reward points for useful Answers

Regards

Anji

4 REPLIES 4

Former Member
0 Kudos
334

Hi,

Saple Code:

----


  • INCLUDE ZXEDFU02 *

----


data: ls_ka1 like e1edka1,

ls_edidd like edidd,

l_lines type i.

describe table int_edidd lines l_lines.

check l_lines ne 0.

read table int_edidd into ls_edidd index l_lines.

check ls_edidd-segnam eq 'E1EDKA1' and

ls_edidd-sdata(2) eq 'RS'.

ls_ka1-parvw = 'ZC'.

case xvbdkr-bukrs.

when '1000'.

ls_ka1-lifnr = '41010005823845840'.

when others.

exit.

endcase.

ls_edidd-sdata = ls_ka1.

append ls_edidd to int_edidd.

Regards

Former Member
0 Kudos
335

Hi

The IDOC which you are using should have a segment

called E1EDP26

and this segment should have the fields QUALF and BETRG

other wise there is no use by writing the user exit

So keep a break point and see whether it is stopping there or not.

Why you arewriting the code under line WHEN 'E1EDP01'

write the code like

WHEN 'E1EDP26'.

clear e1edp26.

E1EDP26-QUALF = '003'.

E1EDP26-BETRG = 777.

Reward points for useful Answers

Regards

Anji

0 Kudos
334

E1EDP26 is subsegment of E1EDP01, so I write

WHEN 'E1EDP01'

CLEAR E1EDP26.

E1EDP26-QUALF = '003'.

E1EDP26-BETRG = 777.

I mean Idoc looks like this:

E1EDP01

.....E1EDP26

.....E1EDP26

The thing is that E1EDP26 contains both of needed fields QUALF and BETRG, because it already contains some lines filled, I just try to add some more lines...

M.

0 Kudos
334

Hi,

Try the following code, I believe it is close to what you are looking for:

DATA: edidd TYPE edidd,

e1edp26 TYPE e1edp26,

l_tabix type sy-tabix.

WHEN 'E1EDP01'

CLEAR E1EDP26, EDIDD.

  • Setup new IDOC segment

E1EDP26-QUALF = '003'.

E1EDP26-BETRG = 777.

EDIDD-SEGNAM = 'E1EDP26'.

EDIDD-SDATA = E1EDP26.

  • Insert the new segment after the E1EDP01 segment

l_tabix = sy-tabix + 1.

INSERT EDIDD into IDOC_DATA index l_tabix