2008 May 21 5:51 AM
Hi,
Can any one send me the coding for BDC 'XK01' along with the upload file in .txt format please its urgent for me
Hi,
Can any one send me the coding for BDC 'XK01' along with the upload file in .txt format please its urgent for me
2008 May 21 6:00 AM
2008 May 21 6:10 AM
Hi ,
See below code, it may help you.
report Z_VER_XK01_RPG no standard page heading line-size 255.
include bdcrecx1.
types : begin of typ_itab,
lifnr type lifnr,
burks type bukrs,
ekorg type ekorg,
ktokk type ktokk,
name1 type name1,
sortl type sortl,
land1 type land1,
akont type akont,
fgdrv type lfb1-fdgrv,
waers type lfm1-waers,
end of typ_itab.
data : it_itab type standard table of typ_itab initial size 0,
wa_itab type typ_itab,
v_file like rlgrap-filename,
u_file type string.
parameters : p_file like rlgrap-filename.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = v_file.
if v_file is not initial.
p_file = v_file.
endif.
start-of-selection.
u_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = u_file
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_itab.
perform open_group.
LOOP AT it_itab INTO wa_itab.
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' wa_itab-lifnr.
perform bdc_field using 'RF02K-BUKRS' wa_itab-burks.
perform bdc_field using 'RF02K-EKORG' wa_itab-ekorg.
perform bdc_field using 'RF02K-KTOKK' wa_itab-ktokk.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR' 'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'LFA1-NAME1' wa_itab-name1.
perform bdc_field using 'LFA1-SORTL' wa_itab-sortl.
perform bdc_field using 'LFA1-LAND1' wa_itab-land1.
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' '0210'.
perform bdc_field using 'BDC_CURSOR' 'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'LFB1-AKONT' wa_itab-akont.
perform bdc_field using 'LFB1-FDGRV' wa_itab-fgdrv.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR' 'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR' 'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE' '/00'.
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' wa_itab-waers.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR' 'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE' '=UPDA'.
perform bdc_transaction using 'XK01'.
ENDLOOP.
Regards,
Vishvesh
if helpful, rewards it
2008 May 21 6:19 AM
Hi, Visvesh your coding is good but I need the upload file also to run your code please do it
2008 May 21 6:35 AM
See below records, the following sample flat file based on the sequence of it_itab which given before,
101 100010000001Testcust1 TC1 IN 31000 A1 INR
102 100010000001Testcust2 TC2 IN 31000 A1 INR
103 100010000001Testcust3 TC3 IN 31000 A1 INR
104 100010000001Testcust4 TC4 IN 31000 A1 INR
105 100010000001Testcust5 TC5 IN 31000 A1 INR
let me know if any clarification need
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |