‎2005 Aug 25 8:09 PM
Hi All,
Can any one provide me with the coding to transfer the data from csv file to SAP using session method for creation of either customer or vendor, assuming that there are 200 transactions.
Thanks in advance.
Sri.....
Message was edited by: sriram Ponna
‎2005 Aug 25 8:23 PM
Use SHDB to record the transaction XK01 or XD01 and then choose the option to create a program. Make changes to the program to add the logic for upload file, split the record at comma into various fields of an internal table and then move the corresponding values to the BDC logic in a loop.
Srinivas
‎2005 Aug 25 8:23 PM
Use SHDB to record the transaction XK01 or XD01 and then choose the option to create a program. Make changes to the program to add the logic for upload file, split the record at comma into various fields of an internal table and then move the corresponding values to the BDC logic in a loop.
Srinivas
‎2005 Aug 27 4:21 PM
Please reward and close the post if answered, if not please revert back.
Srinivas
‎2005 Aug 27 4:40 PM
Twenty transactions - it will be a lot more efficient to have the users enter the data manually, rather than write and test a program to do this.
Rob
‎2005 Sep 08 12:14 AM
Very difficult to paste the whole code. I pasted small segment of the code assuming it will help you to jump start with the initial development.
As Srinivas said, do a recording using SHDB transaction for the transactions and make use of the code pasted below for your development.
START-OF-SELECTION.
PERFORM open_input_output_files.
PERFORM create_bdc_session.
PERFORM write_results.
END-OF-SELECTION.
&----
*& Form OPEN_INPUT_OUTPUT_FILES
&----
FORM open_input_output_files.
PERFORM open_input_file.
PERFORM open_output_error_file.
ENDFORM. " OPEN_INPUT_OUTPUT_FILES
&----
*& Form CREATE_BDC_SESSION
&----
FORM create_bdc_session.
PERFORM open_group.
i_xleg[] = i_leg[].
LOOP AT i_leg.
IF i_leg-po_nm = i_xleg-po_nm.
SKIP.
ELSE.
PERFORM read_xref_tables.
*-- First screen
CLEAR w_insert_line.
PERFORM bdc_dynpro USING 'SAPMM06E' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RM06E-BSART'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'EKKO-LIFNR' i_sap-lifnr.
PERFORM bdc_field USING 'RM06E-BSART' c_yb.
PERFORM bdc_field USING 'EKKO-EKORG' p_ekorg.
PERFORM bdc_field USING 'EKKO-EKGRP' i_sap-ekgrp.
PERFORM close_group.
ENDFORM. " CREATE_BDC_SESSION
Thanks,
Naren