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

Problem with BDC Table Control

Former Member
0 Likes
1,571

Hi Experts,

I have a problem with BDC Table Control (XD01, XK01, etc………).

If I actually have 10 records and say if only 3 records viewable. How can I view other records. Provide me the code.

Due to resolution, in other system I can only see 5 records by Default for the same BDC, then how does the code change.

Is there any Unique code for both the cases. Plz. Provide me the code which is suitable for both the cases.

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,459

Do one thing raj...

When u encounter that screen.. u press <b>Find </b> button and in that specify the field u want to search and press enter ..

u will get a screen with the required field as the first field on the resolution..

I hope u understood what am saying...

U record all these things and then create a program...

This will definitely solve ur problem.....

regards,

sai ramesh

17 REPLIES 17
Read only

Former Member
0 Likes
1,459

i guess while doing the recording if check the standard screen check box then ur problem is solved . Just open a standard screen and count the number of lines and code for the page down option.

Read only

0 Likes
1,459

Hi ,

Can u give me the code for the same.

Will be rewarded for the answer.

Regards

Read only

0 Likes
1,459

Hi raj,

Do something like this.

data x_ctuparams type ctu_params.

x_ctuparams-defsize = 'X'. " This would freeze the resolution in any system

x_ctuparams-dismode = 'N'.

x_ctuparams-updmode = 'S'.

call transaction <TCODE> using it_bdcdata options from x_ctuparams.

Regards,

Ravi

Read only

0 Likes
1,459

Hi Ravikanth,

I want the code for the same. Do provide it and also what would be hte default resolution.

Regards.

Read only

0 Likes
1,459

Hi Ravi,

Can u provide me a program of the same. I need the whole code to analyse and fit it accordingly into my Program.

I have already rewarded.

Thanks for the answer, will be surely rewarded again with healthy points.

Regards

Read only

0 Likes
1,459

Hi Ravi,

According to u, this is ok for call transaction method, but what about while doing in the <b>session method</b>. Do help me in this regard.

Thanks for the reply and will be rewarded with healthy points.

Regards

Read only

Former Member
0 Likes
1,459

default resolution means SAP provides it when you are recording with SHDB when you say NEW Recording a popup comes where you give tcode there u find check box checked so here you find default no of rows wile recording it EX VA01 you find 2 lines at item level eventhough your resolution of screen is 5 ok check it out.

Read only

Former Member
0 Likes
1,460

Do one thing raj...

When u encounter that screen.. u press <b>Find </b> button and in that specify the field u want to search and press enter ..

u will get a screen with the required field as the first field on the resolution..

I hope u understood what am saying...

U record all these things and then create a program...

This will definitely solve ur problem.....

regards,

sai ramesh

Read only

0 Likes
1,459

Hi Sai Ramesh,

I didn't get u. Can u explain me in Detail. Alo can u provide me the code for the same.

Will be surely rewarded.

Regards

Read only

0 Likes
1,459

Hi raj,

After encountering the screen, say u need to select a field in a table. One of the methods is to press<b> Control F </b>on that screen then enter the field name which u want.. and <b>press enter</b>.. then that field will be the <b>first field in the screen resolution</b> ....

just try this for a normal table like <b>spfli</b>... after going to the table display in SE11 press <b>control F or the Binoculars icon.</b>. then u will get a small window u just type in the name of the field u want.. and press enter .. see what happens,

u will come to know... that field will be the first field in the resolution of the screen ... ( No need of scrolling down and all these things, u will get any field u want by this way... )

sorry man i dont have any code with me right now.. u just start recorder in transaction SHDB and record all these things......

regards ,

sai ramesh.

Read only

0 Likes
1,459

Hi Ramesh,

Can u also provide me the code for the same in the case of session method.

Thanks for the answer and also try to provide the code when u do have it with u.

Will be surely rewarded with healthy points.

Regards

Read only

0 Likes
1,459

this is the example with<b> spfli table</b>..

i have opened this spfli in se11 transaction and in display mode..

Now '<b>PERIOD'</b> is the field which is not there in the resolution.. so i have opened the <b>find option</b> ,provided the field name <b>PERIOD </b> in the field of search window.

