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: 

table maintenence generator events

Former Member
0 Kudos
121

Hi experts,

I am having a table in which I have implemented the table maintenence generator.The requirement is as follows:

Field A:User enters value 'aaa' using F4 help

Field B:Automatically gets populated with the short description corresponding to 'aaa'.

Here the short description depends on the selected value for field A.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
90

Hi,

By refering to the above links, u will get an idea abt how to use the events in table maintenance gen.

After that, add choose the event- '05' ( Creating a new entry).

AT_CREATE. in the editor add the following code:


*----------------------------------------------------------------------*
***INCLUDE LZCOSTEP1F01 .
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
*                  FORM AT_CREATE                                      *
*----------------------------------------------------------------------*
form at_create.
  data :  log_sys type zco001-zawsys value 'sap'.

  if zco001-A = 'aa'.
    zco001-B = 'short descr for aa'.
  endif.

endform.                    "at_create

Note that it works fine..but the user has to click ENTER key after inputing the value in field A.

PLs do get back if u have any further issues.

Regards,

Anjali

8 REPLIES 8

Former Member
0 Kudos
90

Hi

<a href="http://https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc">http://https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc</a>

former_member189629
Active Contributor

Former Member
0 Kudos
91

Hi,

By refering to the above links, u will get an idea abt how to use the events in table maintenance gen.

After that, add choose the event- '05' ( Creating a new entry).

AT_CREATE. in the editor add the following code:


*----------------------------------------------------------------------*
***INCLUDE LZCOSTEP1F01 .
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
*                  FORM AT_CREATE                                      *
*----------------------------------------------------------------------*
form at_create.
  data :  log_sys type zco001-zawsys value 'sap'.

  if zco001-A = 'aa'.
    zco001-B = 'short descr for aa'.
  endif.

endform.                    "at_create

Note that it works fine..but the user has to click ENTER key after inputing the value in field A.

PLs do get back if u have any further issues.

Regards,

Anjali

0 Kudos
90

Ya,I have checked in the above sites.

Anjali,the value in field A has to be selected by the user using F4 help.The value

in field B is dynamic and depends on the value chosen by the user in field A.It is not a static value.If you can provide any help on this front?

0 Kudos
90

Hi debansu,

No need to do your coding in events in your case. first of all you understand the internal table used in table Maintainace, The internal tables used are TOTAL and EXTRACT. These table are of string type so you will have to catch your value using offset. To write the logic to popualte the value is very simple in your case. You add one Module in PAI logic of screen of Table maintainance generator in that Module you poupalte the field. for example say for the F4 value of field MATNR you want to populate field MAKTX. then in the one custom PAI moudule you write like this.

SELECT SINGLE FROM MAKT

INTO LF_MAKTX

WHERE MATNR = EXTARCT+3(18)(If Material is the 2nd field after MANDT).

In PAI LOOP is done on EXTARCT internal Table which holds Records in run time.

This will solve your requirment If you are not having F4 help then you can create it by adding one event PROCESS ON VALUE-REQUEST writeen in Flow logic of screen.

We use event where we want to do some validation based on some reasons like Before saving the data in database or before displaying to do the validation of records from table TOTAL. there are diffrent events in Table maintaince but in your case it's not required..

Let me know if you have any more issue.

<b>Kindly reward points for helpfull answers..</b>

Regards

Tanweer Zaki

Message was edited by:

Tanweer Zaki

0 Kudos
90

Thanks to all.Anjali actually I had to capture the value dynamically and then use a select query to fetch the corresponding description.Tanveer,to write code in the PAI of the table maintenence generator,we need to have the appropriate access key.

Thanks again.

Regards

Debansu

0 Kudos
90

Hi debansu,

No you dont need to use Acess Key thats custom generated code. I have done the same you try it. Go to table maintainance screen in SE54. Double click on screen No. and you will get the flow logic of the screen here you can add your own module in one new include and do the validation as written earlier for F4 write a new event PROCESS ON VALUE-REQUEST.

Thanks and Regards

Tanweer

Former Member
0 Kudos
90

Thanks Tanweer.