Application Development and Automation 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: 
Read only

how to clear parameter field.

Former Member
0 Likes
3,845

hi ,

i have created a report in which user gives values in parameter fields, after executing, the values entered in parameter fields should become blank. ihave cleared tha parameter field,but still after executing,. the previous given entrys are still getting displayed.

parameters: field.

clear: field. (clearing parameter field)

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,433

Hi,

CHeck is there any SET/GET paramters that are used in AT SELECTION-SCREEN PUTPUT Event block of the report.

Otherwsie if you just clear your paramters it should clear he values, I think they are getting the values from some global memory like SAP Memory. If yo uclear the values at the event block AT SELECTIOn-SCREEN you should not get any values back.

Check the code in event blocks AT SELECTIOn-SCREEN OUTPUT

and AT SELECTION-SCREEN.

Regards,

Sesh

hi ,

i have created a report in which user gives values in parameter fields, after executing, the values entered in parameter fields should become blank. ihave cleared tha parameter field,but still after executing,. the previous given entrys are still getting displayed.

parameters: field.

clear: field. (clearing parameter field)

10 REPLIES 10
Read only

Former Member
0 Likes
2,433

at selection-screen on p_field.

if p_field > 0.

clear p_field.

endif.

Read only

Former Member
0 Likes
2,433

i think is not possiable.

because it store on screen buffer.

Read only

Former Member
0 Likes
2,433

Hi

Once you execute the report the selection screen is displayed

You can clear the SELECT-OPTIONS and PARAMETERS values in the INITIALIZATION event

write CLEAR < field> in the initialization event and see.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
2,433

Hi,

try this..

CLEAR ( <parameter> ).

This function clears the contents of the parameter – that is, it initializes the given field or fields. <parameter> can be a:

Simple parameter

Field of a structured parameter

CLEAR ( <structure>-<field1> ).

Complete structure

CLEAR ( <structure> ).

Complete table row

CLEAR ( <table>[<index>] ).

Complete table

CLEAR ( <table> ).

Award points if useful.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,434

Hi,

CHeck is there any SET/GET paramters that are used in AT SELECTION-SCREEN PUTPUT Event block of the report.

Otherwsie if you just clear your paramters it should clear he values, I think they are getting the values from some global memory like SAP Memory. If yo uclear the values at the event block AT SELECTIOn-SCREEN you should not get any values back.

Check the code in event blocks AT SELECTIOn-SCREEN OUTPUT

and AT SELECTION-SCREEN.

Regards,

Sesh

Read only

0 Likes
2,433

Hi,

its not a selection screen ,

just parameters: field.

after program is over, i should clear that parameter field. what i mean is once saved ,the parameter field should be blank.

Read only

0 Likes
2,433

Hi,

Can you show us your code, it would be easyto findthe problem then.

If yours is a simple report program with PARAMTERS, this will internally create a SELECTIOn-SCREEN.

Any way just put your clear statement after the SAVE functionality.

Regards,

Sesh

Read only

0 Likes
2,433

CLEAR: ZSTORE_LOC,WA.

PARAMETERS: P_INVNR LIKE ZSTORE_LOC-INVNR,

P_TYPBZ LIKE ZSTORE_LOC-TYPBZ,

P_EQKTX LIKE ZSTORE_LOC-EQKTX.

CLEAR: ZSTORE_LOC,WA.

IF P_INVNR IS INITIAL.

MESSAGE 'PLEASE ENTER INVENTORY NUMBER' TYPE 'E'.

ELSE.

SELECT SINGLE * FROM ZSTORE_LOC WHERE INVNR = P_INVNR.

IF SY-SUBRC <> 0.

ZSTORE_LOC-INVNR = P_INVNR.

ZSTORE_LOC-TYPBZ = P_TYPBZ.

ZSTORE_LOC-EQKTX = P_EQKTX.

ZSTORE_LOC-ERNAM = SY-UNAME.

ZSTORE_LOC-ERDAT = SY-DATUM.

ZSTORE_LOC-ERZET = SY-UZEIT.

INSERT ZSTORE_LOC.

COMMIT WORK.

CLEAR ZSTORE_LOC.

IF SY-SUBRC = 0.

MESSAGE 'DATA INSERTED' TYPE 'S'.

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

ELSE.

MESSAGE 'ERROR IN INSERTING DATA' TYPE 'S' .

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

endif.

ELSEIF SY-SUBRC = 0.

IF P_EQKTX = ZSTORE_LOC-EQKTX AND P_TYPBZ = ZSTORE_LOC-TYPBZ.

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

EXIT.

ENDIF.

IF NOT P_TYPBZ IS INITIAL AND NOT P_EQKTX IS INITIAL.

UPDATE ZSTORE_LOC SET TYPBZ = P_TYPBZ EQKTX = P_EQKTX CNAME = SY-UNAME

AEDAT = SY-DATUM CTIME = SY-UZEIT WHERE INVNR = P_INVNR.

IF SY-SUBRC = 0.

MESSAGE 'DATA UPDATED' TYPE 'S'.

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

endif.

ELSEIF NOT P_TYPBZ IS INITIAL AND P_EQKTX IS INITIAL.

UPDATE ZSTORE_LOC SET TYPBZ = P_TYPBZ CNAME = SY-UNAME

AEDAT = SY-DATUM CTIME = SY-UZEIT WHERE INVNR = P_INVNR.

IF SY-SUBRC = 0.

MESSAGE 'DATA UPDATED' TYPE 'S'.

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

endif.

ELSEIF NOT P_EQKTX IS INITIAL AND P_TYPBZ IS INITIAL.

UPDATE ZSTORE_LOC SET EQKTX = P_EQKTX CNAME = SY-UNAME

AEDAT = SY-DATUM CTIME = SY-UZEIT WHERE INVNR = P_INVNR.

IF SY-SUBRC = 0.

MESSAGE 'DATA UPDATED' TYPE 'S'.

CLEAR: P_INVNR,P_TYPBZ,P_EQKTX.

endif.

ELSE.

MESSAGE 'PLEASE ENTER VALUES FOR UPDATION' TYPE 'S'.

ENDIF.

ENDIF.

Read only

0 Likes
2,433

Hi,

Run in DEBUG mode and find out weather clear is getting executed or not.

ALso check when is getting value again.

Put your clear statements outside the IF ENDIF.

Are you sure your are entring these IF's.

Regards,

Sesh

Read only

0 Likes
2,433

i have checked in debugging mode , it is clearing fields but dont know some how they still appear on screen after completely executed.