06-19-2006 8:17 AM
hai,
i want to upload data to a table control and the table control is having 5 lines but i want to upload 10 records how to scroll in the table control while uploading ( Transaction XK01, Table Control: Bank Details).
regards,
gopan.g
06-19-2006 8:18 AM
after every 5 recodes Do a page Down (ok code is p+).
Regards
Prabhu
06-19-2006 8:19 AM
06-19-2006 8:23 AM
06-19-2006 8:36 AM
hi
good
go through this link which ll give you detail idea about the scrolling in the table .
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm
thanks
mrutyun
06-19-2006 8:39 AM
Hai Gopan
Go through the following Code using BDC Table Control
report Z_TAB_CONTRL_01
no standard page heading line-size 255.
data : begin of it_kna1 occurs 0,
kunnr like RF02D-KUNNR,
D0130 like RF02D-D0130,
end of it_kna1.
data : begin of it_kna2 occurs 0,
kunnr like RF02D-KUNNR,
BANKS like KNBK-BANKS,
BANKL like KNBK-BANKL,
BANKN like KNBK-BANKN,
koinh like KNBK-koinh,
end of it_kna2.
data : V_Count(2) type n.
data : V_Val(15).
include bdcrecx1.
start-of-selection.
perform Get_Data1.
perform Get_Data2.
perform open_group.
loop at it_kna1.
V_Count = '04'.
perform bdc_dynpro using 'SAPMF02D' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-D0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
'10002103'.
perform bdc_field using 'RF02D-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
loop at it_kna2 where kunnr = it_kna1-kunnr.
if v_count = '10'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
v_count = '00'.
endif.
V_Count = V_Count + 1.
concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
perform bdc_field using 'BDC_CURSOR'
'KNBK-KOINH(09)'.
concatenate 'KNBK-BANKS(' V_Count ')' into V_Val.
perform bdc_field using V_Val
it_kna2-BANKS.
concatenate 'KNBK-BANKL(' V_Count ')' into V_Val.
perform bdc_field using V_Val
it_kna2-BANKL.
concatenate 'KNBK-BANKN(' V_Count ')' into V_Val.
perform bdc_field using V_Val
it_kna2-BANKN.
concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
perform bdc_field using V_Val
it_kna2-KOINH.
endloop.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_transaction using 'FD02'.
clear : it_kna1,it_kna2.
endloop.
perform close_group.
&----
*& Form Get_Data1
&----
text
----
--> p1 text
<-- p2 text
----
FORM Get_Data1 .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\tab_contl.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_kna1
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " Get_Data1
&----
*& Form Get_Data2
&----
text
----
--> p1 text
<-- p2 text
----
FORM Get_Data2 .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\tab_cont1.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_kna2
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7 .
ENDFORM. " Get_Data2
Thanks & regards
Sreenivasulu P
06-19-2006 8:50 AM
hi
use this:
perform bdc_field using 'BDC_OKCODE'
'=P+'.
after every five record..usimg sy-tabix..
Reward points if it helps
Regards
Gunjan
06-19-2006 8:45 AM
Hi Gopan
Here is the code i have written for trans 9KE0. where table control was used and i did scrolling . This might helpful for you.
perform bdc_dynpro using 'SAPLPCPP' '1000'.
perform bdc_field using 'BDC_CURSOR'
'RKB1S-FORM'.
perform bdc_field using 'BDC_OKCODE'
'=SPLN'.
perform bdc_field using 'RKB1S-FORM'
P_LAYOUT."'PCA01'.
perform bdc_field using 'RPCAP-DOCTY'
'A0'.
perform bdc_field using 'RPCAA-BUDAT'
w_date.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=CZUR'.
perform bdc_dynpro using 'SAPLPCPP' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=SPLN'.
perform bdc_field using 'RPCAA-BUDAT'
w_date.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=CSUB'.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
perform bdc_field using 'BDC_OKCODE'
'=SACD'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
perform bdc_field using 'BDC_OKCODE'
'=SACD'.
endif.
loop at it_tab.
write it_tab-vlcur to w_vlcur.
write it_tab-msl to w_msl.
concatenate 'BDC02(' w_count ')' into w_bdc02.
concatenate 'BDC04(' w_count ')' into w_bdc04.
concatenate 'BDC06(' w_count ')' into w_bdc06.
concatenate 'BDC07(' w_count ')' into w_bdc07.
concatenate 'BDC08(' w_count ')' into w_bdc08.
concatenate 'BDC10(' w_count ')' into w_bdc10.
concatenate 'BDC11(' w_count ')' into w_bdc11.
concatenate 'BDC12(' w_count ')' into w_bdc12.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
endif.
perform bdc_field using 'BDC_CURSOR'
w_bdc06.
perform bdc_field using 'BDC_OKCODE'
'/00'.
if p_layout = 'PCA01'.
perform bdc_field using w_bdc02
it_tab-prctr."'1010101001'.
perform bdc_field using w_bdc04
it_tab-racct."'890003'.
perform bdc_field using w_bdc06
it_tab-runit.
perform bdc_field using w_bdc07
w_vlcur."'345'.
perform bdc_field using w_bdc08
w_msl.
elseif p_layout = 'PCA02' or p_layout = 'PCA03'.
perform bdc_field using w_bdc02
it_tab-prctr."'1010101001'.
perform bdc_field using w_bdc04
it_tab-fkber."Functional area
perform bdc_field using w_bdc06
it_tab-werks."Plant
perform bdc_field using w_bdc08
it_tab-racct.
perform bdc_field using w_bdc10
it_tab-runit.
perform bdc_field using w_bdc11
w_vlcur."'345'.
perform bdc_field using w_bdc12
w_msl.
endif.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
endif.
perform bdc_field using 'BDC_CURSOR'
w_bdc02.
perform bdc_field using 'BDC_OKCODE'
'=SACD'.
perform bdc_dynpro using 'SAPLPCAD' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=SADL'.
perform bdc_field using 'GLPCA-SGTXT'
it_tab-sgtxt.
perform bdc_dynpro using 'SAPLPCAD' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=SADI'.
perform bdc_field using 'GLPCA-SGTXT'
it_tab-sgtxt.
perform bdc_field using 'BDC_CURSOR'
'GLPCA-REP_MATNR'.
if p_layout = 'PCA01'.
perform bdc_field using 'GLPCA-WERKS'
it_tab-werks.
endif.
perform bdc_field using 'GLPCA-MATNR'
it_tab-matnr.
perform bdc_dynpro using 'SAPLPCAD' '0001'.
perform bdc_field using 'BDC_OKCODE'
'=SWTR'.
*perform bdc_field using 'GLPCA-SGTXT'
'test'.
perform bdc_field using 'BDC_CURSOR'
'GLPCA-ANLN2'.
perform bdc_field using 'GLPCA-ANLN1'
it_tab-anln1.
perform bdc_field using 'GLPCA-ANLN2'
it_tab-anln2.
if p_layout = 'PCA03'.
w_max = 14.
else.
w_max = 15.
endif.
if w_count = w_max.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
endif.
perform bdc_field using 'BDC_OKCODE'
'=CP+'.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
endif.
perform bdc_field using 'BDC_OKCODE'
'=SACD'.
w_count = 0.
endif.
w_count = w_count + 1.
endloop.
if p_layout = 'PCA03'.
perform bdc_dynpro using 'SAPLKPP2' '0106'.
else.
perform bdc_dynpro using 'SAPLKPP2' '0103'.
endif.
perform bdc_field using 'BDC_OKCODE'
'=CBUC'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=CZUR'.
perform bdc_dynpro using 'SAPLPCPP' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/ESZUR'.
CALL TRANSACTION '9KE0' USING BDCDATA
OPTIONS FROM W_OPTIONS
MESSAGES INTO MESSTAB.