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

Deleting the values from table control

Former Member
0 Likes
1,413

HI,

I need to remove the selected line from the Table control on my screen.

The point is that the Internal table does not have any records,.

for example in the Customer Create screen,

while entering the bank details we will enter it in a tbale contraol.

but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.

please guide me.

please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..

regards

hi,

check this program which will suite your requirement..

DEMO_DYNPRO_TABCONT_LOOP_AT

11 REPLIES 11
Read only

Former Member
0 Likes
1,329

Hi,

Whenever you are entering the details in the table control that details will be present in the internal table of that table control. write a code in the PAI based on the index to delete the record which you are selected by pressing the delete button.

Read only

GauthamV
Active Contributor
0 Likes
1,329

hi,

check this program which will suite your requirement..

DEMO_DYNPRO_TABCONT_LOOP_AT

Read only

Former Member
0 Likes
1,329

HI Gautham,

The scenario is that,

I will be entering the cvalues on the Table Control and then must save to the database.

in that scenario after entering the values I user press delete after placing the cursor in a line the line must get deleted from screen

I will not be having the display of values befor hand.

Hope you got it.

Read only

Former Member
0 Likes
1,329

HI Gautham,

The scenario is that,

I will be entering the cvalues on the Table Control and then must save to the database.

in that scenario after entering the values I user press delete after placing the cursor in a line the line must get deleted from screen

I will not be having the display of values befor the .

Hope you got it.

Read only

Former Member
0 Likes
1,329

hi

jus have a look at sample program RSDEMO_TABLE_CONTROL

this would definitely help you out

regards

Aakash Banga

Read only

Former Member
0 Likes
1,329

Hi..

The solution to your problem - deleting values from table control.

Here: it_wizard is the internal table which is holding the value of table control.

wa_wizard is the work are of the internal table it_wizard.

it_delete is the internal table which holds the deleted record of table control.

wa_delete is the work area of the internal table it_delete

Also here the field ZSEL is the character field which is used to select the entire record in the table control.

LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
       MOVE-CORRESPONDING wa_wizard TO wa_delete.
       APPEND wa_delete TO it_delete.
       delete table it_wizard from wa_wizard.
 DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
ENDLOOP
 if sy-subrc eq 0.
Message 'Delete Successful' type 'S'.
endif.

The above code will delete the record from both the table control.internal table and the database table.

I think this will help you to great extent.

Ward regards,

Bhuvaneswari

Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

Read only

Former Member
0 Likes
1,329

HI Gautham,

The scenario is that,

I will be entering the cvalues on the Table Control and then must save to the database.

in that scenario after entering the values I user press delete after placing the cursor in a line the line must get deleted from screen

I will not be having the display of values befor hand.

Hope you got it.

Read only

0 Likes
1,329

Hi SAPLEARNER,

The above which I have given will solve this problem.

Even before saving the record you can delete them using that code.

In such cases use proper flags to give the appropriate message after deleting for user convenience.

Thanks,

Bhuvaneswari

Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:52 AM

Read only

0 Likes
1,329

Hi,

I did as u said

i couls delete the record

and the records are in i_details

But how to display in PBO

flow logic is as follows:

where bank_table is my table control



PROCESS BEFORE OUTPUT.

  LOOP WITH CONTROL bank_table .
    MODULE status_9005.

  ENDLOOP.
  
PROCESS AFTER INPUT.

  LOOP WITH CONTROL bank_table .
    CHAIN.

      FIELD:  /miga/org_bankdl-banks ,
              /miga/org_bankdl-bankl,
              /miga/org_bankdl-bankn,
              /miga/org_bankdl-bkont,
              /miga/org_bankdl-xezer,
              /miga/org_bankdl-bkref,
              /miga/org_bankdl-koinh.

      MODULE delete_row.

    ENDCHAIN.
  ENDLOOP.

  MODULE user_command_9005.

Read only

0 Likes
1,329

Hi,

I need to know whether you have created the table control with wizard or not?

Read only

0 Likes
1,329

Hi,

No I created without wizard.

Whats the point in creating?

it will be the same right in any method !!!!

regards