Application Development 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: 

Problem in selection-screen(when saving data)

Former Member
0 Kudos

Hi Expert,

I have a selection screen. i want to save data in ztable by clicking save. But when i click on save a Variant Attributes screen appear. But i want when i click on save then data save in ztable. please guide me expert ???

1 ACCEPTED SOLUTION

sivaganesh_krishnan
Contributor
0 Kudos

Hi raj,

If you want to Custom Save button then do the following steps,

1. create a pf status and inside this under function keys in PBO,  as this

2. Inside PAI , check for ok_code is 'SAVE' , then write the necessary insert statement for inserting data in the table.

Regards,

Sivaganesh

9 REPLIES 9

arivazhagan_sivasamy
Active Contributor
0 Kudos

When click on save in the report program, it will ask us to save as variant.

If you want to save the selection screen data, create a push button in selection screen.

In at-selection screen event, write a logic to save the data to Ztable.

Or, create module pool program and save the data.

Arivazhagan S

0 Kudos

Actually i dont want to create push-button in selection-screen. I want to save data in ztable without pushbutton. When i click on save then data saved in ztable.

mayur_priyan
Active Participant
0 Kudos

Hi,

As per my understanding you want to use the PF-status of a selection screen defined by the system, and don't want to create a custom push button.

Please check the below link, which shows how to use the standard PF-status for custom use.

http://scn.sap.com/thread/747332

Regards,

Mayur Priyan. S

0 Kudos

Given is the print screen

After Fill the data want to click on save. But when i click on save a variant screen appeared. Simply i want after filling data when i click on save the data save in table without asking variant.

0 Kudos

We understood your requirement. It is seen that the default SAVE option on the selection screen is for 'Saving a Variant'. Hence you have to create a custom PF-status and using them inside the report program using the Function Modules which have been marked in the link which I provided.

sivaganesh_krishnan
Contributor
0 Kudos

Hi raj,

If you want to Custom Save button then do the following steps,

1. create a pf status and inside this under function keys in PBO,  as this

2. Inside PAI , check for ok_code is 'SAVE' , then write the necessary insert statement for inserting data in the table.

Regards,

Sivaganesh

Former Member
0 Kudos

Hi Raj,

  • RS_SET_SELSCREEN_STATUS

Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status.

  • RS_EXTERNAL_SELSCREEN_STATUS

          Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must pass the name of the function module that sets the status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.

REPORT demo_sel_screen_status.

DATA itab TYPE TABLE OF sy-ucomm.

PARAMETERS test(10) TYPE c.

AT SELECTION-SCREEN OUTPUT.
  APPEND: 'PRIN' TO itab,
          'SPOS' TO itab.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
       EXPORTING
            p_status  = sy-pfkey
       TABLES
            p_exclude = itab.

In this example, the Print and Save as variant functions are deactivated. To find out the function codes of the standard GUI status, choose System ® Status and double-click the GUI status field.

Regards,

Ashish Kumar

Former Member
0 Kudos

Hi Raj,

Instead of doing it as report do it in modulepool.

So u can have ur custom screen where you can define set pf status.

Here save is ur function code.

In PAI write logic to save data to ztable.

Regards

Vineesh B

Former Member
0 Kudos

Dear Raj,

In your Report add ur update Statments here :

AT SELECTION-SCREEN.

   case sy-ucomm.

     when 'SPOS'.


        " Updating Your table ztable

       ENDCASE.