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

Help me coding

Former Member
0 Likes
1,124

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 don’t 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

9 REPLIES 9
Read only

Former Member
0 Likes
1,076

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.

Read only

0 Likes
1,076

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

Read only

0 Likes
1,076

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.

Read only

0 Likes
1,076

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

Read only

0 Likes
1,076

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

Read only

Former Member
0 Likes
1,076

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

Read only

0 Likes
1,076

Thanks for reply Ahmad,

CE100 is not a internal table .It is a operating concern strucuture.

Thanks & Regards,

sudhakar

Read only

0 Likes
1,076

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

Read only

Former Member
0 Likes
1,076

Thanks for replies.Iam assigning points.

Thanks & Regards,

sudhakar