Skip to Content
author's profile photo Former Member
Former Member

How to Maintain Values in the Table control?

Hi,

I'm Saikumar.

I've done a table control program.

When I click SAVE or ENTER Button, the values are getting saved into the database(This is working alright)......but when I click those buttons, The values entered in the table control are getting cleared.

What should I do in order to have those values in the table control itself when I click SAVE/ENTER? (I need to create multiple records at a time)

What I've done is:

IF sy-ucomm = 'SAVE' OR sy-ucomm = 'ENTR'.

INSERT into <database table> values wa_matgl.

MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.

Refresh it_matgl.

endif.

I tried many ways but the vales are getting cleared in the table control? (I need to create multiple records at a time).

Please suggest a way to overcome it.

Thanks in advance,

saikumar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 01:03 PM

    Hi saikumar,

    We need to pass the values in the PAI to the PBO if we intend to retain the data on the screen itself....

    the "Refresh it_matgl" command wipes off the entire data in the table..in the PAI itself..in short we have no data transfer from PAI to PBO and hence the blank screen

    <b>Best option is to comment the Refresh it_matgl.

    and replace it with Clear it_matgl.

    if the idea was to clear the header line..</b>

    Refresh ==> wipes the entire data off the internal table

    Clear ==> clears data on the work area/header line

    pls check and revert

    Regards

    Byju

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi ...

      Just to add...

      were there any values in the internal table it_matgl initially in the PBO screen to be shown to the users ?

      <u>if the answer is no...then......</u>

      i came across the same coding in DEMO_DYNPRO_TABCONT_LOOP_AT.....

      here also in PAI..when we press enter..the values are not retained...

      MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.

      <b>because i believe the modify statement is not working.coz the it_matgl is empty..pls check if sy-subrc = 0....after the modify statement....if it is not...then we need to insert the data into the it_matgl using an append statement</b>

      for this it_matgl needs to be with header line...

      Pls explore the following....

      data : it_matgl type table of XXXX with header line.

      in the section

      IF sy-ucomm = 'SAVE' OR sy-ucomm = 'ENTR'.

      INSERT into <database table> values wa_matgl.

      MODIFY it_matgl from wa_matgl INDEX tc1-current_line. "tc1 is the table control name.

      <i>if sy-subrc <> 0.

      move corresponding wa_matgl to it_matgl.

      append it_matgl.

      clear it_matgl.

      endif.

      endif.</i>

      Pls check and revert

      Regards

      Byju

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:33 PM

    Hi,

    are you inserting records in your table control and then, you save those records into the database table ?? if this is true, probably you´re forgetting to save the records in your internal table, which in time passes the information to the control in the PBO module

    PROCESS AFTER INPUT.

    IF sy-ucomm = 'SAVE' OR sy-ucomm = 'ENTR'.

    INSERT into

    endif.

    QUESTION: why do you insert a record into your internal table and then you erase this table (Refresh it_matgl.) ???

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.