2014 May 23 10:00 AM
Hi Guru's
I am using BAPi : BAPI_SALESORDER_CREATEFORMAT2 for Data migration. My input file is Excel.
in single file they gave both header and item.
I need to split it header in to header internal table and item in to item internal table.
I am using function module to convert excel to internal table.
ALSM_EXCEL_TO_INTERNAL_TABLE
Its working fine.
How to split that header and item.
Thanks & Regards,
Meenachi
Hi Guru's
I am using BAPi : BAPI_SALESORDER_CREATEFORMAT2 for Data migration. My input file is Excel.
in single file they gave both header and item.
I need to split it header in to header internal table and item in to item internal table.
I am using function module to convert excel to internal table.
ALSM_EXCEL_TO_INTERNAL_TABLE
Its working fine.
How to split that header and item.
Thanks & Regards,
Meenachi
2014 May 23 10:11 AM
Hi Meenachi,
Can you share how data are differentiated as Header and Item in excel ?
Thanks & Regards,
arun
2014 May 23 10:21 AM
Thanks For reply arun and always learner
for ex excel sheet
Hdr Hdr Hdr Hdr plant mat quantoty
001 IN 001 02 1000 100 1
001 IN 001 02 1002 101 2
001 IN 001 02 1003 102 3
002 IN 001 02 1000 100 1
002 IN 001 02 1002 101 3
002 IN 001 02 1006 102 5
No link between hdr and itm
2014 May 24 6:42 AM
Hi Meenachi ,
Going through the excel , I think first column is the key in header
so you can transport the data into internal table ( itab ) and then follow the code as below.
LOOP AT itab INTO wa.
wa_temp = wa.
AT NEW Hdr.
MOVE-CORRESPONDING wa_temp TO wa_h.
APPEND wa_h TO itab_h.
CLEAR : wa_h , wa_temp.
ENDAT.
MOVE-CORRESPONDING wa TO wa_i.
APPEND wa_i TO itab_i.
CLEAR wa_i.
CLEAR : wa , wa_temp.
ENDLOOP.
Hope this will help you
Thanx and Regards ,
Yogendra Bhaskar
2014 May 23 10:15 AM
hi,
Pls go through this.
Various steps involved in posting a document from a file are:
2014 May 23 10:23 AM
Hello Meenachi,
There will be some indicator (eg H for Header , L for Line item) in excel.
1. Use GUI_upload fm to upload the file
2. loop internal table and based on indicator move the rows to either header or item table.
Thanks
2014 May 24 6:19 AM
Hello Meenachi,
No challenge here just convert your excel data to internal table and read the first line this will be header rest of the entries are items.
LOOP AT LT_TAB ASSIGNING <LS>.
TRANSLATE <LS>-VALUE TO UPPER CASE.
CASE <LS>-COL.
WHEN '0001'.
LS_SERCOMBO-ZPOSTCODE = <LS>-VALUE.
WHEN '0002'.
LS_SERCOMBO-ZCOMDGRP = <LS>-VALUE.
WHEN '0003'.
LS_SERCOMBO-ZVESSELGRP = <LS>-VALUE.
WHEN '0004'.
LS_SERCOMBO-ZSERCOMBO = <LS>-VALUE.
ENDCASE.
AT END OF ROW.
APPEND LS_SERCOMBO TO LT_SERCOMBO.
CLEAR LS_SERCOMBO.
ENDAT.
ENDLOOP.
Now LT_SERCOMBO contains header and items
read with index 1-will be header
rest of the records are item entries.
What is your challenge tell me.
Regards,
Vadamalai A
2014 May 24 7:50 AM
hi vaamalai,
you are correct .. but for second sales order how yo will read/
Meena
2014 May 24 8:22 AM
Hello Meenachi,
use at new statement for change of sales order from your excel extracted itab.
for eg:
at new vbeln.
-
-
-
-
end at.
Regards
Ritesh
2014 May 24 8:05 AM
you mean to say each sales order contains header?
Regards,
Vadamalai A
2014 May 24 12:06 PM
2014 May 24 12:39 PM
Hi Meenachi,
You can use Two sheets in Excel . Consider sheet 1 contains header data and sheet two contains item data. commonly declare one Column for key field to link two sheets.
Regards
Thangam.P
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |