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 write data input screen form

Former Member
0 Kudos

Dear Sir,

We need to develop a Foem which can allow data input to the user . The form will have 3 rows and each row has two field (Material Number and Standard Price field) .

We need that after after entry of each Material Number , it should be validated and invalid value should not be allowed .

At the time of Clicking of SAVE button , the data entered earlier in the 3 rows , should be inserted into Z Table .

I request SAP gurus to kindly help me with a sample code for the above scenario . Or kindly suggest me some refrence help site where I can get some help to address my requirement .

I assure to give full points for the suggested answer pl .

Rgds

Sonia Agarwal

3 REPLIES 3

Former Member
0 Kudos

Hi Sonia I will suggest you some steps do follow them and complete your work.

1) Create the table where u want to store the data of material no and standard price.

2) Create the screen such tht u will give input field names as Tablename-field name as of you have give in table.

3) Coming to coding part

In TOP declare the structure of the table and work area as shown.

TABLES: ZFORMA,

--


STRUCTURE OF ZRPFORMA--

TYPES: BEGIN OF ST_ZFORMA,

MANDT TYPE ZFORMA-MANDT,

FASLN TYPE ZFORMA-FASLN,

FAPLC TYPE ZFORMA-FAPLC,

End of ST_ZFORMA.

--


WA OF ZRPFORMA--

DATA: IT_ZFORMA TYPE TABLE OF ST_ZFORMA, " INTERNAL TABLE IS

W_ZFORMA TYPE ST_ZFORMA, " WORK AREA

WA_ZFORMA TYPE ZFORMA.

--


WA OF ZRPFORMA--

In PBO

If you are having any default values has to be displayed declare them or revert me what are all you have to display I will help you. And define GUI for the screen what are all the functions you want.

IN PAI.

Case sy-ucomm.

WHEN 'SAVE'.

W_ZFORMA-FASLN = ZFORMA-FASLN.

W_ZFORMA-FAPLC = ZFORMA-FAPLC.

MOVE-CORRESPONDING W_ZFORMA TO WA_ZFORMA.

INSERT INTO ZFORMA VALUES WA_ZFORMA.

IF SY-SUBRC = 0.

MESSAGE S000. u201CIn message give data saved successfully

Endif.

And coming to your validation of material No after you finish your saving part pass me your field i will frame the select statement if you are not able.

Hope my answer helps you.

0 Kudos

Hi Balu CH

Thanks for posting a very nice and useful solution . I am trying to apply the suggested guidelines .

Regards

Sonia

0 Kudos

Hi

Good Luck.