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

Data clearing after pressing ENTER

Former Member
0 Likes
940

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

7 REPLIES 7
Read only

Former Member
0 Likes
888

Hi,

please remove statement 'tables:zsalesoff_take.' to TOP include

Read only

Former Member
0 Likes
888

I mean write it only in the TOP include.

Read only

Former Member
0 Likes
888

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

Read only

0 Likes
888

In the PAI, after module I wrote that statements. But not working.Same thing Happening even after the addition of this Code.

Read only

0 Likes
888

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.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
888

Hi,

Just check whether you can written a code to clear the field in PBO.

Read only

Former Member
0 Likes
888

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