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

Step Loops

Former Member
0 Likes
817

Hi,

In my program, I have an internal table, the number of records in internal table vary depending on a condition, here I mean the number of records in internal table is not fixed. I have to display each records in an I/O field in the screen.

Now I need a step loop to be defined , which displays all the records from internal table.

So I cant define a step loop as fixed.

But if I define it as Variable, for example if my internal table has only 10 records, there are 40 I/O fields displayed in the screen in which 10 I/O fields are filled with the data from internal table, is there any way to avoid the blank I/O fields.

i.e. if my internal table has 20 records only 20 I/O fields with data should be displayed, if it has 30 then 30 I/O fields should be displayed.

Please provide me a solution.

Thanks,

Sridhar

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
782

Hi,

You can try in PBO if the field has no value, then use screen-active =1 inside loop at screen.If more fields are required,use some buttons to make the field as visisble in PAI.That if the button is clicked,

loop at screen.

if screen-name eq 'XYZ'.

screen-active = 0.

modify screen.

endif.

endloop.

6 REPLIES 6
Read only

Former Member
0 Likes
782

Hi Sridhar,

Use <b>Table control</b>.

<a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm">Table control</a>

Rgds,

Jothi.P

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
783

Hi,

You can try in PBO if the field has no value, then use screen-active =1 inside loop at screen.If more fields are required,use some buttons to make the field as visisble in PAI.That if the button is clicked,

loop at screen.

if screen-name eq 'XYZ'.

screen-active = 0.

modify screen.

endif.

endloop.

Read only

Former Member
0 Likes
782

Hi Sridhar,

I have done same kind of requirement ,You can write the code in PBO.

use describe command to get number lines in internal table,now use that value in PBO -> this should pass to Step Loop ,Right now i am not system,I will send you the exact logic what i written.

Thanks

Seshu

Read only

Former Member
0 Likes
782

Hi Sreedhar,

User describe command to increase the lines of step loops.

DESCRIBE TABLE lt_invmov LINES fill.

tabctrl2-lines = fill.

Regards,

Line

Read only

Former Member
0 Likes
782

Hi All,

Thanks for your inputs, please provide me an example program, either paste the code or mail the code to write2sridhar@gmail.com.

Thanks,

Sridhar

Read only

Former Member
0 Likes
782

Hi All,

Thanks for your inputs, the issue is solved.

Thanks,

Sridhar