I wants to change the quantity in billing after PGI? plz cive me idea
i wants to change the quantity in billing doc after pgi
plz
give me the ans
Hi
Maha Lingam
No u can not change qty. in billing once PGI is done. If u want to change the qty then U have to reverse the PGI Tcode VL09 and after that u can change qty in Delivery Tcode VL02N and again u have to do PGI.
Thx.
Similar Messages
-
'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 -
How to change the Quantity in Excise Invoice where PART1&2 are posted
Dear Gurus
I have a PO with 2 Qty
Where i have received GR for 1 QTY with excise invoice for 1 Qty
now the User is done GR for 2 Qty with excise details of 1 where Part 1&2 are posted
now i want to change the quantity from 2 to 1 in Excise Document and the GR
how to solve this issue
Please help meHi,
As you needed, 1st reverse GR document in 102 Movement type in t.code: MIGO and cancel the excise entries with t.code: J1IEX, go for post and then cancel for excise amount with entering Rejection Code in miscellaneous TAB.
Regards,
Biju K -
I want to change the company address of payment advice.
i want to change the company address of payment advice.
plz any one tell me the procedure and Can any one tell me program name and layout name for payment advice.
points will given.
with regardsplz tell me the procedure
-
I bought an iphone and i want to change the billing name.
i bought an iphone and i want to change the billing name.
i want the billing name will be to: vahdat yehoshua'a.
is it possible to send me a new receipt?
thank you.Contact your Carrier Telco. If you are wanting to change the name on the purchase receipt then that cannot be done. Only a thief would attempt that, so I hope that is not what you are suggesting
Pete -
How to change the Quantity in the Credit Memo using BAPI
Hi All,
I have a requirement in which i need to change the Quantity Value field available in the Credit Memo using BAPI.
Can anyone help me out to get any available BAPI to perform this action or any Solution to change the Quantity in the Credit Memo ?.
Regards,
Muruganand.KHi,
Try using BAPI_SALESORDER_CHANGE.
DATA: s_order_header_in LIKE bapisdh1.
DATA: s_order_header_inx LIKE bapisdh1x.
DATA: BEGIN OF i_order_item_in OCCURS 0.
INCLUDE STRUCTURE bapisditm.
DATA: END OF i_order_item_in.
DATA: BEGIN OF i_order_item_inx OCCURS 0.
INCLUDE STRUCTURE bapisditmx.
DATA: END OF i_order_item_inx.
DATA: BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_return.
DATA: BEGIN OF i_sched OCCURS 10.
INCLUDE STRUCTURE bapischdl.
DATA: END OF i_sched.
DATA: BEGIN OF i_schedx OCCURS 10.
INCLUDE STRUCTURE bapischdlx.
DATA: END OF i_schedx.
s_order_header_inx-updateflag = 'U'.
i_order_item_in-itm_number = vbap-posnr.
i_order_item_in-TARGET_QTY = rv45a-zzqty.
i_order_item_inx-updateflag = 'U'.
i_order_item_inx-itm_number = vbap-posnr.
i_order_item_inx-TARGET_QTY = 'X'.
APPEND: i_order_item_in, i_order_item_inx.
i_sched-itm_number = vbap-posnr.
i_sched-sched_line = '0002'.
i_sched-req_qty = rv45a-zzqty.
APPEND i_sched.
i_schedx-itm_number = vbap-posnr.
i_schedx-sched_line = '0002'.
i_schedx-updateflag = 'U'.
i_schedx-req_qty = 'X'.
APPEND i_schedx.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = xvbap-vbeln
order_header_in = s_order_header_in
order_header_inx = s_order_header_inx
behave_when_error = 'P'
TABLES
return = it_return
order_item_in = i_order_item_in
order_item_inx = i_order_item_inx
schedule_lines = i_sched
schedule_linesx = i_schedx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Change the fields as per your logic before populating orders item and schedule line data.
You have to pass the quantity in schedule line items as well in case you want to change quanity in order.
KR Jaideep,
Edited by: Jaideep Sharma on Jun 22, 2009 7:35 PM -
Not able to change the quantity....
Hi experts,
When I create standard order in CRM and save it, I can do the followup of other transactions in ECC. My problem when I want to change the order quantiy in crm order, the system is not allowing me to enter or change any data. It is showing the message transaction is being processed........
Pls help me reg.. my client requirement is he need to update or chande the order quantity in crm only.
I even deleted the delivery and try to change the order quantity in crm, even it is not allowing me to enter the quantity.
Waiting for ur reply, best information is always rewarded.
Thanks & Regards
lalitHi,
You can check the Scenario maintained for the orders.
Cehck table CRMPAROLTP in R/3 (Tcode SM30)
Cehck for entry:
Parameter Name = CRM_SCENARIO
If parameter value is 'X'. This means order created in CRM once replicated to R/3, is treated as R3 document and no changes will be possible in CRM system
Check for note 541113 which describes scenario.
Set a scenario that suffices your requirement.
Kindly reward with points in case helpful
Sharif. -
BAPI_SALESORDER_CHANGE - Want to change the Ship-to-party at header level
Hi
I want to change the Ship-to-party at header level in the Sales Order created. I tried using the BAPI BAPI_SALESORDER_CHANGE as shown below.
When I run the program I get the log as Sales Order 45 saved succesfully. However, I don't find the SO changed. Apart from this I get an Express Message saying the Updation failure. Not sure of what'z wrong here.
Pls help
thanks
girish
REPORT ZBAPI_SALESORD_CHANGE.
data : zBAPISDHD type BAPISDH1,
zSALESDOCUMENT type BAPIVBELN-VBELN.
data : zORDER_ITEMS_IN like /AFS/BAPISDITM occurs 0 with header line,
zORDER_SCHEDULES_IN like /AFS/BAPISDSCHD 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,
zORDER_HEADER_INX TYPE BAPISDH1X,
zPARTNERCHANGES like BAPIPARNRC occurs 0 with header line.
clear : zBAPISDHD.
so_no = '0000000045'.
data : l_comp_qty like zORDER_ITEMS_IN-COMP_QUANT.
l_comp_qty = 10.
zBAPISDHD-SALES_ORG = 'BP01'.
zBAPISDHD-DISTR_CHAN = '02'.
zBAPISDHD-DIVISION = '01'.
zORDER_HEADER_INX-UPDATEFLAG = 'U'.
zORDER_HEADER_INX-SALES_ORG = 'X'.
zORDER_HEADER_INX-DISTR_CHAN = 'X'.
zORDER_HEADER_INX-DIVISION = 'X'.
Ship to pary
zORDER_PARTNERS-PARTN_ROLE = 'WE'.
zORDER_PARTNERS-PARTN_NUMB = 'BPAFS0007'.
append zORDER_PARTNERS.
zPARTNERCHANGES-DOCUMENT = '45'.
zPARTNERCHANGES-ITM_NUMBER = '10'.
zPARTNERCHANGES-UPDATEFLAG = 'U'.
zPARTNERCHANGES-PARTN_ROLE = 'WE'.
zPARTNERCHANGES-P_NUMB_OLD = 'BPAFS0001'.
zPARTNERCHANGES-P_NUMB_NEW = 'BPAFS0007'.
append zPARTNERCHANGES.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = so_no
ORDER_HEADER_IN = zBAPISDHD
ORDER_HEADER_INX = zORDER_HEADER_INX
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
NO_STATUS_BUF_INIT = ' '
TABLES
RETURN = zRETURN
ORDER_ITEM_IN =
ORDER_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 =
SCHEDULE_LINESX =
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
data : s_BAPIRET2 like BAPIRET2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = s_bapiret2.Thanks Prashanth. It worked !!!!!!!!!!!!!
Now I am facing another type of 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. -
How to change the currency in Billing plan in SO line item
Hi Experts
Pls help in following scenario.
Company Code Currency: HKD
Sales Document Currency: INR(Indian Rupees)
Item Pricing Condition Currency(PR00): 100 USD
Item Netvalue: 4800INR(System caluculated as per exchange rate type M)
Document Netvalue: INR 4800
The sales document item is linked to a billing plan.
I wanted to maintain 100USD in the billing plan.
When i goto Sales->item-->Billing Plan, The currency in billing plan screen is document currency and is greyed out.
How to change the Currency in Billing plan (to Item Condition currency) and maintain the Billing value in USD?
Pls help.
Regds
HariCurrency change we wanted to do is not during Invoicing.
In billing plan itself we want to change the currency setup the billing value in item condition currency.
Any one, pls help. -
When you plug your ipod into the computer it's name comes up. ie bill's ipod. How do you edit the name. I've recently bought some new ipods and want to change the names of my old ones.
Double click the iPod under Devices in the source list on the left side of the iTunes window then type in a new name.
-
I want to change the state of the account
I want to change the state of the account to Saudi Arabia
But there is a problem is the presence of 34 cents in my account, I can not delete
I want you to delete the remaining money in my account
So I change my country to Saudi Arabia
Thank you
saleh alamriWe are fellow users here on these forums, you're not talking to iTunes Support. You can try contacting iTunes support via this page and ask them if they can remove the balance so that you can change countries : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
-
My problem, cannot update application, how i want to change the store.
my problem, cannot update application, how i want to change the store.
Hello there muhamadamirul,
To change the region your Apple ID is using use these instructions.
Change your iTunes Store country
Sign in to the account for the iTunes Store region you'd like to use. Tap Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
Follow the onscreen process to change your region, agree to the terms and conditions for the region if necessary, and then change your billing information.
From: iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/ht1311
Regards,
Sterling -
My app id have 0.32cents but l want to change the app store region
my app id have 0.32cents but l want to change the app store region i want to get the help without paying money
kevin qian wrote:
my app id have 0.32cents but l want to change the app store region
You need to Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact
NOTE:
To use other Countries iTunes Stores...
You must be within the Country with a Valid Billing Address and Credit Card for that Country to use the iTunes Store of that Country..
iTunes Store Terms of Service
http://www.apple.com/legal/itunes/us/terms.html#SERVICE -
I want to change the security settings on my e-mail. I provided a password once and now it opens without one. I want to keep my messages private.
== This happened ==
Every time Firefox opened
== When I updated.Websites remembering you and automatically log you in is stored in a cookie
Tools > Options > Privacy > Cookies: "Show Cookies"
See also [[Cookies]] -
Mac Snow Leopard
TB 24.5.0
Suggestions have pointed me towards finding prefs.js file, but I can't find it (library/mozilla, libary/application support/mozilla not there nor in search function)
Tried with showing hidden files too.
Really a pain as I need the more active accounts on top opened but not enough room with less active accounts stuck in the middle.
No RSS feeds, local folders on bottom OK.
Just want to change the order but can't seem to find the solution.
Free smile to whoever helps me out! ThanksUse this add-on.
https://addons.mozilla.org/en-US/thunderbird/addon/manually-sort-folders/
Maybe you are looking for
-
I deleted all my photos but there are still 17GB of photos on my ipad.
I synced my iPad with my mac and I imported all my photos and videos. Then I deleted all of them from my ipad. When I open the photos app there isn't a single photo there nor a video. But when I open my settings to view how much storage I have it say
-
How can I burn a CD?, How can I burn a CD?
Please help me, how do I burn a music CD? thank you
-
I-Tunes Transfer Script - Duncan Bernhardt
I'm not sure if this is the correct location for this, but i noticed that some other site admins are getting help directly from Duncan Bernhardt, so i'll give it a go. I'm trying to do the initial setup for our I-tunes account (the address is https:/
-
How do i switch where my videos are?
When i uploaded my music video to my itunes..it automatically shows up under movies..how do i change it to go up under music video?
-
I hope that this hasn't been posted already. I want to be able to use my Solaris 8 (intel) with my laptop computer. But I am having a devil of a time finding the drivers to make the Xircom RealPort Ethernet 10/100 (RE-100) NIC. The closest that I hav