Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Session Method

Former Member
0 Likes
579

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
561

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

4 REPLIES 4
Read only

Former Member
0 Likes
562

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

Read only

0 Likes
561

Please reward and close the post if answered, if not please revert back.

Srinivas

Read only

Former Member
0 Likes
561

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

Read only

0 Likes
561

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