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

bdc table control

Former Member
0 Likes
581

Dear experts,

i have requirements in BDC like the following.

In tablecontrol I have 15 records to record in the line item but in the screen only 10 lines are displaying in one screen, To enter/record remaining 5 items we have to press the Page down key, but in coding i don't know how to accomplish this.

can anybody give me coding and example for this

thanks in advance

karthik

4 REPLIES 4
Read only

h_senden2
Active Contributor
0 Likes
541

Hi karthik,

there's no general answer for this one. You should give more info about the recorded transaction. Sometimes there is a Next-button, and sometimes there is a menu-shortcut for this action.

Hans

Read only

Former Member
0 Likes
541

Hi kalimuthu,

See if there is any option of entering the position number in the screen , so that it comes to the first line always. This way you could get around the pain of handling the table control page down.

If there isn't any, check this example:

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

Regards,

ravi

Read only

Former Member
0 Likes
541

check this code...We implemeted for partner functions...

*-- Add any extra payers

DESCRIBE TABLE i_payer LINES i_count.

IF i_count > 1.

LOOP AT i_payer FROM 2.

IF i_tabix > 14.

PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.

PERFORM bdc_dynpro USING 'SAPMF02D' '0324'.

i_tabix = 2.

ENDIF.

CLEAR xfname.

CONCATENATE 'KNVP-PARVW(' i_tabix ')' INTO xfname.

PERFORM bdc_field USING xfname 'PY'.

CLEAR xfname.

CONCATENATE 'RF02D-KTONR(' i_tabix ')' INTO xfname.

PERFORM bdc_field USING xfname i_payer.

ADD 1 TO i_tabix.

ENDLOOP.

ENDIF.

Read only

former_member69765
Contributor
0 Likes
541

Wait my freind....

There is an relatively easy method..

Normally all the screns with table controls will have buttons to add(Insert) a Row, Delete a Row etc..

After adding data to 1st Row (it will have index 1)... press that insert button so a new Row is inserted again at 1st row..so this will have index 1.

So in this way you can hard code the index to one.

The advantage is that if there are many rows then you will not have to keep a track of how many rows are inserted and when to press the page down button.

I am giving a small example.... Just copy paste this example and run it in all mode...

Run it in all mode so that you can see what I am trying to do...

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

report ZTEST_BDC

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE'.

perform bdc_field using 'BDC_OKCODE'

'=CHANGE_RADIO'.

perform bdc_field using 'RSRD1-TBMA'

''.

perform bdc_field using 'RSRD1-TBMA_VAL'

'EKPO'.

perform bdc_field using 'RSRD1-DDTYPE'

'X'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=ADD'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'EKPO'.

perform bdc_field using 'RSRD1-DDTYPE'

'X'.

perform bdc_field using 'RSRD1-DDTYPE_VAL'

'ztest_Str'.

perform bdc_dynpro using 'SAPLSED1' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D_100-STRU'.

perform bdc_field using 'BDC_OKCODE'

'=GOON'.

perform bdc_field using 'D_100-DTEL'

''.

perform bdc_field using 'D_100-STRU'

'X'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'bukrs'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'bukrs'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_LINE_INSERT'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'kostl'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'kostl'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_LINE_INSERT'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'wrbtr'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'wrbtr'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_SAVE'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_dynpro using 'SAPLSTRD' '0100'.

perform bdc_field using 'BDC_CURSOR'

'KO007-L_DEVCLASS'.

perform bdc_field using 'BDC_OKCODE'

'=TEMP'.

perform bdc_field using 'KO007-L_AUTHOR'

'VARUN'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/EWB_CANCEL'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_OKCODE'

'/EABR'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE_VAL'.

perform bdc_transaction using 'SE11'.

perform close_group.

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

I hope this helps.....

Please mark points if it helps..