11-09-2010 1:38 AM
Hi
I have a table control, having 5 fields (columns) - A, B, C, D and E.
Fields A and C are Required (Mandatory Fields). Now, if I Enter 1 row and press on SAVE, I am prompted to fill in the rest of the rows in the table control as the fields A and C in the rest of the rows are also mandatory.
How do I handle this?
Regards,
abaper
11-09-2010 2:37 PM
Hi,
I think what you did in the table control screen's PBO is you inserted empty lines into the internal table.
If you need to set A and C as mandatory in the way you're using, you could not insert initial empty lines for the user input.
Please use button to insert/create new line for user to input data.
Cheers,
11-09-2010 3:20 PM
Hi Shiliang
I have not inserted initial/blank lines to the control.
But, I have set the field TABLECONTROL-LINES to 100 , other wise the empty lines gets greyed out. Do you tink this might be an issue.
If yes, then that means that I cannot make the fields required if I increase the number of input lines and the user wants to input only one line.
regards.
11-09-2010 3:21 PM
11-09-2010 3:17 PM
11-09-2010 3:22 PM
Hi Keshav
That does not work for my purpose because the user will have to input N number of entries in the control table.
Regards.
Edited by: d sappanese on Nov 9, 2010 4:24 PM
11-09-2010 3:26 PM
In that case you have to validate it in PAI when you modify the content to the internal table.
Just write a check if any of the fields are initial when there is a non initial field in the row.
if the complete row is initial then donot do the validation.
Remove the required option from the screen attributes.
LOOP AT it.
FIELD:it-a,
it-b
MODULE modify_int_table.
ENDLOOP.
module modify_int_table.
"<--do the validations here
modify it index tb-CURRENT_LINE.
endmodule.
11-09-2010 3:28 PM
Hi
It depends on how you're inserting the new record into the internal table, here you should have just one only record
Max
11-09-2010 3:36 PM
Hi Max
I am not sure what exactly you meant.
In my case, the user can enter multiple lines/rows and we cannot restrict him. I am NOT using any button to insert one line at a time.
So, I am assuming that as per Keshav, I will have to validate it myself, and should not be keeping the fields mandatory at the screen level.Rather I will have to code for it.
Regards.
11-09-2010 3:36 PM
Hi Max
I am not sure what exactly you meant.
In my case, the user can enter multiple lines/rows and we cannot restrict him. I am NOT using any button to insert one line at a time.
So, I am assuming that as per Keshav, I will have to validate it myself, and should not be keeping the fields mandatory at the screen level.Rather I will have to code for it.
Regards.
11-09-2010 4:12 PM
Hi
But how do you append the row in the internal table where the rows, to be displayed in table control, are stored
Max
11-09-2010 4:22 PM
Hi Max
I do a Select Before the loop for the table control in flow logic.
Just fyi that No blank lines are selected. and then I increase Tablecontrol-lines so that the user can input more lines.
regrads.
11-09-2010 4:34 PM
The error message to fill mandatary fields should be triggered only if there's a corrisponding record in internal table, so I just want to know if you have appended initial line in order to allow the user to insert new records.
Else if you have appended some records and this records have the mandatary fields with initial value, u need to delete that option from field attribute by screen-painter and do some validation manually in PAI
PROCESS PAI.
LOOP AT ITAB.
MODULE VALIDATION.
ENDLOOP.
Just as some guys have suggested to you before
Max
11-09-2010 4:36 PM
This issue is solved.
I did not do validations.
I kept the required/Mandatory fields as it is.
The problem was, I had a mandatory field Country key, whose SET?GET Parameter were checked in the attributes, due to which the values were getting filled in the lines but were invisible in the table control(God knows why ) .
Thank you guys.