2009 May 22 10:36 AM
Hi Experts,
I wrote a module pool Program with a requirement like this. I am having 3 fields in first box and in second box iam having some other fields.In the first box i have to enter 3 fields, after that if I press Display button it should fetch data in the second box fields. Code is working fine. But the issue is in the first box after entering first field when Iam pressing enter data is disappearing i mean data is clearing. It should not happen like this . Please tell me the Solution.For understanding purpose . Iam sending my Code also.
PROGRAM ZSALES_SCREEN2.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
tables:zsalesoff_take.
data:jtab like zsalesoff_take occurs 0 with header line.
case sy-ucomm.
when 'INS'.
move zsalesoff_take to jtab.
append jtab.
insert into zsalesoff_take values jtab.
if sy-subrc = 0.
message I000(010) with 'inserted'.
else.
message e001(002) with 'not inserted'.
endif.
when 'UPD'.
move zsalesoff_take to jtab.
append jtab.
update zsalesoff_take from table jtab.
if sy-subrc = 0.
message I000(010) with 'updated'.
else.
message e001(002) with 'not updated'.
endif.
when 'DISP'.
select single * from zsalesoff_take into jtab where dist_name = zsalesoff_take-dist_name
and zdate = zsalesoff_take-zdate
and Z_SUBDEALER = zsalesoff_take-z_subdealer.
WHEN 'CLE'.
clear jtab.
WHEN 'BACK'.
leave Program.
when 'Exit'.
leave program.
when 'REP'.
call transaction 'ZSOT1'.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module STATUS_0100 output.
SET PF-STATUS 'ZSTAT'.
SET TITLEBAR 'SALES OFF-TAKE REPORT'.
move-corresponding jtab to zsalesoff_take.
endmodule. " STATUS_0100 OUTPUT
Hi Experts,
I wrote a module pool Program with a requirement like this. I am having 3 fields in first box and in second box iam having some other fields.In the first box i have to enter 3 fields, after that if I press Display button it should fetch data in the second box fields. Code is working fine. But the issue is in the first box after entering first field when Iam pressing enter data is disappearing i mean data is clearing. It should not happen like this . Please tell me the Solution.For understanding purpose . Iam sending my Code also.
PROGRAM ZSALES_SCREEN2.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
tables:zsalesoff_take.
data:jtab like zsalesoff_take occurs 0 with header line.
case sy-ucomm.
when 'INS'.
move zsalesoff_take to jtab.
append jtab.
insert into zsalesoff_take values jtab.
if sy-subrc = 0.
message I000(010) with 'inserted'.
else.
message e001(002) with 'not inserted'.
endif.
when 'UPD'.
move zsalesoff_take to jtab.
append jtab.
update zsalesoff_take from table jtab.
if sy-subrc = 0.
message I000(010) with 'updated'.
else.
message e001(002) with 'not updated'.
endif.
when 'DISP'.
select single * from zsalesoff_take into jtab where dist_name = zsalesoff_take-dist_name
and zdate = zsalesoff_take-zdate
and Z_SUBDEALER = zsalesoff_take-z_subdealer.
WHEN 'CLE'.
clear jtab.
WHEN 'BACK'.
leave Program.
when 'Exit'.
leave program.
when 'REP'.
call transaction 'ZSOT1'.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
module STATUS_0100 output.
SET PF-STATUS 'ZSTAT'.
SET TITLEBAR 'SALES OFF-TAKE REPORT'.
move-corresponding jtab to zsalesoff_take.
endmodule. " STATUS_0100 OUTPUT
2009 May 22 10:58 AM
Hi,
please remove statement 'tables:zsalesoff_take.' to TOP include
2009 May 22 11:00 AM
2009 May 22 11:03 AM
Hi,
I have faced such situation and this got solved by below steps.
Put this code in PAI module.
CHAIN.
FIELD zsalesoff_take-field3.
FIELD zsalesoff_take-field2.
FIELD zsalesoff_take-field1.
ENDCHAIN.
CHAIN endchain helps retain the screen field values along with field validation.
Hope this solves your problem. Give points incase you feel the solution helped you.
Cheers,
Suvendu
2009 May 22 11:13 AM
In the PAI, after module I wrote that statements. But not working.Same thing Happening even after the addition of this Code.
2009 May 22 11:30 AM
Hi,
you will be having a TOP include in your program, right? there you have to include the TABLES statements. Please remove it from the module you wrote in PAI.
2009 May 22 11:34 AM
Hi,
Just check whether you can written a code to clear the field in PBO.
2009 May 23 10:35 PM
Hi,
Move your data declaration in TOP include or at the top of the program(outside any module)
Remove declaration of JTAB from module USER_COMMAND_0100. If it is declared twice, In PBO module, it will refer to global data.
Regards,
Devendra
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |