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: 

how to design user input screens with an option to save data

Former Member
0 Kudos

Hi i have a peculiar requirement,

I need to create some standard screens where user can input data for mm01 say a transaction zmm01.

For which i need to design a screen and place some fields like material number, netweight , gross weight etc

For which i created one table called zmara for basic data.

What would be the approach to create a user input screens with an option to save data , roll back data etc etc

do we need to use dialog programming or selection screens which one would be the best choice..

Our idea is create a custom design screens some thing like MM01 where user can input data to save it...

Thank you

bond

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You can create a module pool by SE80 and create the input/output fields of screens using ZMARA.

You don't need a Rollback options, but you can run the routine for updating in UPDATE TUSK:

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'.

CALL FUNCTION 'Z_UPDATE_ZMARA' IN UPDATE TASK

EXPORTING

ZMARA = ZMARA.

................

  • or you can use:

PERFORM UPDATE_ZMARA ON COMMIT.

ENDCASE.

ENDMODULE.

SAP std usually run the routines (or function) for updating in update tusk, in this situation you have to do a COMMIT WORK to run really the routines.

So after calling the routines for updating you should end your trx and do a COMMIT.

Max

8 REPLIES 8

Former Member
0 Kudos

You will have to use DIALOG PROGRAMMING only. Selection screens are not for this purpose.

You can do the validation in the PAI of the screen and finally save the data.

Regards,

Ravi

Note : Please mark all the helpful answers

0 Kudos

Ravi u mean to say we have to use the INSERT statements to insert data directly into Ztables..

Former Member
0 Kudos

Hi

You can create a module pool by SE80 and create the input/output fields of screens using ZMARA.

You don't need a Rollback options, but you can run the routine for updating in UPDATE TUSK:

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'SAVE'.

CALL FUNCTION 'Z_UPDATE_ZMARA' IN UPDATE TASK

EXPORTING

ZMARA = ZMARA.

................

  • or you can use:

PERFORM UPDATE_ZMARA ON COMMIT.

ENDCASE.

ENDMODULE.

SAP std usually run the routines (or function) for updating in update tusk, in this situation you have to do a COMMIT WORK to run really the routines.

So after calling the routines for updating you should end your trx and do a COMMIT.

Max

0 Kudos

hi max

can u eloborate a little bit on how commit work is done...

Thanks in advance

Martin

0 Kudos

Hi

I suppose you should have a screens flow like this:

FIRST DYNPRO (to select the data have to be updated),

---> NEXT DYNPROs,

I.e. after the first dynpro you can have several screens to insert the new values.

When the user presses 'SAVE' option, you should run the routine for updating and move to the first screen and here do the commit:

CASE OK_CODE.

WHEN 'SAVE'.

PERFORM UPDATE_ZMARA ON COMMIT.

SET SCREEN <FIRST SCREEN>. LEAVE SCREEN.

FL_UPDATE = 'X'.

So the first screen should be:

PROCESS PBO.

MODULE SET_COMMIT.

MODULE SET_COMMIT.

CHECK FL_UPDATE = 'X'.

FL_UPDATE = SPACE.

COMMIT WORK.

  • Now start the routine UPDATE_ZMARA

ENDMODULE.

In routine UPDATE_ZMARA you should insert all code you need to update the database:

FORM UPDATE_ZMARA.

INSERT ZMARA

  • OR

UPDATE ZMARA

  • OR

MODIFY ZMARA

ENDFORM.

Anyway it's better you see the concept on LUW (Logical Unit of Working) on SAP HELP.

Max

Former Member
0 Kudos

Hey,

Take a look at the transaction BIBS. It has examples of user interface design.

-Kiran

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Martin,

Yes u have to use Insert statement if u want it to update to Ztable...

and U have to use Dialog Programming only ..

Selection-Screen is only for user selection of his desired records...

Design the Screen with reuireq Texts and Buttons and handle the appropriate buttons in PAI. Handle the appropriate actions in PAI...

If any help required u r welcome...

If u use <b>Commit</b> work then the record will inserted into Ztable and cannot be Roll backed after the Insert statement... If u doesnt say Commit then it can be Rollbacked..

Regards,

Sridhar

Former Member
0 Kudos

hi bond

you can create this screen using dialog module.you can create the screen fields using layout option.

to save data,you can do coding for SAVE in PAI of required screen.

Regards

Naveen