then pressed enter. Now i will get the same screen( spfli display screen ) with <b>period as the first field in that resolution</b> .. Now i can do whatever is i want with this field.. here i have double clicked on the domain of the field PERIOD.

so u analyse this and use it where ever u want....

*spfli display screen..

-


perform bdc_dynpro using 'SAPLSD41' '2200'. <u>( * spfli display screen , u can use ur screen number here )</u>

perform bdc_field using 'BDC_OKCODE'

'=FIND'. <u>(* To open the find window )</u>

perform bdc_dynpro using 'SAPLSD41' '0114'. <u>( * This is the find window )</u>

perform bdc_field using 'BDC_CURSOR'

'RSDXX-FINDSTR'.

perform bdc_field using 'BDC_OKCODE'

'=CANC'. <u>(* OK_CODE for enter )</u>

perform bdc_field using 'RSDXX-FINDSTR'

'PERIOD'. <u>( * Here i am giving the field name which i want to search or which is not there in the resolution or u can give a vaiable name which contains the value <FIELD NAME> ).</u>

( Now i got the spfli display screen with period as the first field in the screen resolution )

perform bdc_dynpro using 'SAPLSD41' '2200'. <u>(*The previous spfli display screen )</u>

perform bdc_field using 'BDC_OKCODE'

'=WB_SELECT_OBJECT'. <u> (* OK_CODE to double click on the domain of the field PERIOD )</u>

perform bdc_field using 'BDC_CURSOR'

'DD03D-ROLLNAME(01)'.

-


I HOPE U UNDERSTOOD .....

copy and paste the code in between two lines... AND replace screen numbers, program numbers, field names, field values with ur values...

Read only

0 Likes
1,459

Raj,

luk thro the following link..

DATA ZEILE(3). " variable used to concatenate the fieldname

DATA ERG TYPE N. " holds the line item number as seen on the screen

UNPACK BUZEI TO ZEILE.

ERG = BUZEI MOD 10 . "buzei is between 1 and 10 which is the record index

*fill head of dynpro for every first line item on the screen

IF ERG = 1.

PERFORM BDC_DYNPRO USING 'SAPMF10B' '0150'. "INS

ENDIF.

*fill table control runs for all line items on the screen

PERFORM BDC_FIELD_LOOP USING ZEILE 'RF10B-REFRC' SATZ-GSNR .

PERFORM BDC_FIELD_LOOP USING ZEILE 'RF10B-RITEM' SATZ-POSITION.

*

*page down for the last lineitem visible on the screen

IF ERG = 0 .

PERFORM BDC_FIELD USING 'BDC_OKCODE' ' '. "page down

CLEAR BUZEI.

ENDIF.

*concatenate fieldname to fill table

FORM BDC_FIELD_LOOP USING P_ZEILE P_FNAM P_FVAL.

DATA: L_FNAM LIKE BDCDATA-FNAM.

CONCATENATE P_FNAM '(' P_ZEILE ')' INTO L_FNAM.

PERFORM BDC_FIELD USING L_FNAM P_FVAL.

ENDFORM.

basically when i scroll down in a table control during a recording the screen is called again n u can fill the table line items all over again.. the above code runs the screen with table everytime the table is full..

Regards

aparna

Read only

0 Likes
1,459

note buzei mod 10..

10 is the max num of record u can enter into the table control tat u can view without scrolling..

hope this info helps u..

all the best

Aparna

Read only

0 Likes
1,459

Hi Ramesh,

Will this code work in the Session method.

Do give me the code for session method if the above code does not support for session method.

Will be surely rewarded.

Regards.

Read only

0 Likes
1,459

This will work in session method also...

There is no much difference between the CALL TRANSACTION and SESSION METHOD for populating the BDCDATA table ... Till this point both the methods are same... After that the difference comes....

Am sure this will work with SESSION method.....

regards,

sai ramesh

Read only

0 Likes
1,459

Hi Ramesh,

It will be greatly appreciable if u give me the code foer the same in session method.

Will be surely rewarded.

Regards