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 table control

Former Member
0 Kudos

hi,

in interviews how to answer for the questions

HOW TO HANDLE TABLE CONTROL IN BDC?.(NOT THE EXAMPLE CODE.)JUST I HAVE TO ANSWER THE QUESTION.pls help me

6 REPLIES 6

Former Member
0 Kudos

You will need to take care of Page up and Pag down, and logic needs to be written that will calculate the nu,ber of lines displayed ons creen depending on System variables, such as SY-LOOPC, sy-SROWS.

Former Member
0 Kudos

Hi,

The approach to handle a table control in BDC should be something like this

when you record for a table control you have to use index

the lines in a table control are numbered 01,02,03 .... these are the indexs you have to calculate this index in your program.

1. Do a recording in SHDB with default size option checked in the screen where you enter the transaction code and the program name

when you do this find out the number of lines that show up in the table control. lets say its 5. that means after every 5 records you have to do a page down to enter more records.

perform bdc_dynpro using 'SAPLALDB' '3000'.

perform bdc_field using 'BDC_OKCODE'

'=P+'.

Index should be calculated during run time and used in the BDC something like

if there are 5 records already idx shuould be 6

CONCATENATE 'RSCSEL-SLOW_I(' idx ')' INTO fname.

CONDENSE fname NO-GAPS.

PERFORM bdc_field USING fname

'80000016'.

Try to do somethin like this.

reward if it helps..

regards,

Omkar.

Former Member
0 Kudos

Hi

You will first loop the header internal table

then in that Loop the Item level internal table which contains the table control records

for each header table control is populated

you have to take care that each record will enter into table control line one below the other

if the line items are more than the table control lines you have to handle PAGEUP and PAGE-down controls of the table control correctly

you have to take the resolution of the screen, so that table control lines are same

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi Harish,

You can handle table controls in multiple ways,

1) if there is a scroll down button on your screen for which you are writing the BDC, then make use of the scroll button and not traverse between rows of the table control manually.

2) there are some screens in which the table control behaves differently. like->

sometimes if you enter some data into the first row of the table control and press enter then the row moves up and the table control looks as if there is not data entered, but in reality the second row is shown to you as the first line to be entered where the first row has already moved up. In such a case you need to enter data only in the first row always and there is not much to be done here.

3) If you are pretty much sure about the number of rows that you shall be entering into the table control and if the count is always in 2's or 3's then you can do a manual handling of that by using a counter variable.

Another question in table control is of utmost importance, how do we handle in case of varied resolutions of various screens. Answer to this question would be usage of CTU_PARAMS.

<b>Reward points if you find this helpful,</b>

Kiran

Former Member
0 Kudos

Hi,

in data for complete screen should be in one itab. and data to be updated in table control should be in seprate itab.

Now. while looping through main itab give inside scond loop for table control .

Table control entries are accessed rowwise using indexes.

say :

loop at itab.

loop at itab2.

bdc_filedname = itab2-fileld1( 1 ). "for first row n so on, u can concatenate this

endloop.

endloop.

Jogdand M B

Former Member
0 Kudos

Hi

in BDC we have some EVENTS

by useing that EVENTS we can maintain the table control through BDC

You can tell like this

Reward if usefull