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

pbechani
Participant
0 Likes
691

I am creating a customised screen in SAP using a table control. On pressing ENTER key, the data entered in the table control is deleted.

How can I solve this issue and to default data into other columns when certain information is entered.

How is this data copied to code.

Thank you in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
613

Hi,

Create a module UPDATE_DATA and use to update the internal table for the table control..

Ex.,

  • Process the table control

LOOP AT ITAB.

  • Module to update data.

MODULE update_data.

ENDLOOP.

MODULE UPDATE_DATA.

  • Check the table.

MODIFY ITAB FROM SCREEN_STRUCTURE

INDEX tc-current_line.

  • TC WILL BE YOUR TABLE CONTROL NAME.

  • If the return is not sucessful..Append a record.

IF sy-subrc <> 0.

APPEND SCREEN_STRUCTURE TO ITAB.

ENDIF.

ENDMODULE..

Thanks,

Naren

5 REPLIES 5
Read only

Former Member
0 Likes
614

Hi,

Create a module UPDATE_DATA and use to update the internal table for the table control..

Ex.,

  • Process the table control

LOOP AT ITAB.

  • Module to update data.

MODULE update_data.

ENDLOOP.

MODULE UPDATE_DATA.

  • Check the table.

MODIFY ITAB FROM SCREEN_STRUCTURE

INDEX tc-current_line.

  • TC WILL BE YOUR TABLE CONTROL NAME.

  • If the return is not sucessful..Append a record.

IF sy-subrc <> 0.

APPEND SCREEN_STRUCTURE TO ITAB.

ENDIF.

ENDMODULE..

Thanks,

Naren

Read only

Former Member
0 Likes
613

check transaction BIBS

Read only

pbechani
Participant
0 Likes
613

Thankyou for the valuable information guys. But I still have a problem. I am trying to create a sales order screen from BAPI - BAPI_SALESORDER_CREATEFROMDAT2.

I want to provide a table control to capture the order item. There is a structure called - bapisditm. This is what I am binding to the Table Control. I have declared an internal table in my code called order_items_in which references this structure.

in the modify module I have the foolowing code

modify order_items_in from bapisditm index itemdata-current_line.

The table Control is called itemdata.

Still after entering data, on pressing enter the data is wiped out. No data on description column is defaulted after selecting material.

How can this be achieved.

Points willbe reward. Pliz help. Its a bit urgent

Read only

Former Member
0 Likes
613

Prince,

You have a PBO and PAI ok. When you enter data into the Table control make sure you are updating/passing the data to internal table of Table Control. Do this in PAI. Also remember when u enter data and validate PBO fires again. So if u dont update the internal table in PAI, it wont be reflected in PBO.

Hope this helps you..

Regards,

Sujin

Read only

pbechani
Participant
0 Likes
613

Thank you everyone.The table now works. points awarded