Skip to Content
author's profile photo Former Member
Former Member

clear subscreen

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Oct 23, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 23, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 23, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.