Application Development and Automation 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: 
Read only

Custom table

Former Member
0 Likes
1,144

Hi,

Iam developing the one custom table.That table contains 5 columns like product,

plant,message,validity From date,Validate to date.The messages that will be maintained in this table will be product and plant specific.Then when this product plant combination is selcted in the tally analyer the valid message will be displayed,pulling from this custom table.This messages will be displayed in the table to notify the seller of information needed for the product/plant combination and date they have chosen to display.

There wiill be validity dates associated with each entry.A valid end date needs to be 9/9/99,therefore the message would be valid indefinitely.

plant-werks

product-matnr

validfrom date-datbi

valid to date-datab

message-new field

plant and product,dates are primary key.Please give me procedure.Very urgent.

Regads,

Sairam

9 REPLIES 9
Read only

Former Member
0 Likes
938

create a table in SE11 with the below fields...maintain a table maintenance and then u can access table in SM30 wherein required values can be inputted.

now, in ur analyzer, u need to write code as say user has selected material and plant...write a select statement to fetch record from custom table based on material & plant combination....check whether valid from is greater than today and u can display the record to user.

Read only

0 Likes
938

Hi,

But i want to display the my custom message?Means suppose user enter the existing data in i want to dispaly the custom message 'plant alredy exitst' And where i have to write the coding?

Thanks,

sairam

Read only

Former Member
0 Likes
938

Hi Sairam,

To my understanding, you want to display proper error messages for table maintainance.

After creating table, follow the follwing procedure.

Got SE11 -> Tabel Maintance generator ( in utilities menu option) -> Press Fn.Gr.Text -> ( a pop will apear) Press Main Programe -> Programe will apear.

Here you can write your own logic and custom message for the custom table. The sample code for a custom table zh117 is as follows, which is writen in the programe as mentined above.

[code]

*--- No blanks are allowed.

IF zh117-descr IS INITIAL OR

zh117-endda IS INITIAL OR

zh117-begda IS INITIAL OR

zh117-zdiff IS INITIAL OR

zh117-zcode IS INITIAL OR

zh117-zdiff EQ '0'.

MESSAGE e000(zh01) WITH text-004.

ENDIF.

*--- Zcode should not have any special charactres.

IF zh117-zcode CA text-001. "'!@#$%^&*()_-+=|\":;?/>.'<,'.

MESSAGE e000(zh01) WITH text-002.

ENDIF.

*--- begda must alway > or = to endda.

IF zh117-begda GE zh117-endda.

MESSAGE e000(zh01) WITH text-003.

ENDIF.

*--- Assign changed by and changed date when all entries are correct.

zh117-changedby = sy-uname.

zh117-changedon = sy-datum.

[/code]

This code is writen in a separate include for the purpose of readility and modularization.

Award points if it is use ful, Any doubts let me know, please.

All the very best to you,

Regards,

Mohan Vamsi Krishna.A

Read only

0 Likes
938

Hi Mohan Krishna,

I have follwed the same procedure.But in the main program many includes is there.Where i have to write this coding?Please help me.

With Regards,

T.saisuresh

Message was edited by:

sairam kappera

Read only

0 Likes
938

Hi Sriram,

After creating the table maitanece in SM30. In your case you can implement. events for this. Go to the Enviranoment section menu u can find the events.

Implement event like berfor save, after enter like that.

u can implement befor save event.

It will ask for name of the sub routine. after creation u can write ABAP code in that sub routien.

like if the combenation is wrong u can display message.

It will display in SM30 it self and data is not going to save.

It will work, Try this,

Best of luck

Sunil

Read only

0 Likes
938

Hi,

go to utilties -> table maintaince generator...

then..go to enviornment -> modification->events..

Regards,

Sunil

Read only

0 Likes
938

Hi sunil,

give me some sample code.Iam using fields like plant(t001w-WERKS),product(vbap-matnr), valid from date,valid to date,message(VBAP-ARKTX).So to i got a Hot messages for product and plant combinations.Please help me.it is very urgent.

Thanks & Regards,

sairam

Read only

0 Likes
938

Hi,

There you can create a new include. That will do.

If the problem is solved let me know.

Regards,

Mohan Vamsi Krishna.A

Read only

0 Likes
938

Hi Mohan krishna,

Where i have to create the new include.In the standard program or different?

Please help me?

Thanks & regads,

Sai