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

Handling BDC using Table Controls

Former Member
0 Likes
958

Hi every body,

I'm developing a object, where there is a table control on the screen. once u press save button it call the "BDC Call Transaction 'ME51'".

The number of rows in table control is Diff from one screen to another.

we need to change the Page number Once all the rows in the first page were filled.

Can anybody help me to know the no of displayed records in the Table Control.

Thanks in advance.

Helpful answers will be awarded greatly.

1 ACCEPTED SOLUTION
Read only

mithun_shetty4
Contributor
0 Likes
885

Hello,

Once the Cursor Reaches the Last line of The Table Control ,Use Scroll function.

ie Keep a count on the Number of Populated Records

suppose the Table control can take 20 records .

Count till the 20th Record . then use scroll functionality

ie 'P+' in the BDC Cursor .field.reset the counter

Award if helpful.

/M

5 REPLIES 5
Read only

mithun_shetty4
Contributor
0 Likes
886

Hello,

Once the Cursor Reaches the Last line of The Table Control ,Use Scroll function.

ie Keep a count on the Number of Populated Records

suppose the Table control can take 20 records .

Count till the 20th Record . then use scroll functionality

ie 'P+' in the BDC Cursor .field.reset the counter

Award if helpful.

/M

Read only

0 Likes
885

No Midhun,

I'd like to find out, how many rows are displayed in ME51, Table control.

depending on that i can complete the object.

Read only

0 Likes
885

Its 16.

Read only

0 Likes
885

no it varies from screen to screen.

Read only

Former Member
0 Likes
885

Hi,

No need to know about the number of columns.

Better way is record the bdc and when table control comes enter first line of data and press enter and then enter the second line and save it.

now make two internal tables or more depending on ur table control.

and keep the line items data in a loop and keep all the bdc table prepare data for the table control inside it.

and then call ur transaction and keep refreshing the bdcdata as the new data will be filled in the second time.

or use one of the following

In recording of BDC, it is always advisable NOT TO USE scroll functionality as it depends upon what screen size (800X600 or 1200X1024 or something else) user has selected.

What you need to do here is,

Use '+' button given below in the VL01N transaction. The F-Code for that is 'POAN_T'. So here, you need to add one item at a time and press this button and so that you will always need to add the new row at the second line as the previous all the lines will be scrolled above by SAP.

But still if you want to go with your scrolling. You need to take care about the screen resolution problem.

1. while recording ensure that it is in default size. Just ensure the check box is checked or not.

2. while processing means if call transaction use ctu_params structure and make defsize eq 'X'.

3. If it is session method just ensure that dynpro standard size check box is checked or not.

This way you can overcome screen resolution problem.

it depends on the transaction whichyou are suing.

But general way you cna follow the above tips.

you record for an item and then click on page down and save it.use the loop on this bdc to populate the the bdc table no need to do manually.

LOOP AT l_i_dettab_item INTO l_wa_dettab_item..

l_cursor = l_cursor + 1.

IF l_cursor GT 1.

PERFORM bdc_field USING 'BDC_OKCODE'

'=P+'.

ENDIF.

PERFORM cursor_pos_notation USING 'V_EAN_DET001- GTIN_VARIANT_TYP'

l_cursor

CHANGING l_cursor_notation.

PERFORM cursor_pos_notation USING 'V_EAN_DET001-VTWEG'

l_cursor

CHANGING l_cursor_notation.

PERFORM bdc_field USING l_cursor_notation

l_wa_dettab_item-vtweg.

PERFORM cursor_pos_notation USING 'V_EAN_DET001-DATEFROM'

l_cursor

CHANGING l_cursor_notation.

PERFORM bdc_field USING l_cursor_notation

l_v_date.

PERFORM bdc_field USING 'BDC_CURSOR'

l_cursor_notation.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SAVE'.

ENDLOOP.

Here my ok code for page down is =P+ so i am looping on the table control data and then populating the bdc table after this i will populate the remaing info required for the call transaction and refresh bdcdata.

thats it no need to do recording 1000 times.

now if u do like this it doesn't depend on the number of records on table control.

it will take all the records.

Reward if useful.

Regards,

sasi