09-21-2008 1:48 PM
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
09-21-2008 2:54 PM
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,
--
TYPES: BEGIN OF ST_ZFORMA,
MANDT TYPE ZFORMA-MANDT,
FASLN TYPE ZFORMA-FASLN,
FAPLC TYPE ZFORMA-FAPLC,
End of ST_ZFORMA.
--
DATA: IT_ZFORMA TYPE TABLE OF ST_ZFORMA, " INTERNAL TABLE IS
W_ZFORMA TYPE ST_ZFORMA, " WORK AREA
WA_ZFORMA TYPE ZFORMA.
--
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.
09-21-2008 5:15 PM
Hi Balu CH
Thanks for posting a very nice and useful solution . I am trying to apply the suggested guidelines .
Regards
Sonia
09-21-2008 7:43 PM