‎2007 Jul 17 2:42 PM
In table control how to add new empty lines.
In the screen i have a push button clled new entries.
when i press this empty lines should be maintained in table control.
and how to validate the entries which i entered.
‎2007 Jul 17 2:45 PM
Hi,
Validation should be done in PAI. inside the loop for each field that requires validation.
While inserting new line just append a empty line in the internal table. It will create a blank line in table control.
Reward if helpful.
‎2007 Jul 17 2:45 PM
Hi,
Just add the number of lines as follows
tab_cont-lines = tab_cont-lines + 1.
Alternatively append an empty row to the internal table in PAI module that you execute in LOOP AT WITH table control. ENDLOOP.
Regards,
Sesh
‎2007 Jul 17 2:46 PM
In your pai section, create a module
module create_entries.
in program:
module create_entries.
case sy-ucomm.
when 'MORE'. "Assuming MORE is the function code for that button
append initial line to itab.
endcase.
endmodule.
Similarly you can have a validation module in the Pai section
flow logic:
loop at itab.....
module validate.
endloop.
in program
module validate.
select single * from mara where matnr = itab-matnr.
if sy-subrc <> 0.
message e000 with "Invalid material in table control'.
endif.
endmodule.
REgards,
Ravi
‎2007 Jul 17 2:48 PM
‎2007 Jul 17 2:51 PM
hi,
firstly whatever you are doing on the screen thats comes under user command
so now ur problem is to append a blank line then it will solved by writing code in the PAI.
for validation you can use a perform_validations
whatever entries u are inputing u can check it frm the database table whether it exist or not
like following: -
FORM validation USING p_so_cust STRUCTURE so_cust
p_so_vend STRUCTURE so_vend
p_p_cfile.
IF p_so_cust-low IS NOT INITIAL.
Message- Please enter Customer Number
MESSAGE e001(zmmuk).
ELSE.
SELECT SINGLE * FROM lfa1 WHERE lifnr = p_so_cust-low.
IF sy-subrc NE 0.
Value not found, Please enter correct value for Customer
MESSAGE e004(zmmuk).
ENDIF.
ENDIF.
IF p_so_vend-low IS NOT INITIAL.
Message- Please enter Vendor Number
MESSAGE e002(zmmuk).
ELSE.
SELECT SINGLE * FROM lfa1 WHERE lifnr = p_so_vend-low.
IF sy-subrc NE 0.
Value not found, Please enter correct value for Vendor
MESSAGE e005(zmmuk).
ENDIF.
ENDIF.
IF pa_disad = ' '.
IF p_cfile = space.
*Message- Please give File Name
MESSAGE e003(zmmuk).
ENDIF.
ENDIF.
ENDFORM.
hope this will help you.
please reward if helpful.
thanks
divya