Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Clear data

former_member1349771
Participant
0 Kudos

As user enter selection cretiria Like plant & year.If the condtion is not satisfied a information msg is dispalyed.

Now when he click ok user return to selection screen at this level the data remains on screen.

I need to clear this plant & year.

I'm using this

tables : zmm_isslip. "Material issue slip data is stored

data : begin of it_zmm_isslip occurs 0.

include structure zmm_isslip.

data : flag(1).

data : end of it_zmm_isslip.

controls : tab201 type tableview using screen '0100'.

data: ok_code type sy-ucomm,

save_ok like ok_code.

selection-screen begin of block skk with frame title text-011.

selection-screen skip 1.

parameters : DJAHR1 like ZMM_ISSLIP-DJAHR obligatory default '2008'.

select-options: belnr1 for ZMM_ISSLIP-belnr.

select-options: werks1 for ZMM_ISSLIP-werks.

select-options: KOSTL1 for ZMM_ISSLIP-kostl.

select-options: ANLN11 for ZMM_ISSLIP-anln1.

select-options: AUFNR1 for ZMM_ISSLIP-aufnr.

selection-screen skip 1.

selection-screen end of block skk.

at selection-screen.

perform select_release_data.

************************

FORM select_release_data .

refresh it_zmm_isslip.

select * into table it_zmm_isslip

from zmm_isslip

where djahr = djahr1

and belnr in belnr1

and werks in werks1

and KOSTL in kostl1

and ANLN1 in anln11

and AUFNR in aufnr1

and bstat = ''.

if sy-subrc is not initial.

message i333.

clear : belnr1,werks1,kostl1,anln11,aufnr1.

refresh : belnr1,werks1,kostl1,anln11,aufnr1.

else.

call screen 0100.

endif.

*****************

but as i click anything the output is genearted.

for this i modified the code.

tables : zmm_isslip. "Material issue slip data is stored

data : begin of it_zmm_isslip occurs 0.

include structure zmm_isslip.

data : flag(1).

data : end of it_zmm_isslip.

controls : tab201 type tableview using screen '0100'.

data: ok_code type sy-ucomm,

save_ok like ok_code.

selection-screen begin of block skk with frame title text-011.

selection-screen skip 1.

parameters : DJAHR1 like ZMM_ISSLIP-DJAHR obligatory default '2008'.

select-options: belnr1 for ZMM_ISSLIP-belnr.

select-options: werks1 for ZMM_ISSLIP-werks.

select-options: KOSTL1 for ZMM_ISSLIP-kostl.

select-options: ANLN11 for ZMM_ISSLIP-anln1.

select-options: AUFNR1 for ZMM_ISSLIP-aufnr.

selection-screen skip 1.

selection-screen end of block skk.

*initialization.

  • clear : belnr1,werks1,kostl1,anln11,aufnr1.

  • refresh : belnr1,werks1,kostl1,anln11,aufnr1.

start-of-selection.

perform select_release_data.

using this my data is not cleared as i return to output screen.

Plz guide

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can do as below:


at selection-screen.

select fields from <table_name> into itab where field = selection_parameters.

if sy-subrc ne 0.
message 'Error message' type 'E'.
endif.

Thanks,

Sriram Ponna.

14 REPLIES 14

Former Member
0 Kudos

Hi,

You can do as below:


at selection-screen.

select fields from <table_name> into itab where field = selection_parameters.

if sy-subrc ne 0.
message 'Error message' type 'E'.
endif.

Thanks,

Sriram Ponna.

0 Kudos

as soon as i click to select ranges the output is diplayed in this case.

Former Member
0 Kudos

Hi,

Try to put the clear statements in AT SELECTION-SCREEN OUTPUT event.Clear all the selection screen variables which you do want to be cleared here in this event.

Hope it works,

Thanks,

Sandeep.

0 Kudos

Hi Sandeep,

Can u plz expain with sum example.

0 Kudos

I think in your code you missed out CLEAR: DJAHR1.

Hope this helps.

Thanks,

Balaji

Former Member
0 Kudos

write the coding as

select * into table it_zmm_isslip

