‎2007 Sep 10 5:00 AM
iam working on manual bdc program.
if we want to create a manual bdc program, shoudle we need a module pool program , screen no and transaction code?
so first should we want to create all these?
clear my doubts pls..
Regards,
pandu.
‎2007 Sep 10 5:07 AM
Hi ,
BDC are programs used to automate data entry through transactions.
So in order to write a BDC program we need to know the transaction name , the sequence in which the screens are called in the transaction and the fields in the transaction that need to be populated.
Regadrs
Arun
‎2007 Sep 10 5:07 AM
Hi ,
BDC are programs used to automate data entry through transactions.
So in order to write a BDC program we need to know the transaction name , the sequence in which the screens are called in the transaction and the fields in the transaction that need to be populated.
Regadrs
Arun
‎2007 Sep 10 5:14 AM
Thank u for your reply arun..
for eg iam tranfering vendor master data transaction code is xk01, then what is the screen number should i give here?
how can i find the screen number?
Regards,
swathi
‎2007 Sep 10 5:18 AM
Hi ,
Before a BDC is done we need to do a process called recording , this process is nothing else but simulationg the transaction , once the transaction is completed we get a list of all the screens and the fields that have been used during the transaction,
You will have to use this data in your BDC program.
There is an option by which you can convert this recorind into a program and then make the changes to suit your actual requirement,
The rtransaction for recoriding is <b>SHDB</b>. please check the transaction and feel free to revert back in case of any further queries.
Do assign points if reply is helpful.
Regards
Arun
‎2007 Sep 10 5:54 AM
Arun,
i know tha bdc program which is generated by the system, but talking about manual bdc program , we have write the code manually..
in the iam passing data like transaction code , screen number..
then how to fine screen nunber for that...
‎2007 Sep 10 6:04 AM
Please try the transaction <b>SHDB</b> first, in that perofrm a new recording with the tranasaction you want the BDC for .
Once the recording is done view your recording there you will find all the data you want to write your BDC.
Please try the transcation i.e. first perform the recording and still if you have any queries please feel free to revert back.
Regards
Arun
‎2007 Sep 10 6:13 AM
ya...
i did that one in that i got the program name and screen numbers also ..
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
record-LIFNR_001.
perform bdc_field using 'RF02K-EKORG'
record-EKORG_002.
perform bdc_field using 'RF02K-KTOKK'
record-KTOKK_003.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'LFA1-ANRED'
record-ANRED_004.
perform bdc_field using 'LFA1-NAME1'
record-NAME1_005.
perform bdc_field using 'LFA1-SORTL'
record-SORTL_006.
perform bdc_field using 'LFA1-LAND1'
record-LAND1_007.
perform bdc_field using 'LFA1-SPRAS'
record-SPRAS_008.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'LFM1-WAERS'
record-WAERS_009.
perform bdc_transaction using 'XK01'.
i got like this ..
i have two screen numbers in this ..
how to write the code for this?
Regards,
swathi.
‎2007 Sep 10 6:45 AM
ok arun ..
thanks a lot for ur help..
almost all i undersatand , i will try to write the program..
i will add the points to u ..
Regards,
pandu.
‎2007 Sep 10 7:12 AM
Hi ,
Thanks a lot and do feel free to revert back if you encounter some problems.
Regards
Arun
‎2007 Sep 11 5:41 AM
Hi arun,
i written the program .. can u pls check is it correct or not ?
bye iam not getting any output.
pls help me what should i do?
Regards,
pandu.
‎2007 Sep 11 5:43 AM
Hi arun,
i written the program .. can u pls check is it correct or not ?
bye iam not getting any output.
pls help me what should i do?
here is the program
REPORT ZBDCVENDOR
no standard page heading line-size 255 .
DATA: BEGIN OF ITAB OCCURS 2,
LIFNR_001(016) TYPE C,
EKORG_002(004) TYPE C,
KTOKK_003(004) TYPE C,
ANRED_004(015) TYPE C,
NAME1_005(035) TYPE C,
SORTL_006(010) TYPE C,
LAND1_007(003) TYPE C,
SPRAS_008(002) TYPE C,
WAERS_009(005) TYPE C,
END OF ITAB.
DATA BDC LIKE BDCDATA OCCURS 2 WITH HEADER LINE.
start-of-selection.
*perform open_dataset using dataset.
perform open_group.
PERFORM READ_DATA.
LOOP AT ITAB.
CLEAR BDC.
REFRESH BDC.
perform BDC_DYNPRO using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR' 'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RF02K-LIFNR' ITAB-LIFNR_001.
perform bdc_field using 'RF02K-EKORG' ITAB-EKORG_002.
perform bdc_field using 'RF02K-KTOKK' ITAB-KTOKK_003.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR' 'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'LFA1-ANRED' ITAB-ANRED_004.
perform bdc_field using 'LFA1-NAME1' ITAB-NAME1_005.
perform bdc_field using 'LFA1-SORTL' ITAB-SORTL_006.
perform bdc_field using 'LFA1-LAND1' ITAB-LAND1_007.
perform bdc_field using 'LFA1-SPRAS' ITAB-SPRAS_008.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR' 'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR' 'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR' 'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'LFM1-WAERS' ITAB-WAERS_009.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR' 'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
*perform bdc_transaction using 'XK01'.
ENDLOOP.
perform close_group.
*********************************************
FIRST FM -- OPEN GROUP
*********************************************
FORM OPEN_GROUP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'TEST'
KEEP = 'X'
USER = 'SAPUSER'.
ENDFORM. "OPEN GROUP
**********************************************
SECOND FM -- READ_DATA
*********************************************
FORM READ_DATA.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'H:\EMP.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB.
ENDFORM. "READ DATA
*********************************************
THIRD FM -- BDC_DYNPRO
*********************************************
FORM BDC_DYNPRO USING P_PROG
P_SCR.
BDC-PROGRAM = P_PROG.
BDC-DYNPRO = P_SCR.
BDC-DYNBEGIN = 'X'.
APPEND BDC.
ENDFORM. "BDC_DYNPRO
*********************************************
FOURTH FM -- BDC_FILED
*********************************************
FORM BDC_FIELD USING P_FNAM
P_FVAL.
CLEAR BDC.
BDC-FNAM = P_FNAM.
BDC-FVAL = P_FVAL.
APPEND BDC.
ENDFORM. "BDC_FIELD
*********************************************
FIFTH FM -- CLOSE_GROUP
*********************************************
FORM CLOSE_GROUP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. " CLOSE_GROUP
Regards,
pandu.