2023 Jul 11 11:26 AM
Hi Experts,
Greetings.
From the below attached data, the requirement is to find the maximum or highest value from each column or field and populate it in the output field.
In a real time scenario, each material batch has multiple inspection lots that has multiple result values. So, in the current label we are displaying each result (i.e., CV1/CV2.....CV5) as column but the value must be determined out of the multiple inspection results which ever is higher.
To find the max of one field, I able to get it but to find for multiple fields.. I need your help.
Thanks for letting me know.
Best Regards.
2023 Jul 11 12:31 PM
Sorry, your question seems very basic, or I don't understand it, which would mean it's unclear.
To get maximum, you do it this way (obviously):
max_cv1 = 0. " or big negative number if CV1 may contain negative numbers
LOOP AT ...
IF cv1 > max_cv1.
max_cv1 = cv1.
ENDIF.
ENDLOOP.
" max_cv1 is the maximum / highest value
2023 Jul 11 2:11 PM
Hi sankar1781,
Your example is not intuitive to figure out what you really want.
I guess you intend to use SELECT - FROM @itab to read a internal table doing group by something and performing max on some field for other columns, but could not understand what means 1,2,3,4,5...
From the image you posted, what you want as result ?
Regards, Fernando Da Rós
2023 Jul 11 3:16 PM
Hi Sandra, Fernando,
First, thank you for your prompt response.
I apologize for not clear in writing out my requirement before.
Below one, I hope, clear your queries that I have to bring the maximum value from the multiple inspection lot entries (carried out for a single batch) will be written under BATCH wise in the output. It goes for other batch codes which I have not provided here.
Fernando, your guess is right.
Let me know if I am still not clear.
Thanks again.
2023 Jul 11 3:58 PM
It's not clear what you have in the input internal table. BATCH1 should be in a column in the internal table, right? (in order to have data about BATCH2 and BATCH3 too)
Syntax of SELECT is quite simple. Did you look at SELECT MAX( ... ) in ABAP examples?
2023 Jul 13 7:21 AM
Hi Fernando, Sandra,
I have resolved it using SELECT - FROM @itab.
@Sandra, Yes. BATCH code is the unique field to collect/append the Characteristics value results.
Sorry, will be more clear on my questions next time.
Thanks again for your great help.
2023 Jul 13 8:21 AM
Hi fedaros , sandra.rossi,
SELECT - FROM @itab is not working in ADOBE Form code initialization editor.
Can you help please?
Thanks.
2023 Jul 13 9:46 AM
I'm curious to know what "is not working in ADOBE Form code initialization editor" !?