from zmm_isslip

where djahr = djahr1

and belnr in belnr1

and werks in werks1

and KOSTL in kostl1

and ANLN1 in anln11

and AUFNR in aufnr1

and bstat = ''.

if sy-subrc is not initial.

clear : belnr1,werks1,kostl1,anln11,aufnr1. <-- put these statements

before message ..

refresh : belnr1,werks1,kostl1,anln11,aufnr1

message i333.

else.

call screen 0100.

endif.

Former Member
0 Kudos

Hi,

In at selection screen event,after throwing the required error,you can clear or refresh the fields.

Hope this will help

Regards

Shibin

Former Member
0 Kudos

Hi,

As you are using select options, you need to put [] this in the end where you are clearing the select options.

So modify your code as below.

select * into table it_zmm_isslip

from zmm_isslip

where djahr = djahr1

and belnr in belnr1

and werks in werks1

and KOSTL in kostl1

and ANLN1 in anln11

and AUFNR in aufnr1

and bstat = ''.

if sy-subrc is not initial.

message i333.

clear : belnr1[],werks1[],kostl1[],anln11[],aufnr1[].

refresh : belnr1[],werks1[],kostl1[],anln11[],aufnr1[].

else.

call screen 0100.

endif.

Reward if helpful.

Regards.

0 Kudos

this is not working as soon as i return to selection screen my previous data remains thr

0 Kudos

write clear statements before giving information message ..

0 Kudos

Try the below code.


TABLES: vbak.

SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                s_vkorg FOR vbak-vkorg,
                s_auart FOR vbak-auart.

AT SELECTION-SCREEN.

  SELECT SINGLE * FROM vbak WHERE vbeln IN s_vbeln AND
                                  vkorg IN s_vkorg AND
                                  auart IN s_auart.
  IF sy-subrc NE 0.
    CLEAR: s_vbeln[], s_vkorg[], s_auart[].
    MESSAGE i000(zz) WITH 'Invalid Input'.
    LEAVE LIST-PROCESSING.
  ENDIF.

This worked for me. Reward points for all helpful answers.

Thanks,

Balaji

0 Kudos

Plz check the codeeeeeee its giving error.

as soon as i click for range its shows the output.On enter the data is getting cleared.

0 Kudos

Try the below code.


TABLES: vbak.

DATA: gv_ucomm_vbeln TYPE sy-ucomm,
      gv_ucomm_vkorg TYPE sy-ucomm,
      gv_ucomm_auart TYPE sy-ucomm.


SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                s_vkorg FOR vbak-vkorg,
                s_auart FOR vbak-auart.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'S_VBELN-LOW'.
      CONCATENATE '%' screen-group4 INTO gv_ucomm_vbeln.
    ENDIF.
    IF screen-name = 'S_VKORF-LOW'.
      CONCATENATE '%' screen-group4 INTO gv_ucomm_vkorg.
    ENDIF.
    IF screen-name = 'S_AUART-LOW'.
      CONCATENATE '%' screen-group4 INTO gv_ucomm_auart.
    ENDIF.


  ENDLOOP.

AT SELECTION-SCREEN.

  IF sy-ucomm NE gv_ucomm_vbeln AND
     sy-ucomm NE gv_ucomm_vkorg AND
     sy-ucomm NE gv_ucomm_auart.

    SELECT SINGLE * FROM vbak WHERE vbeln IN s_vbeln AND
                                    vkorg IN s_vkorg AND
                                    auart IN s_auart.
    IF sy-subrc NE 0.
      CLEAR: s_vbeln[], s_vkorg[], s_auart[].
      MESSAGE i000(zz) WITH 'Invalid Input'.
      LEAVE LIST-PROCESSING.
    ENDIF.

  ENDIF.

Reward points if helpful.

Thanks,

Balaji

Former Member
0 Kudos

Hi,

Modify the clear statements by adding [].

clear : belnr1[],

werks1[],

kostl1[],

anln11[],

aufnr1[].

refresh : belnr[],

werks1[],

kostl1[],

anln11[],

aufnr1[].

Reward if helpful.

Regards.