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

Code Logic for adding a segment to quotes in exit

Former Member
0 Likes
411

Hello experts

I am trying to write an user exit to add a segment to Quotes.Order05 idoc . I want to add a segment to E1EDP05 with values from table konv. for this i am using EXIT_SAPLVEDE_002 and the include ZXVDEU02.

My code is

DATA: WA_E1EDP05 LIKE E1EDP05.

Types: begin of t_konv,
*include fileds from konv.
KSCHL LIKE KONV-KSCHL,
BETRG LIKE KONV-KWERT,
KRATE LIKE KONV-KBETR,
UPRBS LIKE KONV-KPEIN,
MEAUN LIKE KONV-KMEIN,
KOEIN LIKE KONV-WAERS,
END OF T_KONV.

DATA: it_KONV TYPE STANDARD TABLE OF t_KONV INITIAL SIZE 0,
      wa_KONV TYPE t_KONV.


IF INT_EDIDD-SEGNAM EQ 'E1EDP05'.
MOVE INT_EDIDD-SDATA TO WA_E1EDP05.
WA_E1EDP05-ALCKZ = '+'.

LOOP AT XVBAP.

SELECT kschl kwert kbetr kpein kmein waers FROM konv INTO CORRESPONDING FIELDS OF TABLE it_KONV
                                      WHERE KNUMV EQ XVBAK-KNUMV
                                     and kposn eq XVBAp-posnr and KSCHL eq 'VPRS'.
loop at it_KONV into WA_KONV .
WA_E1EDP05-KSCHL = WA_KONV-KSCHL.

WA_E1EDP05-BETRG = WA_konv-betrg.
WA_E1EDP05-KRATE = WA_konv-KRATE.
WA_E1EDP05-UPRBS = WA_konv-UPRBS.
WA_E1EDP05-MEAUN = WA_konv-MEAUN.
WA_E1EDP05-KOEIN = WA_konv-KOEIN.
MOVE WA_E1EDP05 TO INT_EDIDD-SDATA.
append INT_EDIDD.

endloop.
ENDLOOP.

ENDIF.

But the out output is not what i desired. It has too many E1EDP05 sements with + sign and most of the fileds in the segment are 0s. Is there something wrong with my logic or code ?

When i wanted to debug this user exit i am not able hit this include even if i set a break point in it. any advice on how to debug this code please.

Any help is much appriciated.

Thankyou

Edited by: Julius Bussche on Jan 27, 2009 2:26 PM

Code tags added and subject title made slightly more meaningfull

1 REPLY 1
Read only

Former Member
0 Likes
324

Hi

The main program SAPLXVDE of exit EXIT_SAPLVEDE_002 is set like System program so it needs to active the System Debbuging to debug that kind of program.

So after activing debugging go to Setting->System Debugging

Max