2009 Jan 26 5:16 PM
Hello Abapers
I am trying to write an user exit to extract data from knov table and append it in E1EDP05 segment in the Quotes.ORDERS05 idoc.
For this i am using EXIT_SAPLVEDE_002 and include ZXVDEU02.
My code is like this
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 = '+'.
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.
ENDIF.
It doesn't error but it doesn't give the result i want . I can see many E1EDP05 segments in the idoc with no useful data , all 0s . Is there something wrong with my code . Any help is appriciated.
Regards
2009 Jan 26 5:23 PM
Hi
Your code should be placed in a LOOP of XVBAP:
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.
Max
2009 Jan 26 5:23 PM
Hi
Your code should be placed in a LOOP of XVBAP:
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.
Max