EDI - INVOIC01 - E1EDP02 - QUALF 021
Hello,
We are using EDI, message INVOIC01, to create FI vendor invoices automatically, based on SD Invoices.
Everything works OK except the fact that I can't use transaction OBCC to select different Cost centers based on ID account assignment.
It always picks the entry with *.
And it happens because QUALF 021 on E1EDP02 is not created at all.
Can anyone explain how to create QUALF 021 for E1EDP02 ???
Thank you
Jorge
Hi Jorge,
did you solve the problem ?? we are facing the same issue.
Regards.
R
Similar Messages
-
IDOC ORDERS02 E1EDP02 QUALF 001: Purchase Order at Item level not inserted
Hi all,
I try with an ORDERS02 IDoc in segment E1EDP02 with QUALF 001 to insert a customer purchase order number at item level different from the one passed in E1EDK01 QUALF 001 and I expect to insert additionally to the VBKD record for POSNR 000000 one for my item line.
This additinal VBKD record is not inserted and I do not get this customer purchase order number in my sales order.
Does any one know what to do?
Thanks in advance.
AxelTo take over customer purchase order number on item level like the one for the ship-to-party (to treat a QUALF=001 for BSTKD like the QUALF=044 for BSTKD_E) seems to be unpossible.
Within IDOC_INPUT_ORDERS
LVEDAF5M: FILL_E1EDP02
WHEN '044'.
*- Bestellnummer des Warenempfängers -
*- purchase order number consignee -
PERFORM IDOC_MOVE USING E1EDP02-BELNR XVBAP-BSTKD_E D_FLAG_P-PBES.
We need to have
WHEN '001'.
*- Bestellnummer des Warenempfängers -
*- purchase order number -
PERFORM IDOC_MOVE USING E1EDP02-BELNR XVBAP-BSTKD D_FLAG_P-PBES.
this is calles from
LVEDAF2U:
*- Auftragsposition Referenzen -
*- item reference data -
WHEN 'E1EDP02'.
MOVE IDOC_DATA-SDATA TO E1EDP02.
PERFORM ZUORDNEN_ORDERS_E1EDP02.
*-Zusätzliche Daten aus IDOC-Struktur (Kundenerweiterungen)----
*-additional data's from IDOC (customer exit)----
SY-SUBRC = 0.
PERFORM CUSTOMER_FUNCTION_IDOC USING IDOC_DATA.
This calls
CALL CUSTOMER-FUNCTION '001'
So IDOC-DATA-SDATA is allready in E1EDP02
but it is not sufficient to do the call needed like stated above within EXIT_SAPLVEDA_001 since
I expect a result in VBKD, not in VBAP, and BSTKD is not like BSTKD_E a field of XVBAP.
In LVEDAF16, LVDEAF1C, LVEDAF27 AND LVEDAF4N the field is taken over into the screen but we have no chance to forward it to there
and to enhance there. Last one seems most interesting since it is for VA01!
It could be to enhance EDIT_SAPLVEDA_002 but how to forward the content to this field if it is a VBKD
field and all VBKD fields are statically added to VBAP fields in the program and not in the dictionary.
That would cause to append a parking field in VBAP or require to modify the code!
Any better ideas? -
IDoc to EDI mapping problem (Invoic01 to 810 v4010)
Hi,
I have a problem with my invoice mapping.
I need to exclude children parts from the outbound EDI invoice.
In my mapping I was able to control the number of lines that should go out from the top line item node level using:
G_SIT1 -> If E1EDP02-QUALF = 002 then E1EDP02-ZEILE->Remove Context->SplitByValue->CollapseContext->G_STI1
I have the right amount of lines but the fields under G_STI1 are wrong since I'm missing the last ones.
Then I tried different combinations + playing with the contexts and played again with the top node and my conclusion is that it might be easier to exclude them in IDoc in SAP using an UserExit?!?
Anybody was able to get around this problem without changing the IDoc in R/3?Can I filter on a partner type KU? I need to customize an outboud invoice to not send some segments.
Or is it only for type LS?
Rgds,
Yves -
Graphical Mapping Problem : Create Segments by conditions
Hi,
i have a problem while mapping an incoming invoice to IDoc Invoic02. I had to create some Segments (E1EDP02) on basis of identifiers in the incoming message. I hope the following example i created will help to understand my exact problem:
EXAMPLE MESSAGE:
<invoice>
<document>
<position>
<line>
<posnum> 1 </posnum>
<IMD>
<ident> Name </ident>
<val> Maxx </val>
</IMD>
<IMD>
<ident> Age </ident>
<val> 19 </val>
</IMD>
<IMD>
<ident> Gender </ident>
<val> Male </val>
</IMD>
</line>
</position>
<position>
<line>
<posnum> 2 </posnum>
<IMD>
<ident> Name </ident>
<val> Tina </val>
</IMD>
<IMD>
<ident> Age </ident>
<val> 28 </val>
</IMD>
<IMD>
<ident> Gender </ident>
<val> Female </val>
</IMD>
</line>
</position>
</document>
</invoice>
THE RESULT I WANT:
<invoic02>
<E1EDP01>
<SEGMENT> </SEGMENT>
<POSEX> 1 </POSEX>
<E1EDP02>
<SEGMENT> </SEGMENT>
<QUALF> 021 </QUALF>
<BELNR> 19 </BELNR> // THIS should be the Age
</E1EDP02>
<E1EDP19>
</E1EDP19>
</E1EDP01>
<E1EDP01>
<SEGMENT> </SEGMENT>
<POSEX> 2 </POSEX>
<E1EDP02>
<SEGMENT> </SEGMENT>
<QUALF> 021 </QUALF>
<BELNR> 28 </BELNR> // THIS should be the Age
</E1EDP02>
<E1EDP19>
</E1EDP19>
</E1EDP01>
</invoic02>
I tried to different ways to get the above result but i failed
My first try:
ident -------|--- equalsS ------ createIf ---- E1EDP02
Constant[000] --------- SEGMENT
Constant[Age]--|
ident -------|--- equalsS ------ ifWithoutElse ---- QUALF
Constant[Age]--| |
|
Constant[021]
ident -------|--- equalsS ------ ifWithoutElse ---- BELNR
Constant[Age]--| |
|
val
Result:
The E1EDP02 Element will not created reliable. Sometimes it is there sometimes not dunno why ? Any Idea ?
My second try:
IMD -------------- E1EDP02
Constant[000] --------- SEGMENT
ident -------|--- equalsS ------ ifWithoutElse ---- QUALF
Constant[Age]--| |
|
Constant[021]
ident -------|--- equalsS ------ ifWithoutElse ---- BELNR
Constant[Age]--| |
|
val
Result:
Now every E1EDP01 Element has two E1EDP02 Elements. One correct one and an empty one with only a segment element. Is there a way to delete this empty elements ?
Any ideas to create a working mapping ?
Thanks@Liang Ji
When i do this i have only the first E1EDP01 Element
@Tarang Shah
Which function i had to use for this ?
Thank you -
Hi.
I have a mapping using the INVOIC02 IDoc.
I'm using data in the E1EDK03 segment to populate a field in the E1EDP02 segment.
In the explenation I will just present the effected segment and fields.
Source:
<INVOIC02>
<IDOC BEGIN="">
<E1EDK03 SEGMENT="1">
<IDDAT>012</IDDAT>
<DATUM>20100520</DATUM>
</E1EDK03>
<E1EDK03 SEGMENT="2">
<IDDAT>044</IDDAT>
<DATUM>20100525</DATUM>
</E1EDK03>
<E1EDP01 SEGMENT="">
<E1EDP02 SEGMENT="">
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP02 SEGMENT="">
<QUALF>012</QUALF>
</E1EDP02>
<E1EDP02 SEGMENT="">
<QUALF>021</QUALF>
</E1EDP02>
</E1EDP01>
</IDOC>
</INVOIC02>
When the IDDAT in E!EDK03 has the value 012 the DATUM field should be populating the DATUm field in E!EDP02 if the QUALF field in the same segment has the value 012.
I tried a UDF to acomplish this. It looks as bellow.
public void P02DATUMQALF012(String[] var1, String[] var2, String[] var3, ResultList result, Container container) throws StreamTransformationException{
String text = "";
for (int i=0; i<var1.length; i++) {
if ( var1<i>.equals("012") ){
text = var2<i>;
for (int i=0; i<var3.length; i++) {
if ( var3<i>.equals("012") ){
result.addValue(String.valueOf(text));
else {
result.addValue("");
With this UDF I and SplitByValue after it I get the following result.
<INVOIC02>
<IDOC BEGIN="1">
<E1EDK03 SEGMENT="1">
<IDDAT>012</IDDAT>
<DATUM>20100520</DATUM>
</E1EDK03>
<E1EDK03 SEGMENT="2">
<IDDAT>044</IDDAT>
<DATUM>20100525</DATUM>
</E1EDK03>
<E1EDP01 SEGMENT="1">
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="2">
<QUALF>012</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="1">
<QUALF>021</QUALF>
<DATUM>20100520</DATUM>
</E1EDP02>
</E1EDP01>
<E1EDP01 SEGMENT="2">
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="2">
<QUALF>012</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="1">
<QUALF>021</QUALF>
<DATUM/>
</E1EDP02>
</E1EDP01>
</IDOC>
</INVOIC02>
What am I doing wrong?
BR
KalleSorry mised that
var1 = IDDAT (E1EDK03)
var2 = DATUM (E1EDK03)
var3 = QUALF (E1EDP02)
will present queues as follow.
value = white line in queue
value = grey line in queue
var1 queue:
012
012
044
044
var2 queue:
20100520
20100520
20100525
20100525
var3 queue:
001
001
012
012
021
021
Result queue:
20100520
Looks as the resultqueue has no context and making to many [] entrys.
I would like the resultqueue to look as follow:
Result queue:
20100520
20100520
BR
Kalle -
Hi,
i have a requirement where based on a condition i need to add a new segment dynamically in Inbound IDOC.
I have written the code in the user exit of the inbound FM. Its adding new segments and process it perfectly.
But when i see the IDOC in we02 or we19, i am not able to see the newly added segment.
Will the newly added segment in FM appear in the We02?
PS: i have changed the idoc_control-maxsegnum.
Regards,
NiyazHi Niyaz,
Check out the below program ....Similar to your requirement
IDoc creation from inbound file
REPORT ZS7BM000006 message-id ZS7.
*/ Program Name: Creation of DESADV & INVOIC IDocs from file E021
*/ Description : This program reads in external file E021 containing
* shipping and invoice data from internal vendors and
* creates one DESADV and one INVOIC IDoc per invoice.
*/ Transaction : n/a - run from job Z_ccc_S7B_Annnnn, where
* 'ccc' = 3-digit client and 'nnnnn' = zero-filled
* sequence number matching the scheduled job for E020.
tables: lfa1,
lfm1,
ekpo,
eine,
e1edk01,
e1edk02,
e1edk07,
e1edk08,
e1edk06,
e1edk03,
e1edka1,
e1edka2,
e1edp07,
e1edp09,
e1edp19,
e1edp01,
e1edp02,
e1edp26,
e1edp04,
e1eds01,
e1eds02,
zst7f_ty_vendors.
parameters: p_path like PATH-PATHEXTERN
default '/ftp/atac/in/'.
data: INFILE LIKE PATH-PATHEXTERN,
back_path(7) type c value 'backup/',
offset like sy-fdpos,
p07_ctr like sy-index,
invoice_total type p decimals 3,
d_seg_num like sy-index,
i_seg_num like sy-index.
data: OUTFILE LIKE PATH-PATHEXTERN,
today(8) type c.
data: begin of uty_vendors occurs 10,
lifnr like lfa1-lifnr,
waers like lfm1-waers,
name_abbr like zst7f_ty_vendors-name_abbr,
ship_days like zst7f_ty_vendors-ship_days,
end of uty_vendors.
data: iZSS7B21 like ZSS7B21.
data: desadvdata like edi_dd occurs 5 with header line.
data: invoicdata like edi_dd occurs 5 with header line.
data: dedidc like edi_dc occurs 1 with header line.
data: iedidc like edi_dc occurs 1 with header line.
data: begin of ie021 occurs 10,
lifnr like lfa1-lifnr,
ship_days like zst7f_ty_vendors-ship_days,
invoice_no like e1edk08-vbeln,
stat like e1edk01-action,
po_number(10) type n,
po_lineno(5) type n,
slip_number like e1edp09-vbeln,
shipto_id like e1edka1-partn,
vendor_id like e1edka1-partn,
endcust_name like e1edka1-name1,
cust_partno like e1edp09-kdmat, "char 35
vendor_partno like e1edp09-matnr, "char 35
invoice_qty like e1edp09-lfimg,
qty_uom like e1edp01-menee,
unit_price like e1edp01-vprei,
price_uom like e1edp01-pmene,
price_qty like e1edp01-peinh,
line_amount like e1edp26-betrg,
currency like e1edk01-curcy,
etd like e1edk06-datum, "ship date
eta like e1edk06-datum, "delivery date
ship_id like e1edk08-traid,
ship_method like e1edk08-traty,
create_date like e1edk03-datum,
plant like ekpo-werks,
end of ie021.
data: save_po like ie021-po_number,
save_line like ie021-po_lineno,
save_stat like ie021-stat,
save_invoice like ie021-invoice_no.
constants: hun_thou type p decimals 5 value '100000',
thou type p decimals 3 value '1000'.
*& DEFINITION: append_idoc_rec
* add a data record to the IDoc internal table
define append_idoc_rec.
&1-tabnam = &1-segnam.
&2_seg_num = &2_seg_num + 1.
&1-segnum = &2_seg_num.
shift &1-segnum left deleting leading space.
append &1.
clear &1.
end-of-definition. " append_idoc_rec
* MAIN PROCESSING LOOP
START-OF-SELECTION.
today = sy-datum.
* find all internal vendors
select a~lifnr
b~waers
c~name_abbr c~ship_days
into corresponding fields of table uty_vendors
from lfa1 as a
inner join lfm1 as b
on a~lifnr = b~lifnr
inner join zst7f_ty_vendors as c
on a~lifnr = c~lifnr
where a~ktokk = 'ZZTY' and
b~ekorg = '7100' and
c~ship_code = ' '.
perform init_desadv.
perform init_invoic.
concatenate 'SAP' sy-sysid(3) into: iedidc-sndpor, dedidc-sndpor.
loop at uty_vendors.
clear ie021. refresh ie021.
if not uty_vendors-name_abbr is initial.
* datafiles are received with naming convention:
* E020_<customer name abbreviation>_UTY
concatenate p_path 'E021_' uty_vendors-name_abbr '_UTY'
into infile.
if not sy-subrc is initial. "pathname too long
* Filename too long: &
message i016 with infile.
continue.
endif.
condense infile.
OPEN DATASET INFILE FOR INPUT IN TEXT MODE.
if not sy-subrc is initial.
*'Cannot open dataset & on &'
message i013 with infile sy-datum.
continue.
else.
concatenate p_path back_path 'E021_'
uty_vendors-name_abbr '_UTY' today
into outfile.
if not sy-subrc is initial. "pathname too long
* Filename too long: &
message i016 with outfile.
continue.
endif.
condense outfile.
OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE.
* if the datestamped file cannot be created, do not process the
* input file, because the input file is deleted after processing,
* and there would be no record of the data.
if not sy-subrc is initial.
*'ERROR opening file & for output'
close dataset infile.
message i033 with outfile.
continue. "process next vendor's file
endif.
do.
read dataset infile into izss7b21.
case sy-subrc.
when 0.
transfer izss7b21 to outfile.
if izss7b21-datacode = 'T'. "trailer rec
perform process_one_vendor using infile.
exit. "process next vendor's file
endif.
check: izss7b21-datacode = 'A'. "data rec
case izss7b21-status.
when ' '. "new
ie021-stat = '000'.
when 'M'. "modification
ie021-stat = '002'.
when 'D'. "deletion
ie021-stat = '003'.
endcase.
move-corresponding uty_vendors to ie021.
move-corresponding izss7b21 to ie021.
perform convert_po_no using izss7b21-pono_poline
changing ie021-po_number
ie021-po_lineno.
perform convert_dates using ie021-lifnr
izss7b21-etd
izss7b21-eta
izss7b21-ship_method
izss7b21-create_date
changing ie021-eta
ie021-ship_days.
perform quantity_conversion
using izss7b21-qty_uom
izss7b21-invoice_qty
izss7b21-unit_price
changing ie021-qty_uom
ie021-invoice_qty
izss7b21-line_amount.
perform money_conversion
using izss7b21-currency
izss7b21-unit_price
izss7b21-price_uom
izss7b21-line_amount
changing ie021-currency
ie021-price_uom
ie021-price_qty
ie021-unit_price
ie021-line_amount.
perform SAP_vendor_partno
changing ie021-cust_partno.
append ie021.
when 4. "EOF
perform process_one_vendor using infile.
exit. "process next vendor's file
when others.
*ERROR reading dataset & - &
message i015 with infile sy-datum.
exit.
endcase.
enddo.
close dataset: infile, outfile.
delete dataset infile.
endif.
endif.
endloop. "UTY_VENDORS
*& Form process_one_vendor
* Pre-processed records from one vendor file are now in the
* internal table ie021 - ready to create IDocs
FORM process_one_vendor using value(infile).
sort ie021 by invoice_no stat po_number po_lineno.
loop at ie021.
if ( ie021-invoice_no <> save_invoice or
ie021-stat <> save_stat ).
if sy-tabix > 1.
perform post_idocs using ie021-stat.
endif.
perform idoc_header_segs using ie021-stat.
endif.
if ( ie021-stat <> save_stat or
ie021-po_number <> save_po or
ie021-po_lineno <> save_line or
ie021-invoice_no <> save_invoice ).
if ( sy-tabix > 1 and
ie021-stat = '000' ).
perform idoc_poheader_segs.
endif.
endif.
perform idoc_item_segs using ie021-stat.
save_po = ie021-po_number.
save_line = ie021-po_lineno.
save_invoice = ie021-invoice_no.
save_stat = ie021-stat.
endloop.
perform post_idocs using ie021-stat.
* File successfully processed: &
message s035 with infile.
ENDFORM. " process_one_vendor
*& Form convert_po_no
* Break the PO number & line field into separate fields
FORM convert_po_no using value(infield)
changing po_number like ie021-po_number
po_line like ie021-po_lineno.
data: cpos like sy-fdpos,
lpos like sy-fdpos,
cline(6) type c.
* if the infield contains a hyphen, assume that the preceding characters
* represent the po number, if they are numeric. The po line number is
* assumed to be all numeric characters after the hyphen.
if infield ca '-'.
if infield(sy-fdpos) co ' 0123456789'. "numeric
po_number = infield(sy-fdpos).
cpos = sy-fdpos + 1.
endif.
else. "no hyphen - PTY
if infield(2) = '71'. "SAP number range
cpos = 10.
else. "SyteLine number
cpos = 6.
endif.
if infield(cpos) co ' 0123456789'. "numeric
po_number = infield(cpos).
endif.
endif.
if not po_number is initial.
while infield+cpos(1) co '0123456789'.
cline+lpos(1) = infield+cpos(1).
lpos = lpos + 1.
cpos = cpos + 1.
endwhile.
shift cline left deleting leading '0'.
if not cline is initial.
po_line = cline.
endif.
endif.
* Put out a warning in the job log, but create the IDoc to save the data
if ( po_number is initial or
po_line is initial ).
* PO number - line item conversion failed: &
message i034 with infield.
endif.
ENDFORM. " convert_po_no
*& Form convert_dates
* Convert ship date to delivery date, if necessary
FORM convert_dates using value(vendor_no)
value(i_ship_date)
value(i_delivery_date)
value(i_ship_code)
value(i_create_date)
changing o_delivery_date
ship_days.
data: ship_date type d.
* if delivery date not sent, calculate it from ship date plus
* ship days.
* Note that this logic could leave delivery date blank,
* if ship date is not numeric.
if ( i_delivery_date is initial or
i_delivery_date co ' 0' ). "no delivery date sent
if ( i_ship_date co ' 0123456789' and
i_ship_date cn ' 0' ). "ship date sent
* move the ship date into a date field to add days
ship_date = i_ship_date.
elseif ( i_create_date co ' 0123456789' and
i_create_date cn ' 0' ).
ship_date = i_create_date.
endif.
if not i_ship_code is initial.
select single ship_days from zst7f_ty_vendors
into ship_days
where lifnr = vendor_no
and ship_code = i_ship_code.
endif.
if not ship_date is initial.
if ship_days > 0.
ship_date = ship_date + ship_days.
o_delivery_date = ship_date.
shift o_delivery_date left deleting leading ' '.
endif.
endif.
else. "delivery date sent
o_delivery_date = i_delivery_date.
endif.
ENDFORM. " convert_dates
*& Form quantity_conversion
* The quantities in the input file are implied 3-decimal,
* so need to be converted into a "real" number.
* Also, the unit of measure may be 'KP' indicating that the qty
* is given in thousands.
FORM quantity_conversion USING value(i_UOM)
value(i_invoice_qty)
value(i_unit_price)
CHANGING o_uom like iE021-qty_UOM
o_invoice_qty like IE021-INVOICE_QTY
c_LINE_AMOUNT like izss7b21-line_amount.
data: f_invoice_qty type f.
data: n_invoice_qty like lips-kcmeng.
data: f_unit_price type f.
data: f_line_amt type f.
data: n_line_amt0 type p decimals 0.
if ( i_invoice_qty co ' 0123456789' and
i_invoice_qty cn ' 0' ).
f_invoice_qty = i_invoice_qty.
* if no extended price is sent, calculate it
if c_line_amount is initial.
* the qty is implied 3-dec, the price is still implied
* 5-dec, and line amount should be implied 3-dec.
f_unit_price = i_unit_price.
f_line_amt = ( f_invoice_qty * f_unit_price ) / 100000.
n_line_amt0 = f_line_amt.
c_line_amount = n_line_amt0.
shift c_line_amount left deleting leading space.
endif.
* if the invoice qty is per 1000, the implied 3-dec times 1000 equals
* the unconverted value. Otherwise, divide by 1000 to get the PCE qty
if i_uom = 'KP'.
n_invoice_qty = f_invoice_qty.
else.
n_invoice_qty = f_invoice_qty / thou.
endif.
endif.
o_uom = 'PCE'.
if not n_invoice_qty is initial.
o_invoice_qty = n_invoice_qty.
shift o_invoice_qty left deleting leading space.
else.
clear o_invoice_qty.
endif.
ENDFORM. " quantity_conversion
*& Form money_conversion
* Add the implied decimals and store price-per qty, if
* price per 1,000 is sent.
FORM money_conversion USING value(I_CURR)
value(i_UNIT_PRICE)
value(i_UOM)
value(i_LINE_AMOUNT)
CHANGING o_CURRENCY like ie021-currency
o_PRICE_UOM like ie021-price_uom
o_PRICE_QTY like ie021-price_qty
o_UNIT_PRICE like ie021-unit_price
o_LINE_AMOUNT like ie021-line_amount.
data: n_unit_price type p decimals 5,
n_line_amount type p decimals 3.
* not all of the vendors send the currency code, so use the vendor
* master default
case i_curr(2).
when 'US'.
o_currency = 'USD'.
when 'JP'.
o_currency = 'JPY'.
when others.
o_currency = uty_vendors-waers.
endcase.
* unit price is implied 5-dec
if ( i_unit_price cn ' 0' and
i_unit_price co ' 0123456789' ).
n_unit_price = i_unit_price.
n_unit_price = n_unit_price / hun_thou.
endif.
* line price is implied 3-dec
if ( i_line_amount co ' 0123456789' and
i_line_amount cn ' 0' ).
n_line_amount = i_line_amount.
n_line_amount = n_line_amount / thou.
endif.
* 'KP' = price per thousand
if i_uom = 'KP'.
o_price_qty = '1000'.
else.
o_price_qty = '1'.
endif.
o_price_uom = 'PCE'.
if not n_unit_price is initial.
o_unit_price = n_unit_price.
shift o_unit_price left deleting leading space.
else.
clear o_unit_price.
endif.
if not n_line_amount is initial.
o_line_amount = n_line_amount.
shift o_line_amount left deleting leading space.
else.
clear o_line_amount.
endif.
ENDFORM. " money_conversion
*& Form SAP_vendor_partno
* replace UTY part number sent by vendor with SAP material no.
* from PO line item.
FORM SAP_vendor_partno changing cust_partno like ie021-cust_partno.
tables: makt.
data: partno_sent like makt-maktx.
partno_sent = cust_partno.
clear: makt, cust_partno.
select single matnr from ekpo into cust_partno
where ebeln = ie021-po_number and
ebelp = ie021-po_lineno.
if sy-subrc is initial.
*compare material description to part number sent by vendor
select single maktx from makt into makt-maktx
where matnr = cust_partno.
if partno_sent <> makt-maktx.
* 'Part No. Mismatch: PO & - &, Part sent &, SAP mat.no. &'
message i031 with ie021-po_number ie021-po_lineno
partno_sent makt-maktx.
endif.
else. "PO line not found
*try to find SAP material number using 20-char catalog no. sent
select single matnr from makt into cust_partno
where maktx = partno_sent.
if not sy-subrc is initial.
* 'SAP material no. not found for & - PO & - &'
message i032 with partno_sent ie021-po_number ie021-po_lineno.
endif.
endif.
*if not found, IDoc will go to workflow for missing material no.
ENDFORM. " SAP_vendor_partno
*& Form idoc_header_segs
* create internal table entries for header segments.
* DESADV:
* E1EDK07
* E1EDKA1
* E1EDK03
* E1EDK08
* E1EDKA2
* E1EDK06
* INVOIC:
* E1EDK01
* E1EDKA1(s)
* E1EDK02
* E1EDK03(s)
FORM idoc_header_segs using value(desadv_ok).
* INVOIC
clear i_seg_num.
invoicdata-segnam = 'E1EDK01'.
e1edk01-action = ie021-stat.
if ie021-currency(2) = 'US'.
e1edk01-curcy = 'USD'.
else.
e1edk01-curcy = 'JPY'.
endif.
invoicdata-sdata = e1edk01.
append_idoc_rec invoicdata i.
clear e1edka1.
invoicdata-segnam = 'E1EDKA1'.
e1edka1-parvw = 'RE'.
e1edka1-partn = ie021-shipto_id.
invoicdata-sdata = e1edka1.
append_idoc_rec invoicdata i.
clear e1edka1.
invoicdata-segnam = 'E1EDKA1'.
e1edka1-parvw = 'LF'.
e1edka1-partn = ie021-lifnr.
e1edka1-lifnr = ie021-shipto_id.
invoicdata-sdata = e1edka1.
append_idoc_rec invoicdata i.
if not ie021-endcust_name is initial.
clear e1edka1.
invoicdata-segnam = 'E1EDKA1'.
e1edka1-parvw = 'WE'.
e1edka1-name1 = ie021-endcust_name.
invoicdata-sdata = e1edka1.
append_idoc_rec invoicdata i.
endif.
clear e1edk02.
invoicdata-segnam = 'E1EDK02'.
e1edk02-qualf = '009'.
e1edk02-belnr = ie021-invoice_no.
invoicdata-sdata = e1edk02.
append_idoc_rec invoicdata i.
clear e1edk03.
invoicdata-segnam = 'E1EDK03'.
e1edk03-iddat = '012'.
e1edk03-datum = ie021-create_date.
invoicdata-sdata = e1edk03.
append_idoc_rec invoicdata i.
invoicdata-segnam = 'E1EDK03'.
e1edk03-iddat = '024'.
invoicdata-sdata = e1edk03.
append_idoc_rec invoicdata i.
check desadv_ok = '000'.
* DESADV
clear d_seg_num.
desadvdata-segnam = 'E1EDK07'.
e1edk07-action = ie021-stat.
e1edk07-bolnr = ie021-invoice_no.
desadvdata-sdata = e1edk07.
append_idoc_rec desadvdata d.
clear e1edka1.
desadvdata-segnam = 'E1EDKA1'.
desadvdata-sdata = e1edka1.
append_idoc_rec desadvdata d.
clear e1edk03.
desadvdata-segnam = 'E1EDK03'.
desadvdata-sdata = e1edk03.
append_idoc_rec desadvdata d.
clear e1edk08.
desadvdata-segnam = 'E1EDK08'.
e1edk08-vbeln = ie021-invoice_no.
e1edk08-traid = ie021-ship_id.
e1edk08-traty = ie021-ship_method.
desadvdata-sdata = e1edk08.
append_idoc_rec desadvdata d.
clear e1edka2.
desadvdata-segnam = 'E1EDKA2'.
desadvdata-sdata = e1edka2.
append_idoc_rec desadvdata d.
clear e1edk06.
desadvdata-segnam = 'E1EDK06'.
e1edk06-iddat = '025'. "document date
e1edk06-datum = ie021-create_date.
desadvdata-sdata = e1edk06.
append_idoc_rec desadvdata d.
if not ie021-eta is initial.
clear e1edk06.
desadvdata-segnam = 'E1EDK06'.
e1edk06-iddat = '001'. "delivery date
e1edk06-datum = ie021-eta.
desadvdata-sdata = e1edk06.
append_idoc_rec desadvdata d.
endif.
if not ie021-etd is initial.
clear e1edk06.
desadvdata-segnam = 'E1EDK06'.
e1edk06-iddat = '010'. "ship date
e1edk06-datum = ie021-etd.
desadvdata-sdata = e1edk06.
append_idoc_rec desadvdata d.
endif.
ENDFORM. " idoc_header_segs
*& Form idoc_poheader_segs
* create internal table entries for DESADV PO/item segments
* E1EDP07
FORM idoc_poheader_segs.
*DESADV
clear e1edp07.
desadvdata-segnam = 'E1EDP07'.
e1edp07-bstnk = ie021-po_number.
e1edp07-posex = ie021-po_lineno.
desadvdata-sdata = e1edp07.
append_idoc_rec desadvdata d.
p07_ctr = p07_ctr + 1.
ENDFORM. " idoc_poheader_segs
*& Form idoc_item_segs
* create internal table entries for PO item segments:
* DESADV: E1EDP09
* INVOIC: E1EDP01 Qtys
* E1EDP02 ref nos. (PO number / line)
* E1EDP19 part numbers
* E1EDP26 amounts
* E1EDP04 taxes
FORM idoc_item_segs using value(desadv_ok).
data: n_line_amt type p decimals 3.
*INVOIC
clear e1edp01.
invoicdata-segnam = 'E1EDP01'.
e1edp01-menee = ie021-qty_uom.
e1edp01-menge = ie021-invoice_qty.
e1edp01-vprei = ie021-unit_price.
e1edp01-pmene = ie021-price_uom.
e1edp01-peinh = ie021-price_qty.
e1edp01-netwr = ie021-line_amount.
invoicdata-sdata = e1edp01.
append_idoc_rec invoicdata i.
clear e1edp02.
invoicdata-segnam = 'E1EDP02'.
e1edp02-qualf = '001'.
e1edp02-belnr = ie021-po_number.
e1edp02-zeile = ie021-po_lineno.
invoicdata-sdata = e1edp02.
append_idoc_rec invoicdata i.
clear e1edp19.
invoicdata-segnam = 'E1EDP19'.
e1edp19-qualf = '001'.
e1edp19-idtnr = ie021-cust_partno.
invoicdata-sdata = e1edp19.
append_idoc_rec invoicdata i.
clear e1edp19.
invoicdata-segnam = 'E1EDP19'.
e1edp19-qualf = '002'.
e1edp19-idtnr = ie021-vendor_partno.
invoicdata-sdata = e1edp19.
append_idoc_rec invoicdata i.
clear e1edp26.
invoicdata-segnam = 'E1EDP26'.
e1edp26-qualf = '003'.
e1edp26-betrg = ie021-line_amount.
invoicdata-sdata = e1edp26.
append_idoc_rec invoicdata i.
* dummy tax seg
clear e1edp04.
invoicdata-segnam = 'E1EDP04'.
e1edp04-msatz = '0.00'.
invoicdata-sdata = e1edp04.
append_idoc_rec invoicdata i.
n_line_amt = ie021-line_amount.
invoice_total = invoice_total + n_line_amt.
check desadv_ok = '000'.
*DESADV
clear e1edp09.
desadvdata-segnam = 'E1EDP09'.
e1edp09-vbeln = ie021-slip_number.
e1edp09-matnr = ie021-vendor_partno.
e1edp09-vrkme = ie021-qty_uom.
e1edp09-lfimg = ie021-invoice_qty.
desadvdata-sdata = e1edp09.
append_idoc_rec desadvdata d.
ENDFORM. " idoc_item_segs
*& Form post_idocs
* create database IDocs from the idocdata tables and clear tables.
FORM post_idocs using value(desadv_ok).
*INVOIC
clear e1eds01.
invoicdata-segnam = 'E1EDS01'.
e1eds01-sumid = '010'.
e1eds01-summe = invoice_total.
e1eds01-waerq = ie021-currency.
shift e1eds01-summe left deleting leading space.
invoicdata-sdata = e1eds01.
append_idoc_rec invoicdata i.
CALL FUNCTION 'INBOUND_IDOC_PROCESS'
TABLES
IDOC_CONTROL = iedidc
IDOC_DATA = invoicdata.
commit work.
*DESADV
if desadv_ok = '000'.
clear e1eds02.
desadvdata-segnam = 'E1EDS02'.
e1eds02-sumid = '001'.
e1eds02-summe = p07_ctr.
shift e1eds02-summe left deleting leading space.
desadvdata-sdata = e1eds02.
append_idoc_rec desadvdata d.
CALL FUNCTION 'INBOUND_IDOC_PROCESS'
TABLES
IDOC_CONTROL = dedidc
IDOC_DATA = desadvdata.
commit work.
endif.
refresh: desadvdata,
invoicdata.
clear:
desadvdata,
invoicdata,
p07_ctr,
invoice_total,
save_stat,
save_po,
save_line,
save_invoice.
ENDFORM. " post_idocs
*& Form init_desadv
* add a DESDAV control record and initialize fields
FORM init_desadv.
clear dedidc. refresh dedidc.
* initialize control record:
move: '2' to dedidc-direct,
'DESADV01' to dedidc-doctyp,
'DESADV' to dedidc-mestyp,
'F' to dedidc-std,
'E021' to dedidc-stdmes,
'LS' to dedidc-sndprt,
'TY_VENDORS' to dedidc-sndprn,
sy-datlo to dedidc-credat,
sy-timlo to dedidc-cretim.
append dedidc.
ENDFORM. " init_desadv
*& Form init_invoic
* add a INVOIC control record and initialize fields
FORM init_invoic.
clear iedidc. refresh iedidc.
* initialize control record:
move: '2' to iedidc-direct,
'INVOIC01' to iedidc-doctyp,
'INVOIC' to iedidc-mestyp,
'MM' to iedidc-mescod,
'F' to iedidc-std,
'E021' to iedidc-stdmes,
'LS' to iedidc-sndprt,
'TY_VENDORS' to iedidc-sndprn,
sy-datlo to iedidc-credat,
sy-timlo to iedidc-cretim.
append iedidc.
ENDFORM. " init_invoic
REWARD POINTS IF HELPFUL
Lakshmiraj.A -
STO - IDOC INVOIC - MM Receipt on Delivery note rather PO number
Hi Gurus,
I'm processing an MM Receipt INVOIC IDOC to create an Intercompany Vendor Invoice against a Purchase order.
This is integrated in a standard Stock Transfer Order. This IDOC is generated using Output type RD04 from Intercompany billing.
When SAP creates IDOC, it is based on the Delivery note number rather than the PO number, even I have the PO and Delivery in my PO historic, and even if I have IDOC segment E1EDP02 QUALF 001 with PO and segment E1EDP02 with QUALF 016 with Delivery note.
I tried to managed PO item flags: "Invoice Receipt Indicator" or "Indicator: GR-Based Invoice Verification".
But there is no impact.
When I create the MM Receipt manually using TCode MIRO in reference to the PO. It works.
When I create the MM Receipt manually using TCode MIRO in reference to the Delivery not. It doesn't work. I got the same error message "Delivery note/service entry sheet xxxx does not exist".
I conclude that when SAP performs the IDOC, someting in the IDOC tells him to create a invoice in reference to the Delivery note rather than the PO. How can we change it?
Please, could you help me to understand this blocking point and to allow to create the MM Receipt on PO?
Many thanks.
Stéphane.hello, friend.
i am not an expert in MM, but....
i noticed that when using MIGO, you can do GR based on an inbound delivery, and maybe also an outbound delivery (from STO). an outbound delivery created in an STO scenario should have links to the STO related PO. could this be the link you are looking for?
regards. -
Sales Order Creation against Quotation reference using FM IDOC_INPUT_ORDERS
Hi Experts,
I have to create sales order against reference of Quotation using Function module IDOC_INPUT_ORDERS. Can any one help me out regarding this.
In which segment of IDOC do we need to populate QUOTATION NO.? I am using WE19 with a IDOC and executing FM IDOC_INPUT_ORDERS.
Regards,
Rajiv Singh.e1edp02-qualf = '004'.
e1edp02-belnr = vbap-vbeln.
e1edp02-zeile = vbap-posnr.
vbap-vbeln is the quotation document and vbap-posnr the item number of the quotation.
Regards Jack -
How to post idoc ORDERS05 from ABAP standalone program to the same R3 syst?
Hi Masterminds,
I need to post IDoc from ECC to same R/3 system. For that i need to develop a standalone program which will post Idoc 'ORDERS05'.
I had the following data:
E1EDKA1 - PARTN
E1EDK02; QUALF = 001 - BELNR
E1EDP19; QUALF = 003 - IDTNR
E1EDP02; QUALF = 997 - BELNR
E1EDP01 MENGE - Space
E1EDP02; QUALF = 999 - BELNR
E1EDK01 BSART - Space
E1EDP19; QUALF = 002 - IDTNR
E1EDP01 ABGRU - Space
E1EDKA1 PARVW - Space
Please provide me details how to write the program and what necessary steps do i need to follow.
Thanks......Hi,
Do ALE settings and Fill two tables of type EDIDD and structure of type EDIDC
and pass it to function module
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = P_WA_EDIDC
OBJ_TYPE = ''
CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = P_I_EDIDC
MASTER_IDOC_DATA = P_I_EDIDD
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5. -
Processing IDOC Basic type ORDERS05 in CRM...
I'm processing (via WE19) an IDOC (Basic type ORDERS05) to create a Sales order withing CRM. I'm getting there in that a sales order is being raised, although there is no item level details so far. I know that config of the system plays a big hand in what fields within the IDOC need to be populated but has anyone actually posted/raised a Sales order in this way and can you tell me what fields within the IDOC are mandatory. Or perhaps suggest how I might derive this.
Ideally I wanted to extract a sales order and produce an outbound IDOC and then compare the contents, but I can't (don't know how) do this.
Any help would be greatly appreciated.Hi Garry,
Here is an order from WE19, which works
E1EDK01
ACTION: [QUAL] - suggesting 000 - no changes
E1EDK14
QUALF: [QUAL] - suggesting 008 - sales org
ORGID: [ORGANIZATION] - anything you have defined /your side/
E1EDK03
IDDAT: [QUAL] - suggesting 002 - delivery date
DATUM: [DATE] - any date
E1EDKA1
PARVW: [QUAL] - may use AG as 'sold to' here
PARTN: [PARTNER#] - any partner defined
E1EDKA1 - not necessary
PARVW: [QUAL] - may have different 'sold to' and 'ship to' or 'bill to'
PARTN: [PARTNER#]
E1EDP01
POSEX [ITEM#] - for example '1'
MENEE [Unit of measure] - PCE for peaces
E1EDP02
QUALF: [QUAL] - suggesting 001 - customer order
BELNR: [document number] - document #. any
E1EDP20
WMENG: [Scheduled quantity] - any - quantity
EDATU: [Date] - any - when to deliver
E1EDP19
QUALF: [QUAL] - for example 001 - used by customer, 004 - used by manufactured
IDTNR: [material ID] - material ID
E1EDS01
SUMME: [Total value of sum segment] - check for the number of lines in PO1.
Hope this helps and do not forget to allot points.
Regards,
Martin -
IDOC ORDERS05 to process PO acknowledge sent from vendors.
I am trying to use IDOC ORDERS05 to process PO acknowledge sent from vendors.
You, the IDOC experts out there, please give me some direction about
where I should put the vendor's acknowledge number and
where I should put our PO number in IDOC ORDERS05,
so the field LABNR in EKPO will be updated with vendor's PO acknowledge number after the IDOc is posted.
Thanks in advance!
Fisher LiSam,
The following are what I did and it worked for us.
Hopefully it will help you.
E1EDK01-ACTION = '000'
E1EDKA1-PARVW = 'LF'
E1EDKA1-LIFNR = vendor number
E1EDK02-QUALF = '001'
E1EDK02-BELNR = purchase order number
E1EDP01-ACTION = '004'
E1EDP01-MENGE = PO line item qty
E1EDP01-MENEE = PO line item unit of measure
E1EDP02-QUALF = '001',
E1EDP02-BELNR = purchase order number
E1EDP02-ZEILE = PO line item number
E1EDP02-QUALF = '002',
E1EDP02-BELNR = PO acknowlegement number
Regards
Fisher Li -
EDI Vendor posting (INVOIC01) to account assign Profitability segment
Hello Experts,
Have anyone used INVOIC01 (EDI vendor) Idoc type to post to a Profitability segment in a InterCompany sales scenario? If yes, could someone guide me how to achieve this? I see that OBCC transaction has Profitability segment field, but I am not sure how to use it.
Any ideas?
Thanks for your time.Thanks Waman for the SAP notes.
In fact, I have looked at those notes, already. We cannot change to INVOIC02 Idoc type.
I wonder, why SAP does not offer the functionality to update Profitability segment on the EDI Vendor posting. Transaction OBCC has Profitability segment, but giving a fixed PSEG will not meet any business requirement! EDI enhancement FEDI0001 has only EDI-FIELDS and not the IDoc segment details. There is nothing much one can do with just the EDI-FIELDS.
Have you used FEDI0001 enhancement for PSEG determination? Looks like all that one can do with FEDI0001 is move the OBCC configuration values to Coding block.
Thanks for your time. -
Populating value in idoc segment E1EDP02 for INVOIC01- incoming invoice
Hi Friends,
I am working to get the incoming freight invoice posted to MIRO, using
IDOC : INVOIC01
message type: INVOIC
process code: INVL
function module : IDOC_INPUT_INVOIC_MRM
Vendor does not send the PO number only send the bill of lading number(shipment number). So i have customised the IDOC with one segment for getting bill of lading number. My requirement is get bill of lading number and then get PO no and populate into segment E1EDP02. I am not able to populate this field and hence each time the IDOC fails with message :
Required field BELNR(001) is missing in segment E1EDP02
Required field ZEILE(001) is missing in segment E1EDP02
Please tell me how to get this field populated and get the issue resolved. I have been trying to figure out for couple of days but no success OR My approach is incorrect for posting invoice to MIRO with populating field segment.
Please suggest.
Thanks
DeepakThanks everyone for getting the issue resolved. I have implemented implicit enhanencement and before the function module strarts procesing, I loop over segments and fill up the PO number to E1EDP02 for bill of lading number. There was also a case of error handling for IDOC. That is to check if the amount sent by vendor is correct as compared to the amount on the shipment cost docuemnt, if they dont match then I need to send an email to the business informing them for bill of lading number and amount. There is also another check to find out if the bill of lading number has already been invoiced, if invoiced I again need to inform the business user.
So keep all the requirements in mind I went with Implicit enhancement, thus populating the required segment and if the validations fail for amount or invoice document already generated, then I send the mail to business with bill of lading number and reason of failure. In such case IDOC is not executed and after sending the mail, the logic exits out of function module.
I -
EDI - Incoming Invoice Error and GR based Invoice Verification - 51 No GR
Hi,
We are implementing EDI for incoming invoices and use Goods Receipts based Invoice Verification. When processing an inbound IDOC Invoice (type INVOIC01) where the Goods Receipt has not yet been posted, then Inbound IDOC is siiting at Error Status, 51 - No GR documents found.
Is there any way we can process this as a Parked Invoice or for Verification in the background (MIRA)? because the current situation is a problem, as 95% of our Inbound Invoices will be received electronically before the Goods are Received.
The actual Vendor's delivery note is stored in the segment E1EDP02 (Qualifier 016), field BELNR.
Currently the IDOC as to sit in error until the Vendor's Delivery Note is Goods Receipted which can be several days later - SAP OSS Note 393883 fro 2001 suggests doing this, but surely this is a common situation. The IDOC sitting in error in WE02 in the list of IDOCs is difficult to isolate from true errors.
If this is was mnaul Invoice it could be processed through MIRA for background Invoice Verification later with program RMBABG00.
We havd SAP version ECC 6.0
I have spotted OSS Note 501524 which implies that is possible automatically Park Incoming EDI IDOC Invoices, has anyone tried this? and what would be the transaction/program that could be used to post several at once when the GR has been processed (similar to RMBABG00)Hi ,
You can use the program RBDMANI2 which will reprocess all the IDOCs (EDIinvoices )that have failed . You can schedule this program in the background and it will post all failed invoices which have the GR posted later .
We had the same scenario and we have scheduled this program as a daily job at night .
Regards,
Hari. -
Trying to get EDI Invoices working for purchasing
I am trying to setup inbound Invoice processing using an INVOIC01 IDOC, Process Code INVL.
As far as I can tell from my searches on the internet and from other sources, I have a syntactically correct IDOC and all of my config is correct, however I get the following message in workflow when I try and load the IDOC:
Item 00010 for purchasing document 4500321129 not selectable
I am a novice to the MM side of things, and am not sure exactly what this line means. I am testing against asingle line order. Using WE19, I see the following:
On the E1EDP01
Document item 00010
Action
Item Category 0
Order ackn.req.
Quantity 1000.000
Unit of measure CS
Quantity 1000.000
Price UoM CS
***. quantity
Net price 6.99
On the E1EDP02
Qualifier 001
Document 4500321129
Document item 00010
Date
Time
BSARK
IHREZ
Also, I just want to verify that I am correct in one assumption that I am making. I am assuming that I can bring in a INVOIC01 as a parked invoice against an Purchase Order which has not had the goods receipt. Is this correct?
Thanks, RickRichard,
For your line item issue, check the PO/line item to confirm the line item has not been deleted. If it is an active line item the other thing I would check would be the price (confirm it exists on the pricing conditions) .
During the EDI invoice posting process if the PO/line item is set as GR based-IV the idoc will fail if no GR has been made. Once the GR has been done, the idoc can be reprocessed manually via BD87 or via a scheduled job.
Regards,
Sandra
Maybe you are looking for
-
SQL Database replication between Primary and DR site
Hi, We are setting up a DR Site, for our Production SAP system. At present the curren setup for Production SAP system are as follows. SAP ERP 2005 (SAP ECC 6.), ABAP+JAVA on Windows with MS SQL Server 2005. Data are stored on SAN and SAP installed on
-
Integrating Reports from SQL Server Reporting Services
Dear Experts, I am given the URL to a report from SQL Server Reporting Services. The URL looks like [http://<report_server_host>/ReportServer/Pages/ReportViewer.aspx?/<category>/<report>&<list_of_parameter_value_pairs>] When this URL is executed, the
-
Using logging.properties in weblogic 10.3.6
Hi I have created logging.properties under Middleware Home and the content of property file is below ####################Logging.properties file content#################### handlers = java.util.logging.ConsoleHandler,java.util.logging.FileHandler.lev
-
Hi, I'm new to Oracle APPS. As part of a TAR , I've to do the step below but I need help in this.Its very urgent . Thanks a lot. On a unix session, open PYUPIP on 'PEUTRC' as - PYUPIP <username>/<password>@<dbname> 'PEUTRC' > trace_file.log Thanks...
-
Frustrated and about to throw my mp3 out the win
I just got a creative zen v (not plus), and am using a laptop with windows vista. i downloaded the software with no problems and when i check in my computer, it recognizes that the player is hooked up. however, when i try to use the software to add m