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: 

How to handle cursor in bdc tbcl

Former Member
0 Kudos

Hi,

can any one tell me in detailhow to handle cursor in bdc tbcl.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi..

set the default size when recording .

when populating bdc table control data... first concatenate the fieldname and index number into variable and use the variable in place of fieldname.

when u loop the internal table with table data check the condition if the number of record is greater than default size rows in table control... if it is then use BDC_OKCODE = 'P+' and also reset the index number which u are concatenating to 2.

just check the code

LOOP AT itab_fields WHERE count EQ w_index.

ADD 1 TO w_tabix.

IF w_tabix gt 13.

PERFORM bdc_dynpro USING 'SAPLSD41' '2200'.

PERFORM bdc_field USING 'BDC_CURSOR'

w_fname.

PERFORM bdc_field USING 'BDC_OKCODE'

'=P+'.

w_tabix = 2.

ENDIF.

CONCATENATE 'DD03P-FIELDNAME(' w_tabix ')' INTO w_fname.

CONCATENATE 'DD03P-KEYFLAG(' w_tabix ')' INTO w_fkey.

CONCATENATE 'DD03D-DATATYPE(' w_tabix ')' INTO w_ftype.

CONCATENATE 'DD03P-LENG(' w_tabix ')' INTO w_flen.

CONCATENATE 'DD03P-DDTEXT(' w_tabix ')' INTO w_fdesc.

this would help u

regards

padma

6 REPLIES 6

Former Member
0 Kudos

In the BDC table control.... there is a table. try to find the table....and using that table's index u can easily control the cursor....

Let us take in BDC mode 10 rows are displayed...one page down shows row 10 to 19..two page down shows row 19 to 28.so u can calculate easily the no of page down and corrosponding row no.....

<removed_by_moderator>

Edited by: Julius Bussche on Jun 24, 2008 7:16 PM

Former Member
0 Kudos

Hi ,

Please check this link

Example

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

http://abapprogramming.blogspot.com/2007/11/abap-bdc-table-control.html

Use PAGE UP and PAGE DOWN buttons on the key board to scroll while recording.

Function key for page down is ' =P+ '.

Hope this helps...

Best regards,

raam

Former Member

Former Member
0 Kudos

Hi,

In the SHDB Recording you will have the following values

Field Name BDC_CURSOR

Field Value MSICHTAUSW-DYTXT(02)

to denote the cursor position.In our driver program we need to change the Field Value if we want the cursor at a partcular field.

<removed_by_moderator>

Warm Regards

R Adarsh

Edited by: Julius Bussche on Jun 24, 2008 7:16 PM

Former Member
0 Kudos

Hi Siva Rama Anee,

Considering there are 10 rows visible in Fields tab of table..

Specify fill the contents of table BDCDATA as

BDC_CURSOR <fieldname (10)> (BDC field name )

specify the text and press enter

do this process for 10 times..

On the 11th time set BDC_OKCODE = 'P+'.(PAGE DOWN)

AGAIN REPEAT THE PROCESS as stated above..

or it can be down in other way.....

start filling the fields from first row and after entering 10 records set BDC_OKCODE = 'P+'.

After you press that set BDC_CURSOR to the next field and continue doing..

After ever 10th record do this process.

Hope this would be helpful to you

Regards

Narin Nandivada

Former Member
0 Kudos

hi..

set the default size when recording .

when populating bdc table control data... first concatenate the fieldname and index number into variable and use the variable in place of fieldname.

when u loop the internal table with table data check the condition if the number of record is greater than default size rows in table control... if it is then use BDC_OKCODE = 'P+' and also reset the index number which u are concatenating to 2.

just check the code

LOOP AT itab_fields WHERE count EQ w_index.

ADD 1 TO w_tabix.

IF w_tabix gt 13.

PERFORM bdc_dynpro USING 'SAPLSD41' '2200'.

PERFORM bdc_field USING 'BDC_CURSOR'

w_fname.

PERFORM bdc_field USING 'BDC_OKCODE'

'=P+'.

w_tabix = 2.

ENDIF.

CONCATENATE 'DD03P-FIELDNAME(' w_tabix ')' INTO w_fname.

CONCATENATE 'DD03P-KEYFLAG(' w_tabix ')' INTO w_fkey.

CONCATENATE 'DD03D-DATATYPE(' w_tabix ')' INTO w_ftype.

CONCATENATE 'DD03P-LENG(' w_tabix ')' INTO w_flen.

CONCATENATE 'DD03P-DDTEXT(' w_tabix ')' INTO w_fdesc.

this would help u

regards

padma