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: 

upgrade the database table

Former Member
0 Kudos

hi all

I have a sceen if i will enter the value and press the save button it will add all the value into the database table.

I am doing this using dialog programming.

if anybody have face this prob to upgrade the database table than it would help me a lot

thanks a lot to all

mrutyun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Which is your problem?

You should transfer the data into workarea structurated like your table and then update it.

So if you create the screen fields using that table you should only update the table:

- If you design your screen using Z-TABLE

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'. MODIFY <Z-TABLE>.

ENDCASE.

ENDMODULE.

or

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'. MODIFY <Z-TABLE> FROM <WORK AREA>.

ENDCASE.

ENDMODULE.

Max

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Hi,

in Your PAI handle the SAVE button and update the DB .

in PBO you will set the PF status, enable save and set the FCODE to it.

handle the okcode of save button in your PAI , in that update DB with all your values.

Regards

vijay

Former Member
0 Kudos

Hi

Which is your problem?

You should transfer the data into workarea structurated like your table and then update it.

So if you create the screen fields using that table you should only update the table:

- If you design your screen using Z-TABLE

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'. MODIFY <Z-TABLE>.

ENDCASE.

ENDMODULE.

or

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'. MODIFY <Z-TABLE> FROM <WORK AREA>.

ENDCASE.

ENDMODULE.

Max

Former Member
0 Kudos

HI,

in the Screen PBO, in the PF-STATUS just enable the butons which you want including the SAVE button, here you will give the okcode to the save button.

in the PAI,

if SY_UCOMM = XXX<Save ok code>.

just insert your screen values into the database table.

endif.

this will work

Thanks

Sudheer

Former Member
0 Kudos

Hey Hi

For that first either you have to declare internal table or you can use database table work area in the abap editor

after that you need to declare all 5 fields with same name in abap as well as screen painter.

now in the PAI of the screen you have to handle all your 3 pushbuttons with the help of fcoded assigned to them.

the case may be like this

PROCESS AFTER INPUT

CASE OK-CODE.

WHEN 'CREATE'.

ITABNAME-FNAME1 = SCREEN FIELD NAME1

ITABNAME-FNAME2 = SCREEN FIELD NAME2

ITABNAME-FNAME3 = SCREEN FIELD NAME3

ITABNAME-FNAME4 = SCREEN FIELD NAME4

ITABNAME-FNAME5 = SCREEN FIELD NAME5

INSERT <DATABASE TABLE> FROM ITAB.

WHEN 'DISPLAY'.

SELECT SINGLE * FROM DBTAB INTO ITAB.

SCREEN FIELD NAME1 = ITABNAME-FNAME1

SCREEN FIELD NAME2 = ITABNAME-FNAME2 =

SCREEN FIELD NAME3 = ITABNAME-FNAME3

SCREEN FIELD NAME4 = ITABNAME-FNAME4

SCREEN FIELD NAME5 = ITABNAME-FNAME5.

WHEN 'CHANGE'.

ITABNAME-FNAME1 = SCREEN FIELD NAME1

ITABNAME-FNAME2 = SCREEN FIELD NAME2

ITABNAME-FNAME3 = SCREEN FIELD NAME3

ITABNAME-FNAME4 = SCREEN FIELD NAME4

ITABNAME-FNAME5 = SCREEN FIELD NAME5

MODIFY <DATABASE TABLE> FROM ITAB.

ENDCASE.

THANKS

Former Member
0 Kudos

Hi Mrutyunjaya,

I suppose your requirement is like this.

"In the initial screen , you have buttons for INSERT,MODIFY,DISPLAY.Clicking on INSERT button should insert it into database. Similarly for other buttons corresponding function should be done"

The scenario that you have given is a very easy one.

Insertion.

-


In the Screen Painter, use "Dictionary elements" button to drag and drop the required data into the screen.Let the table be ZMAKT.

In the PAI, when SAVE button is clicked in the INSERT screen, <b> insertion is done in the database by using INSERT Statement </b>.

In this case it is

INSERT ZMAKT.

The new data will be inserted in the table.

Modification

-


The statement required is <b>UPDATE</b>.

In this case,

UPDATE ZMAKT.

Hope your requirement is satisfied.

Regards,

SP.