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

Table control + mandatory fields

Former Member
0 Likes
2,121

Hello Friends,

is it possible to make some of the table control fields as mandatory ?

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,606

hi SHAh

<b>u can define the error message in the PAI of the screen

case sy-ucomm.

when 'CLICK' ***** function code of button

move field to <variable of type field>

if sy-subrc ne 0.

message eoo1(<message class>)***** define message class in se91

endif.

end case.</b>

plz close the thread if u have got the sol and award points accordingly.

regards

ravish

<i><b>plz dont forget to reward points if helpful</b></i>

9 REPLIES 9
Read only

Former Member
0 Likes
1,606

Hi,

I don't know if it is possible for table control, but it is possible in alvs.

1) Create a dynamic internal table.

2) Create the field catalog for the internal table.

3) Call the alv display function.

4) make the grid editable to simulate a table control.

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,606

Hi ,

Yes,

when creating Table control in screen painter u can assign mandatory field in properies.

Rewards points if helpfull

Regards

Suresh.d

Read only

0 Likes
1,606

Hi suresh,

Whih property it is ?

I have seen did not find out...

Regards,

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,606

Hi,

You can do that in the PBO's LOOP AT ENDLOOP over the table control by executing a module and inside the module you can use LOOP AT SCREEN.

ENDLOOP and then use the code as follows.

LOOP AT table control.

MODULE init_tab.

ENDLOOP.

MODULE init_tab OUTPUT.

LOOP AT SCREEN.

CHECK SCREEN-NAME = 'TABLE-FILED2' OR ....

SCREEN-REQUIRED = 1.

MODIFY SCREEN.

ENDLOOP.

ENDMODULE.

You can as well make the field mandatory when you create the table control in the Screen painter.

<b>Double click on the field you want to make mandatory to open the attributes screen there in the attributes section under tab Program, for the dropdown Input select Required</b>.

Regards,

Sesh

.

Read only

Former Member
0 Likes
1,606

hi,

it will be possible go to element list -> special attributes -> tick on req field

Read only

Former Member
0 Likes
1,606

HI

yes it is very much possible. u can mark the fields as mandatory there is an option when u define the fields of the table control

regards

ravish

<b>reward if useful</b>

Read only

0 Likes
1,606

hi Sesh,

Thanks for your reply, it works,

One question: where I can define the error msgs, if the field is not filled ?

Regards,

Message was edited by:

Shah H

Read only

0 Likes
1,606

hi,

when you have created your table control, all its fields will be include in the element list

Read only

Former Member
0 Likes
1,607

hi SHAh

<b>u can define the error message in the PAI of the screen

case sy-ucomm.

when 'CLICK' ***** function code of button

move field to <variable of type field>

if sy-subrc ne 0.

message eoo1(<message class>)***** define message class in se91

endif.

end case.</b>

plz close the thread if u have got the sol and award points accordingly.

regards

ravish

<i><b>plz dont forget to reward points if helpful</b></i>