cancel
Showing results for 
Search instead for 
Did you mean: 

Vendor master upload from excel using standard program rfbikr00

0 Kudos

Hi, what I am trying to do is to upload the vendors from excel file to the transaction xk01. So, I have two parameters, one for local file ( presentation server) and the one for application server . I have managed to finish the first part of uploading the vendors from excel file into a internal table and to upload them to the transaction xk01 using a batch input method. The problem that I have now is to upload the vendors in the application server using the standard program rfbikr00.I have written something for dataset but is not working and I don't know how to continue ( the problem is writing the dataset and transfering the data to p_af). For this I need the following structures BGR00, BLF00, BLFA1, BLFB1, BLFM1 . The fields that I am using for this program are : vendor companycode purchasingorg accountgroup name searchterm country taxnumber dateofbirth firstname1 name1 departament1 function1 firstname2 name2 departament2

function2 sortkey cashmgmntgroup paymentterms chkcashngtime currency termsofpaymnt

inco1 inco2.

I have attached a sample of my code( it's not all the code) but I need help in order to figure out how to finish it( the dataset for transfering data and writing on the app server) and how to write in the dataset the remaining structures BLF00, BLFA1, BLFB1, BLFM1) . Thank you!

TYPES : BEGIN OF ty_tab1,
ktokk TYPE ktokk,
lifnr TYPE lifnr,
bukrs TYPE bukrs,
ekorg TYPE ekorg,
name1 TYPE name1,
sortl TYPE sortl,
name2 TYPE name2,
land1 TYPE land1,
stcd1 TYPE stcd1,
namev TYPE namev,
abtnr1 TYPE abtnr,
abtnr2 TYPE abtnr,
pafkt1 TYPE pafkt,
pafkt2 TYPE pafkt,
akont TYPE akont,
zuawa TYPE lfb1-zuawa,
fdgrv TYPE fdgrv,
zterm TYPE lfb1-zterm,
kultg(3) TYPE c,
waers TYPE waers,
anred TYPE anred,
zterm1 TYPE lfm1-zterm,
namev1 TYPE namev,
namev2 TYPE namev,
name12 TYPE name1,
name13 TYPE name1,
gbdat TYPE datum,
reprf TYPE lfb1-reprf,
inco1 TYPE lfm1-inco1,
inco2 TYPE lfm1-inco2,
END OF ty_tab1.
DATA :  gv_file  LIKE rlgrap-filename,
gv_error TYPE flag,
gv_path TYPE c LENGTH 5000,
gs_bgr00 TYPE bgr00,
gs_blf00 TYPE BLF00,
gs_blfa1 TYPE BLFA1,
gs_blfb1 TYPE blfb1,
gs_blfm1 TYPE blfm1.
DATA:it_tab3 TYPE TABLE OF alsmex_tabline WITH HEADER LINE,
file TYPE rlgrap-filename.
DATA it_bdcdata TYPE TABLE OF bdcdata WITH HEADER LINE.
DATA : it_tab2 TYPE TABLE OF ty_tab1 WITH HEADER LINE,
wa_tab2 TYPE ty_tab1,
w_message(100) TYPE c.
CONSTANTS: gc_x(1)          TYPE c VALUE 'X',
gc_path(8) TYPE c VALUE '/tmp',
gc_slash TYPE c VALUE '/',
gc_uline TYPE c VALUE '_',
gc_e TYPE c VALUE 'E'.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE s1.

PARAMETERS: p_local TYPE ibipparms-path,
p_exp AS CHECKBOX USER-COMMAND check,
p_af TYPE rlgrap-filename DEFAULT 'E:\usr\sap\IDS\DVEBMGS00\work\'.

SELECTION-SCREEN END OF BLOCK block1.
FORM server_file .


OPEN DATASET p_af FOR INPUT IN TEXT MODE ENCODING DEFAULT .
IF sy-subrc <> 0.
gv_error = gc_x.
MESSAGE s003().
ENDIF.
 LOOP AT it_tab2 INTO wa_tab2.
gs_bgr00-stype = '0'.
gs_bgr00-group = 'IC'.
gs_bgr00-mandt = sy-mandt.
gs_bgr00-usnam = sy-uname.
gs_bgr00-start = ' '.
gs_bgr00-xkeep = 'X'.
gs_bgr00-nodata = '/'.
TRANSFER gs_bgr00 TO p_af.
ASSIGN gs_bgr00 TO FIELD-SYMBOL(<fs_field1>).
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_field1> TO FIELD-SYMBOL(<fs_f1>).
IF sy-subrc = 0 AND <fs_f1> IS NOT ASSIGNED.
<fs_f1> = '/'.
ELSEIF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
  CLOSE DATASET p_af.

ENDFORM.
 SUBMIT rfbikr00 WITH ds_name = p_af
WITH xlog = 'X'
AND RETURN.




0 Kudos

Hi jonm47

We are facing the same issue while doing this. Did you solve this issue? If yes can you provide a solution.

Thanks

Accepted Solutions (0)

Answers (0)