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

Former Member
0 Likes
1,103

Hi,

I have a table control in a screen with three input enable fields. And also a button "Post". I want, if user press the button without entering any record in table control, then there will be a error message.I am able to display the error message but the table control is becoming disable. I want after pressing enter again table control will be again input enable.

How could I solve this.

Regards,

Saroj.

13 REPLIES 13
Read only

Former Member
0 Likes
1,081

Clear the variable holding the OK Code of the clicked button before showing the error message.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

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

Hi,

Make sure you are rasing the error message from a PAI module which is executed on these three fields like this.

in the flowlogic

LOOP AT itab.

CHAIN.

FILED1.

FIELD2.

FIELD3.

MODULE check_input ON CHAIN-INPUT.

ENDCHAIN.

ENDLOOP.

Raise your error messagr from the PAI module check_input.

Regards,

Sesh

Read only

0 Likes
1,081

Hi,

If user does not enter any record in table control, then itab will be blank and then control never goes to the line module check_input.

please reply.

Thanks,

saroj

Read only

0 Likes
1,081

Clear the variable holding the OK Code of the clicked button before showing the error message.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

former_member196299
Active Contributor
0 Likes
1,081

hi ,

Have you looped at the table control global internal table in the PBO of the screen flow logic ? Please check there . I think that is the area where the bug lies .

Regards,

Ranjita

Read only

0 Likes
1,081

Hi,

I have looped at at the table control global internal table but If user does not enter any record in table control, then internal table will be blank and control will jump to the endloop statement.

please reply.

Thanks,

saroj

Read only

0 Likes
1,081

I am not sure where you are facing problem ..

May be here you can refer to these 2 sample programs and get some idea from there about programming using table control .

To get an overview about table control check these programs in SE38

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

Even in Txn SAPDOCU you can get few more programs for table controls .

Else post your code here so that we can help you out .

Regards,

Ranjita

Read only

0 Likes
1,081

Hi,

PROCESS BEFORE OUTPUT.

MODULE status_0100.

LOOP AT t_itab2 WITH CONTROL tbc1 CURSOR tbc1-current_line..

MODULE fill_table_control.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT t_itab2.

CHAIN.

FIELD eban-matnr.

MODULE check_data4 ON chain-request.

ENDCHAIN.

ENDLOOP.

MODULE user_command_0100.

MODULE back_0100 AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD t_itab1-battery MODULE f4_battery.

This is my code. My table control fields are input enable.If user does not enter any value in table control then it should give an error message. But the problem is control is entering into the loop because t_itab2 is blank.And it also not executing the MODULE check_data4 ON chain-request.

Thanks,

Saroj.

Read only

0 Likes
1,081

if u want to check when No values are there...then u should not give inside the loop.

PAI...

Chain.

field l_field1.

Module validate_fields.

endchain.

In this module check

if values are not there ie initial....then give error message.

Then have ur rest of the codes..

LOOP AT t_itab2.

CHAIN.

FIELD eban-matnr.

MODULE check_data4 ON chain-request.

ENDCHAIN.

ENDLOOP.

MODULE user_command_0100.

MODULE back_0100 AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD t_itab1-battery MODULE f4_battery.

Read only

0 Likes
1,081

In PAI,

Check whether the t_itab2 is initial i.e. the global table is initial or not , if it is not initial then loop it and write the rest of the logic and if it is initial then give the error message .

Revert if further assistance needed .

Regards,

Ranjita

Read only

0 Likes
1,081

If I will give the error at checking the internal table then all the input enable fields will be disable. Then user can not do anything.

Saroj.

Read only

0 Likes
1,081

you can not use field statement outside the loop incase of table control.

Saroj.

Read only

marcelo_ramos1
SAP Mentor
SAP Mentor
0 Likes
1,081

Hi,

Try this way,

In <b>MODULE user_command_0100.</b> or

<b>MODULE back_0100 AT EXIT-COMMAND.</b>

IF "POST" was pressed...


IF <table name[]> IS INITIAL.
  MESSAGE ID id TYPE mtype NUMBER n.
*  EXIT. If necessary
ENDIF.

Regards.

Marcelo Ramos