2007 Jul 30 7:34 AM
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)
2007 Jul 30 7:40 AM
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)
2007 Jul 30 7:36 AM
at selection-screen on p_field.
if p_field > 0.
clear p_field.
endif.
2007 Jul 30 7:37 AM
2007 Jul 30 7:38 AM
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
2007 Jul 30 7:40 AM
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.
2007 Jul 30 7:40 AM
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
2007 Jul 30 7:45 AM
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.
2007 Jul 30 7:48 AM
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
2007 Jul 30 7:49 AM
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.
2007 Jul 30 7:50 AM
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
2007 Jul 30 7:55 AM
i have checked in debugging mode , it is clearing fields but dont know some how they still appear on screen after completely executed.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |