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

custom idoc giving error

Former Member
0 Likes
429

hi friends

i am adding two segments in Purchase orders ORDERS ---/ afs/orders05

i found the exit and implemented the logic, but when i triggered the idoc

i noticed that custom segment is coming after every segment

like e1edk01 ---

ze1edka1 --- (repeating)

e1edkb1 ---

ze1edka1 -


(repeating)

how to make changes in code so that it will come in right way (means it should not repeated)

thanks

Anil

hi friends

i am adding two segments in Purchase orders ORDERS ---/ afs/orders05

i found the exit and implemented the logic, but when i triggered the idoc

i noticed that custom segment is coming after every segment

like e1edk01 ---

ze1edka1 --- (repeating)

e1edkb1 ---

ze1edka1 -


(repeating)

how to make changes in code so that it will come in right way (means it should not repeated)

thanks

Anil

2 REPLIES 2
Read only

Former Member
0 Likes
390

Hi,

Can you send me the code written in the user exits so that i can check and tell you what you can do.

Regards,

PRASANNA

Read only

uwe_schieferstein
Active Contributor
0 Likes
390

Hello Anilkumar

I assume you want to add your custom segments just behind some standard segments.

Probably your logic looks like this:


DATA: ls_edidd   TYPE edidd.
DATA: ld_idx       TYPE i.

LOOP AT int_edidd INTO ls_edidd
                             WHERE ( segnam = '<name of standard segement>' ).
  ld_idx = syst-tabix + 1.

" Add custom segment
  ls_edidd-segnam = '<name of custom segment>'.
...
  ls_edidd-sdata = ... .

  INSERT ls_edidd INTO TABLE int_edidd INDEX ld_idx.
ENDLOOP.

If the default segment is repeated the custom segement will be repeated as well. Therefore, add a counter logic:


  LOOP AT int_edidd TRANSPORTING NO FIELDS
            WHERE ( segnam = '<name of custom segment>' ).
    EXIT. 
  ENDLOOP.
  CHECK ( syst-subrc NE 0 ).
" NOTE: if customer segment already found leave exit, ELSE...

DATA: ls_edidd   TYPE edidd.
DATA: ld_idx       TYPE i.

LOOP AT int_edidd INTO ls_edidd
                             WHERE ( segnam = '<name of standard segement>' ).
  ld_idx = syst-tabix + 1.
...

Regards

Uwe