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

table control scrolling issue

Former Member
0 Likes
549

hi,

I am having a issue with table control scrolling. When i was passing less number of records (say 19 records becuase table control is having 19 lines) to table control in BDC call transaction, everything is working fine. after filling the 19 line items its not taking the next line item the page is not scrolling down. T.code is <b>GS02</b>. please suggest me. following is my code

REPORT ZLOCK_WBS_ELEMENTS MESSAGE-ID ZFI_RESTMT.

----


  • TYPES *

----


*types declaration for final internal table

types: begin of ty_final,

ryear like zupi5a-ryear, "Fiscal year

rbukrs like zupi5a-rbukrs, "Company code

racct like zupi5a-racct, "Account number

rzzps_posid like zupi5a-rzzps_posid, "WBS element

rzzmtit like zupi5a-rzzmtit, "MPM title

rzzmfor like zupi5a-rzzmfor, "MPM format

rzzmatnr like zupi5a-rzzmatnr, "Material number

rzzcou like zupi5a-rzzcou, "Country

rzzfow like zupi5a-rzzfow, "Financial owner

rzzoow like zupi5a-rzzoow, "Operational owner

rzzcon like zupi5a-rzzcon, "Licensee Contract

rzzloc like zupi5a-rzzloc, "Licensor Contract

kostl like zupi5a-kostl, "Cost center

zzfam like zupi5a-zzfam, "Fame Number

zzfor like zupi5a-zzfor, "Format

zzprd like zupi5a-zzprd, "Product Line

zzwin like zupi5a-zzwin, "Window group

zzwig like zupi5a-zzwig, "Window

rtcur like zupi5a-rtcur, "Currency Key

tsl like zupi5a-tsl, "Amount Transaction currency

hsl like zupi5a-hsl, "Amount Co. code currency

ksl like zupi5a-ksl, "Amount Group currency

msl like zupi5a-msl, "Quantity

end of ty_final.

----


  • Data

----


data: j_final2 type standard table of ty_final,

v_final2 type standard table of ty_final.

data: wa_final2 type ty_final.

data: bdcdata like bdcdata occurs 0 with header line,

messtab like bdcmsgcoll occurs 0 with header line.

data :begin of i_values occurs 0.

include structure setvalues.

data :end of i_values.

data: v_counter(3) type n value '0',

v_from like rgsbl-from,

  • V_FROM(30) TYPE C,

v_setname like zfi_setid_cc-setid,

v_setid like sethier-setid,

n type i,

l type i,

k type i value '1',

p_rbukrs like zupi5a-rbukrs.

import p_rbukrs from memory id 'bukrsid'.

import i_final2 to j_final2 from memory id 'table'.

  • To eliminate duplicate WBS elements to be stored into the sets

v_final2 = j_final2.

sort v_final2 by rzzps_posid.

delete adjacent duplicates from v_final2 comparing rzzps_posid.

select single setid into v_setname

from zfi_setid_cc

where rbukrs EQ p_rbukrs.

IF sy-subrc <> 0.

MESSAGE E005.

ENDIF.

*write 'ZFIRESTATEMENT' to v_setname.

call function 'G_SET_GET_ID_FROM_NAME'

EXPORTING

shortname = v_setname

IMPORTING

new_setid = v_setid.

call function 'G_SET_TREE_IMPORT'

EXPORTING

client = sy-mandt

langu = sy-langu

setid = v_setid

TABLES

set_values = i_values.

describe table i_values lines n.

describe table v_final2 lines l.

write n to v_counter.

clear bdcdata.

refresh bdcdata.

perform bdc_dynpro using 'SAPMGSBM' '0105'.

perform bdc_field using 'BDC_CURSOR'

'RGSBM-SHORTNAME'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

*perform bdc_field using 'RGSBM-SHORTNAME'

  • 'ZFIRESTATEMENT'.

perform bdc_field using 'RGSBM-SHORTNAME'

v_setname.

loop at v_final2 into wa_final2.

v_counter = v_counter + 1.

perform bdc_dynpro using 'SAPMGSBM' '0115'.

concatenate 'RGSBL-FROM(' v_counter ')' into v_from.

perform bdc_field using 'BDC_CURSOR'

v_from.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RGSBS-TITLE'

'FI Restatement-WBS locking'.

perform bdc_field using v_from

wa_final2-rzzps_posid.

endloop.

perform bdc_dynpro using 'SAPMGSBM' '0115'.

perform bdc_field using 'BDC_CURSOR'

v_from.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'RGSBS-TITLE'

'FI Restatement-WBS locking'.

perform bdc_dynpro using 'SAPMGSBM' '0105'.

perform bdc_field using 'BDC_OKCODE'

'/EBACK'.

perform bdc_field using 'BDC_CURSOR'

'RGSBM-SHORTNAME'.

call transaction 'GS02'

using bdcdata

mode 'A'

update 'S'

messages into messtab.

----


  • Start new screen *

----


form bdc_dynpro using program dynpro.

clear bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

append bdcdata.

endform.

----


  • Insert field *

----


form bdc_field using fnam fval.

if fval <> ' '.

clear bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

append bdcdata.

endif.

endform.

this is working fine when they r less than 19 line items. please suggest me with the logic when it is more than 19 line items.

2 REPLIES 2
Read only

Former Member
0 Likes
456

may be i think u r recording is worng, please pass the values of

CTU_PARMS OR write the logic passing the values logic

values = value + 1.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
456

Hi,

Just try to increase the table control lines before display.

v_counter = n + 10.