01-02-2015 5:33 AM
i am trying to create a bdc for module pool(module pool with selection screen)
For some reasons i won't be able to upload data from file or convert module pool into executable report.
While recording i am using multiple selection of select-options on selection screen of module pool.
But while recording i noticed that only 8 entries (out of 100, can be any,dynamic, entered in multiple selection) are captured. this is because only 8 rows are displayed directly and for rest we have to scroll again and again till the end.
Is there exists some way, we just paste entries and need not to scroll till the end(because at runtime, we don't know how many entries will be there.)
I am using recording to fill BDCDATA. and using this internal table in statement.
CALL TRANSACTION 'ZTCODE' USING BDCDATA MODE 'E'.
Please guide .
01-02-2015 5:37 AM
Hi Abhishek,
Can you please attach your BDC code for better understanding of what are you doing exactly?
01-02-2015 5:37 AM
Hi Abhishek,
Can you please attach your BDC code for better understanding of what are you doing exactly?
01-02-2015 6:05 AM
enclosed notepad file for the code transferred from BDC Recording.
I have added comments in code , so that you would identify where the problem persists.
Only 8 entries are recorded while there can be many more at run time.
01-02-2015 6:31 AM
Sorry Abhishek but I am not able to download the attachment, Could you please paste plain text directly here only for the problem area?
01-02-2015 6:35 AM
-----------THIS STARTS HERE ------------------------------
* ONLY 8 entries are filled at select-options
* i have entered more than 100 while recording.
perform bdc_field using 'RSCSEL_255-SLOW_I(01)'
' 94747'.
perform bdc_field using 'RSCSEL_255-SLOW_I(02)'
' 95762'.
perform bdc_field using 'RSCSEL_255-SLOW_I(03)'
' 95775'.
perform bdc_field using 'RSCSEL_255-SLOW_I(04)'
' 598422'.
perform bdc_field using 'RSCSEL_255-SLOW_I(05)'
' 1064746'.
perform bdc_field using 'RSCSEL_255-SLOW_I(06)'
' 1064747'.
perform bdc_field using 'RSCSEL_255-SLOW_I(07)'
' 1064748'.
perform bdc_field using 'RSCSEL_255-SLOW_I(08)'
' 1064749'.
*-----------THIS ENDS HERE ------------------------------
01-02-2015 6:46 AM
To make it dynamic, manipulate the BDC code like belw :
v_index = 0.
DO V_count. "where V_count should contain total number of entries to be copied.
v_index = v_index + 1.
concatenate 'RSCSEL_255-SLOW_I(' v_index ')' INTO v_string.
perform bdc_field using v_string
v_value. "v_value should contain value to be copied. This will change with every loop iteration.
ENDDO.
01-02-2015 7:14 AM
viraj,
i understand what you have said.
but i am still facing issues.
see this is entire code.
Paste this and try to execute.
report ZT5
no standard page heading line-size 255.
include bdcrecx1.
DATA gtvbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
data :vlines TYPE int4,v_index TYPE char3 VALUE '000'.
data v_string TYPE string.
start-of-selection.
SELECT * from vbak into TABLE gtvbak UP TO 100 rows.
DESCRIBE TABLE gtvbak LINES vlines.
perform open_group.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=%000'.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=CLIP'.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL_255-SLOW_I(01)'.
do vlines TIMES.
add 1 to v_index.
concatenate 'RSCSEL_255-SLOW_I(' v_index ')' INTO v_string.
perform bdc_field using V_STRING
''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(02)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(03)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(04)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(05)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(06)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(07)'
* ''.
*perform bdc_field using 'RSCSEL_255-SLOW_I(08)'
* ''.
ENDDO.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL_255-SLOW_I(01)'.
*do vlines TIMES.
CLEAR v_index.
LOOP at gtvbak.
add 1 to v_index.
concatenate 'RSCSEL_255-SLOW_I(' v_index ')' INTO v_string.
perform bdc_field using v_string
gtvbak-vbeln.
*perform bdc_field using 'RSCSEL_255-SLOW_I(02)'
* '4970'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(03)'
* '4971'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(04)'
* '4972'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(05)'
* '4973'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(06)'
* '4974'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(07)'
* '4975'.
*perform bdc_field using 'RSCSEL_255-SLOW_I(08)'
* '4976'.
ENDLOOP.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'SO_VBELN-LOW'
'4969'.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_transaction using 'ZT2'.
perform close_group.
i have created transaction 'ZT2' for program 'ZT3'.
Source code for program 'ZT3'.
REPORT zt3.
TABLES vbak.
SELECT-OPTIONS:so_vbeln FOR vbak-vbeln.
data gt_vbak TYPE STANDARD TABLE OF vbak.
START-OF-SELECTION.
BREAK-POINT.
MESSAGE '' TYPE 'I'." nothing,i'll here just check if all the 100 entries are there in gt_vbak.
Not even a single entry is copied to clipboard.
Error msg's after finished executing bdc.
01-02-2015 8:28 AM
Hi Abhishek,
I have reviewed your code, and done changes in it and tested on my system. Now it is working exactly you want. Please use below code.
report ZT5
no standard page heading line-size 255.
include bdcrecx1.
DATA gtvbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
data :v_index TYPE char2 VALUE '00'.
data v_string TYPE string.
start-of-selection.
SELECT * from vbak into TABLE gtvbak UP TO 20 rows.
perform open_group.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=%000'.
LOOP AT gtvbak.
perform bdc_dynpro using 'SAPLALDB' '3000'.
v_index = v_index + 1.
concatenate 'RSCSEL-SLOW_I(' v_index ')' INTO v_string.
IF v_index = 1.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using v_string
gtvbak-vbeln.
IF v_index = 8.
v_index = 1.
IF v_index = 1.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
ENDIF.
ENDIF.
ENDLOOP.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_transaction using 'ZT2'.
perform close_group.
01-02-2015 9:01 AM
Viraj Shah wrote:
Hi Abhishek,
I have reviewed your code, and done changes in it and tested on my system. Now it is working exactly you want. Please use below code.
report ZT5
no standard page heading line-size 255.
include bdcrecx1.
DATA gtvbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
data :v_index TYPE char2 VALUE '00'.
data v_string TYPE string.
start-of-selection.
SELECT * from vbak into TABLE gtvbak UP TO 20 rows.
perform open_group.
perform bdc_dynpro using 'ZT3' '1000'.
perform bdc_field using 'BDC_CURSOR'
'SO_VBELN-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=%000'.
LOOP AT gtvbak.
perform bdc_dynpro using 'SAPLALDB' '3000'.
v_index = v_index + 1.
concatenate 'RSCSEL-SLOW_I(' v_index ')' INTO v_string.
"dont you think it should be
concatenate 'RSCSEL_255-SLOW_I(' v_index ')' INTO v_string.
IF v_index = 1.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
viraj,
thanks for the effort.
But still i am very far from the objective.
nothing is happening.
have you paste entire code that it should contain.??
see error
01-02-2015 5:41 AM
Hi,
Of course, there is the 'Upload from clipboard' button (second last button in the 'Multiple Selection' screen), but first you need to get your entries onto the clipboard. I'm not sure if that is possible in BDC..
As for repeatedly clicking 'Page Down', that is a common technique in BDC. At runtime you know exactly how many entries have to be filled in, don't you? So the BDC session can be adjusted to suit.
cheers
Paul
01-02-2015 6:06 AM
even if i know how many entries are there that are to be copies on the clipboard. then how come i'll be able to know that how many times i have to scroll down all the entries gets captured.
01-02-2015 7:00 AM
Hi Abhishek,
You have to use the =P+ page down logic to user code to set the valued in input screen, based on your no of entries.
Code would be like below to set the value in input screen,
Loop at Your_internal_table.
if sy-tabix eq 9.
perform BDC_FIELD using 'BDC_OKCODE' '=P+' for page down
endif.
and here the rest of the logic will be same.
endloop.
Regards.
Praveer.
01-02-2015 9:22 AM