2010 Aug 18 12:46 PM
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
2010 Aug 18 12:52 PM
Hi,
first check in your system...
go to se93-->enter CS02->hit where used list you will find the code in some programs
Prabhudas
2010 Aug 18 12:59 PM
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
2010 Aug 18 1:02 PM
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
2010 Aug 18 2:27 PM
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
2010 Aug 18 2:33 PM
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.
2010 Aug 19 6:28 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |