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

Module pool table control problem

Former Member
0 Likes
481

HI friends

I have to clear the table control concept with one object.

I will explain you all the object and the coding what i m using .

i have one ztable zdummydelivery and had made fields inside it and out of them i m using four fields ie ebelp,txz01,menge and meins in my table control.

on my layout editor i have created one tablecontrol through tablecontrol wizard and in that i have used this ztable for input with the above fields and table control is created and automatically coding has come in the program.

Now there is a listbox field on the screen that is purchase order no.

So the task is that when i select any purchase order no from the listbox then corressponding to that no it shows item details in the table control.

So for this i have given one function code to field purchase order no and in pai module i put the following code to reterive the data for the following po number.

WHEN 'PO'.

IF NOT it_EKPO-EBELN IS INITIAL .

SELECT ebelp

txz01

menge

meins

FROM ekpo INTO (IT_MATR-EBELP,IT_MATR-TXZ01,IT_MATR-menge,IT_MATR-meins) WHERE ebeln = it_ekpo-ebeln.

append it_matr.

ENDSELECT.

In this it_matr is my internal table to store the data and data is coming properly in the internal table.

But the problem comes now that its not displaying the cotents properly in the table control .

I m not getting the logic where to write the code in the standard coding of table wizard to display the contents properly.

Its only displaying the last record if i put the following code in the module that is present in the PBO event ie MODULE TC_DUMMY1_MOVE.

Code is

MOVE IT_MATR-EBELP TO G_TC_DUMMY1_WA-EBELP.

MOVE IT_MATR-TXZ01 TO G_TC_DUMMY1_WA-TXZ01.

MOVE IT_MATR-MENGE TO G_TC_DUMMY1_WA-MENGE.

MOVE IT_MATR-MEINS TO G_TC_DUMMY1_WA-MEINS.

and the

default code that is given in this module is

MOVE-CORRESPONDING G_TC_DUMMY1_WA TO ZDUMMYDELIVERY.

So please help me to clear the concept of the table control according to my object.

I understand that my data that is moving to zdummydelivery is not getting appending that is it is overwriting ,so at the last ,last record is repeatedly displayed in output.

Explain me the flow how it will goes after selecting the PO number.

It will first move to PAI and then to PBO to display the tablecontrol or tablecontrol loop in pbo will be executed first.

Please answer as soon as possible.

3 REPLIES 3
Read only

Former Member
0 Likes
457

hi,

use this after move-corresponding use append also.

append G_TC_DUMMY1_WA to ZDUMMYDELIVERY .

Read only

former_member186741
Active Contributor
0 Likes
457

i BELIEVE this is happening because you are not reading the appropraite table entry in your module. The 'MOVE IT_MATR-EBELP ' etc statements operate on the current contents of the table header which is the last record read in. Your code is in a loop but you need to read table it_MATR each time to position on the correwct entry in it.

Try 'read table it_matr index sy-loopc.' before you do your moves.

Read only

0 Likes
457

ONE STRANGE DOUBT.

PLEASE TELL ME THE SOLUTION.

I HAVE CREATED LIFNR ONE FIELD AS A LIST BOX IN MODULE POOL AND UNDER FLOW LOGIC I HAVE CALL

THE POV EVENT AND UNDER THAT FIELD STATEMENT WITH ONE MODULE AND IN THIS MODULE

CALL THE FUNCTION F4IF_INT_TAB_VALUE_REQUEST.

AND PASS THE RESPECTIVE ATTRIBUTES OF THE FUNCTION MODULE.

BUT AFTER THIS I MADE ANOTHER FIELD EBELN IN THE MODULE POOL AND LAYOUT EDITOR JUST DONE THE FIELD PARAMETER AS LISTBOX.

AND NO CODING HAS DONE FOR IT ,THEN ALSO ITS GETTING RIGHT VALUES DURING OUTPUT.

why is it so,please tell me the answer.