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: 

bdc_tablecontrol_line items

Former Member
0 Kudos

HiAll,

I would be a great help in solving the below problem.

I am facing a problem in writing BDC program ( Tcode MR21), where i have to enter line items in table control. How to decide how many lines are visible on the screen. As the no of visible lines differ based on the size of the window. How to dynamically find out this.

Thank you all in advance.

Regards

sree

9 REPLIES 9

Former Member
0 Kudos

Hi Sree,

Go to SHDB and do a recording for MR21 when you create a new recording select the 'Default Size' option and it will work fine in any screen resolution. This will do a recording of the no of line items in the table control during the default size and it will work fine.

Cheers

JK

PS: Award points if this helps you

0 Kudos

Hi jay,

Thanks for your response, It is still not clear to me.

What i understood is, should i take the number of lines visible as constant and then develop my logic. BY the way I am using session method. and i will run the program in back ground.

Can you please be more elaborate.

Thanks & Regards

Sree

0 Kudos

Hi Sree,

What you have understood is correct.

Whatever number of lines you see in the recording is the number of lines that are visible.

It doesn't matter if you are using call transaction /Session method.

0 Kudos

Hi Sree,

I think when you go for session method there will not be problem with window size.

Recently I too got this doubt and i checked with changing the window size.

Ya but consider what our friends are saying.

You are asking that how to find out how many visible lines are there to fill further line items.

If you have any 'sequence no' or 'doc number' starting from 1,2,3 and so on.

then your problem is solved i think.

find out that how many total lines will come in SM35.

catch that line item which you need to sort in descending order, so you will get some 5 or 6 like that.

If you have total lines in T-control suppose 12.

lno = sequence number + 1." here you will get to what line no your data has to fill.

lno = lno mod 12.

use this lno to fill the data.

In the same way u need to calculate the PAGE NO also.

Based on the lino you have you need to calculate PAGE no.

lino = sequence no.

pageno = lino DIV 12.

if lino < 12.

pageno = 0.

do pageno times.

BDC for page down(OK_CODE).

enddo.

For incrimenting you need to do some tricky logic.

The above is example how you need to calculate the no for PAGE down.

******

Check that how your new lines are generating every time. like giving ENTER....

So for every line item take 1 ENTER inorder to generate new lines in T-control.

******

Thanks.

If this helps you reward with points.

Message was edited by: KDeepak

Message was edited by: KDeepak

Former Member
0 Kudos

Hi Sree,

Just check this way.

After you enter the first line in the table control,you press the "Page Down" button so that every time you need to enter the first line until all the records are done.

Message was edited by: Phani Kiran Nudurupati

Former Member
0 Kudos

Hi Sree,

As Jay mentioned corectly. Please record your SHDB recording with default size. No. of lines visable in the default screen are the no of lines .

Then if you have ADD button use that to insert new lines if not then you have to include a logic for scroll bar forward Traversing.

Please note that when you are using BDC Call transaction it will use default settings.

Lanka

former_member188685
Active Contributor
0 Kudos

Hi Sree,

you can check the sample program in the link..

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

regards

vijay

0 Kudos

Hi Vijay,

Please don't recommend this program. I dont think you have understood my probelm correctly. The program is useful for those who are new to BDC programs. The program does not use the page down functinality.

Hi Ravi and Ajay

Thank you very much for the Suggestions, I will work accordingly and come back to you.

Thanks & Regards

Sree

0 Kudos

Hi Sree,

For doing page down and page up it will be better if you use the FM SCROLLING_IN_TABLE. This will help you in achieving the same.

Cheers

JK