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 maintainence

Former Member
0 Kudos

Hello guys,

I have a requirement here. Please help me.

I had created a custom table and had developed a custom program for creating new entries in that table.

Basically the functionality of this program is similar to SM30.

When I click NEW ENTRIES tab (table maintainence screen) for this table, 24 empty rows will be displayed with some default value say 'ABCD'in one of the columns for all 24 rows(pulling ABCD value from domain assigned to that field/column).

Now my requirement is I have to change that default value 'ABCD' to some other value say 'PQRS' with out changing domain value range when I clicked NEW ENTRIES tab.

How should I add this in PBO event of my program??

Any suggestions???

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

First let me get the requirements properly:

You said u created a custom Program for Maintaining Table entries into a custom table. Whne u click on New Entries button, the screen will open with 24 fields which u need to maintain, Then one of the field has 'ABCD' as default value. now you want to change to Other value like 'PQRS'.

Now in when you diplay the screen for maintaining, you can edit the field which has ABCD directly and replace it with PQRS and enter other data and SAVE.

If the new Value PQRS is not in domain values then you can't do any thing. you have to have the value entered from the domain values of the field.

If you want automatically get the new value PQRS instead of ABCD while display itself then in PBO write a Module to change the value i.e. to the table field assign PQRS directly. ex: ITAB-NAME = 'PQRS'.

hope this helps.

Thanks

Balu

7 REPLIES 7

Former Member
0 Kudos

Sorry...forgot to tell you that the column for which I need to change the default value is a list box.

0 Kudos

yes Bala is right.

get that value in domanin, then you can change these values

regards.

Former Member
0 Kudos

Hi

First let me get the requirements properly:

You said u created a custom Program for Maintaining Table entries into a custom table. Whne u click on New Entries button, the screen will open with 24 fields which u need to maintain, Then one of the field has 'ABCD' as default value. now you want to change to Other value like 'PQRS'.

Now in when you diplay the screen for maintaining, you can edit the field which has ABCD directly and replace it with PQRS and enter other data and SAVE.

If the new Value PQRS is not in domain values then you can't do any thing. you have to have the value entered from the domain values of the field.

If you want automatically get the new value PQRS instead of ABCD while display itself then in PBO write a Module to change the value i.e. to the table field assign PQRS directly. ex: ITAB-NAME = 'PQRS'.

hope this helps.

Thanks

Balu

0 Kudos

Thanks for the replies. But if I code a module in PBO for changing the default value in that field it changes all the values for existing entries also. Because this is the module which executes first.

But I want to change only for the empty rows displayed when we click the new entries button.

Thanks

Former Member
0 Kudos

Hi,

Do the following :

In PBO

LOOP .

  • assign new value here.

MODULE test.

  • update data from internal table to table control .

MODULE update_data.

ENDLOOP.

MODULE test OUTPUT.

zztest2-zztest = 'CDEF'.

ENDMODULE. " test OUTPUT

MODULE update_data OUTPUT.

DATA : lin TYPE i.

lin = tc1-current_line + tc1-top_line.

READ TABLE itab1 INDEX lin.

IF sy-subrc = 0.

zztest2-vbeln = itab1-vbeln.

zztest2-zztest = itab1-zztest.

ENDIF.

tc1-lines = sy-loopc.

ENDMODULE. " update_data OUTPUT

Here ZZTEST are the screen fields ( zztest2-zztest change the default value ) and data is in ITAB1.

Hope this work for you.

regards,

Gagan

0 Kudos

Hi Naren,

In case answer was helpful, please reward points .

Regards,

0 Kudos

Hello Gagan,

I really appreciate your time for replying to my query.

I will make changes as per your solution and let you know next week. Right now I am working on another issue which has more priority.

Please bear with me.

Thanks