Application Development 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: 

Need some information about module pool.

former_member196331
Active Contributor
0 Kudos
251

HI,

I need a small clarification about module pool.

IN Pbo i am using the below code.

DESCRIBE TABLE it_ekpo LINES podet-lines.

LOOP AT it_ekpo INTO wa_ekpo WITH CONTROL podet CURSOR

   podet-current_line.

     MODULE fetch_data1.

   ENDLOOP.


Which means how many lines are there in the it_ekpo table  that many times loop will be Rotate.

I am opening the form So PBO WILL BE fire. then the above code is executing.


here  it_ekpo  table is empty, but it is rotating 9 times. If i checked in debugging SY-LOOPC is 9  and podet-lines is 0 (TBC LINES)

so, that many times it is rotating.


May i know why it is rotating 9 times, i hope i was written loop at it_ekpo, how many rows are there in the internal table

that many times it has to rotate.


Can any body clarify my question.


My main aim is , initial Table control should have only 1 rows.





1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
198

You must initialize PODET-LINES = 1 in the PBO to have only one row.

Note: your question is not about "module pool" but about "table control", because dynpros can be also used by executable programs (reports) and function groups.

ADDENDUM: If you have 0 lines in the internal table, and want 0 line to be displayed, then you must use PODET-INVISIBLE = 'X'. PODET-LINES = 0 will display the maximum number of lines (it has always been working like that).

17 REPLIES 17

Juwin
Active Contributor
0 Kudos
198

My understanding is that it rotates based on the number of the table control rows shown on the screen and not based on the entries in the internal table.

Thanks,

Juwin

0 Kudos
198

Your correct, No doubt based on SY-LOOPC eq 9 it is rotating. but based on it_table it has to rotate.

I Tried this one also .

LOOP WITH  CONTROL podet.

     MODULE fetch_data1.

   ENDLOOP.


But still 9 times rotating.


Juwin
Active Contributor
0 Kudos
198

As I said, it is rotating 9 times because there are 9 rows on the screen.

Thanks,

Juwin

0 Kudos
198

I am comparing my code with Some body written the code. Unfortunately nobody are here for asking.

this code is already existing one , working fine, its functionality is .Once pbo will trigger,

SY-LOOPC eq o, with int he loop SY-LOOPC eq 6 (once loop starts)  then  by using  they are making lines eq 1 , the loop is rotating only 1 time.

But what i has written the code rotating 9 times. This is my problem. hope you understood.



MODULE SET OUTPUT.

   DESCRIBE TABLE IT_ZMRETURN LINES V_LINES.

   TABC-LINES = V_LINES + 1.

ENDMODULE.                 " SET  OUTPUT



LOOP AT IT_ZMRETURN INTO WA_ZMRETURN WITH CONTROL TABC

                     CURSOR TABC-CURRENT_LINE.

     MODULE SET.

   ENDLOOP.

   MODULE MODE_CAPTURE.

Sandra_Rossi
Active Contributor
0 Kudos
199

You must initialize PODET-LINES = 1 in the PBO to have only one row.

Note: your question is not about "module pool" but about "table control", because dynpros can be also used by executable programs (reports) and function groups.

ADDENDUM: If you have 0 lines in the internal table, and want 0 line to be displayed, then you must use PODET-INVISIBLE = 'X'. PODET-LINES = 0 will display the maximum number of lines (it has always been working like that).

0 Kudos
198

Yes your correct , I Tried like below but still not working.

PROCESS BEFORE OUTPUT.

  MODULE status_5050.

  LOOP WITH  CONTROL podet.

    MODULE fetch_data1.

  ENDLOOP.

MODULE status_5050 OUTPUT.

  SET PF-STATUS 'FETCHDATA'.

  SET TITLEBAR 'FETCHDATA'.

  BREAK-POINT.

  DESCRIBE TABLE it_ekpo LINES podet-lines.

  podet-lines = podet-lines + 1.

ENDMODULE.  

0 Kudos
198

But i am making   podet-lines eq 1.

but still showing 9 rows.

0 Kudos
198

You changed your initial code. You were using LOOP AT it_ekpo WITH CONTROL podet, and now you're using LOOP WITH CONTROL podet only.

But anyway, I don't understand what you're asking. If you want one line (your "aim"), then you must have one line in your internal table, no?

0 Kudos
198

Just i am saying i was tried Other Way too.

But here imagine this is my code.

it_ekpo is empty. but looping 9 times why.  Loop at It_ekpo. This is my question.

LOOP AT it_ekpo INTO wa_ekpo WITH CONTROL podet CURSOR

   podet-current_line.

     MODULE fetch_data1.

   ENDLOOP.

0 Kudos
198

Hi the loop will iterate as much as the no of records in the internal table which you are looping at with control.


Here gv_lines is the no of records in my table.

IN PBO.

LOOP AT gt_ex_transaction INTO gs_transaction WITH CONTROL gv_transtabc.

     MODULE load_transactions_0200.

ENDLOOP.

IN PAI.


MODULE load_transactions_0200 OUTPUT.

   IF sy-stepl = 1.

     gv_transtabc-lines gv_lines + 1.

   ENDIF.

   IF sy-stepl <= gv_lines.

     READ TABLE gt_ex_transaction INTO gs_transaction INDEX sy-stepl.

   ENDIF.

ENDMODULE.



In this case it ll show No of records in internal table+1 active  lines in my table control output.


Hope this helps.


Regards,

Junas Pious.

0 Kudos
198

Hi, Thanks for your reply.

Hi the loop will iterate as much as the no of records in the internal table which you are looping at with control.


But There is No records in the Table it_table is empty. But why 9 times looping.Any guess.


0 Kudos
198

Hi, I can't see the reason why the loop is running 9 times. It's supposed to run as per no. of records of that internal table and I have checked in the above case I mentioned it's running only as many times as internal table size.


Regards,

Junas Pious.

0 Kudos
198

Thanks for your reply.Why it's running i did not understood.

I have one more module it is also looping only one time.

but new one is looping 9 times.Do you remember  Any settings in Screen painter.

0 Kudos
198

Hi , I still couldn't figure out this behavior and I don't recall any settings in the screen painter related to the No of iterations before showing the  table control for PBO ... Please do notify me if you get any answers.

Regards,

Junas Pious.

0 Kudos
198

Ok.

Sandra_Rossi
Active Contributor
0 Kudos
198

As I said, if you have 0 lines in the internal table, and want 0 line to be displayed, then you must use PODET-INVISIBLE = 'X'. PODET-LINES = 0 will display the maximum number of lines (it has always been working like that). I wanted to provide a reference to the documentation but it's fun that it's mentioned nowhere.

0 Kudos
198

Yes, Your correct it will be work, I am checking, Yesterday i did some changes, But display is 9 rows . But Today i open the same source code, Changes are applicable.Even 1 line of code i had not add.But working  Thanks for your reply.

I will check it and close the post.

Hope you Junas Pious  are hearing

Thank you.