Change the sales bom sub-item catetory
Hi,
I have created sales bom with main material assign LUMF. When I create sales order, with below feedback
item 10 - Material A with item cate. TAP
item 20 - Material B with item cate. TAN
I want to change the item cate. TAN, as we r using other item cate. (ZTAN) I have assign the item cate to sales order type
Saty ItCGR USG. HLevItCa DfltC MitCa
OR LUMP TAP TAN ZTAN
> I have created sales bom with main material assign LUMF. When I create sales order, with below feedback
> item 10 - Material A with item cate. TAP
> item 20 - Material B with item cate. TAN
> I want to change the item cate. TAN, as we r using other item cate. (ZTAN) I have assign the item cate to sales order type
>
> Saty ItCGR USG. HLevItCa DfltC MitCa
> OR LUMP TAP TAN ZTAN
Hi,
Goto the T.Code "VOV4".
In this as you have assigned correctly,you can change manually to "ZTAN" as you have maintained it as Mitcat.
If you want that it should come automatically while creating the order,then Maintain "ZTAN" as the Default Item category.
Save.
Regards,
Krishna.
Similar Messages
-
Printing SALES BOM sub items / child items
Hi,
We currently have SALES BOM materials setup & have sub items suppressed from printing on pick notes & delivery notes. I now have some materials which i need to be SALES BOM materials but i want the sub items to print on the pick notes & delivery notes.
I have copied the material type into a new material type but dont know where to look where I can allow printing of sub items for this material type?? I've look in IMG & also SMARTFORMS but can find where i need to configure this.
Can someone please help?? p.s I'm a bit of a novice so will need detailed instructions.
Many thanks in advance
DeanPlease try VBAP and VSVBAP_CN tables.
You have to take VBAP-SERNR field for your sales order and give it as input in VSVBAP_CN-SERNR and then you will get all the parent and child items. If you tell this to ABAPer, he should be able to enable this in the smartform you are going to use.
The same field is available in VBRP also.
Hope this helps. -
Quantuty on the Sale Order line item
HI,
Can anyone suggest how to control the Quantity on the sales order line item.
Sale order line item should not be reduced below the delivered or invoiced quantity. For EX:Sale order line item 10 has 200kgs,delivery quantity created aganist that order is 100kgs, now the system should not allow us to change the sale order line item quantity below the delivery quantity i.e 100kgs.
Thanks in Advance.In the transaction OVAH, for the message class V4 and message number 083, in the category column, change the entry from W to E. Then system will issue hard error when you change the order qty to below delivered qty.
Regards
Sai -
Change the sales order reason for rejection for line item
Hi,
i want to change the sales order reason for rejection for line item.
iam using bapi_salesorder_change.but i unable to change the sales order.
if possible please provide me what are the fields necessary for changing
sales order reason for rejection for line item.
Regards,
SureshThis is the standard config to supress printing on the rejected item. Are you using standard programs or customised ?
-
when i create a sales bom, all the components display as independent items on the picklist. why? and it also does not display the parent item. the picker needs to see this information! how can i make that show up on the picklist? any ideas?
Hi Gordon,
I appreciate your mature reply to my critical posting.
Do you know what the Sales BOM is supposed to be used for? I am not sure how in any possible context can the below make sense:
1. Currently B1 will deliver components only of a Sales BOM at zero cost
2. Given sales orders can "expire" (in the sense they can have a cut-off date - typically 30 days by default I think), surely if one doesn't receive the remaining components in time, this would lead to a very awkward situation! What if the remaining component(s) is/are non-purchased item(s)?
If the above was registered as a program error, fair enough. But they won't register it. any ideas why?
Although with each version (see below), everything works "as designed" - they keep changing it:
In 2004A, Sales BOMs were working "as designed" - but P&P manager couldn't be used (parent item was lost when making delivery note)
In 2005A, Sales BOMs were working "as designed" - same as above - but Assembly BOMs (essentially the same thing) were improved would print off a separate component picking list.
In 2007A, Sales BOMs are working "as designed" - note, this hasn't officially changed yet - but we now get the parent item in the delivery via P&P
Our SAP partner was just as surprised at the functionality as we were when we moved ahead with the install a few years ago.
Please understand, my only issue is the lack of willingness from SAP to recognise the problem at all - and the standard answer of "as designed" even when it is clear there is a problem. If you can help myself and perhaps Prem improve our understanding of the design (especially points 1 and 2 above) I would genuinely be grateful.
Thanks,
Raj
Edited by: Rajiv Agarwalla on Dec 12, 2008 2:24 AM
Edited by: Rajiv Agarwalla on Dec 12, 2008 2:25 AM -
I need to add fields in additional fields B the sales order line item
i need to add fields in additional fields B beside the field (icon_val_quantity_ structure) in the sales order line item, How to achicve this? please help me..
Please fined the below solution for achieving your requirement.
1. Add new filed "B" in table VBAP.
a) T.code SE11 --> Enter structure name VBAP --> display
b) Goto --> Append Structure --> Enter Structure name and new field "B"
2. request your basis team and take the access key for modification of stabdard program SAPMV45A & Screen: 8459
a) After receiving access key for standard program then got o SE51 --> enter program name SAPMV45A & Screen: 8459
b) click change Button
c) click layout button
d) add new field "B" below of the screen (F6 -> enter table name : VBAP --> get from dictionary --> selet new field and past in screen )
3) write below code in flow logic
PROCESS BEFORE OUTPUT.
Verarbeitung vor der Ausgabe
MODULE ZZPB_INITIALIZE_8459.
MODULE ZZPB_OUTPUT_8459.
PROCESS AFTER INPUT.
CHAIN.
FIELD VBAP-New field name "B".
FIELD ZVC_SALES_EXPORT-ZZAPLHENKO.
ENDCHAIN.
MODULE ZZPA_OUTPUT_8459.
4. functin Module code
module ZZPB_OUTPUT_8459 output.
Data: l_v_actve type ale_active,
l_v_ttyp type c.
Data: l_v_tragr type tragr.
l_v_ttyp = t180-trtyp.
if l_v_actve is initial.
l_v_ttyp = 'A'.
endif.
LOOP AT SCREEN.
CASE l_v_ttyp.
WHEN 'A' OR 'C'.
SCREEN-INPUT = 0.
ENDCASE.
ENDLOOP. -
Copying text from CMIR (KNMT) to the Sales Order Line Item
We need to copy text from the CMIR (KNMT) to the Sales Order Line Item with two steps in the access sequence. First to look up by the Ship to Partner Function. If doesn't exist, then look up by Sold to Partner Function. Have setup a new text id (ZPRN), a new access seq (9011). The access seq has one seq =5 for KNMT, ZPRN, all languages and that saves fine. When I set the Partner Function to be SH. I get the following error msg:
"The Language does not come from the partner function AG for MVKE".
Any ideas? This access seq does not reference MVKE. It only references KNMT.
Thanks!Hi Lisa,
Just stumbled on this post, as I am searching for something similar.
What you are attempting to do isn't possible in config.
This is because as standard Customer Material Info Records are not even considered for ship-to party in the sales order.
They work for sold-to only.
Therefore, this funny error message is SAP's way of saying, "Why are you trying to enter a partner here, because the data is determined for sold to only?"
You can change this with development for other fields (ie, to determine delivery plant, tolerances etc at ship-to) by using
the exit MV45AFZB with the USEREXIT_CUST_MATERIAL_READ form.
However, even if you do this, Text Determination is still sold-to only and still doesn't behave.
I am currently looking myself for a solution for this problem and I will let you know what I find.
Cheers
Chris -
You cannot change the price of an item AFTER I check out!
I ordered an XMEN: Days of Future Past box set with a robot head last night for $17.99 plus tax for store pickup online. The total came out to be a bit over $20. When I checked my email today, I was charged $29.99 for the item, and tax based on the new sale price. This is an increase of more than 50%!
It is not legal to change the price of an item AFTER a price is agreed and someone has paid. I would like someone to fix this, as this is a big deal for your customers.
I would like to know what Best Buy can do about this issue? I live in Minneapolis, and would like to believe that our local businesses aren't cheating their customers, especially those in their hometown.Greetings Kylearin,
I can imagine why you'd be concerned! I'd be surprised too if a price I saw during checkout was not reflected in my order confirmation page.
I've had the chance to review your account and it appears that your order for X-Men: Days of Future Past was submitted on 11/26/2014, shortly after midnight. Since this particular movie was a Deal of the Day item on 11/25 -- and since your order was not received while the lower sale price was in effect -- the price reflected on your order is correct. It's unfortunate if this does not meet your expectations, but remember that you may always cancel your order if you'd like by signing into your account on BestBuy.com.
BestBuy.com > Help Center > Cancel Your Order
http://bbyurl.us/ModifyingOrders
Thanks for your understanding, as well as for taking the time to post.
Aaron|Social Media Specialist | Best Buy® Corporate
Private Message -
Change the color of text item after execute query
Dear friends
I would like to know how can I make a tabular form like grid and chang the color of text item when (for exp in emp table) the value of sal column between 2000$ and 4000$.
I used the SE_IEM_PROPERTY command but it change all of the text items of sal column.
please help me
thanks a lotHighlight the Existing Record in Forms
(Compatible with 4.x, 5.x, 6.x & 9i)
Step 1: Create a New Visual Attribute(BLUE_VA) (Color of highlighted record)
Font â Arial
Size â 8
Style â Plain
Font width - Normal
Font Weight - Bold
Foreground Color â Black
Background Color â Blue
Fill Pattern â Transparent
Step 2: Create another Visual Attribute (WHITE_VA) (Default Color of the record)
Font â Arial
Size â 8
Style â Plain
Font width - Normal
Font Weight - Bold
Foreground Color â Black
Background Color â White
Fill Pattern â Transparent
Step 3: Add Following code to Block-level Trigger WHEN-NEW-RECORD- INSTANCE, POST-BLOCK
(Add to the block, which has these records)
-- Following code will only highlight an item
DISPLAY_ITEM(<block_name>.<item_name>,'BLUE_VA');
-- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
DECLARE
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
BEGIN
cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
cur_itm := cur_block||'.'||cur_itm;
Display_Item( cur_itm, 'BLUE_VA');
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP;
END;
Step 4: Add Following code to Block-level Trigger PRE-RECORD, PRE-BLOCK
(Add to the block, which has these records)
-- Following code will only highlight an item
DISPLAY_ITEM(<block_name>.<item_name>,'WHITE_VA');
-- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
DECLARE
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
BEGIN
cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
cur_itm := cur_block||'.'||cur_itm;
Display_Item( cur_itm, 'WHITE_VA');
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP;
END;
I am using the above code in one of my forms and I so far haven't seen any problem -
'BAPI_SALESORDER_CHANGE - Want to change the Quantity on Line Item in SO
Hi
I am facing a problem. The requirement is to change the Sales Order Item Quantity. I basically planned to update the quantity of Schedule Item which needs to be changed. When I run the below code, it works and says the Sales Order changed succesfully. However I get an express message saying the Database update failure. I don't get any sort of technical information.
Appreciate if you could help me finding the error.
Thanks
regards
girish
Note --> I am trying to change the Quantity for 2 line item in SO '56' to 40 Units.
REPORT ZBAPI_SALESORD_CHANGE.
data : zBAPISDHD type /AFS/BAPISDHD,
zORDER_HEADER_INX TYPE /AFS/BAPISDHDX,
zSALESDOCUMENT type BAPIVBELN-VBELN.
data : zORDER_ITEMS_IN like /AFS/BAPISDITM occurs 0 with header line,
zORDER_ITEM_INX like /AFS/BAPISDITMX occurs 0 with header line,
zORDER_SCHEDULES_IN like /AFS/BAPISDSCHD occurs 0 with header line,
ZSCHEDULE_LINESX LIKE /AFS/BAPISDSCHDX occurs 0 with header line,
zORDER_PARTNERS like BAPIPARNR occurs 0 with header line,
zRETURN like BAPIRET2 occurs 0 with header line,
so_no type BAPIVBELN-VBELN,
zPARTNERCHANGES like BAPIPARNRC occurs 0 with header line.
data : l_comp_qty like zORDER_ITEMS_IN-COMP_QUANT.
data : g_qty like /AFS/BAPISDSCHD-REQ_QTY.
g_qty = 40.
l_comp_qty = 40.
clear : zBAPISDHD.
so_no = '0000000056'.
zBAPISDHD-REFOBJTYPE = '/AFS/ORDER'.
zBAPISDHD-SALES_ORG = 'BP01'.
zBAPISDHD-DISTR_CHAN = '02'.
zBAPISDHD-DIVISION = '01'.
zBAPISDHD-PMNTTRMS = '0001'.
zORDER_HEADER_INX-UPDATEFLAG = 'U'.
zORDER_HEADER_INX-SALES_ORG = 'X'.
zORDER_HEADER_INX-DISTR_CHAN = 'X'.
zORDER_HEADER_INX-DIVISION = 'X'.
zORDER_HEADER_INX-PMNTTRMS = 'X'.
**********ITEM ***************************************
zORDER_ITEMS_IN-ITM_NUMBER = '00020'.
zORDER_ITEMS_IN-MATERIAL = 'F1202'.
zORDER_ITEMS_IN-PLANT = 'BP01'.
zORDER_ITEMS_IN-ITEM_CATEG = 'TAS'.
zORDER_ITEMS_IN-SHIP_POINT = 'BP01'.
zORDER_ITEMS_IN-COMP_QUANT = l_comp_qty.
zORDER_ITEMS_IN-TARGET_QTY = l_comp_qty.
zORDER_ITEMS_IN-TARGET_QU = 'ST'.
append zORDER_ITEMS_IN.
zORDER_ITEM_INX-ITM_NUMBER = '00020'.
zORDER_ITEM_INX-UPDATEFLAG = 'U'.
zORDER_ITEM_INX-MATERIAL = 'X'.
zORDER_ITEM_INX-PLANT = 'X'.
zORDER_ITEM_INX-ITEM_CATEG = 'X'.
zORDER_ITEM_INX-SHIP_POINT = 'X'.
zORDER_ITEM_INX-COMP_QUANT = 'X'.
zORDER_ITEM_INX-TARGET_QTY = 'X'.
zORDER_ITEM_INX-TARGET_QU = 'X'.
append zORDER_ITEM_INX.
*********SCHEDULE LINE******************************
refresh zORDER_SCHEDULES_IN.
clear zORDER_SCHEDULES_IN.
zORDER_SCHEDULES_IN-ITM_NUMBER = '000020'.
zORDER_SCHEDULES_IN-SCHED_LINE = '0001'.
zORDER_SCHEDULES_IN-REQ_DATE = '20070525'.
zORDER_SCHEDULES_IN-DATE_TYPE = '1'.
zORDER_SCHEDULES_IN-SCHED_TYPE = 'CS'.
zORDER_SCHEDULES_IN-GRID_VALUE = 'BLK2728'.
zORDER_SCHEDULES_IN-REQ_CATEGORY = '1DE'.
zORDER_SCHEDULES_IN-REFOBJTYPE = '/AFS/ORDER'.
zORDER_SCHEDULES_IN-REQ_QTY = g_qty.
append zORDER_SCHEDULES_IN.
refresh ZSCHEDULE_LINESX.
clear ZSCHEDULE_LINESX.
ZSCHEDULE_LINESX-ITM_NUMBER = '000020'.
ZSCHEDULE_LINESX-SCHED_LINE = '0001'.
ZSCHEDULE_LINESX-UPDATEFLAG = 'U'.
ZSCHEDULE_LINESX-REQ_DATE = 'X'.
ZSCHEDULE_LINESX-DATE_TYPE = 'X'.
ZSCHEDULE_LINESX-SCHED_TYPE = 'X'.
ZSCHEDULE_LINESX-GRID_VALUE = 'X'.
ZSCHEDULE_LINESX-REQ_CATEGORY = 'X'.
ZSCHEDULE_LINESX-REFOBJTYPE = 'X'.
ZSCHEDULE_LINESX-REQ_QTY = 'X'.
append ZSCHEDULE_LINESX.
CALL FUNCTION '/AFS/BAPI_SALESORD_CHANGE'
EXPORTING
SALESDOCUMENT = so_no
ORDER_HEADER_IN = zBAPISDHD
ORDER_HEADER_INX = zORDER_HEADER_INX
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
TABLES
RETURN = zRETURN
ORDER_ITEM_IN = zORDER_ITEMS_IN
ORDER_ITEM_INX = zORDER_ITEM_INX
ORDER_SCHEDULE_LINES = zORDER_SCHEDULES_IN
ORDER_SCHEDULE_LINESX = ZSCHEDULE_LINESX.
PARTNERS =
PARTNERCHANGES = zPARTNERCHANGES
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
*CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = so_no
ORDER_HEADER_IN = zBAPISDHD
ORDER_HEADER_INX = zORDER_HEADER_INX
TABLES
RETURN = zRETURN
ORDER_ITEM_IN = zORDER_ITEMS_IN
ORDER_ITEM_INX = zORDER_ITEM_INX
PARTNERS = zORDER_PARTNERS
PARTNERCHANGES = zPARTNERCHANGES
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
SCHEDULE_LINES = zORDER_SCHEDULES_IN
SCHEDULE_LINESX = ZSCHEDULE_LINESX.
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
data : s_BAPIRET2 like BAPIRET2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
importing
return = s_bapiret2.Hi,
Refer this code: Marked in bold
Get Line Item Details which are to be deleted
The line items fetched but not matching with ALV data
are the one which are copied from Reference Order
and should be deleted from our Sales Order
PERFORM get_line_item_details.
To get all the uploaded data
i_upload_2[] = i_upload[].
This is to be executed only if the SALES ORDER
IS CREATED WITH REFERENCE & User has selected
the record in ALV for Order Creation
LOOP AT i_upload INTO wa_upload_1
WHERE chkbx = 'X'
AND vbeln NE space.
MOVE wa_upload_1 TO wa_upload.
Clear Work Area/Local variables & Internal tables
CLEAR : l_sales_no,
l_item_number,
wa_header_in,
wa_header_inx,
wa_curr,
l_currency,
l_count,
l_counter.
REFRESH : i_cond,
i_cond_inx,
i_sch_in,
i_sch_inx,
i_items_in,
i_items_inx,
i_return,
i_partner_inx.
AT NEW seqno.
Get the Sales Order Number for corresponding record
READ TABLE i_result_all INTO wa_result_all WITH KEY
ref_no = wa_upload-vbeln
seqno = wa_upload-seqno.
IF sy-subrc EQ 0.
IF NOT wa_result_all-vbeln IS INITIAL.
l_sales_no = wa_result_all-vbeln.
ENDIF.
ELSE.
CONTINUE.
ENDIF.
READ TABLE i_curr INTO wa_curr
WITH KEY vbeln = l_sales_no.
Header Data
CLEAR wa_header_in.
wa_header_in-sales_org = wa_upload-vkorg.
wa_header_in-distr_chan = wa_upload-vtweg.
wa_header_in-division = wa_upload-spart.
wa_header_in-ref_doc = wa_upload-vbeln.
wa_header_in-ref_doc_l = wa_upload-vbeln.
wa_header_in-purch_no_c = wa_upload-bstnk.
CLEAR : wa_header_inx.
wa_header_inx-updateflag = 'U'.
wa_header_inx-sales_org = 'X'.
wa_header_inx-distr_chan = 'X'.
wa_header_inx-division = 'X'.
wa_header_inx-purch_no_c = 'X'.
Check Business Object
CLEAR : l_bus_object.
IF wa_upload-auart = 'ZY01' OR
wa_upload-auart = 'ZY07' OR
wa_upload-auart = 'ZY08' OR
wa_upload-auart = 'ZY09' OR
wa_upload-auart = 'ZY18' OR
wa_upload-auart = 'ZY94' .
l_bus_object = 'BUS2032'.
ELSEIF
wa_upload-auart = 'ZY10' OR
wa_upload-auart = 'ZY11' OR
wa_upload-auart = 'ZY27' OR
wa_upload-auart = 'ZY28' OR
wa_upload-auart = 'ZY92' OR
wa_upload-auart = 'ZY93'.
l_bus_object = 'BUS2102'.
ELSEIF
wa_upload-auart = 'ZY16' OR
wa_upload-auart = 'ZY30'.
l_bus_object = 'BUS2094'.
ELSEIF
wa_upload-auart = 'ZY17' OR
wa_upload-auart = 'ZY31'.
l_bus_object = 'BUS2096'.
ELSEIF
wa_upload-auart = 'ZY06' OR
wa_upload-auart = 'ZY26'.
l_bus_object = 'BUS2032'.
ENDIF.
*Populate Ship-to-party
IF NOT wa_upload-scode IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = '000000'.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_we.
wa_partner_inx-p_numb_new = wa_upload-scode.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Bill to Party
IF NOT wa_upload-bparty IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = '000000'.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_re.
wa_partner_inx-p_numb_new = wa_upload-bparty.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Payer
IF NOT wa_upload-payer IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = '000000'.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_rg.
wa_partner_inx-p_numb_new = wa_upload-payer.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Sales Rep
IF NOT wa_upload-salesrep IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = '000000'.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_ys.
wa_partner_inx-p_numb_new = wa_upload-salesrep.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Check condition type & unit price
For the following Document Types,
Condition Type & Unit Price are mandatory
CLEAR : l_item_number,
wa_upload_2.
LOOP AT i_upload_2 INTO wa_upload_2
WHERE seqno = wa_upload-seqno
AND chkbx = 'X'.
CLEAR : wa_cond,
wa_result.
Get the POSNR
PERFORM conv_alpha_input USING wa_upload_2-matnr
CHANGING wa_upload_2-matnr.
CLEAR : wa_items.
READ TABLE i_items INTO wa_items
WITH KEY vbeln = l_sales_no
matnr = wa_upload_2-matnr.
Check condition types
IF wa_upload_2-auart = 'ZY16' OR
wa_upload_2-auart = 'ZY17' OR
wa_upload_2-auart = 'ZY30' OR
wa_upload_2-auart = 'ZY31'.
If error, then update the output table
IF wa_upload_2-kschl IS INITIAL OR
wa_upload_2-kbetr IS INITIAL.
CLEAR : wa_result_all.
READ TABLE i_result_all INTO wa_result_all WITH KEY
ref_no = wa_upload_2-vbeln
mat_no = wa_upload_2-matnr
kwmeng = wa_upload_2-kwmeng
charg = wa_upload_2-charg
seqno = wa_upload_2-seqno
vbeln = l_sales_no.
IF sy-subrc EQ 0.
wa_result_all-status = 'E'. " E
wa_result_all-remarks = text-007. " Condition Type & Unit
Price is mandatory
MODIFY i_result_all FROM wa_result_all INDEX sy-tabix.
ENDIF.
CLEAR : wa_result_all.
CONTINUE.
Else update the condition type & unit price
ELSE.
wa_cond-itm_number = wa_items-posnr. " ITEM NO.
wa_cond-cond_type = wa_upload_2-kschl. " CNDTION TYPE
wa_cond-cond_value = wa_upload_2-kbetr. " UNIT PRICE
wa_cond-currency = wa_curr-waerk. " Currency
APPEND wa_cond TO i_cond.
CLEAR : wa_cond,
wa_upload_2.
ENDIF.
ELSE.
For other document type, fill Condition type & Unit Price
wa_cond-itm_number = wa_items-posnr. " ITEM NO.
wa_cond-cond_type = wa_upload_2-kschl. " CNDTION TYPE
wa_cond-cond_value = wa_upload_2-kbetr. " UNIT PRICE
wa_cond-currency = wa_curr-waerk.
APPEND wa_cond TO i_cond.
CLEAR : wa_cond,
wa_upload_2.
ENDIF.
CLEAR : wa_cond_inx.
wa_cond_inx-itm_number = wa_items-posnr.
wa_cond_inx-cond_type = wa_upload_2-kschl.
wa_cond_inx-cond_value = 'X'.
wa_cond_inx-currency = 'X'.
APPEND wa_cond_inx TO i_cond_inx.
CLEAR : wa_upload_2.
ENDLOOP.
DELETE Item Data from VBAP which has no matching entires in ALV
if SAME Material occurs more than once in ALV for same key then
count the no. of times the material occurs
CLEAR : wa_upload_3,
l_counter.
l_counter = 0.
LOOP AT i_upload_2 INTO wa_upload_3
WHERE seqno = wa_upload-seqno
AND chkbx = 'X'
AND matnr = wa_upload-matnr.
l_counter = l_counter + 1.
CLEAR : wa_upload_3.
ENDLOOP.
PERFORM conv_alpha_input USING wa_upload-matnr
CHANGING wa_upload-matnr.
check the corresponding no. of line items
for the above material
CLEAR : l_count,
wa_items.
LOOP AT i_items INTO wa_items
WHERE matnr = wa_upload-matnr
AND vbeln = l_sales_no.
CLEAR : wa_items_in,
wa_items_inx.
IF l_count GE l_counter.
wa_items_in-itm_number = wa_items-posnr.
wa_items_in-material = wa_items-matnr.
APPEND wa_items_in TO i_items_in.
CLEAR wa_items_inx.
wa_items_inx-itm_number = wa_items-posnr.
wa_items_inx-updateflag = 'D'. " Delete Record
wa_items_inx-material = 'X'.
APPEND wa_items_inx TO i_items_inx.
ENDIF.
l_count = l_count + 1.
ENDLOOP.
Convert material nos. to 18 digit no.
REFRESH : i_upload_3.
CLEAR : wa_upload_3.
i_upload_3[] = i_upload_2[].
LOOP AT i_upload_3 INTO wa_upload_3
WHERE seqno = wa_upload-seqno
AND chkbx = c_x.
PERFORM conv_alpha_input USING wa_upload_3-matnr
CHANGING wa_upload_3-matnr.
MODIFY i_upload_3 FROM wa_upload_3.
CLEAR : wa_upload_3.
ENDLOOP.
Delete materials which are not in ALV but are in line items
for that sales order
CLEAR : wa_upload_3,
wa_items_in,
wa_items.
LOOP AT i_items INTO wa_items WHERE vbeln = l_sales_no.
PERFORM conv_alpha_input USING wa_items-matnr
CHANGING wa_items-matnr.
READ TABLE i_upload_3 INTO wa_upload_3
WITH KEY matnr = wa_items-matnr.
IF sy-subrc NE 0.
wa_items_in-itm_number = wa_items-posnr.
wa_items_in-material = wa_items-matnr.
APPEND wa_items_in TO i_items_in.
CLEAR wa_items_inx.
wa_items_inx-itm_number = wa_items-posnr.
wa_items_inx-updateflag = 'D'. " Delete Record
wa_items_inx-material = 'X'.
APPEND wa_items_inx TO i_items_inx.
ENDIF.
CLEAR : wa_items,
wa_items_in,
wa_items_inx,
wa_upload_3.
ENDLOOP.
UPDATE Item Data RECORDS
CLEAR : wa_upload_2,
wa_items_in,
wa_items,
wa_items_inx,
wa_sch_in,
wa_sch_inx,
l_item_number.
LOOP AT i_upload_2 INTO wa_upload_2 WHERE
seqno = wa_upload-seqno
AND chkbx = 'X'.
Read the Material no. from ALV & check whether the
corresponding material exists in VBAP, if YES, then
Update the line item data
PERFORM conv_alpha_input USING wa_upload_2-matnr
CHANGING wa_items_in-material.
POPULATE ITEM NO -- Update the record
If line item has same material twice,
then appropriate POSNR should be assigned
READ TABLE i_items INTO wa_items
WITH KEY vbeln = l_sales_no
matnr = wa_items_in-material.
IF sy-subrc EQ 0.
If Reference is not contract then the process to assign
POSNR is as follows :- Check the corresponding material
from ALV with data from ITEMS, the record which matches
the data is selected & POSNR is assigned to it
IF wa_upload_2-oreason NE 'C'.
CLEAR : wa_items_in1.
READ TABLE i_items_in INTO wa_items_in1
WITH KEY material = wa_items_in-material
itm_number = wa_items-posnr.
IF sy-subrc EQ 0.
CLEAR : wa_items1.
LOOP AT i_items INTO wa_items1
WHERE vbeln = l_sales_no
AND matnr = wa_items_in-material.
IF wa_items1-posnr GT wa_items-posnr.
wa_items-posnr = wa_items1-posnr.
CLEAR : wa_items_in1.
READ TABLE i_items_in INTO wa_items_in1
WITH KEY material = wa_items_in-material
itm_number = wa_items-posnr.
IF sy-subrc NE 0.
EXIT.
ENDIF.
ENDIF.
CLEAR : wa_items1.
ENDLOOP.
ENDIF.
ELSE.
If Reference is CONTRACT then the process to assign
POSNR is different. Here if ALV has same material
twice & ITEMS has it once, then the second occurrence
of material of ALV is assigned a new POSNR
CLEAR : wa_items_in1,
l_insert.
READ TABLE i_items_in INTO wa_items_in1
WITH KEY material = wa_items_in-material
itm_number = wa_items-posnr.
IF sy-subrc EQ 0.
CLEAR : l_lines,
l_insert,
wa_items_in1.
DESCRIBE TABLE i_items_in LINES l_lines.
READ TABLE i_items_in INTO wa_items_in1 INDEX l_lines.
wa_items-posnr = wa_items_in1-itm_number + 10.
l_insert = 'X'.
CLEAR : wa_items_in1.
ENDIF.
ENDIF.
<b> wa_items_in-itm_number = wa_items-posnr.
wa_items_in-target_qty = wa_upload_2-kwmeng.
wa_items_in-target_qu = wa_items-zieme.
wa_items_in-store_loc = wa_upload_2-lgort.
wa_items_in-plant = wa_upload_2-werks.
wa_items_in-batch = wa_upload_2-charg.
wa_items_in-route = wa_upload_2-route.
wa_items_in-sales_unit = wa_upload_2-vrkme.
wa_items_in-short_text = wa_upload_2-maktx.
APPEND wa_items_in TO i_items_in.</b>
CLEAR wa_items_inx.
wa_items_inx-itm_number = wa_items-posnr.
IF l_insert EQ c_x.
wa_items_inx-updateflag = c_i. " Insert Record
ELSE.
wa_items_inx-updateflag = 'U'. " Update Record
ENDIF.
wa_items_inx-material = 'X'.
wa_items_inx-target_qty = 'X'.
wa_items_in-target_qu = 'X'.
wa_items_inx-store_loc = 'X'.
wa_items_inx-plant = 'X'.
wa_items_inx-batch = 'X'.
wa_items_inx-route = 'X'.
wa_items_inx-short_text = 'X'.
APPEND wa_items_inx TO i_items_inx.
ENDIF.
*Populate Ship-to-party
IF NOT wa_upload_2-scode IS INITIAL
AND l_insert IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = wa_items-posnr.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_we.
wa_partner_inx-p_numb_new = wa_upload_2-scode.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Bill to Party
IF NOT wa_upload_2-bparty IS INITIAL
AND l_insert IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = wa_items-posnr.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_re.
wa_partner_inx-p_numb_new = wa_upload_2-bparty.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Payer
IF NOT wa_upload_2-payer IS INITIAL
AND l_insert IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = wa_items-posnr.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_rg.
wa_partner_inx-p_numb_new = wa_upload_2-payer.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Sales Rep
IF NOT wa_upload_2-salesrep IS INITIAL
AND l_insert IS INITIAL.
CLEAR wa_partner_inx.
wa_partner_inx-document = l_sales_no.
wa_partner_inx-itm_number = wa_items-posnr.
wa_partner_inx-updateflag = 'U'.
wa_partner_inx-partn_role = c_ys.
wa_partner_inx-p_numb_new = wa_upload_2-salesrep.
wa_partner_inx-refobjtype = l_bus_object.
APPEND wa_partner_inx TO i_partner_inx.
ENDIF.
Populate schedule Line
CLEAR : l_datum,
wa_sch_in.
For following condition types, schedule lines not required
IF wa_upload_2-auart EQ 'ZY16' OR
wa_upload_2-auart EQ 'ZY17' OR
wa_upload_2-auart EQ 'ZY30' OR
wa_upload_2-auart EQ 'ZY31'.
ELSE.
wa_sch_in-itm_number = wa_items-posnr.
wa_sch_in-sched_line = '0001'.
wa_sch_in-req_qty = wa_upload_2-kwmeng.
IF NOT wa_upload_2-vdatu IS INITIAL.
REPLACE ALL OCCURRENCES OF '.' IN wa_upload_2-vdatu WITH ' '.
CONDENSE wa_upload_2-vdatu NO-GAPS.
CLEAR : l_datum.
l_datum = wa_upload_2-vdatu.
wa_sch_in-req_date = l_datum.
ENDIF.
APPEND wa_sch_in TO i_sch_in.
CLEAR wa_sch_inx.
wa_sch_inx-itm_number = wa_items-posnr.
wa_sch_inx-sched_line = '0001'.
IF wa_upload_2-oreason = 'C'.
wa_sch_inx-updateflag = c_i.
ELSE.
wa_sch_inx-updateflag = 'U'.
ENDIF.
wa_sch_inx-req_qty = 'X'.
wa_sch_inx-req_date = 'X'.
APPEND wa_sch_inx TO i_sch_inx.
ENDIF.
CLEAR : wa_upload_2,
wa_items_in,
wa_items,
wa_items_inx,
wa_sch_in,
wa_sch_inx.
ENDLOOP. "LOOP AT i_upload to wa_UPLOAD_2
Change Sales Order
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = l_sales_no
order_header_in = wa_header_in
order_header_inx = wa_header_inx
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
TABLES
return = i_return
order_item_in = i_items_in
order_item_inx = i_items_inx
partners = i_partner
partnerchanges = i_partner_inx
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
schedule_lines = i_sch_in
schedule_linesx = i_sch_inx
ORDER_TEXT =
ORDER_KEYS =
conditions_in = i_cond
conditions_inx = i_cond_inx
EXTENSIONIN =
COMMIT
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
IMPORTING
return = wa_commit.
WAIT UP TO 5 SECONDS.
Best regards,
Prashant -
User Exit to make changes in sales order line item data.
Hi All,
I need to know about user exit by whcih I can make changes in sales order line item details --> Account assignment tab --> Sales order no and line item no.
I want to make changes so as to bring the active maintenance contract no and line item no here instead of sales order no and line item no. So whenever ( Va02 or Va03) we go to sales order line item and se the account assignment tab I should see the contract no there.
Just let me know the USER EXIT to do the above changes.
Points will be awarded.
Regards,
Satish.Hi,
Please have a look at the following user exits...
1. user exit_ save_document
2. user exit_save_document_prepare
Regards
sankar -
Updating BOM Sub Items using CS_BC_BOM_CHANGE_BATCH_INPUT
Hello,
I am trying to update BOM sub items by using this function module. I am filling up all fields in all tables, still it is giving error.
Any body has any sample code for this function module...
Unfortunately there is no documentation for this FM and very little usage in standard programs...
Regards,
Krishna.Hi,
My Code for create
DATA: BOM_HEADER TYPE CAD_BICSK ,"STRUCTURE FOR HEADER DATA
IT_BOM_ITEM TYPE TABLE OF CAD_BOM_ITEM,"INTERNAL TABLE FOR ITEM
WA_BOM_ITEM TYPE CAD_BOM_ITEM,"WORK AREA FOR ITEM
IT_BOM_SUB_ITEM TYPE TABLE OF CSSUBITEM ,"INTERNAL TABLE FOR SUB ITEM
WA_BOM_SUB_ITEM TYPE CSSUBITEM ,"WORK AREA FOR SUB ITEM
IT_DMS TYPE TABLE OF CLS_CHARAC,"INTERNAL TABLE FOR DMS_CLASS_DATA
WA_DMS TYPE CLS_CHARAC,"WORK AREA FOR DMS_CLASS_DATA
IT_SAP_FIELD TYPE TABLE OF RFCDMSDATA,"INTERNAL TABLE FOR SAP_FIELD_DATA
WA_SAP_FIELD TYPE RFCDMSDATA,"WORK AREA FOR SAP_FIELD_DATA
E_RETURN TYPE CAD_RETURN-VALUE,"STRUCTURE FOR RETURN
E_MESSAGE TYPE MESSAGE-MSGTX,"STRUCTURE FOR MESSAGE
E_MESSAGE_LEN TYPE CAD_RETURN-MESSAGE_LEN."STRUCTURE FOR MESSAGE LENGTH
LOOP AT IT_DATA INTO WA_DATA.
MOVE-CORRESPONDING WA_DATA TO WA_DATA1.
APPEND WA_DATA1 TO IT_DATA1.
ENDLOOP.
SORT IT_DATA1 BY MATNR WERKS.
DELETE ADJACENT DUPLICATES FROM IT_DATA1 COMPARING MATNR WERKS.
LOOP AT IT_DATA1 INTO WA_DATA1.
CLEAR: BOM_HEADER, WA_BOM_ITEM,WA_RET.
REFRESH: IT_BOM_ITEM.
FILL BOM HEADER
PERFORM DATE_FORMAT USING WA_DATA1-DATUV CHANGING BOM_HEADER-DATUV.
BOM_HEADER-MATNR = WA_DATA1-MATNR.
BOM_HEADER-WERKS = WA_DATA1-WERKS.
BOM_HEADER-STLAL = WA_DATA1-STLAL.
BOM_HEADER-STLAN = WA_DATA1-STLAN.
BOM_HEADER-ZTEXT = WA_DATA1-ZTEXT.
LOOP AT IT_DATA INTO WA_DATA WHERE MATNR = WA_DATA1-MATNR and werks = wa_Data1-werks.
FILL ITEM
if wa_data-postp = 'T'.
WA_BOM_ITEM-POSNR = WA_DATA-POSNR.
WA_BOM_ITEM-POSTP = WA_DATA-POSTP.
WA_BOM_ITEM-POTX1 = WA_DATA1-ZTEXT.
else.
WA_BOM_ITEM-IDNRK = WA_DATA-IDNRK.
WA_BOM_ITEM-POSNR = WA_DATA-POSNR.
WA_BOM_ITEM-POSTP = WA_DATA-POSTP.
WA_BOM_ITEM-MENGE = WA_DATA-MENGE.
endif.
APPEND WA_BOM_ITEM TO IT_BOM_ITEM.
ENDLOOP.
CALL FUNCTION 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
EXPORTING
I_BOM_HEADER = BOM_HEADER
IMPORTING
E_RETURN = E_RETURN
E_MESSAGE = E_MESSAGE
TABLES
BOM_ITEM = IT_BOM_ITEM
BOM_SUB_ITEM = IT_BOM_SUB_ITEM
DMS_CLASS_DATA = IT_DMS
SAP_FIELD_DATA = IT_SAP_FIELD.
WA_RET-MATNR = WA_DATA1-MATNR.
if e_return = 0 .
wa_ret-status = 'SUCCESS'.
ELSE.
wa_ret-status = 'ERROR'.
ENDIF.
WA_RET-WERKS = WA_DATA1-WERKS.
WA_RET-MSG = E_MESSAGE.
APPEND WA_RET TO IT_RET .
ENDLOOP.
LOOP AT IT_RET INTO WA_RET.
if wa_ret-status = 'ERROR'.
APPEND wa_ret to it_erv.
ENDIF.
WRITE: /.
WRITE:(12) WA_RET-MATNR,(6) WA_RET-WERKS,(8) wa_ret-status,(70) WA_RET-MSG.
ENDLOOP.
Regards,
Manesh.R -
Not able to re-atp 1of the sales order line item
Hi SAP PP Gurus,
When I tried to re-atp 1 of the sales order line item it is giving error as mentioned below. Please let me know where this fix qty indicator in the sales order and how can I de-activate the same. Thanks in advance....
Item has no open quantity - Check fixed quantity ID
Message no. V1 601
Diagnosis
The item does not have any open, confirmed quantities and the "fix
quantity" indicator is activated. This means that the customer has
agreed on a zero quantity and nothing is delivered.
System Response
The system issues a corresponding message.
Procedure
If you want the item to receive a confirmed quantity after all which can
be delivered later, you should de-activate the fix quantity indicator.Hi Ritish,
Strategy is MTO..
I have triied to perform atp by using fix qty/date but still system in not proposing MAD. And it is giving below error screen.
No. of components checked: 1
Missing parts: 1
Overall confirmation date could not be determined
Order : 1104739992
Material Plnt SLoc Reqmts q Requirements ATP/avai Committ. d Material description M Bl
NH524AA@@ 32F2 F2WH 1.000 03.08.2009 0.000 99.99.9999 HP gt7725 PCI Expres X
Thanks and Regards,
SHARAN. -
How to set Confrimed quantity as 0 in the sales order line item
hi all
i have a requirement that my user dont want to see confirmed quantity in the sales order line item.
scenario is make to order.
i have set strategy group is 20 -make to order
MRP Type is PD
Lot size -
EX , still its showing confirmed quantity.
could pls any one tell me how to set 0 quantity in the sales order line item
thnxDear Sateesh,
If the availability check is carried out and stock is not there in our plant, then it will show the confirmed quantity as Zero.
If you don't want to carry out the availability check,
To achieve this,
1. Remove the availability check in the transaction OVZG against your requirement class.
You can find the requirement type assigned to the sale order in the procurement tab.
In OVZH transaction, you can find the requirement class assigned to your requirement type.
2. Remove the availability check for your schedule line category in VOV6.
In the material master MRP3 view, you ll be having Availability check, there you need to specify the availability check..
If you specify it as KP(No check), then it will confirm the qty, though the stock is not there in our plant..
To meet your requirement, you have to prefer user exit.(Correct me if I am wrong)
Thanks,
Venkatesh.S.P -
Changing the position of graphic item
Hi all,
I am using graphical items in my form canvas. I want to change the position of these items in runtime.
can any one suggest me how to change the positions at run time.?.....
Thanks,
Pavan.Hello,
This question has been aked so many times, and the answer is always the same : NO
There is no available buit-in to deal with graphical objects located on the canvas. All you can do is to drop them on a small stacked-canvas, then move this stacked-canvas.
Francois
Maybe you are looking for
-
Hi I don't know since when, but I can't send email anymore via iCloud on my Mac. iPhone and iPad work. Online iCloud as well. I am running: OS X 10.9.2 Mail 7.2 (1874) I use the @me.com adresses smtp Server says: iCloud(iCloud) What I tried so far: I
-
Creation of assets in only one depreciation area.
hi We have a request to create several assets for an existing asset class (some of them with capitalization date in the past) such that the values reflect only in the local GAAP depreciation area 22. For example here is the requirement Asset Class
-
Change source in multiple pages
I am trying to find out already for long time, but can't seem to find it: I made a mistake with making a photo gallery and now all the seperate photo pages have a mistake in the photo src (link). It's easy to fix, but now I have to do it by hand for
-
Does Air allow file downloads/transfers to desktop from inside app?
Hello, I am looking into writing an air application that I intend to put onto a usb thumb drive. If a Mac or Pc user plugged the said usb drive into their computer, would the user of the app be able to easily download/transfer files directly onto the
-
Hi geeks! help me out.. How can u create a MS Word document from JSP? I am developing an application which takes in large user data.I want it to be saved in ".doc" format at the server side. Please help me Alternate solutions will also help! javed p