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

how to write bdc programme to load the data in table control

Former Member
0 Likes
1,263

Hi

i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode

thanks and regards

naveen

Hi

i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode

thanks and regards

naveen

6 REPLIES 6
Read only

Former Member
0 Likes
1,105

Hi,

first check in your system...

go to se93-->enter CS02->hit where used list you will find the code in some programs

Prabhudas

Read only

Former Member
0 Likes
1,105

Hi Naveen,

See the sample code

PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29N-DATUV'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=KALL'.

PERFORM bdc_field USING 'RC29N-MATNR'

w_matnr.

PERFORM bdc_field USING 'RC29N-WERKS'

w_werks.

PERFORM bdc_field USING 'RC29N-STLAN'

'1'.

PERFORM bdc_field USING 'RC29N-DATUV'

'01/01/2004'.

PERFORM bdc_dynpro USING 'SAPLCSDI' '2110'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=FCPU'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29K-BMENG'.

PERFORM bdc_field USING 'RC29K-BMENG'

w_testuph.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29P-MENGE(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=FCBU'.

PERFORM bdc_field USING 'RC29P-MENGE(01)'

w_testuph.

"For raw material.

IF NOT w_raw_mat_fg IS INITIAL.

PERFORM bdc_field USING 'RC29P-MENGE(02)'

w_testuph.

ENDIF.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29P-POSNR'.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29P-POTX1'.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29P-POSNR'.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RC29P-POTX1'.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.

CALL TRANSACTION 'CS02' USING bdcdata MODE w_display_mode UPDATE 'S'

MESSAGES INTO t_message_tab.

Prabhudas

Read only

Former Member
0 Likes
1,105

Hi,

go to trx SHDB, select New recording, enter a name and CS02 for Transaction code and Start recording.

After you have saved your recording, select your recording in the next screen and click on Program. That is not only your sample coded, you can copy that code into your programme.

Roy

Read only

Former Member
0 Likes
1,105

Hi,

Just as index in () along with the field names in table control

Like


ZBGR-KOKRS(01)
ZBGR-KOKRS(02)
ZBGR-KOSTL(01)
ZBGR-KOSTL(02)

this u can do programically also.

Thanks,

Anmol

Read only

Former Member
0 Likes
1,105

Hey Naveen,

Please go through the below link.

http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm

I would say there are few methods to do the table control, but prefer doing it with SPLIT.

Disha.

Read only

Former Member
0 Likes
1,105

Hi Gurivi,

You need to take care of one thing.

While you find table row index of table control, you need to check how much entry you can enter by ZBGR-KOKRS(01) to ZBGR-KOKRS(02) like this, if you filled all 10 or 15 entries in table control & you need more rows to fill your all rows then you have to use ok code as 'P+' it will page down the table control & then again you can start from ZBGR-KOKRS(02) & so on.

Hope this helps.