How to handle multiple line items in lsmw
hi all,
how can i handle multiple line items in lsmw either by using direct input method or BDC recording.
first preference is Bdc recording in lsmw . can u tell me the steps in detail.
thanks,
harini.c
Hi Harini,
Check this link.
BDC - Header with multiple line items.
Regards,
Arun
Similar Messages
-
How to insert multiple line items in fv60 using bdc.
Hi all,
How to insert multiple line items in fv60 using bdcshi
chk this
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : V_EBELP(30) , V_MENGE(30) , V_WERKS(30), V_EMATN(30) ,
V_PEINH(30).
DATA : FILE TYPE STRING, V_MSG(100) , V_IND(2) TYPE N , FLAG VALUE 'X'.
PARAMETERS: P_FILE(50) TYPE C DEFAULT 'C:\ME21_TEST'.
DATA : BEGIN OF ITAB OCCURS 0,
IND(02),
LIFNR_001(010),
data element: BSART
BSART_002(004),
data element: BEDAT
data element: EKORG
EKORG_004(004),
EKGRP_006(003),
data element: LPEIN
LPEIN_005(001),
data element: EMATNR
EMATN_01_007(018),
data element: EWERK
WERKS_01_008(004),
data element: EPEIN
PEINH_01_009(006),
data element: EWERK
MENGE_01_013(017),
data element: AUFEP
EBELP_014(005),
data element: AUFEP
END OF ITAB.
START-OF-SELECTION.
FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
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 IND.
START-OF-SELECTION.
LOOP AT ITAB.
REFRESH IT_MESSAGES.
<b>V_IND = V_IND + 1.</b>
<b>AT NEW IND.</b>
<b>READ TABLE ITAB INDEX SY-TABIX.</b>
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0100'.
PERFORM BDC_FIELD USING 'EKKO-LIFNR'
ITAB-LIFNR_001.
PERFORM BDC_FIELD USING 'RM06E-BSART'
ITAB-BSART_002.
*perform bdc_field using 'RM06E-BEDAT'
ITAB-BEDAT_003.
PERFORM BDC_FIELD USING 'EKKO-EKORG'
ITAB-EKORG_004.
PERFORM BDC_FIELD USING 'RM06E-LPEIN'
ITAB-LPEIN_005.
PERFORM BDC_FIELD USING 'EKKO-EKGRP'
ITAB-EKGRP_006.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
ENDAT.
<b>PERFORM BDC_DYNPRO USING 'SAPMM06E' '0120'.
CONCATENATE 'EKPO-EMATN(' V_IND ')' INTO V_EMATN.
PERFORM BDC_FIELD USING V_EMATN
ITAB-EMATN_01_007.
CONCATENATE 'EKPO-WERKS(' V_IND ')' INTO V_WERKS.
PERFORM BDC_FIELD USING V_WERKS
ITAB-WERKS_01_008.
CONCATENATE 'EKPO-PEINH(' V_IND ')' INTO V_PEINH.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0120'.
PERFORM BDC_FIELD USING V_PEINH
ITAB-PEINH_01_009.
*CONCATENATE 'EKPO-MENGE(' V_IND ')' INTO V_MENGE.
*perform bdc_dynpro using 'SAPMM06E' '0120'.
*perform bdc_field using V_MENGE
ITAB-MENGE_01_013.
*CONCATENATE 'EKPO-EBELP(' V_IND ')' INTO V_EBELP.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0120'.
PERFORM BDC_FIELD USING 'RM06E-EBELP'
ITAB-EBELP_014.</b>PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
AT END OF IND.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
ENDAT.
CALL TRANSACTION 'ME21' USING IT_BDCDATA MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
LOOP AT IT_MESSAGES WHERE MSGTYP = 'E' OR MSGTYP = 'A'.
IF FLAG = 'X'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'GAMY_FAILURE'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR FLAG.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'ME21'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGES-MSGID
LANG = 'EN'
NO = IT_MESSAGES-MSGNR
V1 = IT_MESSAGES-MSGV1
V2 = IT_MESSAGES-MSGV2
V3 = IT_MESSAGES-MSGV3
V4 = IT_MESSAGES-MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
WRITE : / V_MSG.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDLOOP.
IF FLAG NE 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 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.
ENDIF.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA. -
How to Update multiple line Items in Sales order Interactive form
Hi,
I have created one online interactive form for sales order. In that I incorporated dynamic table logic .i.e. we can add row and delete row using buttons. Interactive form is working fine with one line item. But if I give multiple lines in table (line item) its creating sales order with single line item. So please help me how to pass multiple lines.
Thanks & Regards,
Krishna.Hi,
Check out this link, this deals with the problem you are facing.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
Regards,
Runal -
Unable to create PO with multiple line items through LSMW-BAPI method
Hi All,
I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
It seems that through LSMW-BAPI it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
BR,
Atanu MukherjeeSolved by myself.
Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA. Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
H~header data
I~item data
I~item data
This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
BR,
Atanu Mukherjee -
SNC5.1- How to Publish multiple line items in SNC Web UI (Supplier view)
Hi Experts,
I am working in SAP SNC Supplier Collaboration project. I have a scenario where i am trying to "Publish PO" for multiple line items in Web UI. I am able to confirm each PO line item and Save PO. But if i try to publish one line item at a time, then the system publishes the 1st line item and it does not allow me to publish the remaining PO line items.
All i can do is, Confirm and Save all line items, and then "publish" it at the end. In this way,i can view all the confirmed line items (POA) in SNC. But how do I Confirm/Save/Publish each PO line item?
Appreciate your help.
Regards,
dmohiteHi dmohite,
As the POC standard process Supplier should give confirmation for all PO items after confirmation of all items it should allow to Published the PO at Header level.
If supplier does not give confirmation for all items it should not allowed to Published the PO at Header level but you are able Published the PO at header level without confirmation of all PO items.
You can implement note no: 1320445 (manual implementation is required).
After implementation of this note without confirmation of all PO items it won't allow to publish the PO at header level.
Please let me know for any clarification.
Regards,
Nikhil -
How to Create multiple line items
Hi
I have created a web dynpro application that accesses BAPI_REQUISITION_CREATE to create a requisition. The application so far creates a requisition with only one line item.
How do I capture details about multiple line items from the user before submitting the form to create the requisition.
Thanks in advance for your help.
SriramHi Sriram,
Create a form where u enter the requisition details of one line item.Suppose say if u have a button Add another Line Item on click of that fill a value node say
RequsitionDetails of cardinality 0-n and clear the form.If u want u can also show the added item in a table below by bindin the data source to RequistionDetails. Now the user can enter another line item in the form.Similarly now he can enter multiple line items.On click of Submit u submit the records in the RequistionDetails node.Add all these records to the table parameter which u r passing.
BAPI_REQUISITION_CREATE_Input input = new BAPI_REQUISITION_CREATE_Input();
wdContext.node<<>>.bind(input);
for(int index=0;index<wdContex.nodeRequsitionDetails().size();index++)
zTestStruc test = new zTestStruc();
test.setattr1(wdContex.nodeRequsitionDetails().getRequsitionElementAt(index).getattr1());
input.add<<>>(test);
Hope this solves.
Regards,
Sowjanya. -
LSMW - ME21 How to map multiple line items
Hi all,
I am using LSMW tool with batch input recording technique to create POs via ME21. I have defined source structures as HEAD with POSI as its subordianted structure. This settings worked perfectly for one single item line. However, it created a new transaction for each line item in the file. I did some searches in this forum and I noticed that someone suggested to dynamically set the line positon at the processing points. I tried a few times and could not get it work. Anyone knows how to map multiple items in LSMW, please help.
Here is part of my recording:
EKPO-EMATN(01) 000995NM
EKPO-MENGE(01) 1 RM06E-EEIND(01) 2006.04.27 EKPO-NETPR(01) 10 EKPO-WERKS(01) 0001 EKPO-LGORT(01) 0001
My input file looks like this:
H 77777400 NB2006.05.140001001T
L000995NM00000000052006.05.15 1000010001CAON
L000998NM00000000052006.05.15 1000010001CAON
H 77777400 NB2006.05.140001001T
L000995NM00000000052006.05.15 1000010001CAON
Thanks!Hi
If you have used a b.i. recording, all abap code is inserted in std table /SAPDMC/LSGBDC.
The program to generate the B.I. session is automatically created when you run "Create Batch Input Session" step.
What means the numbers of items you can insert depend on the totals of items you have used while creating your b.i. recording:
If you have simulated to insert only one item, you'll be able to insert only one item in your project.
So you should simulate to insert severals items not only one, but I think it should be better you use a std method to create PO by LSMW:
- Std B.I: object 0085, method 0001 (RM06EEI0);
- BAPI : object BUS2012, method CREATEFROMDATA1
Max -
hi,
How to load multiple material in line item level for a sales order conversion.step wise explanation would be appreciated.
cheers,
sanjayHi Sanjay,
Lets assume ur file structure for header and item is like this.
Header : ORDERNO ORDERTYPE field1 field2.
Item : ORDERNO VORNR MATNR QTY.
As u can see in the input file the header and item orders are linked through the common field ORDERNO. In most of SAP systems external numbering for sales order is not allowed even though it is necessary to maintain a common field between the header and item files even if they are not mapped to sap database. Ur input file contains entries like-
Header : 1000 OR 100.00 20.00
1001 RT 50.00 10.00
Item : 1000 0010 Material1 10.00
1000 0020 Material2 10.00
1001 0010 Material1 10.00
Please fallow the fallowing steps.
1. Create a structure for header with all the necessay header fields.
2. Create a structure for item below the header in the hierarchy level and use a common field from header into the item. ( both of them should have same name and should be the first field in the structure).
3. After mapping it to the standard lsmw or custom program structure create two flat files with structure similar to the structure mentioned above and upload the data.
I hope my info helps u in some way.
Sharath Kumar. -
How to Print Multiple line items(only the one's that are selected in va22)
Hello All ,
My smartform should print the multiple selected line items that i as a user should be able to see as the output .
In my case i dont have any program that calls the transaction va22
directly from the transaction VA22 i give the ISSUE OUTPUT TO .
The Driver program that calls my smartforms fetches the data from table VBAP .
Two cases that i get because of this fetching logic .
1. When i try to fetch the data based on only VBELN in the output i get all the items that are in the particular Quotation .
2 . When i try to fetch data based on VBELN and POSNR in the ouptut when i select multiple items and give print the first item that i i selected is displayed .
Now what i need is to print only those data that i select in VA22 .
say if there are items A, B , C, D ,E in the Quotation .
and before printing i select A , C , D then only those items should be printed .
I hope any one of the Experts can solve my problem .
Thanks & Regards
FaranHi
I think you will need to do some enhancemwnt for this. What you can do select the lines in table comtrol and before issuing output you need to find a suitable wnhancement place where you can export the selected lines and make the corresponding change in logic for the same?.
Secondly uou can make a custom report also where user will select lines of po and print..but in this way you will need to many calculations
Nabheet -
ECATT questions regarding handling multiple line items in test data conatin
Hi all,
We are using ECATT for automation.
We do have a query .
The Question is
When we have
Ist level Header information [One entry per header]
IInd level Item Level information [Per Header Multiple item entries is possible]
For eg.
Header
Sales ordno Customer
S001 C001
Item
Salesordno itemNo Material
S001 001 M001
S001 002 M002
We need to call an API for creating the salesorder using ECATT .We want to achieve the same with test data container.
How we can approach this?
Reg,
Ganesh
Message was edited by:
GaneshKumar Phi,
you can do that by using ABAP...ENDABAP statement.
By using this command you can write any ABAP login in between.
and u can also call RFC's, BAPI in between.
all you need to do is wirte your ABAP code in se38 and make sure that its working fine. then copy ur code to ecatt tool and pleace that in between ABAP...ENDABAP statements.
hope this helps.
>>reward if this helps.
regards,
kvr -
Create Quotation (ME41) with multiple lines item
Hi All,
Do you guys know how to create a quotation (ME41) with a multiple lines item with LSMW ?
I'm considering create a LSMW with a BAPI just like "CREATEFROMDATA1 (for create PO)" so it has a HeaderData and also ItemData.
I also looked on the BAPI, but couldn't find any BAPI for quotation.
Any suggestion?
Thx uHope this could help u...
BAPI for RFQ Creation (ME41) -
Hi all,
I wana pass multiple line items thru bdc me21n....can any1 please help me .if u guys have some code can mail me at [email protected] will be rewarded.
my code below is not working for passing multiple items.
report y1_po_test
no standard page heading line-size 255.
tables: mara,
lfa1,
eina,
eine,
eban,
zdrgsah, zdrgsap,
zdrgsup,
t100,
ekko,
a004, zprice_grpsal, mvke.
*Internal Table to get the input Data
data: begin of i_input occurs 0,
matnr like ekpo-matnr,
asqty like ekpo-menge,
ebeln like ekpo-ebeln,
posnr(5),
posnr like zdrgsap-posnr,
invno like zdrgsap-invno,
invdt like zdrgsah-invdt,
netpr like zdrgsap-netpr,
cntno like zdrgsap-cntno,
shcnm like zdrgsah-shcnm,
apcno like zdrgsap-apcno,
spcno like zdrgsap-spcno,
werks like ekpo-werks,
lgort like ekpo-lgort,
matkl like ekpo-matkl,
pack(10),
mvgr2 like mvke-mvgr2,
dpric type p decimals 6 ,
gpric type p decimals 6,
end of i_input.
data: begin of i_inputxt occurs 0,
matnr(18) ,
asqty(13) ,
ebeln(10) ,
posnr(6) ,
invno(10) ,
invdt(8) ,
netpr(11) ,
cntno(11) ,
shcnm(10) ,
werks(4) ,
lgort(4) ,
matkl(9) ,
pack(10),
end of i_inputxt.
data: begin of i_error occurs 0,
prnum like eban-banfn,
pritm like eban-bnfpo,
inmat like mara-matnr,
prmat like mara-matnr,
asqty like zdrgsap-asqty,
prqty like eban-menge,
remak(100),
remark(255) type c,
end of i_error.
data : begin of i_error1 occurs 0,
prnum like eban-banfn,
pritm like eban-bnfpo,
asqty like zdrgsap-asqty,
prqty like eban-menge,
remak(100),
end of i_error1.
data : begin of i_zsap occurs 0,
ebeln like zdrgsap-ebeln,
posnr(5),
menge like zdrgsap-menge,
asqty like zdrgsap-asqty,
end of i_zsap.
data : v_ebeln like eket-ebeln.
data : begin of i_a004 occurs 0,
matnr like a004-matnr,
knumh like a004-knumh,
kbetr like konp-kbetr,
end of i_a004,
i_a0041 like i_a004 occurs 0 with header line.
data : begin of i_konp occurs 0,
knumh like konp-knumh,
kbetr like konp-kbetr,
konwa like konp-konwa,
end of i_konp.
data : begin of i_konp1 occurs 0,
knumh like konp-knumh,
kbetr like konp-kbetr,
konwa like konp-konwa,
end of i_konp1.
data : begin of i_netpr occurs 0,
ebeln like eket-ebeln,
ebelp like eket-ebelp,
matnr like ekpo-matnr,
menge like ekpo-menge,
netpr like ekpo-netpr,
kbetr like konp-kbetr,
end of i_netpr.
data : begin of i_grpsal occurs 0,
pcode like zprice_grpsal-pcode,
fact like zprice_grpsal-fact,
wfact like zprice_grpsal-wfact,
end of i_grpsal.
data : begin of i_domsal occurs 0,
pcode like zprice_grpsal-pcode,
fact like zprice_grpsal-fact,
wfact like zprice_grpsal-wfact,
end of i_domsal.
data : begin of i_zsap1 occurs 0,
ebeln like zdrgsap-ebeln,
posnr(5),
asqty like zdrgsap-asqty,
end of i_zsap1.
data: begin of bdcdata occurs 0.
include structure bdcdata. " Batch input: New table field
data: end of bdcdata.
messages of call transaction
data: messtab like bdcmsgcoll occurs 0 with header line.
data: i_mara type mara occurs 0 with header line,
i_eina like eina occurs 0 with header line,
i_eine like eine occurs 0 with header line.
data : begin of i_inferr occurs 0,
matnr like eina-matnr,
infnr like eina-infnr,
werks like eine-werks,
end of i_inferr.
data : begin of i_inferrc occurs 0,
matnr like eina-matnr,
end of i_inferrc.
*Data declaration.
data: v_file type string, " Variable for uploading file
v_item(5) type c, " Line item number
v_itno(2) type n,
p_wkurs like zdrgkurs-wkurs,
v_matnr(20) type c,
v_menge(20) type c,
v_banfn(20) type c,
v_bnfpo(20) type c,
v_bednr(20) type c,
v_werks(20),
p_lifnr(10) ,
v_flag,
p_lifnrtxt(10),
p_wkurstxt(9),
p_bsartxt(4),
v_posnr(5), n type i,
v_quant(13),
v_asqty(13),
v_prqty(13),
v_apcno(6),
v_spcno(4),
v_itm(11),
v_cnt type i,
v_cntno(4),
v_pack(10),
v_order(15),
v_lifnr(10),
v_invdt like sy-datum,
v_waers like ekko-waers,
v_podat like ekko-bedat,
v_docdt1 like sy-datum,
v_docdt(10),
v_fnam(132).
data : begin of i_test occurs 0,
bnfpo like eban-bnfpo,
matnr like eban-matnr,
menge like eban-menge,
bsmng like eban-bsmng,
end of i_test.
data : begin of i_mvke occurs 0,
matnr like mvke-matnr,
mvgr2 like mvke-mvgr2,
end of i_mvke.
data : begin of i_invno,
ebeln like ekko-ebeln,
angnr like ekko-angnr,
end of i_invno.
data : i_final like zinvdiff occurs 0 with header line.
Constants
constants : c_pd01 like eine-werks value 'PD01'.
*Selection Screen Declarations
selection-screen begin of block b1 with frame title text-010.
parameters: p_invno like zdrgsah-invno obligatory,
p_bsart like ekko-bsart obligatory.
selection-screen end of block b1.
start-of-selection.
To Upload the data into Internal table.
perform f_upload_data.
To Validate the input data.
perform f_check_data.
if i_error[] is not initial or i_error1[] is not initial.
To display the error message
perform f_display_errors.
else.
To create PO
perform f_process_session.
endif.
perform f_check_calc_price.
perform f_display_data.
perform f_update_zinvdiff.
*& Form f_get_filename
text
form f_get_filename.
endform. " F_get_filename
*& Form f_upload_data
form f_upload_data .
select matwa as matnr asqty ebeln posnr b~invno invdt netpr cntno
shcnm apcno spcno into table i_input
from zdrgsah as a join zdrgsap as b on
a~invno = b~invno
where b~invno eq p_invno.
select ebeln
posnr
menge
asqty
from zdrgsap into table i_zsap
where invno = p_invno.
loop at i_zsap.
concatenate i_zsap-posnr(4) '0' into v_posnr.
i_zsap1-ebeln = i_zsap-ebeln.
i_zsap1-posnr = v_posnr.
i_zsap1-asqty = i_zsap-asqty.
collect i_zsap1.
clear i_zsap1.
endloop.
delete adjacent duplicates from i_zsap comparing posnr menge .
delete adjacent duplicates from i_input comparing ebeln posnr.
loop at i_input.
p_werks = i_input-werks.
v_invdt = i_input-invdt.
call function 'CONVERT_DATE_FORMAT'
exporting
i_date = v_invdt
importing
e_calc_date = v_invdt.
if i_input-apcno is initial.
v_apcno = '0000'.
else.
v_apcno = i_input-apcno.
endif.
if i_input-spcno is initial.
v_spcno = '0000'.
else.
v_spcno = i_input-spcno.
endif.
if i_input-cntno is initial.
i_input-cntno = '0000'.
endif.
concatenate v_apcno v_spcno into i_input-pack.
concatenate v_pack v_cntno into v_order separated by '-'.
i_input-order = v_order.
clear : v_itm, v_cnt, v_cntno, v_pack, v_apcno, v_spcno, v_order.
concatenate i_input-posnr(4) '0' into v_posnr.
select single lifnr into p_lifnr from zdrgsup
where shcnm = i_input-shcnm.
v_lifnr = p_lifnr.
if sy-subrc <> 0.
message e000(zcnc) with text-002.
endif.
select single * from eban
where banfn eq i_input-ebeln
and bnfpo eq v_posnr.
if sy-subrc eq 0.
move eban-werks to i_input-werks.
move eban-lgort to i_input-lgort.
move eban-matkl to i_input-matkl.
move eban-bnfpo to i_test-bnfpo.
move eban-matnr to i_test-matnr.
move eban-menge to i_test-menge.
move eban-bsmng to i_test-bsmng.
modify i_input.
if not i_input-matnr eq i_test-matnr.
move i_input-ebeln to i_error-prnum.
move v_posnr to i_error-pritm.
move i_input-matnr to i_error-inmat.
move eban-matnr to i_error-prmat.
i_error-remak = 'Material does not match'.
append i_error.
clear i_error.
endif.
v_quant = i_test-menge - i_test-bsmng.
read table i_zsap1 with key ebeln = i_input-ebeln posnr = v_posnr.
if not i_zsap1-asqty <= v_quant.
move i_input-ebeln to i_error1-prnum.
move i_zsap1-posnr to i_error1-pritm.
move i_zsap1-asqty to i_error1-asqty.
move eban-menge to i_error1-prqty.
move v_quant to i_error1-prqty.
i_error1-remak = 'Material Quantity does not match'.
append i_error1.
clear i_error1.
endif.
select single matnr infnr from eina
into corresponding fields of i_eina
where matnr eq i_input-matnr
and lifnr eq p_lifnr.
if sy-subrc = 0.
append i_eina.
check not i_eina[] is initial.
select single * from eine
into i_eine
where infnr eq i_eina-infnr
and werks eq eban-werks.
if sy-subrc <> 0.
move i_input-matnr to i_inferr-matnr.
move i_eina-infnr to i_inferr-infnr.
move eban-werks to i_inferr-werks.
append i_inferr.
clear i_inferr.
endif.
else.
move i_input-matnr to i_inferrc-matnr.
append i_inferrc.
clear i_inferrc.
endif.
clear : i_eina, i_eine.
clear : i_zsap, i_zsap1, i_input, v_posnr,
v_quant, i_test.
endif.
endloop.
delete adjacent duplicates from i_error1 comparing prnum pritm.
perform chk_info_rec.
endform. " f_upload_data
*& Form f_check_data
form f_check_data .
if not i_input[] is initial.
select * from mara
into table i_mara
for all entries in i_input
where matnr eq i_input-matnr.
endif.
loop at i_mara.
read table i_input with key matnr = i_mara-matnr.
if sy-subrc <> 0.
write : 'Following Part Numbers are not found in MARA'.
write : / i_input-matnr.
endif.
endloop.
if i_mara[] is initial.
loop at i_input.
format color col_heading intensified off.
write : 'Following Part Numbers are not found in MARA'.
format color col_normal intensified off.
write : / i_input-matnr.
endloop.
endif.
select single wkurs into p_wkurs from zdrgkurs
where invno = p_invno.
if sy-subrc ne 0.
message e000(zcnc) with text-s11.
endif.
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = p_lifnr
importing
output = p_lifnr.
p_lifnrtxt = p_lifnr.
p_wkurstxt = p_wkurs.
p_bsartxt = p_bsart.
loop at i_input.
move-corresponding i_input to i_inputxt.
append i_inputxt.
endloop.
select single ebeln
angnr from ekko
into i_invno
where angnr = p_invno.
if sy-subrc = 0.
perform display_err.
endif.
endform. " f_check_data
*& Form f_process_session
text
form f_process_session.
v_docdt1 = sy-datum.
write v_docdt1 to v_docdt using edit mask '__.__.____'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MEDOCTYPE'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_TOPLINE-BSART'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
p_bsartxt.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
p_lifnrtxt.
perform bdc_field using 'BDC_CURSOR'
'MEPO1222-BUKRS'.
perform bdc_field using 'MEPO1222-EKORG'
'SBAP'.
perform bdc_field using 'MEPO1222-EKGRP'
'PG1'.
perform bdc_field using 'MEPO1222-BUKRS'
'SBA'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=TABHDT2'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
p_bsartxt.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
p_lifnrtxt.
********************conditions***************************************
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(08)'.
perform bdc_field using 'KOMV-KSCHL(07)'
'zot1'.
perform bdc_field using 'KOMV-KSCHL(08)'
'zinc'.
perform bdc_field using 'KOMV-KSCHL(09)'
'ziv1'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=V69A_KOAN'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(01)'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KOMV-KSCHL(02)'
'zca1'.
perform bdc_field using 'KOMV-KSCHL(03)'
'zfa1'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=TABHDT7'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(09)'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1229-IHRAN'.
perform bdc_field using 'MEPO1229-ANGNR'
p_invno.
perform bdc_field using 'MEPO1229-IHRAN'
v_invdt.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4001BUTTON'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1229-IHRAN'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4000BUTTON'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1229-IHRAN'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
loop at i_inputxt.
concatenate i_inputxt-posnr(4) '0' into v_posnr.
concatenate 'MEPO1211-EMATN(' v_itno ')' into v_matnr.
concatenate 'MEPO1211-MENGE(' v_itno ')' into v_menge.
concatenate 'MEPO1211-BANFN(' v_itno ')' into v_banfn.
concatenate 'MEPO1211-BNFPO(' v_itno ')' into v_bnfpo.
concatenate 'MEPO1211-BEDNR(' v_itno ')' into v_bednr.
concatenate 'MEPO1211-WERKS(' v_itno ')' into v_werks.
v_item = v_item + 10.
endif.
v_itno = v_itno + 1.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
v_matnr.
perform bdc_field using v_matnr "'MEPO1211-EMATN(01)'
i_inputxt-matnr.
perform bdc_field using v_menge "'MEPO1211-MENGE(01)'
i_inputxt-asqty.
perform bdc_field using v_banfn "'MEPO1211-BANFN(01)'
i_inputxt-ebeln.
perform bdc_field using v_bnfpo "'MEPO1211-BNFPO(01)'
i_inputxt-posnr.
perform bdc_field using 'DYN_6000-LIST'
v_itno.
loop at i_inputxt .
v_itno = sy-tabix.
clear v_fnam.
concatenate 'MEPO1211-EMATN(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-matnr.
clear v_fnam.
concatenate 'MEPO1211-MENGE(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-asqty.
clear v_fnam.
concatenate 'MEPO1211-BANFN(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-ebeln.
clear v_fnam.
concatenate 'MEPO1211-BNFPO(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-posnr.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
endloop.
loop at i_inputxt from 6.
v_itno = sy-tabix.
clear v_fnam.
concatenate 'MEPO1211-EMATN(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-matnr.
clear v_fnam.
concatenate 'MEPO1211-MENGE(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-asqty.
clear v_fnam.
concatenate 'MEPO1211-BANFN(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-ebeln.
clear v_fnam.
concatenate 'MEPO1211-BNFPO(' v_itno ')' into v_fnam.
perform bdc_field using v_fnam
i_inputxt-posnr.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
endloop.
perform bdc_field using 'BDC_CURSOR'
'MEPO1320-SLFDT(01)'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=TABHDT2'.
perform bdc_field using 'DYN_6000-LIST'
' 2'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=V69A_KOAK'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(05)'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MECHECKDOC'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(01)'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/03'.
perform bdc_field using 'BDC_OKCODE'
'=&ONT'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4000BUTTON'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_TOPLINE-BSART'.
perform bdc_field using 'DYN_6000-LIST'
' 2'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(08)'.
perform bdc_field using 'KOMV-KBETR(03)'
' .54'.
perform bdc_field using 'KOMV-KBETR(08)'
' .54'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MESAVE'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1211-NETPR(01)'.
perform bdc_transaction using 'ME21N'.
endform. "f_process_session
*& Form bdc_transaction
text
-->P_0464 text
form bdc_transaction using tcode.
data: l_mstring(480).
data: l_subrc like sy-subrc.
data: v_mode type c.
v_mode = 'A'.
refresh messtab.
call transaction tcode using bdcdata
mode v_mode
update 'S'
messages into messtab.
l_subrc = sy-subrc.
WRITE: / 'CALL_TRANSACTION',
TCODE,
'returncode:'(I05),
L_SUBRC,
'RECORD:',
SY-INDEX.
loop at messtab.
select single * from t100 where sprsl = messtab-msgspra
and arbgb = messtab-msgid
and msgnr = messtab-msgnr.
if sy-subrc = 0.
l_mstring = t100-text.
if l_mstring cs '&1'.
replace '&1' with messtab-msgv1 into l_mstring.
replace '&2' with messtab-msgv2 into l_mstring.
replace '&3' with messtab-msgv3 into l_mstring.
replace '&4' with messtab-msgv4 into l_mstring.
else.
replace '&' with messtab-msgv1 into l_mstring.
replace '&' with messtab-msgv2 into l_mstring.
replace '&' with messtab-msgv3 into l_mstring.
replace '&' with messtab-msgv4 into l_mstring.
endif.
condense l_mstring.
if messtab-msgtyp eq 'E' or messtab-msgtyp eq 'W'.
write: / messtab-msgtyp, l_mstring(250).
endif.
search l_mstring for 'SEA'.
if sy-subrc = 0.
write: / messtab-msgtyp, l_mstring(250).
endif.
else.
write: / messtab.
endif.
endloop.
endform. " bdc_transaction
Start new screen *
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform. "BDC_DYNPRO
Insert field *
form bdc_field using fnam fval.
if fval <> space.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endif.
endform. "BDC_FIELD
*& Form f_display_errors
form f_display_errors .
if i_error[] is not initial.
format color col_heading intensified off.
uline .
write :/ 'PR No ',
(10) 'Item No',
(20) 'PR Part No',
(30) 'Invoiced Part No',
(60) 'Remark'.
uline .
loop at i_error.
perform f_display_color.
write :/ i_error-prnum,
(10) i_error-pritm ,
(20) i_error-prmat,
(30) i_error-inmat,
(60) i_error-remak.
clear i_error.
endloop.
endif.
if i_error1[] is not initial.
format color col_heading intensified off.
uline .
write :/ 'PR No ',
(10) 'Item No',
(20) 'PR Quantity',
(30) 'Invoiced Quantity',
(60) 'Remark'.
uline .
loop at i_error1.
perform f_display_color.
if not i_error1-asqty is initial.
v_asqty = i_error1-asqty .
v_prqty = i_error1-prqty.
write :/ i_error1-prnum,
(10) i_error1-pritm ,
(20) v_prqty,
(30) v_asqty,
(60) i_error1-remak.
clear : v_asqty, v_prqty.
endif.
clear i_error1.
endloop.
endif.
endform. " f_display_errors
*& Form f_display_color
form f_display_color .
if v_flag = 0.
format color col_normal intensified on.
v_flag = 1.
elseif v_flag = 1.
format color col_normal intensified off.
v_flag = 0.
endif.
endform. " f_display_color
*& Form display_err
text
--> p1 text
<-- p2 text
form display_err .
format color col_heading intensified off.
write (120) text-006.
uline .
write : 'PR No ',
(15) 'Invoice No',
(30) 'Remark'.
uline.
format color col_negative intensified off.
write :/ i_invno-ebeln,
(15) p_invno ,
(30) 'Invoice Already Exists'.
endform. " display_err
*& Form f_check_calc_price
text
--> p1 text
<-- p2 text
form f_check_calc_price .
data : d_pric type p decimals 6 ,
g_pric type p decimals 6,
v_exch type p decimals 4 value '0.1049'.
select single ebeln
waers
bedat
from ekko into (v_ebeln , v_waers , v_podat)
where angnr eq p_invno.
loop at i_input.
concatenate i_input-posnr(4) '0' into v_posnr.
select single p~ebeln
p~ebelp
matnr
p~menge
netpr
into i_netpr
from eket as t inner join ekpo as p
on t~ebeln eq p~ebeln
and t~ebelp eq p~ebelp
where t~ebeln eq v_ebeln
and t~banfn eq i_input-ebeln
and t~bnfpo eq v_posnr.
if v_waers eq 'JPY'.
i_netpr-netpr = i_netpr-netpr * 100.
endif.
if not i_input-netpr eq i_netpr-netpr.
append i_netpr.
clear : i_input, i_netpr, v_posnr.
else.
clear : i_input, i_netpr, v_posnr.
endif.
endloop.
delete adjacent duplicates from i_netpr comparing ebeln ebelp matnr.
modify zinvdiff from table i_final.
if i_netpr[] is not initial.
select matnr
knumh
from a004
into table i_a004
for all entries in i_netpr
where matnr = i_netpr-matnr
and kschl = 'ZPR0'
and vkorg = 'SBAP'
and vtweg = 'DD'
and ( datab <= sy-datum and datbi => sy-datum ).
select matnr
knumh
from a004
into table i_a0041
for all entries in i_netpr
where matnr = i_netpr-matnr
and kschl = 'ZPR0'
and vkorg = 'EXPT'
and vtweg = 'BR'
and ( datab <= sy-datum and datbi => sy-datum ).
select matnr mvgr2 from mvke
into corresponding fields of table i_mvke
for all entries in i_netpr
where matnr = i_netpr-matnr
and vkorg = 'SBAP'
and vtweg = 'DD'.
if i_a004[] is not initial.
select knumh
kbetr
from konp
into table i_konp
for all entries in i_a004
where knumh = i_a004-knumh.
loop at i_a004.
read table i_konp with key knumh = i_a004-knumh.
i_konp-kbetr = i_konp-kbetr / 10.
move i_konp-kbetr to i_a004-kbetr.
modify i_a004.
clear : i_konp, i_a004.
endloop.
endif.
if i_a0041[] is not initial.
select knumh
kbetr
from konp
into table i_konp1
for all entries in i_a0041
where knumh = i_a0041-knumh.
loop at i_a0041.
read table i_konp1 with key knumh = i_a0041-knumh.
move i_konp1-kbetr to i_a0041-kbetr.
modify i_a0041.
clear : i_konp1, i_a0041.
endloop.
endif.
if i_mvke[] is not initial.
select pcode
fact
wfact
into table i_domsal
from zprice_grpsal
for all entries in i_mvke
where pcode = i_mvke-mvgr2
and vkorg = 'SBAP'
and vtweg = 'DD'
and lifnr = v_lifnr.
select pcode
fact
wfact
into table i_grpsal
from zprice_grpsal
for all entries in i_mvke
where pcode = i_mvke-mvgr2
and vkorg = 'EXPT'
and vtweg = 'BR'
and lifnr = v_lifnr.
endif.
loop at i_input .
read table i_mvke with key matnr = i_input-matnr.
if sy-subrc = 0.
move i_mvke-mvgr2 to i_input-mvgr2.
endif.
read table i_domsal with key pcode = i_input-mvgr2.
if sy-subrc = 0.
d_pric = i_domsal-fact / i_domsal-wfact.
i_input-dpric = i_input-netpr * d_pric * ( 112 / 100 ).
endif.
read table i_grpsal with key pcode = i_input-mvgr2.
if sy-subrc = 0.
g_pric = i_grpsal-fact * i_grpsal-wfact.
i_input-gpric = ( i_input-netpr * ( 112 / 100 ) ) / g_pric .
endif.
modify i_input.
clear i_input.
clear d_pric.
clear g_pric.
endloop.
endif.
endform. " f_check_price
*& Form f_display_data
text
--> p1 text
<-- p2 text
form f_display_data .
loop at i_netpr.
move i_netpr-ebeln to i_final-ebeln.
move i_netpr-ebelp to i_final-ebelp.
move i_netpr-matnr to i_final-matnr.
move i_netpr-netpr to i_final-poprc.
move i_netpr-menge to i_final-asqty.
move p_invno to i_final-invoice.
append i_final.
clear i_final.
endloop.
loop at i_final.
move v_podat to i_final-podat.
read table i_input with key matnr = i_final-matnr.
move i_input-netpr to i_final-invpr.
move i_input-dpric to i_final-dcalclp.Dear Santosh,
I haven't gone through your piece of code.
But I can suggest a way out, while handling multiple line-items.
The following code sample elucidate the use of multiple line-items. This is just an example for your understanding.
FORM BDC_OPERATION .
DATA: LV_ARBPL(15) TYPE C,
LV_ROWNO(2) TYPE N.
LOOP AT IT_TABDATA INTO WA_TABDATA.
CLEAR: LV_ARBPL
LV_ROWNO = SY-TABIX.
CONCATENATE 'PLPOD-ARBPL' '(' LV_ROWNO ')' INTO LV_ARBPL.
PERFORM BDC_DYNPRO USING 'SAPLCPDI' '1400'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' LV_ARBPL.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=PICK'.
PERFORM BDC_FIELD USING LV_ARBPL WA_TABDATA-ARBPL.
ENDLOOP.
ENDFORM. " BDC_OPERATION
Regards,
Abir
Please don't forget to award points * -
How to handle the multiple line items in the Inbound idoc FM
Hi ,
Can any body give me how to handle the multiple line item in the idoc when we reprocessing it from workitem....
Thanks in Advance,,,,
Regards,
BharaniHi ,
Can any body give me how to handle the multiple line item in the idoc when we reprocessing it from workitem....
Thanks in Advance,,,,
Regards,
Bharani -
LSMW- Recording : Multiple Line Items
I am trying to create an LSMW recording that simulates transaction O3I7.
The thing is that we have different line items. This is similar to a sales order where we have header details and items details.
I created a recording. Then I created two structures. One header Structure and one Item structure. I define the specific header fields under the header structure and the item fields under the item structure.
However LSMW gives me an error. Because in LSMW each recording is considered as one target structure. I can't have more source structures than Target structures. Since I have One recording LSMW gives me an error.
I tried to create two recordings but this does not work since LSMW will read each one as a different transaction.
Does anyone know how to create LSMW recording with multiple line items so he/she can help?
ThxHi,
Not sure about the transaction that you have mentioned. However, in LSMW recording, you can load the items along with the header in 2 steps using 2 data files.
Step1: Create the header along with the first line item. Here you use a file which contains the header data along with the first line item data.
Step2. Add subsequent line items to the header. In this case you need to enter the transaction in change mode. The data file may contain items data only. Please be sure to have an identifier at header level to add the items in that specific document.
Hope this helps.
Best Regards, Murugesh -
LSMW to create Sales Order refer to Quotation with multiple line items.
Hi Gurus,
I am new to LSMW, and my requirement is that, I have a file downloaded from another system, it is like this:
Quotation No. Sold to party data item no. material no. quatity
556 10000012 10 19077 1
556 10000012 20 19078 1
557 10000011 10 19076 1
And it is required I need to create orders in VA01 refering to quotations, and then delete all the items from quotation, and add the items in the file. I am now doing it through transaction recording in VA01, but I came to a difficult part, that is how I can process line items. Because the items number will only be decided at runtime, so I can not record a BDC for that. And I have read some guides on LSMW, one of it said that transaction recording in LSMW can not deal with deep structures. So could any1 help on this?
Best regards,
VincentDear SD Gurus n Experts,
I have solved the above problem. But there is another problem appearing regarding the date format. Now system generating a message: Date . . is not valid.
While I am using Date: YYYYMMDD format in flat file, which is SAP's Standard Format.
In SDN Link: LSMW upload Sales Order using VA01/VA02 I have found that there are some date fields which are mandatory to filled. Here I have mapped
VDATU - Requested delivery date, BSTDK - Customer purchase order date, PRSDT - Date for pricing and exchange rate, BSTDK_E - Ship-to party's PO date, FKDAT - Billing Date, KORDT - Delivery Date,
and PRGRS - Date type is Constant = D
Can any one tell me, where is the priblem.
With thanks,
DSC
Maybe you are looking for
-
G570 Choppy Sound - Poor Performanc​e
Hi I'm currently having a few issues with my laptop All drivers are up to date They all seem to happen at the same time so I believe its a internal issue A lot of the time lately randomly my sound will get really choppy a static sound right when that
-
I rented a movie (The last song) after 13 minutes it stopped and I recieved the following message "AN UNKNOWN ERROR OCURRED (-50)" . What can I do in this case?
-
"tp import all" runs 24 times faster than "tp import TR " for long queue?
After a test upgrade to ECC 6.0, I processed 1200 individual transports in 12 hours. When I rebuilt the queue of 1200 transports and processed "tp import all", it completed in 30 minutes. Should I expect "tp import all" to process 24 times faster tha
-
I have this error on deployed process (in BPEL console). What is this?
I have this error on deployed process (in BPEL console). What is this? The following exception occured while loading this Process: Exception Name: java.lang.ClassCastException Exception Description: null Suggested Fix: Context: Stack Trace: ---------
-
if my mac runs on the leopard OS and not the snow leopard os, does this mean i can't purchase the new lion os?