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

in BDC

Former Member
0 Likes
770

iam writing a BDC for standard transaction in this while entering values in table control how can i write the code to enter the values.

iam concatinating the table-field name with (var) but to increment the 'var' upto which value i have to increase.

bcoz as of now i don't know that how many rows in table control will appear in client system..

iam writing a BDC for standard transaction in this while entering values in table control how can i write the code to enter the values.

iam concatinating the table-field name with (var) but to increment the 'var' upto which value i have to increase.

bcoz as of now i don't know that how many rows in table control will appear in client system..

7 REPLIES 7
Read only

Former Member
0 Likes
728

Hi Vijay,

To avoid this problem while recording the standard transaction you have to use the option RECORD IN BACKGROUND MODE. If you use this the number of rows displayed while recording are only displayed in any system even if the resolution of the systems are diffrent.

Thanks and Regards,

Bharat Kumar Reddy.V

Read only

Former Member
0 Likes
728

The number of lines that wuld appear in any screen is the number of lines that you see in your recording(SHDB) recording.

To code irrepective of tfe visisble lines, you can hit the page down button to get the record to first or second line always.

Other option is to check if th etransaction has a 'POSITION' button which will take the item number as input and gets that line to the top.

check this link:

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

Regards,

Ravi

Read only

dani_mn
Active Contributor
Read only

Former Member
0 Likes
728

Hi

The number of rows depends on resultion of the pc where your BDC'll work.

If you use CALL TRANSACTION mode you can use the option OPTION

CALL TRANSACTION <TCODE> .....

OPTION FROM <opt>

<OPT> is like structure CTU_PARAMS where you can indicate to the defualt windows size setting the flag DEFSIZE.

If your program has the functionality to place to the top, u can simulate it to use only the first row.

If you can't u shoul try to understand how many rows can be displayed on line, for example:

DATA: V_LINE_MAX TYPE I VALUE 10,

V_COUNT TYPE I.

DATA: V_TC_INDEX(2) TYPE N.

LOOP AT ITAB.

V_COUNT = V_COUNT + 1.

IF V_COUNT > 10.

  • New-page: here you should insert the code to simulate * the page down.

V_COUNT = 1.

ENDIF.

MOVE V_COUNT TO V_TC_INDEX.

CONCATENATE <FIELD NAME> '(' V_TC_INDEX ')'

INTO BDC_FIELD_NAME.

ENDLOOP.

Max

Read only

Former Member
0 Likes
728

Hi Vijay,

if you know the item table no of lines by describing it. Do it so many times with in the loop.

Madhavi.

Read only

Former Member
0 Likes
728

hi,

you can fix the screen size to default which will always have same no of rows in the table control.

Use the code

*-- Structure for Parameter string for runtime of CALL TRANSACTION
  data : x_ctu_params type ctu_params.
* To have default screen size, mode and update
    x_ctu_params-defsize = 'X'.
    x_ctu_params-dismode = 'N'.
    x_ctu_params-updmode = 'S'.

Now, the table control will have same no of rows everytime. Hope this helps.

Regards,

Richa

Read only

Former Member
0 Likes
728

This message was moderated.