‎2007 Jul 18 9:14 AM
Hi all,
Please help me coding.
Hi,
Iam working one user exit COPA0005 function module EXIT_SAPLKEII_002.
Data would be looked up from the following tables and parameters:
CE100 : Operating Concern table for generated line items.
T_ITEM : Available table used for transfer parameter.
I_ERKRS : Import parameter in function module.
Conditions is :
1. Check if operating concern (I_ERKRS) is 0001 than go to step 2 else go to step
4.
2. Read CE100 table and verify value for Item Category (CE100-PSTYV).
3. If Item Category(CE100-PSTYV) is TAS Than change Warehouse cost value
field(CE100-VV504) value to 0.00 irrespective of its current value.
else dont change value of warhouse cost value field(CE100-VV504) .
4. exit from function module.
This logic should be implemented for all line items in each billing document. E.g. if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
Any body helping the code?
Thanks & Regads
sudhakar
‎2007 Jul 18 9:58 AM
Hi,
From your information the piece of code is framed like this...
if I_erkrs eq C_0001.
loop at CE100 into wa_ce100.
if CE100-pstyv eq C_TAS.
CE100-VV504 = '0.00''.
append CE100.
endif.
clear wa_CE100.
endloop.
else.
exit.
endif.
It would be great if you mention if CE100 is internal Table or not. In general C_name is a constant naming notation. And Wa_itab is a standard table workarea.
Please let me know if you need any further clarification.
Thanks,
Samantak
Rewards useful answers.
‎2007 Jul 18 10:13 AM
Hi samantak,
Thanks for reply.Can u explain the code?
CE100 is structure.The structure contains all necessarry fields like pstyv , VV504 .And what is C_0001 and wa_ce10I.
One more doubt is this logic check the below condition?
This logic should be implemented for all line items in each billing document. E.g. if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
Thanks & Regards,
sudhakar
‎2007 Jul 18 10:31 AM
Hi Sudhakar,
Please check the modifed code below and let me know your further concerns.
data: lv_no_of_lines type i,
count type i.
constant: c_0001(4) type c value '0001'. " Constant having value 1
clear: lv_no_of_lines,
count.
Initializating the count to 1
count = 1.
Coping the no lines the code needs to be executed for each line item
assuming T_ITEM is an internal table
describe table t_item lines lv_no_of_lines.
while count le lv_no_of_lines.
count = count + 1.
if I_erkrs eq 0001.
if CE100-pstyv eq 'TAS'.
CE100-VV504 = '0.00''.
endif.
else.
exit. " Exit from the code
endif.
endwhile.
Thanks,
Samantak.
Rewards points for useful answers.
‎2007 Jul 18 11:11 AM
Thanks for updating.
i think the below point is not working in ur code.
This logic should be implemented for all line items in each billing document. E.g. if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
Plesase check this point : if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times.
Thanks & Regards,
sudhakar
‎2007 Jul 18 12:28 PM
Hi,
How to implement the below logic in ur code?
if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
Thanks & Regards,
sudhakar
‎2007 Jul 18 10:30 AM
Hi Sudhakar,
try this logic
if I_ERKRS eq '0001'.
loop at CE100.
if CE100-PSTYV = 'TAS'.
CE100-VV504 = 0.0.
modify CE100.
endif.
endloop.
endif.
Note: i hope CE100 is an internal table with header line.
Regards,
Niyaz
‎2007 Jul 18 11:07 AM
Thanks for reply Ahmad,
CE100 is not a internal table .It is a operating concern strucuture.
Thanks & Regards,
sudhakar
‎2007 Jul 18 12:30 PM
Hi Ahamed,
How to implement the below logic in ur code?
if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
Thanks & Regarsd,
sudhakar
‎2007 Jul 18 1:41 PM
Thanks for replies.Iam assigning points.
Thanks & Regards,
sudhakar