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: 

Using alsm function module to upload quotations from excel file

Former Member
0 Kudos

hi all,

I am using ALSM_EXCEL_TO_INTERNAL_TABLE to upload quotaions from a test

file.

qt 1000 dfue m-20

m-17

m-08

qt 1000 dfue m-17

m-20

m-07

the xcel file structure is like above.

iam able to read the quotation header data into one internal table

it_header and material data into it_item.but when iam uploading this in the

item data all the materials are coming.i mean to say for 2 quotations

all the materials are being copied.

the problem iam facing is i need to validate item data according to

each quotation (each header).

so that those for ex. as above the item data corresponds to particular

quotation.

the code iam using is as given below.the above test file is just to show how iam taking it in flat file.

loop at it_excel.

  • Reset values for next row

if it_excel-row ne gd_currentrow.

append wa_record to itab19.

clear wa_record.

gd_currentrow = it_excel-row.

endif.

*clear wa_record.

case it_excel-col.

when '0001'.

wa_record-v_auart = it_excel-value.

temp = temp + 1.

when '0002'.

wa_record-V_VKORG = it_excel-value.

when '0003'.

wa_record-V_VTWEG = it_excel-value.

when '0004'.

wa_record-V_spart = it_excel-value.

when '0005'.

wa_record-v_vkbur = it_excel-value.

WHEN '0006’.

WA_RECORD-V_BSARK = IT_EXCEL-VALUE.

WHEN '0007’.

WA_RECORD-V_BNAME = IT_EXCEL-VALUE.

  • append wa_record to it_header.

  • it_excel-row = it_excel-row + 1.

append wa_record to it_header.

when '0008’.

IF V_AUART IS INITIAL.

wa_record1-v_matnr1 = it_excel-value.

ENDIF.

when '0009’.

IF V_AUART is not initial .

wa_record1-v_kwmeng1 = it_excel-value.

ENDIF.

append wa_record1 to it_item.

endcase.

ENDLOOP.

any help on this issue would be appreciated.

thanks and regards,

ahmed

Message was edited by: parvez ahmed

1 REPLY 1

former_member181962
Active Contributor
0 Kudos

HI Ahmed,

YOur item internal table should have some fields which are already there in the header table.so that you can tell that the item belongs to a particular item.

Here in your item table there are no fields that connect the item to a header record.

Regards,

ravi