‎2006 Oct 23 3:44 PM
how can you clear a subscreen of all the data. I have a tabstrip that has 5 subscreen. the main screen which is 100 has a primary field that will use to load the data into all the 5 subscreens. when the user wants to create a new record, the subscreens should be blank. then when they push the save button, then the record will be save.
MODULE USER_COMMAND_0100 INPUT.
CASE SY-DYNNR.
CASE OK_CODE.
WHEN 'SAVE'.
perform check_projectnumber.
perform saverecord.
WHEN 'DELETE'.
perform check_projectnumber.
WHEN 'CHANGE'.
perform check_projectnumber.
WHEN 'INSERT'.
perform check_projectnumber.
WHEN 'CREATE'.
perform add_project.
when 'ENTER'.
perform check_projectnumber.
ENDCASE.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " EXIT INPUT
‎2006 Oct 23 3:47 PM
If the screen fields are not part of some structure, then you will need to clear them individually.
Clear: p_fld1, p_Fld2, p_Fld3, p_fld4.If all your fields are of a structure, then you can simple clear the structure.
Data: begin of xscreen,
p_fld1 type c,
p_fld2 type c,
p_fld3 type c,
p_fld4 type c,
end of xscreen.
clear xscreen.In your USER_COMMAND, simply enter the clear statement.
MODULE USER_COMMAND_0100 INPUT.
CASE SY-DYNNR.
CASE OK_CODE.
WHEN 'SAVE'.
perform check_projectnumber.
perform saverecord.
WHEN 'DELETE'.
perform check_projectnumber.
WHEN 'CHANGE'.
perform check_projectnumber.
WHEN 'INSERT'.
perform check_projectnumber.
WHEN 'CREATE'.
<b>* Insert the CLEAR STATEMENT HERE <---- HERE</b>
perform add_project.
when 'ENTER'.
perform check_projectnumber.
ENDCASE.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " EXIT INPUT
Regards,
Rich Heilman
‎2006 Oct 23 3:47 PM
I think you have to clear each field individually.
If they are a part of the same structure, then you can clear that structure at once.
Regards,
Ravi
‎2006 Oct 23 3:48 PM
Hi,
You can use CLEAR syntax.
Eg: CLAER: V_FIELD1, V_STRCTURE1.
It is better to define all fields in 5 screens in single structure. Because it is simple to clear all the data in one instance.
Write the CLEAR statement after SAVE data.
Thanks,
Ramakrishna
‎2006 Oct 23 4:11 PM
I try to clear it using clear ZTBLCTRL_BUDGET. but when i run the transaction, give me runtime error. DYNP_COMPRESS_ILLEGAL_VALUE
The tabstrips are created in SPWizard and all the subscreens are link to a custom SAP table. I'm trying to add, delete, modify the data in the table. Is there a simple way of doing this? any help will be great appreciate.