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

Need to create a validation Function Module

Former Member
0 Likes
563

Hi,

I need to create a Validation Function Module.

I have a ITAB into which data comes.

FIELD-SYMBOLS : <ITAB> TYPE ANY ,

key TYPE ANY,

char TYPE ANY.

<ITAB> = local_file.

there is a field KEY whose sum when becomes equal to 10.000 for every CHAR,system should show a popup in the below FM

CALL FUNCTION 'POPUP_WITH_WARNING_ALV'

EXPORTING

TEXTLINE1 = LT_POPUPTEXT

  • TEXTLINE2 = ' '

  • TITEL = 'Warnung'

Please let me know if the requirement is not clear.

Thank U very Much.

.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
529

I will give an example.

for CHAR KEY

mat1 4.1

mat1 3.2

mat1 4.2

mat2 3.8

mat2 6.2

In the above case for mat1 the sum of all KEY is 11.5 (4.13.24.2) So a pop-up should come.

saying the KEY sum is not equal to 10.0

but in case of mat2 the sum of all KEY is 10.0 so it should not throw any pop-up.

Hope the req is clear.Please let me know if it isn't

3 REPLIES 3
Read only

Former Member
0 Likes
530

I will give an example.

for CHAR KEY

mat1 4.1

mat1 3.2

mat1 4.2

mat2 3.8

mat2 6.2

In the above case for mat1 the sum of all KEY is 11.5 (4.13.24.2) So a pop-up should come.

saying the KEY sum is not equal to 10.0

but in case of mat2 the sum of all KEY is 10.0 so it should not throw any pop-up.

Hope the req is clear.Please let me know if it isn't

Read only

0 Likes
529

Hi annapurna ,

In your case even the KEY value is the most useful one right,

If so go about this way,

have another field flag set it when the sum of the KEY values exceeds 10.

Loop in an internla table.

Now the internal table will have all the data including the flag and now based on the flag (whether set or not) call the function module popup which should retrieve those matnr field where flag is set.

Display the error message saying that the KEY value fr this matnr exceeds 10.

Revert for further clarification.

Thanks and Regards

Srikanth.P

Read only

0 Likes
529

Hi Sri,

Thanks for the reply.'

I need to Calculate the sum for each MTNR ,ie., for matnr1 all the KEY filed should be added.

How can I do that ?