‎2007 Jul 30 10:25 AM
Hi,
I have created a screen 100 and there are four fields for the user to input. I need to transfer the data (which the user enters) to the internal table. So that I can compare those data with the database and wants to display a message in the same screen.please tell me how to do it
‎2007 Jul 30 10:35 AM
Hi,
The easiest way is to use a work area(wa) created as:
Data: wa like line of itab.
Afterwards you call wa from screen via get from program tooltipped button and write the textbox wa. Then click ok.
The fields automatically come.
For example the itab and wa contains the fields like, Name, SName,City,Zip.
Then:
In the PAI write:
itab-name = wa-name.
itab-sname = wa-sname.
itab-city = wa-city.
itab-zip = wa-zip..
append itab.
The game is over now:)
Hope helps...
‎2007 Jul 30 10:30 AM
Hi,
U can acess the values entered by the user in the PAI event. There u can append them in to internal table and compare with the database.
You can display corresponding message on the same screen.
Regards,
Sankar
‎2007 Jul 30 10:32 AM
Hi,
say your flow logic will like this:
PBO:
MODULE PBO_100.
PAI:
MODULE PAI_100.
NOW IN PAI WRITE LIKE
if sy-ucomm = 'SAVE'. "User presses SAVE button
itab-fld1 = tblctrl-tbl_fld1.
itab-fld2 = tblctrl-tbl_fld2.
itab-fld3 = tblctrl-tbl_fld3.
itab-fld4 = tblctrl-tbl_fld4.
append itab.
endif.
"comapre data here
"show message
if <comditon> = <codn>.
message 'type a message' type 'I'. "information message .
endif.Hope this will help u.
Jogdand M B
‎2007 Jul 30 10:33 AM
1. first user enters data in the screen
2. get your data from the data base in to a work area
3. wa-fld1 = freld 1 form screen
wa-fld2 = freld 2 form screen
wa-fld3 = freld 3 form screen
wa-fld4 = freld 4 form screen
if all the four conditions are satisfied
set a flag as 'x'
if not display a your message
and use this flag where ever u want these conditions further
‎2007 Jul 30 10:33 AM
First uif u r having the fieldnames of the textbox which u have in ur screen 100 as like table or differesnt...
for example if u have fieldname as i_vbeln i_date then u have to declare in ur program first.
If u are having VBAK-VBELN then no need to declare in the program
Declare in program like this...
Data : i_vbeln like vbak-vbeln.
Then in screen 100
in the PAI
Chain.
field: i_vbeln ,
i_date.
Module Process_fiele.
endchain.
Module Process_fields input.
Check here with the database table.
endmodule.
‎2007 Jul 30 10:34 AM
try this code
tables mara.
parameters : p_matnr type mara-matnr,
p_mtart type mara-mtart,
p_matkl type mara-matkl,
p_meins type mara-meins.
select * from mara where matnr = p_matnr and
mtart = P_mtart and
matkl = p_matkl and
meins = p_meins.
if sy-subrc = 0.
message 'Entered data already exists' type 'S'.
else.
message 'Entered data doesnt exist' type 'S'.
endif.
‎2007 Jul 30 10:35 AM
Hi,
The easiest way is to use a work area(wa) created as:
Data: wa like line of itab.
Afterwards you call wa from screen via get from program tooltipped button and write the textbox wa. Then click ok.
The fields automatically come.
For example the itab and wa contains the fields like, Name, SName,City,Zip.
Then:
In the PAI write:
itab-name = wa-name.
itab-sname = wa-sname.
itab-city = wa-city.
itab-zip = wa-zip..
append itab.
The game is over now:)
Hope helps...