Application Development 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: 

kindly help (buisness object types)

Former Member
0 Kudos

hi all,

I would be extremely gratefull for your help.

This program uploads data from excel into internal table IT_RECORD.Now i want to post this data in transaction

f-02 using LSMW & bapi.please tell me the buisness object type & how would it be achieved .

thanking in advance.

data: itab like alsmex_tabline occurs 0 with header line.

Types: begin of t_record ,

order LIKE ITAB-VALUE,

EMPLOYEE like itab-value,

costcenter like itab-value,

END OF T_RECORD.

DATA: IT_RECORD TYPE STANDARD TABLE OF T_RECORD INITIAL SIZE 0,

WA_RECORD TYPE T_RECORD.

DATA: GD_CURRENTROW TYPE I.

PARAMETER P_INFILE LIKE RLGRAP-FILENAME.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = P_INFILE

i_begin_col = '1'

i_begin_row = '2'

i_end_col = '14'

i_end_row = '31'

tables

intern = ITAB

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

SORT ITAB BY ROW COL.

READ TABLE ITAB INDEX 1.

GD_CURRENTROW = ITAB-ROW.

LOOP AT ITAB .

IF ITAB-ROW NE GD_CURRENTROW.

APPEND WA_RECORD TO IT_RECORD.

CLEAR WA_RECORD.

GD_CURRENTROW = ITAB-ROW.

ENDIF.

case itab-col.

WHEN '0001'.

WA_RECORD-ORDER = ITAB-VALUE.

WHEN '0002'.

WA_RECORD-EMPLOYEE = ITAB-VALUE.

WHEN '0003'.

WA_RECORD-COSTCENTER = ITAB-VALUE.

ENDCASE.

ENDLOOP.

APPEND WA_RECORD TO IT_RECORD.

LOOP AT IT_RECORD INTO WA_RECORD.

WRITE:/(10) WA_RECORD-ORDER, SY-VLINE,

(10) WA_RECORD-EMPLOYEE, SY-VLINE,

(10) WA_RECORD-COSTCENTER , SY-VLINE.

ENDLOOP.

3 REPLIES 3

Former Member
0 Kudos

Hi

I think you should use BO BUS6035, it's linked to the BAPI BAPI_ACC_DOCUMENT_POST

Max

0 Kudos

hi max,

can u please elobrate.

regards

Former Member
0 Kudos

Hi,

Check the following BOs

BUS6030

BUS6035

BUS3006.

Hope this help.