cancel
Showing results for 
Search instead for 
Did you mean: 

BDC Table control Page-down.......................

Former Member
0 Kudos

Hi,

I am working on BDC Table Control through Call Transaction.

Here I have 15 lines in my T-control. I am able to catch the line no and to what line the data must append.

But after completion of 15 lines I am unable to do PAGE-DOWN.

********

Here what I found is after PAGE-DOWN the line no's are again coming to 1,2,3,...... not 16,17,18...etc as I have 15 lines in 1st page.

This I found through SHDB recording.

I know this is quite critical, I am unable to come out of this.

********

If any body faced the similar issue please suggest me some thing.

If you have sample code also please post here.

Thanking you,

Deepak.

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

My problem didnot solved.....Urgent.

If ant body have sample plzzzz provide.

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

Message was edited by: KDeepak

Message was edited by: KDeepak

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Thanks every body for your valuable reply's..........

*******

Let me explain my senarion 1st.

My Transaction is Z*.

In that I have T-Control which is having 15 lines.

When ever page gets down the line no's are changing to 1,2,3,....... not 15,16,17.....

Here my scenarion is for single record I am going for Fields modification and record (delete or re-consider) in single loop.

For this I applied simple logic to catch page no and line no.

I have a filed SEQNR which will give me the line no say(15 or 19 or 22 or....).

Based on this (SEQNR)I am claculating the page no and line no.

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

loop at itab.

lno = ITAB-SEQNR.

lno = lno mod 15.

Here i will get LINE NO.

But when it come to PAGE NO ...

pgd = lno div 15.******

abc = pgd.

if abc ne xyz.

pgd = pgd - xyz.

do pgd time.

BDC for PAGE DOWN.

ENDDO.

.......

.......

.......

xyz = abc.

endloop.

Here every thing is getting perfectly.

But for PAGE NO calculation if LNO = 15.

then my pgd = lno div 15.

then it is throughing 1, but it must be 0 as my line no=15 will be in base page i.e., 0.

like this particular scenarion my code is failed.

So any body have piece of code/Idea any thing plzzz reply me as soon as possible coz I need to fix it by the end of the day.

Thanx.

****Any body have some example............

Message was edited by: KDeepak

Message was edited by: KDeepak

Former Member
0 Kudos

Hi

You can only have whole page/s, so you can have 1 or 2 or 3 pages, not 1,52 pages, can't you?

So if you have N-hit and your page can have 15 hit:

DATA: PAGES TYPE I,

REST TYPE I.

PAGES = N DIV 15.

REST = N MOD 15.

IF REST > 0. PAGE = PAGE + 1. ENDIF.

Max

abdul_hakim
Active Contributor
0 Kudos

Hi

Please record the table control page down scroll icon.

Pass this to BDC_OKCODE field..

Abdul

Former Member
0 Kudos

Please find below the sample code which explains how you should change your code. Reward points if it helps.

Regards,

Ankur Bhandari

_________________________________________________________

LOOP AT gi_itab.

PERFORM bdc_dynpro USING 'SAPLALDB' '3000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'LINS'.

PERFORM bdc_field USING 'BDC_CURSOR' 'RSCSEL-SLOW_I(01)'.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(01)'

gi_itab-runid.

ENDLOOP.

Former Member
0 Kudos

Hi Deepak,

Normally most of SAP's table controls come with an evebt called detail or insert. /you can use these events to place the record at the position 01. For example if you want to read the 25th item in a sales order, you need to just press this detail button(this gives u an ok code) and then a pop up comes (which is also recordable) and u put in 25 in it and press enter. The 25th item will come to the row 1. Now you can use your bdc code for RSSEL(01) again and highlight this line item. If this option is not available for u then u need to use CTPARAMS for the screen resolution as well. SOme systems will show 15 lines, some other systems will show only 5 lines. It depends on the screen resolution.

Shobana

Former Member
0 Kudos

Hi Deepak

This is a very known problem and you can't solve it if your transaction haven't a functionality to place an item to top of table control.

The trick is to insert the new record in second position:

- Insert the first record in the first position of tc;

- Insert the second record in the second position of tc;

- place the second record to top of tc,

- Insert the third record in the second position of tc;

- place the third record to top of tc;

....... and so

But if your transaction haven't the functionality to place an item to top, you should looking for another solution (BAPI for example).

Max

former_member181962
Active Contributor
0 Kudos

Hi Deepak,

If you have the line number of the record, then you need to split that number as the number of page downs and the offset.

EG: if you have the line number as 10,(assuming the visible lines = 15).

that means the number of page downs = 0.

and offset = 10.

If the number is 20, the number of page downs = 1

and offset = 5.

31=>2 pagedowns and offset 1.

do v_no_of_page_downs.

peform bdc_dynfield using <Pagedown Fcode>.

enddo.

concatenate '<Fieldname>(' v_offset ')' into v_fieldname.

perform bdc_dynfield using v_fieldname <Value of the field>.

I know this can be confusing.

Other atlenatives include using a BAPI instead of the transaction, if there is one.

Check if the table control has a 'Position' field just underneath the table control(Some transactions have that).

YOu can record the action in shdb for positioning the cursor for a line you wanted.(i.e if you give a line number 34, the table control's first line will show the 34th line.

Regards,

Ravi