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: 

Dynamically change maintainence generator of a table

Former Member
0 Kudos

Hi,

I have created a custom table and a maintainence generator for it. In my table i have 5 columns , out of which one is 'Status'.

My requirement is that intially the status would be 'Start' and all the columns will be in editable mode.

But as soon as the status is set to 'Available' ( which is being done dynamically in code) all the columns become uneditable, so that no entries could be changed.

Please suggest a way to do this.

Thanks in advance.

Parul.

7 REPLIES 7

Former Member
0 Kudos

Hello,

If you are using Module pool program you can you below logic to disable the fields.

IF status eq 'AVAIABLE'.

Loop the screen and disable all the fields which u r dont want editing.

endif.

Example:

LOOP AT SCREEN.

CASE screen-name.

WHEN 'TABLENAME-STATUSFIELD'.

IF status eq 'AVAIABLE'.

screen-input = y_k_0.

MODIFY SCREEN.

ENDIF.

endcase.

endloop.

0 Kudos

Hi,

I am not using module pool. The screen is through the transaction SM30.

Within the screen, looping on screen is not possible.

Is there any other way?

Thanks,

Parul.

0 Kudos

You can change the PBO code. To get that code you have to go to SE11 in change mode, then menu Utilities/Table Maintenance Generator/Enviroment/Modification/Maintenance Screens will show a pop up where you'll able to select your screen, then double click the screen that you need to change.

I hope it helps you.

0 Kudos

Hi

U need to change the program generated by the table maintainence generator: so after going to there press:

- Enviroment->Modification->Maintenance Screens

- Doubleclick on your screen

So the system'll open the screen editor where u insert your modifications.

Here u can modify the screen flow logic because the program generated by the system is custom (u should consider u've assigned a Z-function group to generate it).

Just only u need to considere u could loose your modification if you generate again the program after inserting a new field in your Z-TABLE.

Max

Former Member
0 Kudos

Open ur table and then go to table maintenance generator there you can see a tab 'Source code. click on it and choose the program name starting from sapm.. (genrally at the top) and then press enter.

This take u to the module pool screen there you can add your custom module for modify record.

Former Member
0 Kudos

Go to the Table Maintenance Generator via SE11.

Click on Environment -> Modification -> Maintenance Screens

In the PBO of the screen, you can add your 'loop at screen...' code.

Hope this helps. .

Former Member
0 Kudos

In the Table control screen

You will find the this code under PBO

*---standard

LOOP AT EXTRACT WITH CONTROL

TCTRL_ZTRV_GLACC CURSOR NEXTLINE." this line can be diffrent

MODULE LISTE_SHOW_LISTE.

ENDLOOP.

*---change it as follows

LOOP AT EXTRACT WITH CONTROL

TCTRL_ZTRV_GLACC CURSOR NEXTLINE.

MODULE LISTE_SHOW_LISTE.

MODULE MY_CODE.

ENDLOOP.

In the module MY_CODE

Put this logic

IF wa_tc_display-status IS INITIAL.

wa_tc_display-status = 'Default Value'.

ENDIF.

IF wa_tc_display-status = 'Approved'.

LOOP AT SCREEN.

IF SCREEN-NAME CS 'wa_tc_display-'. "or mention all the column names in TC here seprated by OR

SCREEN-INPUT = 0.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

Edited by: Amit Gupta on Oct 21, 2008 12:13 PM