2008 Aug 12 11:30 AM
hi Abapers,
i have doubt regarding my set pf satus in my module pool program. i have a screen and from that i have to save data which is entered in text fields . now for activating the default save button i have assigned thru pf -status . but while executing save button its saying this function not possible. can anyone clarify .
Thanks & Regards,
Syam.
2008 Aug 12 11:49 AM
HI,
try this.
set pf-status 'ZPF'.
skip.
at user-command.
case sy-ucomm.
when 'SAV'.
message 'ahi' type 'I'.
endcase.
here SAV is the function code assigned to save button in the pf status.
2008 Aug 12 11:34 AM
If you are using module pool program u need to activate the PF-Status. Double click on the pf-status and inside you will see the components screen. Here, for save define a function code as SAVC and activate the pf-status.
now, in ur program write Case sy-ucomm.
when 'SAVC'.
write the code...
2008 Aug 12 11:36 AM
hello,
i have exactly done like that , but its not working fine.So any more further help .
Thanks & Regards,
Syam.
2008 Aug 12 11:35 AM
Hi,
Try this.
Check whether you have activated properly.
After giving the pf-status. check the sy-ucomm at the usercommand in the PAI event.
For ex: ur pf-status is 'SAVE'.
if sy-ucomm eq 'SAVE'
< perform the required operation>
endif.
Sharin
2008 Aug 12 11:49 AM
HI,
try this.
set pf-status 'ZPF'.
skip.
at user-command.
case sy-ucomm.
when 'SAV'.
message 'ahi' type 'I'.
endcase.
here SAV is the function code assigned to save button in the pf status.
2008 Aug 12 12:02 PM
Hi...Syam...
1. Check w'ther you are getting that message from your program.
2. Verify the action, which you are doing with that button.
or
Send the sample code which you written for your SAVE button.
Thanks
Naveen.I
2008 Aug 12 12:06 PM
Hi Syam....
> goto menu painter-> application keys ->double click on SAVE ->change your function type as SPACE..
May be now its S.
S - System function. <---- which gives above error in your case
SPACE - Normal application function.
Thanks,
Naveen.I
2008 Aug 12 12:13 PM
thank u its working , but i do have another small doubt .
in my module program i have to take data from a screen and my database table is LFA1 . and when i press save data should be updated in that table .
Regards,
Syam.
2008 Aug 12 1:03 PM
HI...
1. declare internal table t_lfa1 and work area wa for LFA1 table.
2. Here itab , wa1 are you r screen table and its work areas.
3. In PAI event.
> case sy-ucomm.
> when 'SAVE'.
>loop at LFA1 into wa.
>read table itab into wa2 with key <key>'.
> if sy-subrc = 0.
> wa_f1 = wa1-f1.
> wa_f2 = wa1-f2.
> endif.
> modify LFA1 from wa.
> endloop.
>endcase.
Thats it!!! Your table will be updates.
Thanks,
Naveen.I
2008 Aug 12 1:06 PM
Hi..
for taking the records which were changed or newly inserted u can use module modify which present in chain ..endchain..(PAI)
there u will get the data which is changed/inserted and then put those records in internal table and using that table update the databse in user command..
regards
vivek
Edited by: vivek jain on Aug 12, 2008 2:06 PM
2008 Aug 13 2:38 PM