‎2007 Apr 10 6:04 AM
Hi guys,
i am modifying screen fields of a screen using modify push button. the data is updating into the table for the particular field but i am unable to clear the previous value. plz suggest me the solution
regards
alson
‎2007 Apr 10 6:10 AM
Hi alson,
After u update the table from screen fields in PAI module, clear the updated filed from screen.
say...if field p_matnr is there on screen then...
after you write MODIFY DBTAB FROM P_MATNR.
write....CLEAR P_MATNR.
This clearing of fields can also be done in the last PBO module just before the screen is displayed.
Reward Points if helpful,
Regards,
Tejas
‎2007 Apr 10 6:08 AM
Give clear field name .. and if that even dont work try adding commit work.
assign points if it helps.
-Gaurang
‎2007 Apr 10 6:09 AM
Hi,
If you are using a field for that particular value CLEAR that field and populate with the new value in PBO.
Or if you are using the internal table have to modify that internal table with the changed data after refreshing it for every BACK of the screen and populate in PBO.
it will come.
So it is just related to CLEAR and REFRESH of the data. check,
reward if useful
regards,
ANJI
‎2007 Apr 10 6:10 AM
Hi alson,
After u update the table from screen fields in PAI module, clear the updated filed from screen.
say...if field p_matnr is there on screen then...
after you write MODIFY DBTAB FROM P_MATNR.
write....CLEAR P_MATNR.
This clearing of fields can also be done in the last PBO module just before the screen is displayed.
Reward Points if helpful,
Regards,
Tejas
‎2007 Apr 10 6:10 AM
hi alson,
u can use a push button clear for this purpose.
in PAI u have to write code for the same.
case okcode.
when 'CLEA'.
// write ur code as per requirement.
clear itab[].
Endcase.
Regards...
Arun.
Reward points if useful.
‎2007 Apr 10 6:13 AM
Hi anji reddy,
i am using WA(work area) to display data. Any how i am sending the code plz suggest me the solution.
regards
alson
‎2007 Apr 10 6:16 AM
hi reddy,
this is the code i written.
PROGRAM zcslecpdt .
TABLES zlec_master.
DATA itab LIKE zlec_master OCCURS 0 WITH HEADER LINE.
DATA: wa LIKE itab.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE user_command_0100 INPUT.
SELECT SINGLE zz_licno
FROM zlec_master
INTO zlec_master-zz_licno
WHERE zz_licno = zlec_master-zz_licno.
IF sy-subrc <> 0.
MESSAGE e000(zmj) WITH 'ENTER VALID LICENCE NUMBER'.
ENDIF.
IF NOT zlec_master-zz_licno IS INITIAL.
SELECT zz_licno
zz_lec
zadd_line_1
zadd_line_2
zadd_line_3
zlandline_no
zmobile_no
zlicence_val_dt
FROM zlec_master
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE zz_licno = zlec_master-zz_licno.
ENDIF.
CASE sy-ucomm.
WHEN 'DISP'.
CALL SCREEN 200.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE user_command_0200 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
WHEN 'MODY'.
MOVE wa-zadd_line_1 TO zlec_master-zadd_line_1.
MOVE wa-zadd_line_2 TO zlec_master-zadd_line_2.
MOVE wa-zadd_line_3 TO zlec_master-zadd_line_3.
MOVE wa-zlandline_no TO zlec_master-zlandline_no.
MOVE wa-zmobile_no TO zlec_master-zmobile_no.
MOVE wa-zlicence_val_dt TO zlec_master-zlicence_val_dt.
MODIFY zlec_master.
COMMIT WORK.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE status_0200 OUTPUT.
SET PF-STATUS 'ABC'.
IF NOT itab[] IS INITIAL.
READ TABLE itab WITH KEY zz_licno = zlec_master-zz_licno.
MOVE itab-zz_licno TO wa-zz_licno.
MOVE itab-zz_lec TO wa-zz_lec.
MOVE itab-zadd_line_1 TO wa-zadd_line_1.
MOVE itab-zadd_line_2 TO wa-zadd_line_2.
MOVE itab-zadd_line_3 TO wa-zadd_line_3.
MOVE itab-zlandline_no TO wa-zlandline_no.
MOVE itab-zmobile_no TO wa-zmobile_no.
MOVE itab-zlicence_val_dt TO wa-zlicence_val_dt.
ENDIF.
LOOP AT SCREEN.
IF screen-name = 'WA-ZZ_LICNO'.
screen-input = '0'.
MODIFY SCREEN.
CLEAR screen.
ENDIF.
IF screen-name = 'WA-ZZ_LEC'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " STATUS_0200 OUTPUT
thanks and regards,
alson
‎2007 Apr 10 6:21 AM
Hi alson,
in Module...
Add the BOLDLY WRITTEN STATEMENT.
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE user_command_0200 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
WHEN 'MODY'.
MOVE wa-zadd_line_1 TO zlec_master-zadd_line_1.
MOVE wa-zadd_line_2 TO zlec_master-zadd_line_2.
MOVE wa-zadd_line_3 TO zlec_master-zadd_line_3.
MOVE wa-zlandline_no TO zlec_master-zlandline_no.
MOVE wa-zmobile_no TO zlec_master-zmobile_no.
MOVE wa-zlicence_val_dt TO zlec_master-zlicence_val_dt.
MODIFY zlec_master.
COMMIT WORK.
<b>CLEAR WA.</b>
ENDCASE.
<b>
Reward Points if helpful,</b>Regards,
Tejas
‎2007 Apr 10 6:19 AM
hi alson,
this is bcoze you clear the filed in PAI (by pushing a button) but again in PBO it assign the previous value , so make a procedure that if a particular button is click ,use a variable as flag and make use of it in PBO (as condition)
in the same way you can provide some value to a field.
rgds
Deepak.
‎2007 Apr 10 6:48 AM
hi guys,
i have tried all ur suggestions. but still i am getting the same problem
I have copied the code earlier. plz fgo thru it suggest me a solution.
Regards,
alson
‎2007 Apr 10 6:53 AM
Hi Alson,
What is happening is......
after you clear the WA....
again in PBO module...
***********************************************************************************
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE status_0200 OUTPUT.
SET PF-STATUS 'ABC'.
IF NOT itab[] IS INITIAL.
READ TABLE itab WITH KEY zz_licno = zlec_master-zz_licno.
MOVE itab-zz_licno TO wa-zz_licno.
MOVE itab-zz_lec TO wa-zz_lec.
MOVE itab-zadd_line_1 TO wa-zadd_line_1.
MOVE itab-zadd_line_2 TO wa-zadd_line_2.
MOVE itab-zadd_line_3 TO wa-zadd_line_3.
MOVE itab-zlandline_no TO wa-zlandline_no.
MOVE itab-zmobile_no TO wa-zmobile_no.
MOVE itab-zlicence_val_dt TO wa-zlicence_val_dt.
ENDIF.
<b>CLEAR WA.</b>
***********************************************************************************
here afain you assign the values from itab to WA...so it does not stay cleared...
so either you need to put condition based on which WA is to be populated from itab before screen is displayed <b>OR</b> you should use...
<b>CLEAR WA.</b> statement after this last endif statement in above mentioned PBO MODULE as i have adited above...
<b>Reward Points if helpful,</b>
Regards,
Tejas
‎2007 Apr 10 6:58 AM
Hi alson,
after COMMIT WORK statement.
clear the fields in the screen.(i don't mean work area).
<b>clear <name of that field in the screen</b>>
regards,
bharat.
Message was edited by:
Bharat Kalagara