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

idocs

Former Member
0 Likes
580

hi guys,

I am stuck with the following assignment!!

I am supposed to store the mandatory fields required to create business partners in an excel sheet and then using idocs i have to create new business partners based on the data in excel sheet.That is import data from excel sheet using idocs into the sap system for creation of business partners.

I am totally stuck.please tell me how to start.

regards

shilpi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
546

HI,

Upload the excel sheet data into the internal table . Then fill the idocs with the internal table data send idocs.

EXCEL UPLOADING:

REPORT ZEXCEL_ITAB .

TYPES : BEGIN OF TY_ITAB ,

V1 TYPE C,

V2(10) TYPE C,

V3(10) TYPE C,

V4(10) TYPE C,

END OF TY_ITAB.

DATA : ITAB TYPE TABLE OF TY_ITAB,

WITAB TYPE TY_ITAB.

DATA:JTAB TYPE TABLE OF ALSMEX_TABLINE ,

WJTAB TYPE ALSMEX_TABLINE .

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'D:\Documents and Settings\hzb14v.APAC\Desktop\Book1.xls'

I_BEGIN_COL = 1

I_BEGIN_ROW = 1

I_END_COL = 4

I_END_ROW = 3

TABLES

INTERN = JTAB.

LOOP AT JTAB INTO WJTAB.

CASE WJTAB-COL.

WHEN '0001'.

MOVE: WJTAB-VALUE TO WITAB-V1.

WHEN '0002'.

MOVE: WJTAB-VALUE TO WITAB-V2.

WHEN '0003'.

MOVE: WJTAB-VALUE TO WITAB-V3.

WHEN '0004'.

MOVE: WJTAB-VALUE TO WITAB-V4.

ENDCASE.

AT END OF ROW.

APPEND WITAB TO ITAB.

CLEAR WITAB.

ENDAT.

CLEAR WJTAB.

ENDLOOP.

Link for creating IDOCS:

[http://sapabapnotes.blogspot.com/2008/05/sample-abap-program-for-create-idoc.html]

Reward points if helpful.

Thanks and Regards

hi guys,

I am stuck with the following assignment!!

I am supposed to store the mandatory fields required to create business partners in an excel sheet and then using idocs i have to create new business partners based on the data in excel sheet.That is import data from excel sheet using idocs into the sap system for creation of business partners.

I am totally stuck.please tell me how to start.

regards

shilpi

2 REPLIES 2
Read only

Former Member
0 Likes
546

Hi,

create an Idoc /check if standard Idoc exists.

create a report program . Do the following in the program :

-upload the excel file into the internal table in the abap program using CL_GUI_FRONTEND_SERVICES=>gui_upload

-after getting the excel data into internal table, use the data to populate the IDOC structure programatically

-Post the IDOC programatically

Regards,

Pls reward points if useful

Shruthi R

Read only

Former Member
0 Likes
547

HI,

Upload the excel sheet data into the internal table . Then fill the idocs with the internal table data send idocs.

EXCEL UPLOADING:

REPORT ZEXCEL_ITAB .

TYPES : BEGIN OF TY_ITAB ,

V1 TYPE C,

V2(10) TYPE C,

V3(10) TYPE C,

V4(10) TYPE C,

END OF TY_ITAB.

DATA : ITAB TYPE TABLE OF TY_ITAB,

WITAB TYPE TY_ITAB.

DATA:JTAB TYPE TABLE OF ALSMEX_TABLINE ,

WJTAB TYPE ALSMEX_TABLINE .

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'D:\Documents and Settings\hzb14v.APAC\Desktop\Book1.xls'

I_BEGIN_COL = 1

I_BEGIN_ROW = 1

I_END_COL = 4

I_END_ROW = 3

TABLES

INTERN = JTAB.

LOOP AT JTAB INTO WJTAB.

CASE WJTAB-COL.

WHEN '0001'.

MOVE: WJTAB-VALUE TO WITAB-V1.

WHEN '0002'.

MOVE: WJTAB-VALUE TO WITAB-V2.

WHEN '0003'.

MOVE: WJTAB-VALUE TO WITAB-V3.

WHEN '0004'.

MOVE: WJTAB-VALUE TO WITAB-V4.

ENDCASE.

AT END OF ROW.

APPEND WITAB TO ITAB.

CLEAR WITAB.

ENDAT.

CLEAR WJTAB.

ENDLOOP.

Link for creating IDOCS:

[http://sapabapnotes.blogspot.com/2008/05/sample-abap-program-for-create-idoc.html]

Reward points if helpful.

Thanks and Regards