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: 

Two table controls in single screen

Former Member
0 Kudos

Hi all,

I have a requirement of creating two table controls in single screen.I have created two table controls and looped on both the table controls in flow logic.But it is giving me following error.

-"The first field (key word )in loop must have field name: a loop...endloop. may be missing in PBO or PAI."

I will be thankful if somebody can resove the issue otherwise provide me a sample code for the similar requirement.

Thanks.

3 REPLIES 3

Former Member
0 Kudos

did u you wizard to create table controls? If you do, it will automatically insert appropriate screen logic for both of them.

n e ways, put your screen flow logic, and modules if any, here to help you better.

Former Member
0 Kudos

Here is an example of screen flow. I_VBAP is the internal table. T_VBAP is work area for it. TC_VBAP is the table control. Just below it is the code for modules.

Note that I am using table control for display only so am not doing anything in PAI. however, loop statement must be there in PAI too even if u r not doing anything to it.

PBO

**********************************

MODULE Init_VBAP_Table.

loop at I_VBAP

into T_VBAP

WITH CONTROL tc_vbap.

MODULE Transfer_VBAP_TO_TablControl.

ENDLOOP.

**********************************

PROCESS AFTER INPUT.

  • PAI loop for Table control.

  • Nothing needs to be done so it is empty.

  • It has to be mentioned in PAI that is why it is here.

loop at I_VBAP.

ENDLOOP.

**********************************

**********************************

MODULE Init_VBAP_Table OUTPUT.

CLEAR I_VBAP.

select VBELN POSNR INTO TABLE I_VBAP

from VBAP

WHERE PS_PSP_PNR = PRPS-pspnr.

  • Tell Table Controls TC_VBAP how many lines it will have to display.

describe table I_VBAP lines TC_VBAP-lines.

ENDMODULE.

**********************************

**********************************

MODULE Transfer_VBAP_TO_TablControl OUTPUT.

MOVE-CORRESPONDING T_VBAP to TC_VBAP.

ENDMODULE.

Former Member
0 Kudos

Hi,

Here, LOOP AT ITAB-ENDLOOP statement in PBO event is used to fetch the records and insert into table control component. CURSOR statement is used to make use of the cursor in table control component whenever we try to select a particular field and modify it.

LOOP AT ITAB-ENDLOOP statement in PAI event is used to make necessary modifications to the database table from table control component.

ex:

In Flow Logic editor, write following code:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0123.

LOOP AT ITAB CURSOR CUR WITH CONTROL TABCTRL.

ENDLOOP.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0123.

LOOP AT ITAB.

ENDLOOP.

Regards,

Priya.