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

Dynamic output & input fields in the table control

Former Member
0 Likes
1,695

HI Guys,

How can one change the attribute of input field to output field basically greying of field) dynamically

based on the some flag. Loop at screen does not work. I need to change the attributes

of field 'outfiled' and output field display only'.

Any help is highly appreciated.

Regards,

Harsha

9 REPLIES 9
Read only

Former Member
0 Likes
1,082

Hi Harsha,

set the screen input of the coreesponding element to 0.

try this code..

loop at screen.

if screen-name = ' '. " enter the element name

screen-input = 0.

endif.

endloop.

if u still face any problems, i'll send a example.

Regards,

Prasanth

  • Reward if helpful

Read only

Former Member
0 Likes
1,082

Hi Harsha,

Where did you do your dynamic screen modification? In PBO section right?

It is the only way you can dynamically change screen attributes.

Refer this help link to know more about the topic:

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm

Regards,

Ravi

Read only

Former Member
0 Likes
1,082

Hi,

use this code

FIELD-SYMBOLS: <fs_cols> TYPE cxtab_control-cols,

<fs_wkcols> TYPE LINE OF cxtab_control-cols,

<fs_scr> TYPE screen.

ASSIGN tabcntrl-cols TO <fs_cols>.

LOOP AT <fs_cols> ASSIGNING <fs_wkcols>.

ASSIGN <fs_wkcols>-screen TO <fs_scr>.

IF <fs_scr>-name = 'TB_MARA-MATNR'. " here you give ur table and field name

<fs_scr>-input = 0.

ENDIF.

ENDLOOP.

This will work

Regards

Nishant

Read only

Former Member
0 Likes
1,082

Hi Harsha,

U need to set the value of flag in PAI event upon enter. In the PBO module write code something like this :

PROCESS BEFORE OUTPUT.

MODULE rad.

MODULE rad OUTPUT.

CASE ok_code.

WHEN ' '.

LOOP AT SCREEN.

IF l_flag = 1.

IF screen-name = 'PROJ_DESC'

OR screen-name = 'PROJECT_TYPE'.

screen-input = 0.

ENDIF.

ENDIF.

ENDLOOP.

ENDCASE.

ENDMODULE.

Now my fields project type and project description gets grayed.

-SatyaPriya

Read only

0 Likes
1,082

Hi Satya,

This doesn't work for table controls.

harsha,

you can try the code I wrote and test it .

Regards

Nishant

Read only

0 Likes
1,082

Thanks you all for the express reply. Yes, Nishant

is right, it does not work. Will try your code and revert.

Thanks a ton.

warm regards,

Harsha

Read only

Former Member
0 Likes
1,082

Hi Harsha,

I generated a table control (ERP 6.2) and somewhere I found the coding like this (the name of the table control is TABLE_CONTROL):

*&spwizard: output module for tc 'TABLE_CONTROL'. do not change this lin

*&spwizard: get lines of tablecontrol

module TABLE_CONTROL_get_lines output.

g_TABLE_CONTROL_lines = sy-loopc.

If I do a loop at the screen at this place, I can control the individual input/output for the screen fields (the table fields). In my work area (WA_CONTROL) I can see the actual value of fields. Depending on this, I choose to enable/disable input via:

loop at screen.

if wa_control-material <> ' '.

screen-input = '0'.

modify screen.

endif.

endloop.

Read only

0 Likes
1,082

HI Stefan Bergmann ,

Thanks a ton . I am using 4.6c, will it work? Anyway let met ry this also.

Regards,

Harsha

Read only

0 Likes
1,082

Hi Harsha,

I guess this will also work in 4.6C.

Cheers,

Stefan.