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

Problem in table control wizard in module pool programming

Former Member
0 Likes
2,680

Hi all,

i am facing a problem in my table which i have created through Table Control wizard, the problem is that when user enter a value in a column and press ENTER button, it creates a a new row, but i don't need it.

Actually when he puts any values into table control wizard it remains as it is, and do not create any row for the previous row. And for the same thing i am not getting how to achieve it. Please tell me what could i do next to stop creating new row. My code is as shown below

MODULE ZLEGAL_MODIFY INPUT.
*****  MODIFY IT_ZLNAME
*****    FROM WA_ZLNAME
*****    INDEX ZLEGAL-CURRENT_LINE.
  APPEND WA_ZLNAME TO IT_ZLNAME.

ENDMODULE.

and the problem which i am facing is shown in below screenshot., while entering the value P and pressing ENTER i got a second row automatically and i want to restrict the automatic second row formation for ENTER , and this should be valid for all of my columns in my table control wizards.

1 ACCEPTED SOLUTION
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
2,382

Hello Srikant Jain.

MODULE ZLEGAL_MODIFY INPUT.


     MODIFY IT_ZLNAME FROM WA_ZLNAME INDEX ZLEGAL-CURRENT_LINE.

     if sy-subrc <> 0.

          APPEND WA_ZLNAME TO IT_ZLNAME.

     endif.


ENDMODULE.

Regards.

11 REPLIES 11
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
2,383

Hello Srikant Jain.

MODULE ZLEGAL_MODIFY INPUT.


     MODIFY IT_ZLNAME FROM WA_ZLNAME INDEX ZLEGAL-CURRENT_LINE.

     if sy-subrc <> 0.

          APPEND WA_ZLNAME TO IT_ZLNAME.

     endif.


ENDMODULE.

Regards.

Read only

0 Likes
2,382

Hi Arun,

thanks a lot for your suggestion , but i need something more here, now after the last column if user enters all the values and then presses ENTER , all the row below it get in grayed mode, if i have to make any entries then i have to click on new entries button.

But what actually i need is that when user enters in last column and presses ENTER then the Sno as shown in above screenshot should get increased by one and the rows below it should be in editable mode.

How could i achieve it, please tell me, many thanks for your help.

Read only

0 Likes
2,382

Srikant,

     Understand the concept that table control is nothing but reflection of internal table data.

     You have to handle your required business logic in PAI suitably.

Regards.

Read only

0 Likes
2,382

Hi Arun,

i am new to module pool hence not getting what are you saying, can you please elaborate how could i achieve this.

My requirement is that when user enters all the values in all column and press ENTER, then a new editable row should get created below the existing row with increased Sno.

What i have done is, I have written these code lines , but during debugging it is not getting at CASE..ENDCASE. Please tell me the required changes.

CASE SY-UCOMM.

    WHEN 'ENTER'.
   LOOP AT IT_ZLNAME INTO WA_ZLNAME.
     WA_ZLNAME-SNO = WA_ZLNAME-SNO + 1.
MODIFY IT_ZLNAME FROM WA_ZLNAME TRANSPORTING SNO.
ENDLOOP.
*   WHEN .
*   WHEN OTHERS.
  ENDCASE.

    MODIFY IT_ZLNAME
     FROM WA_ZLNAME
     INDEX ZLEGAL-CURRENT_LINE.
   if sy-subrc <> 0.
  APPEND WA_ZLNAME TO IT_ZLNAME.
  ENDIF.

Read only

0 Likes
2,382

Hi

you need to control the status of table control in pbo process in order to open/close a row if there'r a corrisponding row in internal table;


PROCESS PBO.

   MODLE INIT_VAR.

   LOOP....

     MODULE LOOP_SCREEN.


MODULE LOOP_SCREEN.


   READ TABLE IT_ZLNAME INTO WA_ZLNAME.INDEX <TABLE CONTROL>-CURRENT_LINE.

    IF SY-SUBRC = 0,

* The line exists so you can change the setting in order the line in not edidable

       LOOP AT SCREEN.

          SCREEN-INPUT = 0.

          MODIFY SCREEN.

       ENDLOOP.

    ELSE,

* The line doesn't exist, so you do nothinh except for the next line

       IF FIRST_EMPTY_LINE = SPACE.

            FIRST_EMPTY_LINE = 'X'.

       ELSE.

            LOOP AT SCREEN.

                 SCREEN-INPUT = 0.

                  MODIFY SCREEN.

             ENDLOOP.

         ENDIF,

      ENDIF.

ENDMODULE.

      


MODLE INIT_VAR.

    CLEAR FIRST_EMPTY_LINE.

ENDMODULE.

Anyway the real solution depends on how you manage the table control

Max

Read only

0 Likes
2,382

Srikant,

     For system to recognise ENTER, you need to set it in GUI status of the screen.

Read only

0 Likes
2,382

Hi Arun,

i have done this already, but i am not getting how could i increase Sno by one on ENTER.

Read only

0 Likes
2,382

Hi Srikant,

Add Condition to Check the Work area, if all data all filled in work area, then use  append Statement.

Regards,

Venkat.

   

Read only

0 Likes
2,382

Hi  http://scn.sap.com/people/karun.prabhu,

one more problem what i am getting, in my one program i am saving data and generating a unique number from it, now in my second program when i am entering that unique no it fetches all of my data in table which i have created through table control wizard.

Now the problem i am facing is that when i get my data in table control wizard, then user will edit those data, and i have to save those edited data in a custom table (from where it was fetched previously).

When i have created variables like p_variable then it is not fetching data in table control wizards, so i have created an internal table and then fetched all the values in table control wizard, now while editing and changing the changes are not get reflected, can you please tell me the process so that i can achieve what i wants.

Read only

0 Likes
2,382

Hi

one more problem what i am getting, in my one program i am saving data and generating a unique number from it, now in my second program when i am entering that unique no it fetches all of my data in table which i have created through table control wizard.

Now the problem i am facing is that when i get my data in table control wizard, then user will edit those data, and i have to save those edited data in a custom table (from where it was fetched previously).

When i have created variables like p_variable then it is not fetching data in table control wizards, so i have created an internal table and then fetched all the values in table control wizard, now while editing and changing the changes are not get reflected, can you please tell me the process so that i can achieve what i wants.

Read only

0 Likes
2,382

Hi

Where?

You can't see the changes in table control or in your custom table?

Max